all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'B. T. Raven'" <nihil@nihilo.net>, <help-gnu-emacs@gnu.org>
Subject: RE: More convenient editing of recentf files
Date: Sun, 15 Mar 2009 20:24:47 -0700	[thread overview]
Message-ID: <006601c9a5e6$c2c41020$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <E76dnQwc-fbSBSDUnZ2dnUVZ_qTinZ2d@posted.cpinternet>

> From: B. T. Raven Sent: Sunday, March 15, 2009 6:09 PM
>
> Thanks, Drew. I called the main defun prune-recentf-list and 
> it worked but with deeply nested file hierarchy, it's still
> a lot of typing.

I guess you're saying that with a file that has many ancestor directories, you
must type a lot, for (absolute file-name) completion to distinguish a unique
candidate.

Yes, I can see that. That's where Icicles substring or regexp matching comes
into play. You can match any parts of the absolute file name. Pick one or more
distinctive parts of the name, and match just those parts directly. No need to
type the whole prefix up to the significantly different part.

That part is not available with the vanilla code I sent, even though the actual
code is almost the same. You need Icicles to get the other features.

> For now I'll just use:
> (defalias 'rel 'recentf-edit-list)
> (defalias 'rof 'recentf-open-files)
> (defalias 'rsl 'recentf-save-list)
> so I can avoid the mouse.
> 
> Does the code below require that Icicles be installed?
> It looks like it depends on the existence of icicle-define-command.

The first code I sent (`remove-some-recent-files') does not require Icicles. I
think it might respond to your need. (I guess that's what you called
`prune-recentf-list', above.)

The second code I sent (`icicle-remove-file-from-recentf-list') depends on (a)
Icicles being installed and (b) your being in Icicle minor mode. It uses Icicles
multi-command features.

> I probably will install icicles someday. It looks intriguing
> but I need to keep things as close to the standard Emacs
> install as possible for now.

(FWIW, you can toggle Icicle mode off at any time, to return to vanilla Emacs
behavior.)

Let me be clear. My aim was to:

1. Give you an idea how to code a command that would help you out, using vanilla
Emacs (no Icicles).

2. Explain that nearly the same code will define a multi-command in Icicles,
which can be even more helpful (but which requires Icicles). The code is about
the same, but the effect is more power, because of being able to bring into play
other Icicles features (e.g. regexp matching, candidate cycling).

Had the aim been just to tell you how to get what you need with Icicles, I would
have mentioned foremost that you can remove file names from the recent list on
the fly, when you use command `icicle-recent-file' (File > Icicles > Open Recent
File) to open recent files. No need to invoke a separate command
(`icicle-remove-file-from-recentf-list') just for the removal.

How does that work? `icicle-recent-file' is ostensibly for opening one or more
recent files, not for removing them from `recentf-list'.

But just as you can use `C-RET', `C-mouse-2', etc. with an Icicles multi-command
to act on more than one candidate (see previous mail), so, at least with some
multi-commands, you can use `C-S-RET', `C-S-mouse-2', etc. to act in some other
way on candidates. These are "alternative action" keys, and for
`icicle-recent-file' the alternative action is to remove the chosen file name
from the recent-files list.

So this is a second way to do what you requested using Icicles. If you are
already in the process of opening one or more recent files, you can also remove
one or more others from the recent list at the same time.

HTH.







      reply	other threads:[~2009-03-16  3:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-15 18:42 More convenient editing of recentf files B. T. Raven
2009-03-15 19:47 ` Lennart Borgman
2009-03-15 22:53 ` Drew Adams
2009-03-15 23:02   ` Drew Adams
     [not found] ` <mailman.3262.1237146438.31690.help-gnu-emacs@gnu.org>
2009-03-15 23:01   ` B. T. Raven
     [not found] ` <mailman.3269.1237157595.31690.help-gnu-emacs@gnu.org>
2009-03-16  1:09   ` B. T. Raven
2009-03-16  3:24     ` 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='006601c9a5e6$c2c41020$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=nihil@nihilo.net \
    /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.