From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: More convenient editing of recentf files Date: Sun, 15 Mar 2009 20:24:47 -0700 Message-ID: <006601c9a5e6$c2c41020$0200a8c0@us.oracle.com> References: <-P2dnR3ZpK8hoCDUnZ2dnUVZ_sudnZ2d@posted.cpinternet> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1237173905 28840 80.91.229.12 (16 Mar 2009 03:25:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Mar 2009 03:25:05 +0000 (UTC) To: "'B. T. Raven'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 16 04:26:22 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lj3T3-0003Bi-T6 for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Mar 2009 04:26:22 +0100 Original-Received: from localhost ([127.0.0.1]:40188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lj3Rh-0004KY-TS for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Mar 2009 23:24:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lj3RM-0004KR-0k for help-gnu-emacs@gnu.org; Sun, 15 Mar 2009 23:24:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lj3RH-0004KF-KJ for help-gnu-emacs@gnu.org; Sun, 15 Mar 2009 23:24:35 -0400 Original-Received: from [199.232.76.173] (port=41312 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lj3RH-0004KC-Cz for help-gnu-emacs@gnu.org; Sun, 15 Mar 2009 23:24:31 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:32077 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lj3RG-0001j7-O6 for help-gnu-emacs@gnu.org; Sun, 15 Mar 2009 23:24:30 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n2G3OLpk026621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 16 Mar 2009 03:24:22 GMT Original-Received: from acsmt702.oracle.com (acsmt702.oracle.com [141.146.40.80]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n2G3OSx4008635; Mon, 16 Mar 2009 03:24:30 GMT Original-Received: from dradamslap1 (/24.4.133.20) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 16 Mar 2009 03:24:24 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acmlz86dKttsn+ezRfW2eLcyyRBpygACiqpw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt702.oracle.com [141.146.40.80] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A0B020A.49BDC66A.0008:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62963 Archived-At: > 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.