emacs-devel
[Top][All Lists]
Advanced

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

RE: "Snippet" database


From: Drew Adams
Subject: RE: "Snippet" database
Date: Sun, 8 Jan 2012 22:02:06 -0800

> > So maybe a `yank-select' command to select from the kill ring would
> > be useful to you
> 
> Possible today via the menu bar (Edit->Paste from Kill Menu).


Using completion against the `kill-ring' is a whole lot handier than
picking a kill from a menu.

FWIW -

For "snippet" stuff it is handy to have a selection ring that is
separate from the kill ring.  The kill ring is volatile, and many of
its entries are typically not something you necessarily want to yank -
there can be a lot of noise.

A less volatile selection is the secondary selection.  Library
`second-sel.el' gives you a ring for this, `secondary-selection-ring',
which you can use the same way as the `kill-ring'.  Its entries can be
more appropriate for snippets, since a typical use of killing text
does not have snippets in mind.

In any case, it's also good to be able to copy or move a selection
from one ring to the other - e.g. to save a kill as a snippet.

Library `browse-kill-ring+.el' lets you browse either selection ring
(kills or secondary selections), yank entries from it, and copy or
move selections from one ring to the other.  You can create other
selection rings to browse, and you can of course persist a ring using
savehist or whatever (e.g., a "database of snippets").

With these libraries (by default), if `M-y' follows a yank command, it
acts normally.  If it follows a yank-secondary command it acts
similarly but using the `secondary-selection-ring' instead of the
`kill-ring'.  Otherwise (`M-y' at top level), it browses the current
ring or, if in a buffer browsing a ring, it browses the other ring.

In Icicles (by default), `M-y' acts similarly.  But instead of
browsing selections, a top-level `M-y' yanks a selection using
completion, from the `kill-ring' or (with prefix arg) from the
`secondary-selection-ring'.

During this completion you can hit a key to:

* Copy a selection to the other ring
* Delete a selection from the current ring
* Sort the selections in various ways for easier access (no dups)

http://www.emacswiki.org/emacs/SecondarySelection#secondary-sel.el
http://www.emacswiki.org/emacs/BrowseKillRing




reply via email to

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