diff options
| author | Stefan Monnier | 2014-10-14 21:56:56 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-10-14 21:56:56 -0400 |
| commit | 10fff83762262ec4d5f571e26069d37162ba514d (patch) | |
| tree | 973bdab1e224bbac0315daf43e187a58961b1d82 | |
| parent | 643b1e97f71b3f90a55d90e00885b70cda123df2 (diff) | |
| download | emacs-10fff83762262ec4d5f571e26069d37162ba514d.tar.gz emacs-10fff83762262ec4d5f571e26069d37162ba514d.zip | |
* lisp/progmodes/elisp-mode.el (elisp--local-variables-1):
Handle quoted expressions.
Fixes: debbugs:18688
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/elisp-mode.el | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 055ec17160e..f092ec6b539 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-10-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * progmodes/elisp-mode.el (elisp--local-variables-1): | ||
| 4 | Handle quoted expressions (bug#18688). | ||
| 5 | |||
| 1 | 2014-10-14 Jérémy Compostella <jeremy.compostella@intel.com> | 6 | 2014-10-14 Jérémy Compostella <jeremy.compostella@intel.com> |
| 2 | Michael Albinus <michael.albinus@gmx.de> | 7 | Michael Albinus <michael.albinus@gmx.de> |
| 3 | 8 | ||
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index f3143bd76ee..900e859b54a 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el | |||
| @@ -255,18 +255,27 @@ Blank lines separate paragraphs. Semicolons start comments. | |||
| 255 | (dolist (binding bindings) | 255 | (dolist (binding bindings) |
| 256 | (push (or (car-safe binding) binding) vars)) | 256 | (push (or (car-safe binding) binding) vars)) |
| 257 | (elisp--local-variables-1 vars (car (last body))))) | 257 | (elisp--local-variables-1 vars (car (last body))))) |
| 258 | (`(lambda ,_) (setq sexp nil)) | 258 | (`(lambda ,_args) |
| 259 | ;; FIXME: Look for the witness inside `args'. | ||
| 260 | (setq sexp nil)) | ||
| 259 | (`(lambda ,args . ,body) | 261 | (`(lambda ,args . ,body) |
| 260 | (elisp--local-variables-1 | 262 | (elisp--local-variables-1 |
| 261 | (append args vars) (car (last body)))) | 263 | (append (remq '&optional (remq '&rest args)) vars) |
| 264 | (car (last body)))) | ||
| 262 | (`(condition-case ,_ ,e) (elisp--local-variables-1 vars e)) | 265 | (`(condition-case ,_ ,e) (elisp--local-variables-1 vars e)) |
| 263 | (`(condition-case ,v ,_ . ,catches) | 266 | (`(condition-case ,v ,_ . ,catches) |
| 264 | (elisp--local-variables-1 | 267 | (elisp--local-variables-1 |
| 265 | (cons v vars) (cdr (car (last catches))))) | 268 | (cons v vars) (cdr (car (last catches))))) |
| 269 | (`(quote . ,_) | ||
| 270 | ;; FIXME: Look for the witness inside sexp. | ||
| 271 | (setq sexp nil)) | ||
| 272 | ;; FIXME: Handle `cond'. | ||
| 266 | (`(,_ . ,_) | 273 | (`(,_ . ,_) |
| 267 | (elisp--local-variables-1 vars (car (last sexp)))) | 274 | (elisp--local-variables-1 vars (car (last sexp)))) |
| 268 | (`elisp--witness--lisp (or vars '(nil))) | 275 | (`elisp--witness--lisp (or vars '(nil))) |
| 269 | (_ nil))) | 276 | (_ nil))) |
| 277 | ;; We didn't find the witness in the last element so we try to | ||
| 278 | ;; backtrack to the last-but-one. | ||
| 270 | (setq sexp (ignore-errors (butlast sexp))))) | 279 | (setq sexp (ignore-errors (butlast sexp))))) |
| 271 | res)) | 280 | res)) |
| 272 | 281 | ||