emacs-devel
[Top][All Lists]
Advanced

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

Making hide-ifdef-use-define-alist more user friendly


From: Juan-Leon Lahoz Garcia
Subject: Making hide-ifdef-use-define-alist more user friendly
Date: Mon, 21 Feb 2005 03:03:03 -0600 (CST)

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





reply via email to

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