From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: find-file-read-args: cursor's file as default in Dired Date: Tue, 10 Jul 2007 15:34:38 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184107608 27841 80.91.229.12 (10 Jul 2007 22:46:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Jul 2007 22:46:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 11 00:46:47 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I8OTm-0001NY-HP for ged-emacs-devel@m.gmane.org; Wed, 11 Jul 2007 00:46:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8OTm-0005WE-4F for ged-emacs-devel@m.gmane.org; Tue, 10 Jul 2007 18:46:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8OTi-0005Vz-Lj for emacs-devel@gnu.org; Tue, 10 Jul 2007 18:46:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8OTh-0005VM-8x for emacs-devel@gnu.org; Tue, 10 Jul 2007 18:46:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8OTh-0005VJ-05 for emacs-devel@gnu.org; Tue, 10 Jul 2007 18:46:41 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I8OJo-0007Jj-LE; Tue, 10 Jul 2007 18:36:29 -0400 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l6AMaN5L026597; Tue, 10 Jul 2007 16:36:23 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l6AMJwAE026219; Tue, 10 Jul 2007 16:36:22 -0600 Original-Received: from dhcp-amer-csvpn-gw2-141-144-73-85.vpn.oracle.com by acsmt351.oracle.com with ESMTP id 3027551631184106883; Tue, 10 Jul 2007 15:34:43 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74602 Archived-At: > 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 *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.