help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Opening file with is in killring


From: Drew Adams
Subject: RE: Opening file with is in killring
Date: Sat, 1 Nov 2008 09:45:31 -0700

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]