mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 19:37:52 +00:00
org-macro: Fix incomplete docstring
* lisp/org-macro.el (org-macro--counter-increment): Fix incomplete docstring. Small refactoring.
This commit is contained in:
parent
54344574c6
commit
657ed58eac
|
@ -321,17 +321,17 @@ Return a list of arguments, as strings. This is the opposite of
|
|||
|
||||
(defun org-macro--counter-increment (name &optional reset)
|
||||
"Increment counter NAME.
|
||||
NAME is a string identifying the counter. If optional argument
|
||||
RESET is a non-empty string, reset the counter instead."
|
||||
(if (org-string-nw-p reset)
|
||||
(let ((new-value (if (string-match-p "\\`[ \t]*[0-9]+[ \t]*\\'" reset)
|
||||
(string-to-number reset)
|
||||
1)))
|
||||
(puthash name new-value org-macro--counter-table))
|
||||
(let ((value (gethash name org-macro--counter-table)))
|
||||
(puthash name
|
||||
(if (null value) 1 (1+ value))
|
||||
org-macro--counter-table))))
|
||||
NAME is a string identifying the counter. When non-nil, optional
|
||||
argument RESET is a string. If it represents an integer, set the
|
||||
counter to this number. Any other non-empty string resets the
|
||||
counter to 1."
|
||||
(puthash name
|
||||
(cond ((not (org-string-nw-p reset))
|
||||
(1+ (gethash name org-macro--counter-table 0)))
|
||||
((string-match-p "\\`[ \t]*[0-9]+[ \t]*\\'" reset)
|
||||
(string-to-number reset))
|
||||
(t 1))
|
||||
org-macro--counter-table))
|
||||
|
||||
|
||||
(provide 'org-macro)
|
||||
|
|
Loading…
Reference in a new issue