emacs-devel
[Top][All Lists]
Advanced

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

Re: find-file-read-args


From: Stefan Monnier
Subject: Re: find-file-read-args
Date: Tue, 24 Nov 2009 14:40:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> + ;;;###autoload
> + (progn (defun dired-file-name-at-point ()
> +   "Try to get a file name at point in the current dired buffer.
> + This hook is inteneded to be put in `file-name-at-point-functions'."
> +   (when (eq major-mode 'dired-mode)
> +     (let ((filename (dired-get-filename nil t)))
> +       (when filename
> +     (if (file-directory-p filename)
> +         (file-name-as-directory (abbreviate-file-name filename))
> +       (abbreviate-file-name filename)))))))
[...]
> + (defcustom file-name-at-point-functions '(dired-file-name-at-point
> +                                       ffap-guess-file-name-at-point)

Almost right: don't put dired-file-name-at-point in the default value.
Instead use `add-hook' in dired-mode to add it buffer-locally.
That will also get you rid of the ugly (eq major-mode 'dired-mode).
After that, please install your patch (and advertise it well in
etc/NEWS).  And thank you very much for working on it.


        Stefan




reply via email to

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