emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r118113: * lisp/progmodes/elisp-mode.el (elisp--loca


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r118113: * lisp/progmodes/elisp-mode.el (elisp--local-variables-1):
Date: Wed, 15 Oct 2014 01:57:03 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118113
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18688
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2014-10-14 21:56:56 -0400
message:
  * lisp/progmodes/elisp-mode.el (elisp--local-variables-1):
  Handle quoted expressions.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/elisp-mode.el   elispmode.el-20140927013948-e1y3x6iieoc5zmhn-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-10-14 11:59:16 +0000
+++ b/lisp/ChangeLog    2014-10-15 01:56:56 +0000
@@ -1,3 +1,8 @@
+2014-10-15  Stefan Monnier  <address@hidden>
+
+       * progmodes/elisp-mode.el (elisp--local-variables-1):
+       Handle quoted expressions (bug#18688).
+
 2014-10-14  Jérémy Compostella  <address@hidden>
            Michael Albinus  <address@hidden>
 

=== modified file 'lisp/progmodes/elisp-mode.el'
--- a/lisp/progmodes/elisp-mode.el      2014-09-27 10:08:59 +0000
+++ b/lisp/progmodes/elisp-mode.el      2014-10-15 01:56:56 +0000
@@ -255,18 +255,27 @@
                        (dolist (binding bindings)
                          (push (or (car-safe binding) binding) vars))
                        (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)
                      (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 ,v ,_ . ,catches)
                      (elisp--local-variables-1
                       (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--witness--lisp (or vars '(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)))))
     res))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]