diff options
| author | Stefan Monnier | 2011-05-22 15:22:30 -0300 |
|---|---|---|
| committer | Stefan Monnier | 2011-05-22 15:22:30 -0300 |
| commit | 9c848d8a7578d84212bac6559681fd0cf795581c (patch) | |
| tree | abd2b0230e653f625ded84ee1f3004f53937c7ce | |
| parent | 79106a44d30dd3ec15a5bdd653b1d1911fe05ff7 (diff) | |
| download | emacs-9c848d8a7578d84212bac6559681fd0cf795581c.tar.gz emacs-9c848d8a7578d84212bac6559681fd0cf795581c.zip | |
* lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Convert ' to #' for
funcall as well. Warn when performing those conversions.
* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Fix error report.
Fixes: debbugs:8712
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/macroexp.el | 10 |
3 files changed, 15 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a759eb749ef..5b0fa090eaa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2011-05-22 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2011-05-22 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * emacs-lisp/macroexp.el (macroexpand-all-1): Convert ' to #' for | ||
| 4 | funcall as well (bug#8712). Warn when performing those conversions. | ||
| 5 | * emacs-lisp/bytecomp.el (byte-compile-form): Fix error report. | ||
| 6 | |||
| 3 | * progmodes/grep.el (grep-mode): Fix it for good (bug#8684)! | 7 | * progmodes/grep.el (grep-mode): Fix it for good (bug#8684)! |
| 4 | 8 | ||
| 5 | 2011-05-22 Glenn Morris <rgm@gnu.org> | 9 | 2011-05-22 Glenn Morris <rgm@gnu.org> |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e7f2115a848..49b39b6a1f9 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -2892,8 +2892,8 @@ If FORM is a lambda or a macro, byte-compile it as a function." | |||
| 2892 | That command is designed for interactive use only" fn)) | 2892 | That command is designed for interactive use only" fn)) |
| 2893 | (if (and (fboundp (car form)) | 2893 | (if (and (fboundp (car form)) |
| 2894 | (eq (car-safe (symbol-function (car form))) 'macro)) | 2894 | (eq (car-safe (symbol-function (car form))) 'macro)) |
| 2895 | (byte-compile-report-error | 2895 | (byte-compile-log-warning |
| 2896 | (format "Forgot to expand macro %s" (car form)))) | 2896 | (format "Forgot to expand macro %s" (car form)) nil :error)) |
| 2897 | (if (and handler | 2897 | (if (and handler |
| 2898 | ;; Make sure that function exists. This is important | 2898 | ;; Make sure that function exists. This is important |
| 2899 | ;; for CL compiler macros since the symbol may be | 2899 | ;; for CL compiler macros since the symbol may be |
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index f0a075ace37..ccfdf2e0551 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el | |||
| @@ -169,14 +169,22 @@ Assumes the caller has bound `macroexpand-all-environment'." | |||
| 169 | ;; here, so that any code that cares about the difference will | 169 | ;; here, so that any code that cares about the difference will |
| 170 | ;; see the same transformation. | 170 | ;; see the same transformation. |
| 171 | ;; First arg is a function: | 171 | ;; First arg is a function: |
| 172 | (`(,(and fun (or `apply `mapcar `mapatoms `mapconcat `mapc)) | 172 | (`(,(and fun (or `funcall `apply `mapcar `mapatoms `mapconcat `mapc)) |
| 173 | ',(and f `(lambda . ,_)) . ,args) | 173 | ',(and f `(lambda . ,_)) . ,args) |
| 174 | (byte-compile-log-warning | ||
| 175 | (format "%s quoted with ' rather than with #'" | ||
| 176 | (list 'lambda (nth 1 f) '...)) | ||
| 177 | t) | ||
| 174 | ;; We don't use `maybe-cons' since there's clearly a change. | 178 | ;; We don't use `maybe-cons' since there's clearly a change. |
| 175 | (cons fun | 179 | (cons fun |
| 176 | (cons (macroexpand-all-1 (list 'function f)) | 180 | (cons (macroexpand-all-1 (list 'function f)) |
| 177 | (macroexpand-all-forms args)))) | 181 | (macroexpand-all-forms args)))) |
| 178 | ;; Second arg is a function: | 182 | ;; Second arg is a function: |
| 179 | (`(,(and fun (or `sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args) | 183 | (`(,(and fun (or `sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args) |
| 184 | (byte-compile-log-warning | ||
| 185 | (format "%s quoted with ' rather than with #'" | ||
| 186 | (list 'lambda (nth 1 f) '...)) | ||
| 187 | t) | ||
| 180 | ;; We don't use `maybe-cons' since there's clearly a change. | 188 | ;; We don't use `maybe-cons' since there's clearly a change. |
| 181 | (cons fun | 189 | (cons fun |
| 182 | (cons (macroexpand-all-1 arg1) | 190 | (cons (macroexpand-all-1 arg1) |