Paul Kinnucan <[EMAIL PROTECTED]> writes:

> Jon Schewe writes:
>  > Can you please not override efc-query-options-function with a function
>  > that creates a dialog box even if the user has asked XEmacs not to
>  > display them under any circumstances?  Please rewrite this to pay
>  > attention to the use-dialog-box variable.
>  > 
>  > `use-dialog-box' is a variable declared in Lisp.
>  >   -- loaded from "/usr/share/xemacs/21.4.15/lisp/minibuf.elc"
>  > 
>  > Value: nil
>  > 
>  > Documentation:
>  > *Variable controlling usage of the dialog box.
>  > If nil, the dialog box will never be used, even in response to mouse
>  > events.

I've been using the following.
Index: efc.el
===================================================================
RCS file: /p/sss/cvs/jde/lisp/efc.el,v
retrieving revision 1.1.1.1
diff -c -c -r1.1.1.1 efc.el
*** efc.el      31 Oct 2004 23:58:41 -0000      1.1.1.1
--- efc.el      4 Nov 2004 20:14:14 -0000
***************
*** 40,45 ****
--- 40,64 ----
    "If non-nil the function to use for interactively querying options.
  If nil then the default efc custom-based dialogs will be used.")
  
+ ;;; Minibuffer interface
+ (defvar efc-query-options-history nil
+   "History of efc option values selected through the minibuffer")
+ 
+ (defun efc-query-options-with-minibuffer (&optional disable)
+   "Choose whether to enter efc options through a dialog box or the minibuffer.
+ By default this function sets `efc-query-options-function' to use read 
+ input from the minibuffer.  With a prefix argument, this function clears
+ `efc-query-option-function' to re-enable dialog boxes."
+   (interactive "P")
+   (setq efc-query-options-function
+       (if disable
+           nil
+         (lambda (options prompt title)
+           (completing-read prompt
+                            (mapcar (lambda (x) (cons x t)) options)
+                            nil t nil
+                            'efc-query-options-history)))))
+ 
  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;                                                                            
;; 
  ;; Dialog Class                                                               
;;

and calling efc-query-options-with-minibuffer from .xemacs/init.el.

I did not submit this to the patches list because I don't think it is
the best solution for many efc-query-options clients.

I have an idea for speeding up jde-open-source and
jde-find-and-import.  I'd like to see them read classes of the form
<simple-name>:<qualifier> from the minibuffer with standard emacs
completion.

Suppose you are trying to import the name C where p1.p2.p3.C and
p1.p4.p5.C are defined.  jde-find-and-import should prompt with.
`Choose a class to import: C:'  From there, one can type the first
letter of p1, <tab>, the first letter of p4, <tab>, <return>, and get
an import of p1.p4.p5.C.  This is a lot faster than reaching for a
mouse, or any other option jde currently provides.

Jason

Reply via email to