From: "Drew Adams" <drew.adams@oracle.com>
To: <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: RE: find-file-read-args: cursor's file as default in Dired
Date: Tue, 10 Jul 2007 15:34:38 -0700 [thread overview]
Message-ID: <BNELLINCGFJLDJIKDGACCEGNCAAA.drew.adams@oracle.com> (raw)
In-Reply-To: <E1I8NlV-0000kv-0X@fencepost.gnu.org>
> Here's what it should be, so that `M-n' with `C-x C-f' gives
> you the file of the cursor in Dired mode:
>
> That is a good feature. Would you please send a patch and change log
> entry, and text for etc/NEWS?
----------------8<----------------------------------
2007-07-10 Drew Adams <drew.adams@oracle.com>
*files.el (find-file-read-args): Default in Dired mode is cursor's
file.
----------------8<----------------------------------
diff -c "c:/drews-lisp-20/cvs-lisp/NEWS-22-2007-07-10.txt"
"c:/drews-lisp-20/cvs-lisp/NEWS-22-patched-2007-07-10.txt"
*** c:/drews-lisp-20/cvs-lisp/NEWS-22-2007-07-10.txt Tue Jul 10 15:30:16
2007
--- c:/drews-lisp-20/cvs-lisp/NEWS-22-patched-2007-07-10.txt Tue Jul 10
15:31:52 2007
***************
*** 4163,4168 ****
--- 4163,4171 ----
modification times. Magic file name handlers can handle this
operation.
+ *** In Dired, the default file to visit with `find-file' is the file
+ on the same line as the cursor.
+
** Input changes:
*** Functions `y-or-n-p', `read-char', `read-key-sequence' and the like,
that
----------------8<----------------------------------
diff -c "c:/drews-lisp-20/cvs-lisp/files-CVS-2007-07-10.el"
"c:/drews-lisp-20/cvs-lisp/files-CVS-patched-2007-07-10.el"
*** c:/drews-lisp-20/cvs-lisp/files-CVS-2007-07-10.el Tue Jul 10 15:18:52
2007
--- c:/drews-lisp-20/cvs-lisp/files-CVS-patched-2007-07-10.el Tue Jul 10
15:20:24 2007
***************
*** 1065,1076 ****
(defun find-file-read-args (prompt mustmatch)
(list (let ((find-file-default
! (and buffer-file-name
! (abbreviate-file-name buffer-file-name))))
! (minibuffer-with-setup-hook
! (lambda () (setq minibuffer-default find-file-default))
! (read-file-name prompt nil default-directory mustmatch)))
! t))
(defun find-file (filename &optional wildcards)
"Edit file FILENAME.
--- 1065,1078 ----
(defun find-file-read-args (prompt mustmatch)
(list (let ((find-file-default
! (if (eq major-mode 'dired-mode)
! (abbreviate-file-name (dired-get-file-for-visit))
! (and buffer-file-name (abbreviate-file-name
! buffer-file-name)))))
! (minibuffer-with-setup-hook
! (lambda () (setq minibuffer-default find-file-default))
! (read-file-name prompt nil default-directory mustmatch)))
! t))
(defun find-file (filename &optional wildcards)
"Edit file FILENAME.
next prev parent reply other threads:[~2007-07-10 22:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-10 2:32 find-file-read-args: cursor's file as default in Dired Drew Adams
2007-07-10 22:01 ` Richard Stallman
2007-07-10 22:34 ` Drew Adams [this message]
2007-07-10 23:17 ` Juri Linkov
2007-07-11 0:49 ` Drew Adams
2007-07-11 2:33 ` Stefan Monnier
2007-07-11 8:04 ` Juri Linkov
2007-07-11 15:20 ` Drew Adams
2007-07-11 22:59 ` Juri Linkov
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=BNELLINCGFJLDJIKDGACCEGNCAAA.drew.adams@oracle.com \
--to=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=rms@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 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).