all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: bash and reverse-search-history
Date: Sat, 22 Apr 2006 13:27:26 -0700	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICOEBPDFAA.drew.adams@oracle.com> (raw)
In-Reply-To: <20060422192402.GC4759@radix50.net>

Hello Baurzhan,

    > Icicles lets you search the entire history (your #2),
    > updating matches as you type (your #1).

    This looks interesting. I wanted to try it, however I couldn't find out
    how to invoke it. I downloaded the *.el files mentioned, put them into
    ~/.elisp/load, and added the following lines to my ~/.emacs:

    (add-to-list 'load-path (expand-file-name "~/.elisp/load"))
    (load-library "icicles.el")

After you load Icicles you are automatically in Icicle mode, unless
`define-minor-mode' is not defined in your version of Emacs, in which case
you can put this in your .emacs (it doesn't hurt to do this anyway): (when
(fboundp 'icicle-mode) (icicle-mode 99)). Whenever you are in Icicle mode,
you will see "Icy" in the mode line minor-mode list. Command `icicle-mode'
enters and exits the mode.

In Icicle mode, minibuffer completion is enhanced in several ways, including
matching minibuffer history items, with incremental update of the list of
possible completions.

    I start emacs, M-x shell RET, and get the shell prompt. I've read some
    of the wiki pages, but it isn't clear for me how I can use Icicles. The
    page about history doesn't mention shell at all, only minibuffer
    completions. Any idea?

I haven't used the Emacs shell in years. I guess I was thinking that you
were inputting stuff through the minibuffer - sorry to have misled you.
Icicles works with any minibuffer input, but I imagine that you won't get
many Icicles features out of the box with comint (shell command line)
completion, which does not use the minibuffer.

I did enhance dabbrev completion (which, like comint completion, does not
use the minibuffer) to be able to take advantage of some Icicles features,
but I haven't yet done that for comint (shell) completion.

Trying shell command completion just now, I notice that about the only thing
you get for free is Icicles candidate cycling, which isn't all that helpful
here. Comint completion apparently does its own matching, so it can't
automatically take advantage of Icicles completion features like regexp
matching. And there is no way to use the Icicles minibuffer history
enhancements with the (non-minibuffer) shell history. With some Emacs-Lisp
programming, you could probably cobble together some of the Icicles
functions to get yourself something workable, but I'm sorry that I don't
have time to work on this.

So I guess the short answer is that you won't get what you want with
Icicles, until I get around to tweaking comint completion so that it can use
Icicles features. Sorry for the false route.

    In bash, you can press C-r, and type, e.g., "dpkg". As you type each
    character, bash shows the most recent command that matches the
    expression you've typed up to that moment.

    In emacs, I press M-r, it asks for a regexp, I type "dpkg". Nothing is
    updated as I type, emacs waits for me to press RET to start searching. I
    press RET, it finds the last dpkg command, which happens to be the 29th.
    I see it isn't what I was looking for, and want to repeat the search. I
    have to press M-r dpkg RET again (this is the "next run" I'd mentioned
    in the first posting; "modifying" it is about the case you are not
    satisfied with your initial regexp and want to enter a more specific one
    instead of the one you typed at first). Or, I can press M-r M-r RET RET,
    and emacs will search again. But only 32 commands back?!

    So, what I'm looking for is more or less exactly bash's C-r
    functionality. Can I perhaps just unbind emacs's C-r for shell buffers,
    so that the character is passed to bash?

The incremental completion update you describe is available in Icicles
(which is why I replied to you) for both standard prefix matching and regexp
matching, but only for minibuffer completion. Sorry.

  reply	other threads:[~2006-04-22 20:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21 12:43 bash and reverse-search-history Baurzhan Ismagulov
2006-04-21 15:13 ` Peter Dyballa
2006-04-21 15:43   ` Baurzhan Ismagulov
2006-04-21 16:45     ` Drew Adams
2006-04-22 19:24       ` Baurzhan Ismagulov
2006-04-22 20:27         ` Drew Adams [this message]
2006-04-22 21:05           ` Baurzhan Ismagulov
2006-04-22 21:29         ` Peter Dyballa
2006-04-22 21:53           ` Baurzhan Ismagulov
2006-04-22 22:21             ` Peter Dyballa
2006-04-23  7:00               ` Baurzhan Ismagulov
2006-04-21 22:02     ` Kevin Rodgers
2006-04-22 12:24       ` Baurzhan Ismagulov
     [not found] <mailman.700.1145623405.9609.help-gnu-emacs@gnu.org>
2006-04-22  9:18 ` Gary Wessle
2006-04-22 12:21   ` Baurzhan Ismagulov

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=DNEMKBNJBGPAOPIJOOICOEBPDFAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.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.