unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: nospam@spamgourmet.com, tomas@tuxteam.de, emacs-devel@gnu.org
Subject: Re: Update filename history after several actions
Date: Wed, 12 Oct 2005 08:47:04 +0300	[thread overview]
Message-ID: <874q7nwixm.fsf@jurta.org> (raw)
In-Reply-To: <E1EPLP1-0001BP-BC@fencepost.gnu.org> (Richard M. Stallman's message of "Tue, 11 Oct 2005 10:46:51 -0400")

>     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/

  reply	other threads:[~2005-10-12  5:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87fys87vbv.fsf@ID-24456.user.uni-berlin.de>
     [not found] ` <E1EFXvj-00051R-HS@fencepost.gnu.org>
     [not found]   ` <87r7br1rp9.fsf@ID-24456.user.uni-berlin.de>
     [not found]     ` <E1EFtKY-0004Vy-2X@fencepost.gnu.org>
     [not found]       ` <u8xxtqtpw.fsf@ID-24456.user.uni-berlin.de>
2005-10-04  5:02         ` Update filename history after several actions Richard M. Stallman
2005-10-04  7:13           ` Tomas Zerolo
2005-10-08  0:04             ` Juri Linkov
2005-10-09 18:16               ` Richard M. Stallman
2005-10-10  6:14                 ` Juri Linkov
2005-10-11 14:46                   ` Richard M. Stallman
2005-10-12  5:47                     ` Juri Linkov [this message]
2005-10-13  4:51                       ` Richard M. Stallman
2005-10-13 14:10                         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874q7nwixm.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=nospam@spamgourmet.com \
    --cc=tomas@tuxteam.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).