unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Decebal'" <CLDWesterhof@gmail.com>, <help-gnu-emacs@gnu.org>
Subject: RE: Opening file with is in killring
Date: Sat, 1 Nov 2008 09:45:31 -0700	[thread overview]
Message-ID: <001901c93c41$412a93e0$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <e24e446e-4ecf-4605-a86f-c40e8389f871@d36g2000prf.googlegroups.com>

> > I bind a key (I use `M-k') in the minibuffer keymaps to 
> > a command that clears the minibuffer, so only two
> > keystrokes are needed (`M-k C-y').
> 
> What is this command?

This will do it:
(defun foo () (interactive) (delete-minibuffer-contents))
(define-key minibuffer-local-map "\C-y" 'foo)

(Likewise, for any minibuffer keymaps that don't inherit from
`minibuffer-local-map'.)

[In reality, I bind `M-k' in the minibuffer to a command that either clears the
minibuffer (as above) or, if you are cycling through a minibuffer history,
deletes the current element from that history.]

> > such a binding, you can always use `C-x DEL' (`DEL' is 
> > typically the Backspace key), which is `backward-kill-sentence',
> > or `ESC C-backspace' or `ESC C-delete', which are
> > `backward-kill-sexp'. They can generally help to 
> > clear the minibuffer.
> 
> But this puts the contents of the minibuffer in the killring. :-{

Yes, and? ;-)

> I understood that with m-y I should get the previous entry, but when I
> use that I get: Previous command was not a yank

Correct. `C-y' yanks the head of the kill-ring. `M-y' replaces that insertion
with the previous kill-ring entry. `C-y' is a one-time thing; you can repeat
`M-y' to move through the ring until you get to the kill you want.

> I have kill-ring-max set on 60. So anybody an idea what is happening
> here?

See above.


[FWIW, outside of the minibuffer, I bind an Icicles multi-command to `C-- C-y'.
It lets you yank any items from the kill-ring using completion, without needing
to cycle through them. You can also cycle if you like, but you need not go
through all of them one by one. And you can sort them in various ways, which
helps when cycling. And you can hit `S-delete' to remove selected candidates
from the kill-ring. And you can filter completion matches using multiple
patterns (progressive completion), to quickly get to what you want.]







  parent reply	other threads:[~2008-11-01 16:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-31 10:17 Opening file with is in killring Decebal
2008-10-31 12:28 ` Paul R
2008-10-31 14:31   ` Drew Adams
2008-10-31 14:40     ` Paul R
2008-10-31 15:16       ` Drew Adams
     [not found]       ` <mailman.2573.1225466182.25473.help-gnu-emacs@gnu.org>
2008-11-01  8:27         ` Decebal
     [not found]   ` <mailman.2570.1225463508.25473.help-gnu-emacs@gnu.org>
2008-11-01  8:24     ` Decebal
2008-11-01  8:29       ` Teemu Likonen
2008-11-01 20:07         ` Decebal
2008-11-01 16:45       ` Drew Adams [this message]
     [not found]       ` <mailman.2644.1225557931.25473.help-gnu-emacs@gnu.org>
2008-11-01 20:20         ` Decebal
     [not found] ` <mailman.2561.1225456153.25473.help-gnu-emacs@gnu.org>
2008-10-31 14:39   ` Decebal
2008-11-01 13:41     ` Kevin Rodgers

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='001901c93c41$412a93e0$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=CLDWesterhof@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).