Commit 10fff837 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/progmodes/elisp-mode.el (elisp--local-variables-1):

Handle quoted expressions.

Fixes: debbugs:18688
parent 643b1e97
2014-10-15 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/elisp-mode.el (elisp--local-variables-1):
Handle quoted expressions (bug#18688).
2014-10-14 Jérémy Compostella <jeremy.compostella@intel.com> 2014-10-14 Jérémy Compostella <jeremy.compostella@intel.com>
Michael Albinus <michael.albinus@gmx.de> Michael Albinus <michael.albinus@gmx.de>
   
......
...@@ -255,18 +255,27 @@ Blank lines separate paragraphs. Semicolons start comments. ...@@ -255,18 +255,27 @@ Blank lines separate paragraphs. Semicolons start comments.
(dolist (binding bindings) (dolist (binding bindings)
(push (or (car-safe binding) binding) vars)) (push (or (car-safe binding) binding) vars))
(elisp--local-variables-1 vars (car (last body))))) (elisp--local-variables-1 vars (car (last body)))))
(`(lambda ,_) (setq sexp nil)) (`(lambda ,_args)
;; FIXME: Look for the witness inside `args'.
(setq sexp nil))
(`(lambda ,args . ,body) (`(lambda ,args . ,body)
(elisp--local-variables-1 (elisp--local-variables-1
(append args vars) (car (last body)))) (append (remq '&optional (remq '&rest args)) vars)
(car (last body))))
(`(condition-case ,_ ,e) (elisp--local-variables-1 vars e)) (`(condition-case ,_ ,e) (elisp--local-variables-1 vars e))
(`(condition-case ,v ,_ . ,catches) (`(condition-case ,v ,_ . ,catches)
(elisp--local-variables-1 (elisp--local-variables-1
(cons v vars) (cdr (car (last catches))))) (cons v vars) (cdr (car (last catches)))))
(`(quote . ,_)
;; FIXME: Look for the witness inside sexp.
(setq sexp nil))
;; FIXME: Handle `cond'.
(`(,_ . ,_) (`(,_ . ,_)
(elisp--local-variables-1 vars (car (last sexp)))) (elisp--local-variables-1 vars (car (last sexp))))
(`elisp--witness--lisp (or vars '(nil))) (`elisp--witness--lisp (or vars '(nil)))
(_ nil))) (_ nil)))
;; We didn't find the witness in the last element so we try to
;; backtrack to the last-but-one.
(setq sexp (ignore-errors (butlast sexp))))) (setq sexp (ignore-errors (butlast sexp)))))
res)) res))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment