emacs-devel
[Top][All Lists]
Advanced

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

Re: Update earlier posted hideif.el enhancements


From: Luke Lee
Subject: Re: Update earlier posted hideif.el enhancements
Date: Fri, 8 Nov 2013 12:07:26 +0800

Sure, my fault. I just thought that it will be easier for people that didn't have my earlier version yet.
Here is the patch, thanks.
---

diff --git a/elisp/hideif.el b/elisp/hideif.el
index 2e35fcd..a85e28e 100755
--- a/elisp/hideif.el
+++ b/elisp/hideif.el
@@ -1574,6 +1574,7 @@ Return a list of the arguments, if '...' exists the first arg will be hif-etc."
                          ;; or we save the tokens, parse it after parameter replacement
                          (expr (and tokens
                                     (or (and hif-simple-token-only
+                                             (listp tokens)
                                              (= (length tokens) 1)
                                              (hif-parse-if-exp tokens))
                                         `(hif-define-macro ,parmlist ,tokens))))
@@ -1581,9 +1582,10 @@ Return a list of the arguments, if '...' exists the first arg will be hif-etc."
                                   (assoc (intern name) hide-ifdef-env))))
                     (and name
                          (if SA
-                             (setcdr SA expr) ;; Lazy evaluation, eval only if hif-lookup find it
+                             (or (setcdr SA expr) t) ;; Lazy evaluation, eval only if hif-lookup find it
                            ;; define it anyway, even if nil it's still in list and therefore considerred defined
                            (push (cons (intern name) expr) hide-ifdef-env)))))
+            ;; #undef
             (and name
                  (hif-undefine-symbol (intern name))))))
        t))
@@ -1835,7 +1837,7 @@ If prefixed, it will also hide #ifdefs themselves."
   "Compress the define list ENV into a list of defined symbols only."
   (let ((new-defs nil))
     (dolist (def env new-defs)
-      (if (hif-lookup (car def)) (push (car env) new-defs)))))
+      (if (hif-lookup (car def)) (push (car def) new-defs)))))
 
 (defun hide-ifdef-set-define-alist (name)
   "Set the association for NAME to `hide-ifdef-env'." 

reply via email to

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