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: Mon, 10 Oct 2005 09:14:45 +0300 Organization: JURTA Message-ID: <874q7qj5qe.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> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128925756 5036 80.91.229.2 (10 Oct 2005 06:29:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Oct 2005 06:29:16 +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 Mon Oct 10 08:29:09 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EOr92-00018y-Rv for ged-emacs-devel@m.gmane.org; Mon, 10 Oct 2005 08:28:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EOr91-00074H-Ba for ged-emacs-devel@m.gmane.org; Mon, 10 Oct 2005 02:28:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EOr5L-00068u-Np for emacs-devel@gnu.org; Mon, 10 Oct 2005 02:24:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EOr5G-00068F-UA for emacs-devel@gnu.org; Mon, 10 Oct 2005 02:24:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EOr5C-00067y-Ji for emacs-devel@gnu.org; Mon, 10 Oct 2005 02:24:23 -0400 Original-Received: from [194.126.101.114] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EOr5B-0002wC-LB; Mon, 10 Oct 2005 02:24:21 -0400 Original-Received: from mail.neti.ee (80-235-32-140-dsl.mus.estpak.ee [80.235.32.140]) by Relayhost1.neti.ee (Postfix) with ESMTP id 2A4DC20D9; Mon, 10 Oct 2005 09:24:21 +0300 (EEST) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Sun, 09 Oct 2005 14:16:41 -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:43774 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. It seems that users of Recentf mode are satisfied with its file list. So the same method could be used to add recently opened files to the file name history. To update the list of recently opened files, Recentf mode puts the function `recentf-track-opened-file' in `find-file-hook'. The following code does the same to add recently opened files to the history: (add-hook 'find-file-hook 'add-file-name-to-history) (defun add-file-name-to-history () "Add the name of the file just opened to the history." (when (and buffer-file-name (or (null file-name-history) (not (equal buffer-file-name (car file-name-history))))) (if history-delete-duplicates (delete buffer-file-name file-name-history)) (setq file-name-history (cons buffer-file-name file-name-history)))) -- Juri Linkov http://www.jurta.org/emacs/