unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Making it easier to get rid of *Completions*
@ 2014-03-30  3:42 Daniel Colascione
  2014-03-30 18:25 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Colascione @ 2014-03-30  3:42 UTC (permalink / raw)
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]

When I'm using completion-at-point (and completion-in-region-mode more
generally), I find that I always have a *Completions* buffer that stick
around when I don't want it. *Completions* is supposed to go away during
the course of normal editing as the completions it contains become
obsolete, but sometimes it doesn't --- imagine moving back to the prompt
after completing a command in comint.

The following patch makes C-g in the regular command loop exit
completion-in-region-mode, getting rid of the *Completions* buffer. It
seems like it's doing a decent job so far. This patch also makes it
easier to work with a two-window Emacs: otherwise, C-x o

Comments? Better ways to make *Completions* less annoying in stock Emacs?

=== modified file 'lisp/minibuffer.el'
--- lisp/minibuffer.el	2014-03-05 07:04:01 +0000
+++ lisp/minibuffer.el	2014-03-30 03:39:32 +0000
@@ -1928,6 +1928,7 @@
       (and completion-in-region--data
            (and (eq (marker-buffer (nth 0 completion-in-region--data))
                     (current-buffer))
+                (not (eq this-command 'keyboard-quit))
                 (>= (point) (nth 0 completion-in-region--data))
                 (<= (point)
                     (save-excursion



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

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

* Re: Making it easier to get rid of *Completions*
  2014-03-30  3:42 Making it easier to get rid of *Completions* Daniel Colascione
@ 2014-03-30 18:25 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2014-03-30 18:25 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Emacs developers

> The following patch makes C-g in the regular command loop exit
> completion-in-region-mode, getting rid of the *Completions* buffer.

I think I like the idea, but comparing this-command against
keyboard-quit doesn't appeal to me.  I'd rather change keyboard-quit to
explicitly disable completion-in-region-mode.


        Stefan



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

end of thread, other threads:[~2014-03-30 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-30  3:42 Making it easier to get rid of *Completions* Daniel Colascione
2014-03-30 18:25 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).