[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 1d31733ef8 311/500: Add more function documentati
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 1d31733ef8 311/500: Add more function documentation |
Date: |
Sat, 29 Jan 2022 08:27:16 -0500 (EST) |
branch: elpa/nix-mode
commit 1d31733ef894d9d9a89465cc76f25a67e2c4438c
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Add more function documentation
---
nix-mode.el | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index 05f1d75503..e2bc726a3c 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -421,6 +421,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
;; left-hand side of the first assignment on that line.
;; - Otherwise, it is the position of the first token on that line.
(defun nix-smie-rules (kind token)
+ "Core smie rules."
(pcase (cons kind token)
(`(:after . ,(guard (string-match-p nix-smie-indent-tokens-re
token)))
@@ -491,13 +492,14 @@ STRING-TYPE type of string based off of Emacs syntax
table types"
anchor))
(defun nix-smie--indent-anchor (&optional indent)
- ;; Intended for use only in the rules function.
+ "Intended for use only in the rules function."
(let ((indent (or indent tab-width)))
- `(column . ,(+ indent (nix-smie--anchor)))))
+ `(column . ,(+ indent (nix-smie--anchor)))))
(defconst nix-smie--path-chars "a-zA-Z0-9-+_.:/~")
(defun nix-smie--skip-path (how)
+ "Skip path related characters."
(let ((start (point)))
(pcase how
('forward (skip-chars-forward nix-smie--path-chars))
@@ -509,6 +511,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(ignore (goto-char start))))))
(defun nix-smie--forward-token-1 ()
+ "Move forward one token."
(forward-comment (point-max))
(or (nix-smie--skip-path 'forward)
(buffer-substring-no-properties
@@ -520,6 +523,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(point)))))
(defun nix-smie--forward-token ()
+ "Move forward one token, skipping certain characters."
(let ((sym (nix-smie--forward-token-1)))
(if (member sym '(";" "?"))
;; The important lexer for indentation's performance is the backward
@@ -528,6 +532,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
sym)))
(defun nix-smie--backward-token-1 ()
+ "Move backward one token."
(forward-comment (- (point)))
(or (nix-smie--skip-path 'backward)
(buffer-substring-no-properties
@@ -539,6 +544,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(point)))))
(defun nix-smie--backward-token ()
+ "Move backward one token, skipping certain characters."
(let ((sym (nix-smie--backward-token-1)))
(unless (zerop (length sym))
(pcase sym
@@ -563,7 +569,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
'("{" ",")))
(defun nix-smie--indent-close ()
- ;; Align close paren with opening paren.
+ "Align close paren with opening paren."
(save-excursion
(when (looking-at "\\s)")
(forward-char 1)
@@ -576,9 +582,9 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(scan-error nil)))))
(defun nix-smie--indent-exps ()
- ;; This function replaces and is based on `smie-indent-exps'.
- ;; An argument to a function is indented relative to the function,
- ;; not to any other arguments.
+ "This function replaces and is based on `smie-indent-exps'.
+An argument to a function is indented relative to the function,
+not to any other arguments."
(save-excursion
(let (parent ;; token enclosing the expression list
skipped) ;; whether we skipped at least one expression
@@ -721,7 +727,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
;;;###autoload
(defun nix-mode-format ()
- "Format the entire nix-mode buffer."
+ "Format the entire `nix-mode' buffer."
(interactive)
(when (eq major-mode 'nix-mode)
(save-excursion
@@ -819,8 +825,8 @@ END where to end the region."
;;;###autoload
(defun nix-mode-ffap-nixpkgs-path (str)
"Support `ffap' for <nixpkgs> declarations.
-If STR contains brackets, call nix-instantiate to find the
-location of STR. If nix-instantiate has a nonzero exit code,
+If STR contains brackets, call `nix-instantiate' to find the
+location of STR. If `nix-instantiate' has a nonzero exit code,
don’t do anything"
(when (and (string-match nix-re-bracket-path str)
(executable-find nix-instantiate-executable))
- [nongnu] elpa/nix-mode 183d4212e2 134/500: Fix fontification bug, (continued)
- [nongnu] elpa/nix-mode 183d4212e2 134/500: Fix fontification bug, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 42632ee471 168/500: Remove misc/ folder, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 93bfb4428d 182/500: Add nix-build function., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9d4eb7d199 274/500: Make find-file-at-point support <nixpkgs>, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 54f28871a3 376/500: Fix issue #70, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ef64fa293b 388/500: Set nix-version to nil, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 218c885d78 414/500: Merge pull request #116 from taku0/update-install-nix-action, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d6e895969b 400/500: Set the 'LD_LIBRARY_PATH' environment variable for mkShell, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c041115673 301/500: Fix failing test., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 01c53b7ff1 289/500: Merge pull request #66 from etu/add-travis-badge, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1d31733ef8 311/500: Add more function documentation,
ELPA Syncer <=
- [nongnu] elpa/nix-mode be06d675b8 315/500: Run tests for nix-indent-line and smie-indent-line, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode a33ccd4fd7 322/500: Add more issue test cases, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ce8f523eb6 330/500: Set the indent function to the value passed in in with-nix-mode-test, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 023a471576 329/500: Remove unnecessary while loop., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 82d26d496a 335/500: Fix easy-menu name, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode bf027132d0 341/500: Merge pull request #83 from j-piecuch/smie-tweaks, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5b5961780f 358/500: Merge pull request #90 from purcell/dash-syntax, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode aa1fa07344 342/500: Fix handling of keywords in identifiers, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7d681ff81b 357/500: Merge pull request #91 from purcell/relative-executable-paths, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 47ec698474 422/500: Add version to invocation of define-obsolete-function-alias, ELPA Syncer, 2022/01/29