From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luke Lee Newsgroups: gmane.emacs.devel Subject: Re: Update earlier posted hideif.el enhancements Date: Fri, 8 Nov 2013 12:07:26 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b86f30689bed104eaa28711 X-Trace: ger.gmane.org 1383883691 26989 80.91.229.3 (8 Nov 2013 04:08:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Nov 2013 04:08:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 08 05:08:16 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VedMk-0001Iw-LY for ged-emacs-devel@m.gmane.org; Fri, 08 Nov 2013 05:08:14 +0100 Original-Received: from localhost ([::1]:43757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VedMj-0005NH-OE for ged-emacs-devel@m.gmane.org; Thu, 07 Nov 2013 23:08:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VedMf-0005N0-Ly for emacs-devel@gnu.org; Thu, 07 Nov 2013 23:08:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VedMe-0001C8-5a for emacs-devel@gnu.org; Thu, 07 Nov 2013 23:08:09 -0500 Original-Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]:48457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VedMd-0001Bz-P5 for emacs-devel@gnu.org; Thu, 07 Nov 2013 23:08:08 -0500 Original-Received: by mail-pa0-f46.google.com with SMTP id kl14so306331pab.19 for ; Thu, 07 Nov 2013 20:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=H1LdJbI2Gp0lP+pd++1d1hJFbYDcrn9HZY5vWTRJXpo=; b=Pck/Jsot3wvwyr8RAUas2w4Yq8FtKYwpIOGD/snlzBh4S4E7J7tOA1J8O0NF3L3JBh on5ucyILXuAoq98GuqqZmZZPFvlbvZ+u0TxQvq046WmyVrfL94nuy9LN7r31H7qdTIdA NXHug6L8kWXPsAvZxiRoQV2Rn05R5VzeZZ1BtoCbU8ZiOv5cNWpIKs+GJUHYZPLdyxJn nNL32q3Wp9wg04RUgOS++kR7CrcSWNWb9V68Av6o7NBbfJa7kOqJNlhNSaWnfYkxUAup YiWlugUMcpCFOgSl1Q56/xHS1gUJSuFavXxnHlMNDpz6akeptpc2qp7IWMTCdiV6CJ50 mjtw== X-Received: by 10.66.161.229 with SMTP id xv5mr13462257pab.87.1383883686392; Thu, 07 Nov 2013 20:08:06 -0800 (PST) Original-Received: by 10.70.17.226 with HTTP; Thu, 7 Nov 2013 20:07:26 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165061 Archived-At: --047d7b86f30689bed104eaa28711 Content-Type: text/plain; charset=ISO-8859-1 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'." --047d7b86f30689bed104eaa28711 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
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/hide= if.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 th= e arguments, if '...' exists the first arg will be hif-etc."
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; or we save the = tokens, parse it after parameter replacement
=A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (expr (and tokens
=A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(or (and hif-si= mple-token-only
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 (listp tokens)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (=3D (lengt= h tokens) 1)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (hif-parse-if-exp tokens))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0`(hif-define-macro ,parmlist ,tokens))))
@@ -1581,= 9 +1582,10 @@ Return a list of the arguments, if '...' exists the f= irst arg will be hif-etc."
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(ass= oc (intern name) hide-ifdef-env))))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0(and name
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 (if SA
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 (setcdr SA expr) ;; Lazy evaluation, eval only if hif-lookup fi= nd it
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (or (setcdr = SA expr) t) ;; Lazy evaluation, eval only if hif-lookup find it
= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; define it anyway= , even if nil it's still in list and therefore considerred defined
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (push (cons (i= ntern name) expr) hide-ifdef-env)))))
+ =A0 =A0 =A0 =A0 =A0 =A0;;= #undef
=A0 =A0 =A0 =A0 =A0 =A0 =A0(and name
=A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 (hif-undefine-symbol (intern name))))))
=A0 =A0 =A0 =A0 t))
@@ -1835,7 +1837,7 @@ If prefixed, it wi= ll also hide #ifdefs themselves."
=A0 =A0"Compress the = define list ENV into a list of defined symbols only."
=A0 = =A0(let ((new-defs nil))
=A0 =A0 =A0(dolist (def env new-defs)
- =A0 =A0 =A0(if (hif-= lookup (car def)) (push (car env) new-defs)))))
+ =A0 =A0 =A0(if = (hif-lookup (car def)) (push (car def) new-defs)))))
=A0
=A0(defun hide-ifdef-set-define-alist (name)
=A0 =A0"Set the association for NAME to `hide-ifdef-env'.&quo= t;=A0
--047d7b86f30689bed104eaa28711--