dot/emacs: More `dired' hacking: tweak keymap.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 4 Jan 2010 11:32:08 +0000 (11:32 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 4 Jan 2010 11:32:08 +0000 (11:32 +0000)
In Emacs23, C-x C-q is already bound to a slightly different function.
So don't fiddle if that key is already bound.  Also, bind C-c C-s for
making relative symlinks.  (Could have used plain `r' but that seems
weird.)

dot/emacs

index 1546c2c..5b37d8b 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
 
 (eval-after-load "dired"
   '(progn
-     (define-key dired-mode-map [?\C-x ?\C-q]
-       'wdired-change-to-wdired-mode)))
+     (or (lookup-key dired-mode-map  [?\C-x ?\C-q])
+        (define-key dired-mode-map [?\C-x ?\C-q]
+          'wdired-change-to-wdired-mode))
+     (and (fboundp 'dired-do-relsymlink)
+         (define-key dired-mode-map [?\C-c ?\C-s] 'dired-do-relsymlink))))
 
 (add-hook 'org-mode-hook
          #'(lambda () (mdw-clobber-evil-keymap org-mode-map)))