From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Javier Oviedo" Newsgroups: gmane.emacs.help Subject: Re: recentf.el and listing recently visited files Date: Mon, 17 Mar 2003 12:52:25 -0500 Organization: Texas Instruments Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1047924336 6058 80.91.224.249 (17 Mar 2003 18:05:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 17 Mar 2003 18:05:36 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 17 19:05:34 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18uyzO-0001ZY-00 for ; Mon, 17 Mar 2003 19:05:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18uyzQ-0003F3-01 for gnu-help-gnu-emacs@m.gmane.org; Mon, 17 Mar 2003 13:05:36 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.media.kyoto-u.ac.jp!nntp1.hal-pc.org!attdl1!attdl2!ip.att.net!news.ti.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 163 Original-NNTP-Posting-Host: gt64v7121.telogy.design.ti.com Original-X-Trace: tilde.itg.ti.com 1047923461 5795 158.218.105.183 (17 Mar 2003 17:51:01 GMT) Original-X-Complaints-To: usenet@news.ti.com Original-NNTP-Posting-Date: 17 Mar 2003 17:51:01 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Original-Xref: shelby.stanford.edu gnu.emacs.help:111162 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:7662 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7662 Klaus, Yes, I meant instances...thanks for the correction. I think that I will follow your advice. "Klaus Berndl" wrote in message news:ud6kqrlos.fsf@sdm.de... > On Mon, 17 Mar 2003, Javier Oviedo wrote: > > > Sandip, > > > > Thanks for your reply. I tried your functions but they don't seem handle > > the cases that I want covered. > > > > What I have noticed is that when I close emacs, the recentf-list > > updates....the list gets written. I noticed a undesirable behavior with > > this. Let say that I have two emacs session open. In one I open foo.c and > > in the other I open bar.c (both happen to be in the same directory). When I > > close the session with foo.c I then see foo.c added to the recentf-list. I > > then close the second session with bar.c and I see bar.c written to the > > list but I no longer see foo.c. It seems to have been deleted from the > > list. > > > > First, I think that once a file is written, it should be saved. Is it > > possible to have the list update as soon as any file is opened in any emacs > > window? Once the list has updated, any emacs window should be able to now > > see the new recently visited file. > > Yes, recentf.el works not well in scenarios where more than one Emacs-instance > is opened - in such a scenario always that one "wins" (means overwrites the > recentf-file) which is closed at last. > > recentf.el is designed to work well with one emacs-instance - IMHO a scenario > which you should follow. IMHO there are not really many reasons why to use > more than one Emacs instance because you can use several frames and for > command-line using you can use gnuclient etc.... > > To handle a recent-file-list correct with more than one independent > Emacs-instances could be done as follows: > After every new file opening this must be written down to the file and every > emacs-instance has to react to this event - could be done maybe with the > mechanisms of auto-revert-mode....in general it seems to so easy... > > BTW: I suppose that you meant in your first posting not "Emacs windows" but > "Emacs instances", right?! > > Klaus > > > Do you functions handle this case? > > > > Thanks for your help. > > > > > > "Sandip Chitale" wrote in message > > news:b607d812.0303141643.761485a5@posting.google.com... > > > Javier, > > > > > > I had hacked the recentf.el so that it takes into account > > > the file-name-history variable. Thus all files opened using > > > the find-file (and it's variants) also get added to the > > > recent files list. > > > > > > My changes were top of the following version of recentf.el : > > > > > > ;; Author: David Ponce > > > ;; Created: July 19 1999 > > > ;; Keywords: customization > > > > > > Here are the changed defuns: > > > > > > (defun recentf-add-file (filename) > > > "Add or move FILENAME at the beginning of `recentf-list'. > > > Does nothing if FILENAME matches one of the `recentf-exclude' regexps." > > > (let ((filename (expand-file-name filename))) > > > (when (recentf-include-p filename) > > > (setq recentf-list (cons filename (delete filename recentf-list))) > > > (setq file-name-history (cons filename (delete filename > > file-name-history))) > > > (setq recentf-update-menu-p t)))) > > > : > > > : > > > (defun recentf-find-file (filename) > > > "Edit file FILENAME using `find-file'. > > > If FILENAME is not readable it is removed from `recentf-list'." > > > (if (file-readable-p filename) > > > (progn > > > (find-file filename) > > > (setq file-name-history (cons filename file-name-history)) > > > ) > > > (progn > > > (message "File `%s' not found." filename) > > > (setq recentf-list (delete filename recentf-list)) > > > (setq recentf-update-menu-p t)))) > > > : > > > : > > > (defun recentf-add-file (filename) > > > "Add or move FILENAME at the beginning of `recentf-list'. > > > Does nothing if FILENAME matches one of the `recentf-exclude' regexps." > > > (let ((filename (expand-file-name filename))) > > > (when (recentf-include-p filename) > > > (setq recentf-list (cons filename (delete filename recentf-list))) > > > (setq file-name-history (cons filename (delete filename > > file-name-history))) > > > (setq recentf-update-menu-p t)))) > > > > > > HTH, > > > sandip > > > > > > "Javier Oviedo" wrote in message > > news:... > > > > Hello all: > > > > > > > > I really like recentf.el and use it quite frequently. I do however have > > a > > > > few questions: > > > > 1. Would it be possible to make entries timeout after some period of > > time? > > > > After a few days or something like that, the list would drop files. > > > > > > > > 2. How does the recentf-list update? Is it possible to have recentf-list > > > > update whenever a new file is opened regardless of which emacs window it > > is > > > > opened in? > > > > > > > > Example: I have one emacs window open. I then open a second emacs window > > for > > > > some temporary work. I would like the recentf-list to update and show > > the > > > > file(from second window) in the original window list. Is this possible? > > > > > > > > > > > > > > > > Thanks In Advance. > > -- > Klaus Berndl mailto: klaus.berndl@sdm.de > sd&m AG http://www.sdm.de > software design & management > Thomas-Dehler-Str. 27, 81737 München, Germany > Tel +49 89 63812-392, Fax -220