aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/lisp-mode.el32
1 files changed, 17 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index f48ecf8be69..8ffbf0eeaf9 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -149,24 +149,24 @@ ine-condition\\|ine-widget\\|face\\)\\s-+'?\\(\\sw\\(\\sw\\|\\s_\\)+\\)")
149 (- (match-end 0) (match-beginning 0)))) 149 (- (match-end 0) (match-beginning 0))))
150 150
151 151
152(defvar shared-lisp-mode-map () 152(defvar lisp-mode-shared-map ()
153 "Keymap for commands shared by all sorts of Lisp modes.") 153 "Keymap for commands shared by all sorts of Lisp modes.")
154 154
155(if shared-lisp-mode-map 155(if lisp-mode-shared-map
156 () 156 ()
157 (setq shared-lisp-mode-map (make-sparse-keymap)) 157 (setq lisp-mode-shared-map (make-sparse-keymap))
158 (define-key shared-lisp-mode-map "\e\C-q" 'indent-sexp) 158 (define-key lisp-mode-shared-map "\e\C-q" 'indent-sexp)
159 (define-key shared-lisp-mode-map "\177" 'backward-delete-char-untabify)) 159 (define-key lisp-mode-shared-map "\177" 'backward-delete-char-untabify))
160 160
161(defvar emacs-lisp-mode-map () 161(defvar emacs-lisp-mode-map ()
162 "Keymap for Emacs Lisp mode. 162 "Keymap for Emacs Lisp mode.
163All commands in `shared-lisp-mode-map' are inherited by this map.") 163All commands in `lisp-mode-shared-map' are inherited by this map.")
164 164
165(if emacs-lisp-mode-map 165(if emacs-lisp-mode-map
166 () 166 ()
167 (let ((map (make-sparse-keymap "Emacs-Lisp"))) 167 (let ((map (make-sparse-keymap "Emacs-Lisp")))
168 (setq emacs-lisp-mode-map (make-sparse-keymap)) 168 (setq emacs-lisp-mode-map (make-sparse-keymap))
169 (set-keymap-parent emacs-lisp-mode-map shared-lisp-mode-map) 169 (set-keymap-parent emacs-lisp-mode-map lisp-mode-shared-map)
170 (define-key emacs-lisp-mode-map "\e\t" 'lisp-complete-symbol) 170 (define-key emacs-lisp-mode-map "\e\t" 'lisp-complete-symbol)
171 (define-key emacs-lisp-mode-map "\e\C-x" 'eval-defun) 171 (define-key emacs-lisp-mode-map "\e\C-x" 'eval-defun)
172 (define-key emacs-lisp-mode-map [menu-bar] (make-sparse-keymap)) 172 (define-key emacs-lisp-mode-map [menu-bar] (make-sparse-keymap))
@@ -252,12 +252,12 @@ if that value is non-nil."
252 252
253(defvar lisp-mode-map 253(defvar lisp-mode-map
254 (let ((map (make-sparse-keymap))) 254 (let ((map (make-sparse-keymap)))
255 (set-keymap-parent map shared-lisp-mode-map) 255 (set-keymap-parent map lisp-mode-shared-map)
256 (define-key map "\e\C-x" 'lisp-eval-defun) 256 (define-key map "\e\C-x" 'lisp-eval-defun)
257 (define-key map "\C-c\C-z" 'run-lisp) 257 (define-key map "\C-c\C-z" 'run-lisp)
258 map) 258 map)
259 "Keymap for ordinary Lisp mode. 259 "Keymap for ordinary Lisp mode.
260All commands in `shared-lisp-mode-map' are inherited by this map.") 260All commands in `lisp-mode-shared-map' are inherited by this map.")
261 261
262(defun lisp-mode () 262(defun lisp-mode ()
263 "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. 263 "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp.
@@ -288,13 +288,13 @@ if that value is non-nil."
288 288
289(defvar lisp-interaction-mode-map 289(defvar lisp-interaction-mode-map
290 (let ((map (make-sparse-keymap))) 290 (let ((map (make-sparse-keymap)))
291 (set-keymap-parent map shared-lisp-mode-map) 291 (set-keymap-parent map lisp-mode-shared-map)
292 (define-key map "\e\C-x" 'eval-defun) 292 (define-key map "\e\C-x" 'eval-defun)
293 (define-key map "\e\t" 'lisp-complete-symbol) 293 (define-key map "\e\t" 'lisp-complete-symbol)
294 (define-key map "\n" 'eval-print-last-sexp) 294 (define-key map "\n" 'eval-print-last-sexp)
295 map) 295 map)
296 "Keymap for Lisp Interaction mode. 296 "Keymap for Lisp Interaction mode.
297All commands in `shared-lisp-mode-map' are inherited by this map.") 297All commands in `lisp-mode-shared-map' are inherited by this map.")
298 298
299(defun lisp-interaction-mode () 299(defun lisp-interaction-mode ()
300 "Major mode for typing and evaluating Lisp forms. 300 "Major mode for typing and evaluating Lisp forms.
@@ -400,9 +400,11 @@ With argument, print output into current buffer."
400 (setq debug-on-error new-value)) 400 (setq debug-on-error new-value))
401 value))) 401 value)))
402 402
403;; Change defvar into defconst within FORM,
404;; and likewise for other constructs as necessary.
405(defun eval-defun-1 (form) 403(defun eval-defun-1 (form)
404 "Change defvar into defconst within FORM.
405Likewise for other constructs as necessary."
406 ;; The code in edebug-defun should be consistent with this, but not
407 ;; the same, since this gets a macroexpended form.
406 (cond ((and (eq (car form) 'defvar) 408 (cond ((and (eq (car form) 'defvar)
407 (cdr-safe (cdr-safe form))) 409 (cdr-safe (cdr-safe form)))
408 ;; Force variable to be bound. 410 ;; Force variable to be bound.
@@ -840,8 +842,8 @@ ENDPOS is encountered."
840 (and endpos 842 (and endpos
841 (<= next-depth 0) 843 (<= next-depth 0)
842 (progn 844 (progn
843 (setq indent-stack (append indent-stack 845 (setq indent-stack (nconc indent-stack
844 (make-list (- next-depth) nil)) 846 (make-list (- next-depth) nil))
845 last-depth (- last-depth next-depth) 847 last-depth (- last-depth next-depth)
846 next-depth 0))) 848 next-depth 0)))
847 (or outer-loop-done endpos 849 (or outer-loop-done endpos