all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'WalterGR'" <waltergr@gmail.com>, <help-gnu-emacs@gnu.org>
Subject: RE: Dismissing a completion buffer?
Date: Tue, 13 Jan 2009 12:28:32 -0800	[thread overview]
Message-ID: <001d01c975bd$8259c600$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <238c8ae2-ce48-40b8-ac58-4435c5dbb2c8@p36g2000prp.googlegroups.com>

> > > When a completion buffer pops up, e.g. M-x o, enter something, hit
> > > tab... how do I dismiss that buffer?  Ctrl-g (cancel) 
> > > seems to have no effect; Ctrl-x k doesn't do the right thing; and
> > > hitting Esc doesn't have the desired effect.
>
> > In vanilla Emacs, `C-g' does nothing to remove this frame, 
> > as you say. Icicles does not have this problem:
> > http://www.emacswiki.org/cgi-bin/wiki/Icicles
> 
> (I'm fairly new to Emacs and still hazy on the interaction between
> pieces and parts...)
> 
> The completion buffer I'm concerned about is created while using SLIME
> to edit Lisp code / interact with a Lisp REPL.

I don't use SLIME, so I can't speak directly to that.

> Is my understanding correct that Icicles works with any completion
> buffer? (My assumption here is that buffers named "*Completions*"
> are some specific Emacs "thing" that code can interact with, which
> obviously may be incorrect...)

Icicles always uses buffer *Completions* for its completion. Any Emacs-Lisp code
that calls `completing-read' or `read-file-name' will, in Icicle mode,
automatically take advantage of Icicles completion enhancements.

In addition, some other existing Emacs-Lisp code can also take advantage of
Icicles - for example, Emacs-Lisp symbol completion, dabbrev completion, BBDB
completion, ESS completion, GUD completion, IELM completion, and shell-mode
completion generally:
http://www.emacswiki.org/emacs/Icicles_-_Completion_in_Other_Buffers

Yes, it is possible for some Emacs-Lisp code to display completions in a buffer
other than *Completions*. If it uses function `display-completion-list', then it
can provide any name it wants for the completion-candidates buffer.

Even if some Emacs-Lisp code does use the name "*Completions*" when it calls
`display-completion-list', if it does not also use the minibuffer for completion
(e.g. by calling `completing-read') then Icicles will not kick in - except for a
certain number of special cases (see above for examples) where Icicle mode
enhances the vanilla non-minibuffer completion.

For your specific question regarding SLIME mode completion, I don't know whether
it uses the minibuffer for completion. If it does not, then Icicles completion
will not automatically kick in - there is currently no SLIME mode-specific
enhancement by Icicles. (It could no doubt be added, just as it was added for
the kinds of non-minibuffer completion mentioned above.)

It's easy to download Icicles and try it, to see if it helps with SLIME-mode
completion:
http://www.emacswiki.org/emacs/Icicles_-_Libraries

If it does not, then let me know the specifics off-list, and I'll look into the
possibility of adding some SLIME-mode support.

Or you could add that support yourself, using this as a guideline:
http://www.emacswiki.org/emacs/Icicles_-_Defining_Completion_for_Comint_Modes
That is, if SLIME uses Comint mode ("a general-purpose mode for
communicating with interactive subprocesses" - Emacs manual), then adding
support for it is pretty simple.

If SLIME does not derive from Comint mode, but SLIME completion is similar to,
say, Emacs-Lisp symbol completion, then you can use
`icicle-lisp-complete-symbol' as a guideline. It is a simple enhancement to the
vanilla `lisp-complete-symbol': it just uses minibuffer completion whenever
there are multiple completion candidates.

In short, whenever the minibuffer is used for completion, Icicles kicks in. If
you have a function that completes buffer text without using the minibuffer,
then you can change it to call `completing-read' whenever there are multiple
completions. In that way, it will use the minibuffer for such a choice, and
Icicles will kick in.

HTH.





      reply	other threads:[~2009-01-13 20:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12 18:13 Dismissing a completion buffer? WalterGR
2009-01-12 23:09 ` Peter Dyballa
     [not found] ` <mailman.4689.1231801752.26697.help-gnu-emacs@gnu.org>
2009-01-13  8:03   ` WalterGR
2009-01-13 16:01     ` Peter Dyballa
2009-01-13 16:43 ` Drew Adams
     [not found] ` <mailman.4776.1231865048.26697.help-gnu-emacs@gnu.org>
2009-01-13 16:55   ` WalterGR
2009-01-13 20:28     ` Drew Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001d01c975bd$8259c600$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=waltergr@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.