unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* dired-jump keybinding and autoload
@ 2008-05-08 12:59 Stephen Berman
  2008-05-08 14:12 ` Stefan Monnier
  0 siblings, 1 reply; 29+ messages in thread
From: Stephen Berman @ 2008-05-08 12:59 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]

Start Emacs with -Q, type C-x C-j, Emacs beeps and says "C-x C-j is
undefined".  Now type `M-x dired-jump' and you get a Dired buffer of the
default directory.  Type q to bury it, and now typing C-x C-j works and
brings up the default directory again.  The reason for this behavior is
that the command dired-jump from dired-x.el is autoloaded, but its
default global keybinding, C-x C-j, is not.  Since this keybinding is
conditioned on the value of the defcustom dired-bind-jump, it is not
possible to put the keybinding on an autoload cookie, as is done
e.g. with C-x d in dired.el.  But users can always change or eliminate
the keybinding anyway, so dired-bind-jump isn't really a very
interesting defcustom.  So, since the default value of dired-bind-jump
is t, I suggest eliminating dired-bind-jump and the condition on the
keybinding, and autoloading the latter.  Ditto for the keybinding of
dired-jump-other-window, and also autoload this command.

Steve Berman


2008-05-08  Stephen Berman  <Stephen.Berman@gmx.net>

	* dired-x.el (dired-bind-jump): Eliminate.
	Add key bindings for `dired-jump' and `dired-jump-other-window' as
	autoload cookies.
	(dired-jump-other-window): Add autoload cookie.


[-- Attachment #2: dired-x.el patch --]
[-- Type: text/plain, Size: 2128 bytes --]

*** /Users/steve/cvsroot/emacs/lisp/dired-x.el.~1.91.~	2008-05-06 17:54:02.000000000 +0200
--- /Users/steve/cvsroot/emacs/lisp/dired-x.el	2008-05-08 14:24:58.000000000 +0200
***************
*** 59,65 ****
  ;;
  ;;      dired-bind-vm
  ;;      dired-vm-read-only-folders
- ;;      dired-bind-jump
  ;;      dired-bind-info
  ;;      dired-bind-man
  ;;      dired-x-hands-off-my-keys
--- 59,64 ----
***************
*** 128,138 ****
    :type 'boolean
    :group 'dired-keys)
  
- (defcustom dired-bind-jump t
-   "*Non-nil means bind `dired-jump' to C-x C-j, otherwise do not."
-   :type 'boolean
-   :group 'dired-keys)
- 
  (defcustom dired-bind-man t
    "*Non-nil means bind `dired-man' to \"N\" in dired-mode, otherwise do not."
    :type 'boolean
--- 127,132 ----
***************
*** 324,335 ****
          :help "Enable or disable omitting \"uninteresting\" files")
        'dashes)))
  
- ;;; 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)))
- 
  \f
  ;;; Install into appropriate hooks.
  
--- 318,323 ----
***************
*** 351,357 ****
  For more features, see variables
  
    `dired-bind-vm'
-   `dired-bind-jump'
    `dired-bind-info'
    `dired-bind-man'
    `dired-vm-read-only-folders'
--- 339,344 ----
***************
*** 496,501 ****
--- 483,489 ----
  \f
  ;;; JUMP.
  
+ ;;;###autoload (define-key ctl-x-map "\C-j" 'dired-jump)
  ;;;###autoload
  (defun dired-jump (&optional other-window)
    "Jump to dired buffer corresponding to current buffer.
***************
*** 530,535 ****
--- 518,525 ----
  		    (dired-omit-mode)
  		    (dired-goto-file file))))))))
  
+ ;;;###autoload (define-key ctl-x-4-map "\C-j" 'dired-jump-other-window)
+ ;;;###autoload
  (defun dired-jump-other-window ()
    "Like \\[dired-jump] (`dired-jump') but in other window."
    (interactive)
***************
*** 1751,1757 ****
    (list
     'dired-bind-vm
     'dired-vm-read-only-folders
-    'dired-bind-jump
     'dired-bind-info
     'dired-bind-man
     'dired-find-subdir
--- 1741,1746 ----

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2010-05-25  6:35 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08 12:59 dired-jump keybinding and autoload Stephen Berman
2008-05-08 14:12 ` Stefan Monnier
2008-05-08 14:36   ` David Kastrup
2008-05-08 16:08     ` Stephen Berman
2008-05-09 23:52       ` Juri Linkov
2010-05-18 22:59         ` Juri Linkov
2010-05-23 15:48           ` Wojciech Meyer
2010-05-23 16:04             ` Juri Linkov
2010-05-23 16:45               ` Drew Adams
2010-05-23 16:50                 ` Lennart Borgman
2010-05-23 17:11                   ` Drew Adams
2010-05-23 17:24                     ` Lennart Borgman
2010-05-23 18:14                       ` Drew Adams
2010-05-23 18:47                         ` Lennart Borgman
2010-05-23 20:56                           ` Drew Adams
2010-05-23 21:08                             ` Lennart Borgman
2010-05-24  1:01                   ` Stephen J. Turnbull
2010-05-24  1:30                     ` Lennart Borgman
2010-05-24  5:03                       ` Stephen J. Turnbull
2010-05-23 16:59               ` Leo
2010-05-24 16:00                 ` Juri Linkov
2010-05-24 16:17                   ` Lennart Borgman
2010-05-24 16:46                     ` Drew Adams
2010-05-24 16:53                       ` Lennart Borgman
2010-05-24 16:35                   ` Drew Adams
2010-05-24  5:05             ` Miles Bader
2010-05-24  7:19               ` Wojciech Meyer
2010-05-24 17:39                 ` Lennart Borgman
2010-05-25  6:35                 ` Miles Bader

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).