From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: dired-jump Date: Sat, 08 Jul 2006 10:29:06 +0200 Message-ID: <85u05s4i0d.fsf@lola.goethe.zz> References: <87d5cghpd8.fsf@catnip.gol.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1152347372 25069 80.91.229.2 (8 Jul 2006 08:29:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 8 Jul 2006 08:29:32 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 08 10:29:32 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fz8Bq-0001NJ-LK for ged-emacs-devel@m.gmane.org; Sat, 08 Jul 2006 10:29:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fz8Bq-0003lp-3V for ged-emacs-devel@m.gmane.org; Sat, 08 Jul 2006 04:29:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fz8Ba-0003kR-I3 for emacs-devel@gnu.org; Sat, 08 Jul 2006 04:29:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fz8BZ-0003jX-Sl for emacs-devel@gnu.org; Sat, 08 Jul 2006 04:29:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fz8BZ-0003jO-L5 for emacs-devel@gnu.org; Sat, 08 Jul 2006 04:29:09 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fz8CA-0002nL-RQ for emacs-devel@gnu.org; Sat, 08 Jul 2006 04:29:46 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1Fz8BY-0001qy-TI; Sat, 08 Jul 2006 04:29:09 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 4BBF11C464E1; Sat, 8 Jul 2006 10:29:06 +0200 (CEST) Original-To: Miles Bader In-Reply-To: <87d5cghpd8.fsf@catnip.gol.com> (Miles Bader's message of "Sat, 08 Jul 2006 10:11:47 +0900") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:56772 Archived-At: Miles Bader writes: > I just found out about a very very handy binding (thanks to David > Kastrup's comment on another mailing list): C-x C-j -- dired-jump > (which when given in a file buffer, pops up a dired buffer on its > directory with point positioned over the entry for that file). > > Unfortunately this only gets bound if you load dired-x.el. > > This seems so handy that I think it really ought to be bound by default > (`dired-jump' is already autoloaded from dired-x.el) -- having global > non-mode-specific bindings take effect only when you load a particular > lisp file seems most peculiar when that file is part of the standard > lisp distribution. > > The code which binds dired-jump to `C-x C-j' is conditional upon the > variable `dired-bind-jump' -- if that variable is nil, then the binding > is not done. > > We could simply continue honoring `dired-bind-jump', but move the > binding code from dired-x.el to bindings.el (and maybe add a bit of > customize magic to make changes to `dired-bind-jump' do something > intelligent). [If bindings.el is executed before dumping, perhaps this > code would need to be put somewhere that happens after loading the > user's init file...] > > Here's the code from dired-x.el: > > ;;; GLOBAL BINDING. > (if dired-bind-jump > (progn > (define-key global-map "\C-x\C-j" 'dired-jump) > (define-key global-map "\C-x4\C-j" 'dired-jump-other-window))) > > > What do people think? Personally, I find that dired-jump is so useful that it should be the default (I actually forgot it wasn't). The problem I see is that dired-x does a lot more, and just using a particular keybinding should not change the behavior of dired. The intro to dired states: File: dired-x, Node: Features, Next: Technical Details, Up: Introduction 1.1 Features ============ Some features provided by Dired Extra 1. Omitting uninteresting files from Dired listing. *Note Omitting Files in Dired::. 2. Local variables for Dired directories. *Note Local Variables::. 3. Guessing shell commands in Dired buffers. *Note Shell Command Guessing::. 4. Running Dired command in non-Dired buffers. *Note Virtual Dired::. 5. Finding a file mentioned in a buffer *Note Find File At Point::. 6. Commands using file marking. *Note Advanced Mark Commands::. `dired-x.el' binds some functions to keys in Dired Mode (*note Key Index::) and also binds `C-x C-j' and `C-x 4 C-j' _globally_ to `dired-jump' (*note Miscellaneous Commands::). It may also bind `C-x C-f' and `C-x 4 C-f' to `dired-x-find-file' and `dired-x-find-file-other-window', respectively (*note Find File At Point::). Personally, I consider all of those useful, but that is not guaranteed to be the opinion of everybody else. So we should either make dired-x the default in toto, or we should extract the code dealing with dired-jump (and maybe dired-x-find-file) and move it into dired or a separate file, so that those bindings can be made the default without getting the rest of dired-x. But I don't think we should have dired-x's features turned on depending on whether one has used a stock keybinding. So either we decouple the keybindings from dired-x, or make all of dired-x stock. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum