From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juan-Leon Lahoz Garcia Newsgroups: gmane.emacs.devel Subject: Making hide-ifdef-use-define-alist more user friendly Date: Mon, 21 Feb 2005 03:03:03 -0600 (CST) Message-ID: <200502210903.j1L933jt024808@il06exr01.mot.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1108977127 12245 80.91.229.2 (21 Feb 2005 09:12:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Feb 2005 09:12:07 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 21 10:12:07 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D39bW-0005tH-EY for ged-emacs-devel@m.gmane.org; Mon, 21 Feb 2005 10:11:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D39sQ-0006VD-Rx for ged-emacs-devel@m.gmane.org; Mon, 21 Feb 2005 04:29:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D39oA-0005jH-0p for emacs-devel@gnu.org; Mon, 21 Feb 2005 04:24:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D39nN-0005Qp-Oy for emacs-devel@gnu.org; Mon, 21 Feb 2005 04:24:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D39nJ-0005Ag-4O for emacs-devel@gnu.org; Mon, 21 Feb 2005 04:23:57 -0500 Original-Received: from [129.188.136.101] (helo=ftpbox.mot.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D39Sh-0002oo-1d for emacs-devel@gnu.org; Mon, 21 Feb 2005 04:02:39 -0500 Original-Received: from il06exr01.mot.com (il06exr01.mot.com [129.188.137.131]) by ftpbox.mot.com (Motorola/Ftpbox) with ESMTP id j1L92bkn020466 for ; Mon, 21 Feb 2005 02:02:37 -0700 (MST) Original-Received: from zes06exm01.madrid.ecid.cig.mot.com ([10.161.1.12]) by il06exr01.mot.com (8.13.1/8.13.0) with ESMTP id j1L933jt024808 for ; Mon, 21 Feb 2005 03:03:03 -0600 (CST) Original-Received: from kaliban.madrid.ecid.cig.mot.com.motorola.com (10.161.14.31 [10.161.14.31]) by zes06exm01.madrid.ecid.cig.mot.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id FGJDAGL4; Mon, 21 Feb 2005 10:02:35 +0100 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33663 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33663 Hi, `hide-ifdef-use-define-alist', when invoked interactivelly, does not know how to complete to the symbols in alist `hide-ifdef-define-alist', despite it is mandatory to enter one of them. This is an incovenience because when you use several list is hard to remember the exact names for them. Since I can see in CVS this file is untouched for a lot of time, here goes a patch so solve this (you might find a more elegant solution, I suppose), just for the case of anyone here with time to review it and maybe modify and/or apply. --- hideif.el.ori Mon Feb 21 09:33:58 2005 +++ hideif.el Mon Feb 21 10:08:52 2005 @@ -1061,9 +1061,16 @@ (cons (cons name (hif-compress-define-list hide-ifdef-env)) hide-ifdef-define-alist))) -(defun hide-ifdef-use-define-alist (name) +(defun hide-ifdef-use-define-alist (&optional name) "Set `hide-ifdef-env' to the define list specified by NAME." - (interactive "SUse define list: ") + (interactive) + (unless name + (setq name + (completing-read "Use define list: " + (mapcar (lambda (arg) + (cons (symbol-name (car arg)) t)) + hide-ifdef-define-alist) nil t))) + (if (stringp name) (setq name (intern name))) (let ((define-list (assoc name hide-ifdef-define-alist))) (if define-list (setq hide-ifdef-env -- Regards juanleon