[Top][All Lists]

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

Re: dired-jump

From: David Kastrup
Subject: Re: dired-jump
Date: Sat, 08 Jul 2006 10:29:06 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Miles Bader <address@hidden> 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:
>    (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

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

reply via email to

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