unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* what is minibuffer-completion-confirm's purpose?
@ 2004-05-20 19:06 Chris Green
  2004-05-20 20:17 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Green @ 2004-05-20 19:06 UTC (permalink / raw)


In XEmacs, I can set minibuffer-confirm-incomplete and that will
prevent me from accepting a minibuffer completion that doesn't already
exist without confirmation.

For example, C-x b *Unknown* will prompt saying [no completions,
confirm] if the buffer *Unknown* doesn't already exist or C-x f
.bashtc will also say [no completions, confirm].'

In Emacs 21.3.1 and current CVS,

minibuffer-completion-confirm seems to provide that same kind of
functionality by it's docstring.  However, setting it to t doesn't
give me the desired behavior combined with emacs -q.  Is there another
minibuffer customization I can perform to get the promping on unknown
behavior?

Thanks,
-- 
Chris Green <cmg@dok.org>
 "Not everyone holds these truths to be self-evident, so we've worked
                  up a proof of them as Appendix A." --  Paul Prescod

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: what is minibuffer-completion-confirm's purpose?
  2004-05-20 19:06 what is minibuffer-completion-confirm's purpose? Chris Green
@ 2004-05-20 20:17 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2004-05-20 20:17 UTC (permalink / raw)


Chris Green wrote:
 > In XEmacs, I can set minibuffer-confirm-incomplete and that will
 > prevent me from accepting a minibuffer completion that doesn't already
 > exist without confirmation.
 >
 > For example, C-x b *Unknown* will prompt saying [no completions,
 > confirm] if the buffer *Unknown* doesn't already exist or C-x f
 > .bashtc will also say [no completions, confirm].'
 >
 > In Emacs 21.3.1 and current CVS,
 >
 > minibuffer-completion-confirm seems to provide that same kind of
 > functionality by it's docstring.  However, setting it to t doesn't
 > give me the desired behavior combined with emacs -q.  Is there another
 > minibuffer customization I can perform to get the promping on unknown
 > behavior?

Not really.  completing-read overrides minibuffer-completion-confirm's
ambient value, resetting it according to its REQUIRE-MATCH argument.
And many commands like switch-to-buffer (C-x b) and find-file (C-x C-f)
are defined using interactive codes that allow non-existent buffers and
files ("B" and "F"), which pass a nil REQUIRE-MATCH through read-buffer
and read-file-name to completing-read.

That being said, see these examples from lisp/emacs-lisp/advice.el:

;;(defadvice switch-to-buffer (before existing-buffers-only activate)
;;  "When called interactively switch to existing buffers only, unless
;;when called with a prefix argument."
;;  (interactive
;;   (list (read-buffer "Switch to buffer: " (other-buffer)
;;                      (null current-prefix-arg)))))
;;
;;(defadvice switch-to-buffer (around confirm-non-existing-buffers activate)
;;  "Switch to non-existing buffers only upon confirmation."
;;  (interactive "BSwitch to buffer: ")
;;  (if (or (get-buffer (ad-get-arg 0))
;;          (y-or-n-p (format "`%s' does not exist, create? " (ad-get-arg 0))))
;;      ad-do-it))
;;
;;(defadvice find-file (before existing-files-only activate)
;;  "Find existing files only"
;;  (interactive "fFind file: "))

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-20 20:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-20 19:06 what is minibuffer-completion-confirm's purpose? Chris Green
2004-05-20 20:17 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).