Mercurial > emacs
comparison lisp/emacs-lisp/lisp-mode.el @ 41332:15d7e3180dcf
(lisp-mode, emacs-lisp-mode): Don't use define-derived-mode.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 20 Nov 2001 23:41:41 +0000 |
parents | ab1a42ecf560 |
children | cc4a4bcf9fb6 |
comparison
equal
deleted
inserted
replaced
41331:8fa706b1026c | 41332:15d7e3180dcf |
---|---|
295 "Hook run when entering Lisp Interaction mode." | 295 "Hook run when entering Lisp Interaction mode." |
296 :options '(turn-on-eldoc-mode) | 296 :options '(turn-on-eldoc-mode) |
297 :type 'hook | 297 :type 'hook |
298 :group 'lisp) | 298 :group 'lisp) |
299 | 299 |
300 (define-derived-mode emacs-lisp-mode nil "Emacs-Lisp" | 300 (defun emacs-lisp-mode () |
301 "Major mode for editing Lisp code to run in Emacs. | 301 "Major mode for editing Lisp code to run in Emacs. |
302 Commands: | 302 Commands: |
303 Delete converts tabs to spaces as it moves back. | 303 Delete converts tabs to spaces as it moves back. |
304 Blank lines separate paragraphs. Semicolons start comments. | 304 Blank lines separate paragraphs. Semicolons start comments. |
305 \\{emacs-lisp-mode-map} | 305 \\{emacs-lisp-mode-map} |
306 Entry to this mode calls the value of `emacs-lisp-mode-hook' | 306 Entry to this mode calls the value of `emacs-lisp-mode-hook' |
307 if that value is non-nil." | 307 if that value is non-nil." |
308 (interactive) | |
309 (kill-all-local-variables) | |
310 (use-local-map emacs-lisp-mode-map) | |
311 (set-syntax-table emacs-lisp-mode-syntax-table) | |
312 (setq major-mode 'emacs-lisp-mode) | |
313 (setq mode-name "Emacs-Lisp") | |
308 (lisp-mode-variables) | 314 (lisp-mode-variables) |
309 (setq imenu-case-fold-search nil)) | 315 (setq imenu-case-fold-search nil) |
316 (run-hooks 'emacs-lisp-mode-hook)) | |
310 | 317 |
311 (defvar lisp-mode-map | 318 (defvar lisp-mode-map |
312 (let ((map (make-sparse-keymap))) | 319 (let ((map (make-sparse-keymap))) |
313 (set-keymap-parent map lisp-mode-shared-map) | 320 (set-keymap-parent map lisp-mode-shared-map) |
314 (define-key map "\e\C-x" 'lisp-eval-defun) | 321 (define-key map "\e\C-x" 'lisp-eval-defun) |
315 (define-key map "\C-c\C-z" 'run-lisp) | 322 (define-key map "\C-c\C-z" 'run-lisp) |
316 map) | 323 map) |
317 "Keymap for ordinary Lisp mode. | 324 "Keymap for ordinary Lisp mode. |
318 All commands in `lisp-mode-shared-map' are inherited by this map.") | 325 All commands in `lisp-mode-shared-map' are inherited by this map.") |
319 | 326 |
320 (define-derived-mode lisp-mode nil "Lisp" | 327 (defun lisp-mode () |
321 "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. | 328 "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. |
322 Commands: | 329 Commands: |
323 Delete converts tabs to spaces as it moves back. | 330 Delete converts tabs to spaces as it moves back. |
324 Blank lines separate paragraphs. Semicolons start comments. | 331 Blank lines separate paragraphs. Semicolons start comments. |
325 \\{lisp-mode-map} | 332 \\{lisp-mode-map} |
326 Note that `run-lisp' may be used either to start an inferior Lisp job | 333 Note that `run-lisp' may be used either to start an inferior Lisp job |
327 or to switch back to an existing one. | 334 or to switch back to an existing one. |
328 | 335 |
329 Entry to this mode calls the value of `lisp-mode-hook' | 336 Entry to this mode calls the value of `lisp-mode-hook' |
330 if that value is non-nil." | 337 if that value is non-nil." |
338 (interactive) | |
339 (kill-all-local-variables) | |
340 (use-local-map lisp-mode-map) | |
341 (setq major-mode 'lisp-mode) | |
342 (setq mode-name "Lisp") | |
331 (lisp-mode-variables) | 343 (lisp-mode-variables) |
332 (set (make-local-variable 'comment-start-skip) | 344 (make-local-variable 'comment-start-skip) |
345 (setq comment-start-skip | |
333 "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") | 346 "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") |
334 (set (make-local-variable 'font-lock-keywords-case-fold-search) t) | 347 (make-local-variable 'font-lock-keywords-case-fold-search) |
335 (setq imenu-case-fold-search t)) | 348 (setq font-lock-keywords-case-fold-search t) |
349 (setq imenu-case-fold-search t) | |
350 (set-syntax-table lisp-mode-syntax-table) | |
351 (run-hooks 'lisp-mode-hook)) | |
336 | 352 |
337 ;; This will do unless inf-lisp.el is loaded. | 353 ;; This will do unless inf-lisp.el is loaded. |
338 (defun lisp-eval-defun (&optional and-go) | 354 (defun lisp-eval-defun (&optional and-go) |
339 "Send the current defun to the Lisp process made by \\[run-lisp]." | 355 "Send the current defun to the Lisp process made by \\[run-lisp]." |
340 (interactive) | 356 (interactive) |