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 15:53:25 -0700 Message-ID: <004d01c9a5c0$d989a430$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 1237157626 29089 80.91.229.12 (15 Mar 2009 22:53:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Mar 2009 22:53:46 +0000 (UTC) To: "'B. T. Raven'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 15 23:55:02 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 1LizET-0001zD-Q6 for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Mar 2009 23:55:02 +0100 Original-Received: from localhost ([127.0.0.1]:60283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LizD7-0006gp-P9 for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Mar 2009 18:53:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LizCk-0006gZ-3X for help-gnu-emacs@gnu.org; Sun, 15 Mar 2009 18:53:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LizCf-0006fA-HA for help-gnu-emacs@gnu.org; Sun, 15 Mar 2009 18:53:13 -0400 Original-Received: from [199.232.76.173] (port=34321 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LizCf-0006f5-EH for help-gnu-emacs@gnu.org; Sun, 15 Mar 2009 18:53:09 -0400 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:65230 helo=rgminet11.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 1LizCf-0003sU-1S for help-gnu-emacs@gnu.org; Sun, 15 Mar 2009 18:53:09 -0400 Original-Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n2FMtwAn032149 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 15 Mar 2009 22:55:59 GMT Original-Received: from acsmt700.oracle.com (acsmt700.oracle.com [141.146.40.70]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n2FMrKmj020400; Sun, 15 Mar 2009 22:53:21 GMT Original-Received: from dradamslap1 (/24.4.133.20) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 15 Mar 2009 22:53:02 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <-P2dnR3ZpK8hoCDUnZ2dnUVZ_sudnZ2d@posted.cpinternet> Thread-Index: AcmlnarBnQCmpaWLSV6tRg1ATKlWFAAB3K4g X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt700.oracle.com [141.146.40.70] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090201.49BD86CF.02D3: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:62958 Archived-At: > From: B. T. Raven Sent: Sunday, March 15, 2009 11:43 AM > In .emacs I have: > (add-to-list 'same-window-buffer-names "*Buffer List*") > and '(iswitchb-mode t nil (iswitchb)) in custom-set-variables > so I can navigate to buffers quickly with C-x b and kill > selected ones with C-x C-b via D, SPC, and X keys. > Is there a way to do something like this with recentf files? > Now I have to use the mousey checkbox interface: > menubar > Open Recent > Edit list > check ... check ... check > .... move to bottom of list ... check ok Perhaps someone else will give you an Iswitchb-specific answer for recentf file deletion. If not, the following might help. If you use Icicles, you can use `Remove from Recent Files List' in menu Files > Icicles, or use `M-x icicle-remove-file-from-recentf-list'. During completion, you can filter candidates with your input (e.g. substring, regexp, prefix), and cycle among matches. Use `C-RET' or `C-mouse-2' repeatedly to remove as many individual file names as you like. Use `C-!' to remove all file names that match the current input pattern - use as many patterns as you like. Use `C-~' (complement) to match against all candidates that do *not* match some input pattern. Use `M-SPC' to combine input patterns (logical AND): progessive completion. (And yes, you can use Iswitchb with Icicles.) ---- Without Icicles, you could call, within a loop, a command that reads a single absolute file name using completion (letting the user quit the loop with, e.g., `C-g'). A user would then complete file names to remove them from `recentf-list'. (defun remove-some-recent-files () "Remove some files from the list of recently used files." (interactive) (while recentf-list (call-interactively #'remove-a-recent-file))) Within the loop, call `completing-read' against `recentf-list'. E.g.: (defun remove-a-recent-file (file) "Remove a file from the list of recently used files." (interactive (list (completing-read "Remove from recent files list (`C-g' when done): " (mapcar #'list (progn (unless (boundp 'recentf-list)(require 'recentf)) (when (fboundp 'recentf-mode) (recentf-mode 99)) (unless (consp recentf-list) (error "No recently accessed files")) recentf-list)) nil (and (fboundp 'confirm-nonexistent-file-or-buffer) (confirm-nonexistent-file-or-buffer)) ; Emacs23. nil 'file-name-history (car recentf-list)))) (setq recentf-list (delete file recentf-list)) (message "`%s' removed from `recentf-list'" file)) If you know you're going to have `recentf.el' loaded and be in `recentf-mode', then you can skip the first part of the `progn'. If you know you have Emacs 22+, you can skip the `mapcar'. If you know you have Emacs 23, you can skip the `fboundp' for `confirm-...'. ---- FYI, a nearly identical definition suffices to define the Icicles multi-command (no loop needed) that lets you remove as many files as you want from the list: (icicle-define-command icicle-remove-file-from-recentf-list "Remove some files from the list of recently used files." icicle-remove-from-recentf-candidate-action "Remove from recent files list: " (mapcar #'list (progn (unless (boundp 'recentf-list) (require 'recentf)) (when (fboundp 'recentf-mode) (recentf-mode 99)) (unless (consp recentf-list) (error "No recently accessed files")) recentf-list)) nil (and (fboundp 'confirm-nonexistent-file-or-buffer) (confirm-nonexistent-file-or-buffer)) nil 'file-name-history (car recentf-list) nil ((icicle-use-candidates-only-once-flag t))) (defun icicle-remove-from-recentf-candidate-action (file) "Action function for `icicle-remove-file-from-recentf-list'." (setq recentf-list (delete file recentf-list)) (message "`%s' removed from `recentf-list'" file)) HTH.