From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Update filename history after several actions Date: Wed, 12 Oct 2005 08:47:04 +0300 Organization: JURTA Message-ID: <874q7nwixm.fsf@jurta.org> References: <87fys87vbv.fsf@ID-24456.user.uni-berlin.de> <87r7br1rp9.fsf@ID-24456.user.uni-berlin.de> <20051004071357.GB30424@www.trapp.net> <8764s8vljt.fsf@jurta.org> <874q7qj5qe.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129097393 30741 80.91.229.2 (12 Oct 2005 06:09:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 12 Oct 2005 06:09:53 +0000 (UTC) Cc: nospam@spamgourmet.com, tomas@tuxteam.de, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 12 08:09:49 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EPZn3-0000Uu-7Q for ged-emacs-devel@m.gmane.org; Wed, 12 Oct 2005 08:08:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPZn2-0002XP-1v for ged-emacs-devel@m.gmane.org; Wed, 12 Oct 2005 02:08:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EPZiA-00022Q-Iz for emacs-devel@gnu.org; Wed, 12 Oct 2005 02:03:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EPZi8-00021h-22 for emacs-devel@gnu.org; Wed, 12 Oct 2005 02:03:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPZi7-00021Z-Ct for emacs-devel@gnu.org; Wed, 12 Oct 2005 02:03:31 -0400 Original-Received: from [194.126.101.114] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EPZi5-0006ER-Pk; Wed, 12 Oct 2005 02:03:30 -0400 Original-Received: from mail.neti.ee (80-235-42-54-dsl.mus.estpak.ee [80.235.42.54]) by Relayhost1.neti.ee (Postfix) with ESMTP id 3CE9D2120; Wed, 12 Oct 2005 09:03:38 +0300 (EEST) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Tue, 11 Oct 2005 10:46:51 -0400") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43907 Archived-At: > The simplest solution is to use the same method as employed by > Recentf mode. It maintains the list of recently opened files, > no matter what user-level command visited them, and doesn't include > automatically processed files. > > To update the list of recently opened files, Recentf mode puts > the function `recentf-track-opened-file' in `find-file-hook'. > > How does that avoid recording files that are processed by Lisp > programs that the user doesn't know about? If those programs use > find-file-noselect, that would run find-file-hook, which would > record the file name thus being processed. Recentf is quite an old package, and it seems its users are happy with the way it records recently opened files. Perhaps this means there are not many places where find-file-noselect is used for internal file processing (i.e. not intended for the users to know). In those places where such processing is required, a more preferable way is to insert the contents of a file into a temporary buffer. While I tried to run the code which uses find-file-hook I sent earlier, I noticed that often it adds too many file names to the history, even the files opened for editing (there were no file names left from internal file processing at all in my test). For example, I don't like that `next-error' adds every file it opens from the grep buffer. Also I don't like adding files visited in read-only mode by dired's "v" key. All this means that the question what file names to add to the history is rather a matter of personal preferences. A simple hook for `find-file-hook' is easy to put in .emacs. But even if this functionality will get into Emacs, I think it's better to leave the current default behavior (with only adding user input to the history) unchanged. -- Juri Linkov http://www.jurta.org/emacs/