[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs Improvement

From: era
Subject: Re: Emacs Improvement
Date: 13 Jan 2004 09:33:37 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

On Mon, 12 Jan 2004 18:27:51 +0100, Arturo García Ares
<address@hidden> posted to bug-gnu-emacs:
 > On Mon, Jan 12, 2004 at 01:44:14PM +0200, address@hidden wrote:
 >> > This is such a snippet:
 >> > (add-hook 'find-file-hooks
 >> >           (lambda ()
 >> >             (add-to-list 'file-name-history
 >> >                          (abbreviate-file-name (buffer-file-name)))))
 >> This modifies what happens when you M-x find-file within Emacs, not
 >> what happens with file name arguments passed in on the command line.
 >> Also it duplicates what Emacs already does by itself (you don't get
 >> duplicates on file-name-history because add-to-list won't add a file
 >> name which is there already).
 > File names passed as arguments to emacs are opened via find-file, so in
 > effect the above code adds those files to file-name-history.
 > Yes: duplicates are (intentionally) avoided by add-to-list, and it's
 > not optimal to let the hook execute for every visited file when it's
 > only required for non-interactive (by interactive I mean those opened
 > via C-x C-f) file opens. Nevertheless, it's harmless, except for the
 > extra cpu cycles. It's just a quick hack tu put in your .emacs, but it
 > does the job (have you tried it?)

Yes, I tried it, and it didn't work for me. But maybe my Emacs is too
old (or too new? :-)

/* era */

The email address era     the contact information   Just for kicks, imagine
at iki dot fi is heavily  link on my home page at   what it's like to get
spam filtered.  If you    <http://www.iki.fi/era/>  500 pieces of spam for
want to reach me, see     instead.                  each wanted message.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]