summaryrefslogtreecommitdiff
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2010-10-10 16:12:30 -0700
committerDan Nicolaescu <dann@ics.uci.edu>2010-10-10 16:12:30 -0700
commita0310a6c2226b23bc25c2dd66c8dd9664fdeb022 (patch)
tree31c8181c70d9f9a3d0532f128b38a0fcb62f9d8c /lisp/shell.el
parentdab0271f8dfd284e0ecd5022745a67c182410b81 (diff)
downloademacs-a0310a6c2226b23bc25c2dd66c8dd9664fdeb022.tar.gz
Declare and define in one step various mode maps.
* lisp/shell.el (shell-mode-map): * lisp/progmodes/modula2.el (m2-mode-map): * lisp/progmodes/inf-lisp.el (inferior-lisp-mode-map): * lisp/play/mpuz.el (mpuz-mode-map): * lisp/play/landmark.el (lm-mode-map): * lisp/play/decipher.el (decipher-mode-map): * lisp/play/5x5.el (5x5-mode-map): * lisp/net/telnet.el (telnet-mode-map): * lisp/net/quickurl.el (quickurl-list-mode-map): * lisp/net/mairix.el (mairix-searches-mode-map): * lisp/net/eudc-hotlist.el (eudc-hotlist-mode-map): * lisp/net/dig.el (dig-mode-map): * lisp/mail/mspools.el (mspools-mode-map): * lisp/hexl.el (hexl-mode-map): * lisp/emulation/ws-mode.el (wordstar-C-k-map, wordstar-mode-map) (wordstar-C-o-map, wordstar-C-q-map): * lisp/emacs-lisp/edebug.el (edebug-eval-mode-map): * lisp/emacs-lisp/chart.el (chart-map): * lisp/edmacro.el (edmacro-mode-map): * lisp/array.el (array-mode-map): Declare and define in one step. * lisp/erc/erc-list.el (erc-list-menu-mode-map): Declare and define in one step.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el39
1 files changed, 19 insertions, 20 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 23b7f7d8498..6cb9a511101 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -334,26 +334,25 @@ Thus, this does not include the shell's current directory.")
(defvar shell-dirstack-query nil
"Command used by `shell-resync-dirs' to query the shell.")
-(defvar shell-mode-map nil)
-(cond ((not shell-mode-map)
- (setq shell-mode-map (nconc (make-sparse-keymap) comint-mode-map))
- (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command)
- (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command)
- (define-key shell-mode-map "\t" 'comint-dynamic-complete)
- (define-key shell-mode-map (kbd "M-RET") 'shell-resync-dirs)
- (define-key shell-mode-map "\M-?"
- 'comint-dynamic-list-filename-completions)
- (define-key shell-mode-map [menu-bar completion]
- (cons "Complete"
- (copy-keymap (lookup-key comint-mode-map [menu-bar completion]))))
- (define-key-after (lookup-key shell-mode-map [menu-bar completion])
- [complete-env-variable] '("Complete Env. Variable Name" .
- shell-dynamic-complete-environment-variable)
- 'complete-file)
- (define-key-after (lookup-key shell-mode-map [menu-bar completion])
- [expand-directory] '("Expand Directory Reference" .
- shell-replace-by-expanded-directory)
- 'complete-expand)))
+(defvar shell-mode-map
+ (let ((map (nconc (make-sparse-keymap) comint-mode-map)))
+ (define-key map "\C-c\C-f" 'shell-forward-command)
+ (define-key map "\C-c\C-b" 'shell-backward-command)
+ (define-key map "\t" 'comint-dynamic-complete)
+ (define-key map (kbd "M-RET") 'shell-resync-dirs)
+ (define-key map "\M-?" 'comint-dynamic-list-filename-completions)
+ (define-key map [menu-bar completion]
+ (cons "Complete"
+ (copy-keymap (lookup-key comint-mode-map [menu-bar completion]))))
+ (define-key-after (lookup-key map [menu-bar completion])
+ [complete-env-variable] '("Complete Env. Variable Name" .
+ shell-dynamic-complete-environment-variable)
+ 'complete-file)
+ (define-key-after (lookup-key map [menu-bar completion])
+ [expand-directory] '("Expand Directory Reference" .
+ shell-replace-by-expanded-directory)
+ 'complete-expand)
+ map))
(defcustom shell-mode-hook '()
"Hook for customizing Shell mode."