From: Stephen Berman <Stephen.Berman@gmx.net>
To: emacs-devel@gnu.org
Subject: dired-jump keybinding and autoload
Date: Thu, 08 May 2008 14:59:42 +0200 [thread overview]
Message-ID: <874p9954u9.fsf@escher.local.home> (raw)
[-- 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 ----
next reply other threads:[~2008-05-08 12:59 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-08 12:59 Stephen Berman [this message]
2008-05-08 14:12 ` dired-jump keybinding and autoload 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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874p9954u9.fsf@escher.local.home \
--to=stephen.berman@gmx.net \
--cc=emacs-devel@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.