diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 05ee0615fec..47bafbde03e 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -246,6 +246,12 @@ declaration" f2 f)) (list 'function-put (list 'quote f) ''function-type (list 'quote val)))) +(defalias 'byte-run--dont-autoload + #'(lambda (fn) + #'(lambda (&rest args) + (let ((code (apply fn args))) + (list 'progn ':autoload-end code))))) + ;; Add any new entries to info node `(elisp)Declare Form'. (defvar defun-declarations-alist (list @@ -368,16 +374,18 @@ This is used by `declare'.") (cons actions cl-decls)))) (defvar macro-declarations-alist - (cons - (list 'debug #'byte-run--set-debug) - (cons + (nconc + (list + (list 'debug #'byte-run--set-debug) ;; macros can declare (autoload-macro expand) to request expansion ;; during autoload generation of forms calling them. See ;; `loaddefs-generate--make-autoload'. (list 'autoload-macro #'byte-run--set-autoload-macro) - (cons - (list 'no-font-lock-keyword #'byte-run--set-no-font-lock-keyword) - defun-declarations-alist))) + ;; Override the entry from `defun-declarations-alist', because we + ;; prefer to autoload the macro when trying to indent it (bug#68818). + (list 'indent (byte-run--dont-autoload #'byte-run--set-indent)) + (list 'no-font-lock-keyword #'byte-run--set-no-font-lock-keyword)) + defun-declarations-alist) "List associating properties of macros to their macro expansion. Each element of the list takes the form (PROP FUN) where FUN is a function. For each (PROP . VALUES) in a macro's declaration, the FUN corresponding diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 0756c0f908f..e91587b5b23 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -861,7 +861,7 @@ or to switch back to an existing one." :type '(choice (const nil) integer) :safe (lambda (x) (or (null x) (integerp x)))) -(defcustom lisp-indent-function 'lisp-indent-function +(defcustom lisp-indent-function #'lisp-indent-function "A function to be called by `calculate-lisp-indent'. It indents the arguments of a Lisp function call. This function should accept two arguments: the indent-point, and the @@ -1256,7 +1256,7 @@ Lisp function does not specify a special indentation." (progn (forward-sexp 1) (point)))) method) (setq method (or (function-get (intern-soft function) - 'lisp-indent-function) + 'lisp-indent-function 'macro) (get (intern-soft function) 'lisp-indent-hook))) (cond ((or (eq method 'defun) ;; Check whether we are in flet-like form.