mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-07-16 22:46:26 +00:00
macro: Do not generate macros with (&optional &rest _) signature
* lisp/org-macro.el (org-macro--makeargs): Fix Emacs-26 burping because of a bug when functions are declared with 0 optional arguments like (&optional &rest x).
This commit is contained in:
parent
f6139e6c54
commit
8e68eac0bd
|
@ -91,10 +91,11 @@ directly, use instead:
|
||||||
(setq i (match-end 0))
|
(setq i (match-end 0))
|
||||||
(setq max (max max (string-to-number (match-string 1 template)))))
|
(setq max (max max (string-to-number (match-string 1 template)))))
|
||||||
(let ((args '(&rest _)))
|
(let ((args '(&rest _)))
|
||||||
(while (> max 0)
|
(if (< max 1) args ;Avoid `&optional &rest', refused by Emacs-26!
|
||||||
(push (intern (format "$%d" max)) args)
|
(while (> max 0)
|
||||||
(setq max (1- max)))
|
(push (intern (format "$%d" max)) args)
|
||||||
(cons '&optional args))))
|
(setq max (1- max)))
|
||||||
|
(cons '&optional args)))))
|
||||||
|
|
||||||
(defun org-macro--set-templates (templates)
|
(defun org-macro--set-templates (templates)
|
||||||
"Set template for the macro NAME.
|
"Set template for the macro NAME.
|
||||||
|
|
Loading…
Reference in a new issue