HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make macro errors less verbose
[bpt/emacs.git]
/
lisp
/
emacs-lisp
/
macroexp.el
diff --git
a/lisp/emacs-lisp/macroexp.el
b/lisp/emacs-lisp/macroexp.el
index
e3a746f
..
55e2ebf
100644
(file)
--- a/
lisp/emacs-lisp/macroexp.el
+++ b/
lisp/emacs-lisp/macroexp.el
@@
-97,8
+97,9
@@
each clause."
(defun macroexp--compiler-macro (handler form)
(condition-case err
(apply handler form (cdr form))
(defun macroexp--compiler-macro (handler form)
(condition-case err
(apply handler form (cdr form))
- (error (message "Compiler-macro error for %S: %S" (car form) err)
- form)))
+ (error
+ (message "Compiler-macro error for %S: %S" (car form) err)
+ form)))
(defun macroexp--funcall-if-compiled (_form)
"Pseudo function used internally by macroexp to delay warnings.
(defun macroexp--funcall-if-compiled (_form)
"Pseudo function used internally by macroexp to delay warnings.
@@
-200,6
+201,12
@@
Assumes the caller has bound `macroexpand-all-environment'."
(macroexp--all-forms body)
(cdr form))
form))
(macroexp--all-forms body)
(cdr form))
form))
+ (`(,(and fun (or `flet `labels)) . ,(or `(,bindings . ,body) dontcare))
+ (macroexp--cons fun
+ (macroexp--cons (macroexp--all-clauses bindings 2)
+ (macroexp--all-forms body)
+ (cdr form))
+ form))
(`(,(and fun `(lambda . ,_)) . ,args)
;; Embedded lambda in function position.
(macroexp--cons (macroexp--all-forms fun 2)
(`(,(and fun `(lambda . ,_)) . ,args)
;; Embedded lambda in function position.
(macroexp--cons (macroexp--all-forms fun 2)
@@
-402,7
+409,7
@@
symbol itself."
(defvar macroexp--pending-eager-loads nil
"Stack of files currently undergoing eager macro-expansion.")
(defvar macroexp--pending-eager-loads nil
"Stack of files currently undergoing eager macro-expansion.")
-(defun internal-macroexpand-for-load (form)
+(defun internal-macroexpand-for-load (form
full-p
)
;; Called from the eager-macroexpansion in readevalloop.
(cond
;; Don't repeat the same warning for every top-level element.
;; Called from the eager-macroexpansion in readevalloop.
(cond
;; Don't repeat the same warning for every top-level element.
@@
-425,7
+432,9
@@
symbol itself."
(condition-case err
(let ((macroexp--pending-eager-loads
(cons load-file-name macroexp--pending-eager-loads)))
(condition-case err
(let ((macroexp--pending-eager-loads
(cons load-file-name macroexp--pending-eager-loads)))
- (macroexpand-all form))
+ (if full-p
+ (macroexpand-all form)
+ (macroexpand form)))
(error
;; Hopefully this shouldn't happen thanks to the cycle detection,
;; but in case it does happen, let's catch the error and give the
(error
;; Hopefully this shouldn't happen thanks to the cycle detection,
;; but in case it does happen, let's catch the error and give the