summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/byte-run.el35
-rw-r--r--lisp/emacs-lisp/debug.el7
-rw-r--r--lisp/emacs-lisp/find-func.el3
3 files changed, 34 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index ef426494b68..60fc862676d 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -31,12 +31,36 @@
;;; Code:
+;; We define macro-declaration-function here because it is needed to
+;; handle declarations in macro definitions and this is the first file
+;; loaded by loadup.el that uses declarations in macros.
+
+(defun macro-declaration-function (macro decl)
+ "Process a declaration found in a macro definition.
+This is set as the value of the variable `macro-declaration-function'.
+MACRO is the name of the macro being defined.
+DECL is a list `(declare ...)' containing the declarations.
+The return value of this function is not used."
+ ;; We can't use `dolist' or `cadr' yet for bootstrapping reasons.
+ (let (d)
+ ;; Ignore the first element of `decl' (it's always `declare').
+ (while (setq decl (cdr decl))
+ (setq d (car decl))
+ (cond ((and (consp d) (eq (car d) 'indent))
+ (put macro 'lisp-indent-function (car (cdr d))))
+ ((and (consp d) (eq (car d) 'debug))
+ (put macro 'edebug-form-spec (car (cdr d))))
+ (t
+ (message "Unknown declaration %s" d))))))
+
+(setq macro-declaration-function 'macro-declaration-function)
+
+
;; Redefined in byte-optimize.el.
;; This is not documented--it's not clear that we should promote it.
(fset 'inline 'progn)
(put 'inline 'lisp-indent-function 0)
-
;;; Interface to inline functions.
;; (defmacro proclaim-inline (&rest fns)
@@ -105,11 +129,10 @@ was first made obsolete, for example a date or a release number."
(put variable 'byte-obsolete-variable (cons new when))
variable)
-(put 'dont-compile 'lisp-indent-function 0)
(defmacro dont-compile (&rest body)
"Like `progn', but the body always runs interpreted (not compiled).
If you think you need this, you're probably making a mistake somewhere."
- (declare (debug t))
+ (declare (debug t) (indent 0))
(list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))
@@ -118,19 +141,17 @@ If you think you need this, you're probably making a mistake somewhere."
;;; definition in the file overrides the magic definitions on the
;;; byte-compile-macro-environment.
-(put 'eval-when-compile 'lisp-indent-function 0)
(defmacro eval-when-compile (&rest body)
"Like `progn', but evaluates the body at compile time.
The result of the body appears to the compiler as a quoted constant."
- (declare (debug t))
+ (declare (debug t) (indent 0))
;; Not necessary because we have it in b-c-initial-macro-environment
;; (list 'quote (eval (cons 'progn body)))
(cons 'progn body))
-(put 'eval-and-compile 'lisp-indent-function 0)
(defmacro eval-and-compile (&rest body)
"Like `progn', but evaluates the body at compile time and at load time."
- (declare (debug t))
+ (declare (debug t) (indent 0))
;; Remember, it's magic.
(cons 'progn body))
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 2be217a41c6..e97e9012fc1 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -302,7 +302,7 @@ That buffer should be current already."
(debugger-make-xrefs))
(defun debugger-make-xrefs (&optional buffer)
- "Attach cross-references to symbol names in the `*Backtrace*' buffer."
+ "Attach cross-references to function names in the `*Backtrace*' buffer."
(interactive "b")
(save-excursion
(set-buffer (or buffer (current-buffer)))
@@ -353,6 +353,7 @@ That buffer should be current already."
;; Scan the new part of the backtrace, inserting xrefs.
(goto-char (point-min))
(while (progn
+ (goto-char (+ (point) 2))
(skip-syntax-forward "^w_")
(not (eobp)))
(let* ((beg (point))
@@ -364,8 +365,8 @@ That buffer should be current already."
(goto-char beg)
;; help-xref-button needs to operate on something matched
;; by a regexp, so set that up for it.
- (re-search-forward "\\(\\(\\sw\\|\\s_\\)+\\)")
- (help-xref-button 1 'help-function-def sym file)))
+ (re-search-forward "\\(\\sw\\|\\s_\\)+")
+ (help-xref-button 0 'help-function-def sym file)))
(forward-line 1))
(widen))
(setq debugger-previous-backtrace (buffer-string))))
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 18e5706dc3d..eab957e5671 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -63,7 +63,8 @@
(concat
"^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\
ine-minor-mode\\|un-cvs-mode\\|foo\\|[^cfgv]\\w+\\*?\\)\
-\\|easy-mmode-define-global-mode\\)" find-function-space-re
+\\|easy-mmode-define-global-mode\\|menu-bar-make-toggle\\)"
+ find-function-space-re
"\\('\\|\(quote \\)?%s\\(\\s-\\|$\\|\(\\|\)\\)")
"The regexp used by `find-function' to search for a function definition.
Note it must contain a `%s' at the place where `format'