From: "Arturo García Ares" <arturo@pikatoste.homeip.net>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: Emacs Improvement
Date: Mon, 12 Jan 2004 18:27:51 +0100 [thread overview]
Message-ID: <20040112172750.GB593@pikatoste.homeip.net> (raw)
In-Reply-To: <87vfnhquny.fsf@era.iki.fi>
On Mon, Jan 12, 2004 at 01:44:14PM +0200, era@iki.fi 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?)
next prev parent reply other threads:[~2004-01-12 17:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.229.1073581027.928.bug-gnu-emacs@gnu.org>
2004-01-08 16:45 ` Emacs Improvement Klaus Uhl
2004-01-09 13:04 ` era
2004-01-10 0:43 ` Arturo García Ares
2004-01-12 11:44 ` era
2004-01-12 17:27 ` Arturo García Ares [this message]
2004-01-13 7:33 ` era
2004-01-13 21:21 ` Arturo García Ares
2004-01-08 15:36 Adam Morton
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040112172750.GB593@pikatoste.homeip.net \
--to=arturo@pikatoste.homeip.net \
--cc=bug-gnu-emacs@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.