changeset 12035:c3747e64cff0

(emacs-lisp-mode-map): Add a menu. (emacs-lisp-byte-compile): New function.
author Karl Heuer <kwzh@gnu.org>
date Tue, 30 May 1995 23:07:27 +0000
parents 639cd125eddb
children 035d4ee6cc80
files lisp/emacs-lisp/lisp-mode.el
diffstat 1 files changed, 29 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el	Tue May 30 23:06:00 1995 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Tue May 30 23:07:27 1995 +0000
@@ -123,10 +123,35 @@
 
 (if emacs-lisp-mode-map
     ()
-  (setq emacs-lisp-mode-map
-	(nconc (make-sparse-keymap) shared-lisp-mode-map))
-  (define-key emacs-lisp-mode-map "\e\t" 'lisp-complete-symbol)
-  (define-key emacs-lisp-mode-map "\e\C-x" 'eval-defun))
+  (let ((map (make-sparse-keymap "Emacs-Lisp")))
+    (setq emacs-lisp-mode-map
+	  (nconc (make-sparse-keymap) shared-lisp-mode-map))
+    (define-key emacs-lisp-mode-map "\e\t" 'lisp-complete-symbol)
+    (define-key emacs-lisp-mode-map "\e\C-x" 'eval-defun)
+    (define-key emacs-lisp-mode-map [menu-bar] (make-sparse-keymap))
+    (define-key emacs-lisp-mode-map [menu-bar emacs-lisp]
+      (cons "Emacs-Lisp" map))
+    (define-key map [edebug-defun]
+      '("Instrument Function for Debugging" . edebug-defun))
+    (define-key map [byte-recompile]
+      '("Byte-recompile Directory..." . byte-recompile-directory))
+    (define-key map [byte-compile]
+      '("Byte-compile This File" . emacs-lisp-byte-compile))
+    (define-key map [separator-eval] '("--"))
+    (define-key map [eval-buffer] '("Evaluate Buffer" . eval-current-buffer))
+    (define-key map [eval-region] '("Evaluate Region" . eval-region))
+    (define-key map [eval-sexp] '("Evaluate Last S-expression" . eval-last-sexp))
+    (define-key map [separator-format] '("--"))
+    (define-key map [comment-region] '("Comment Out Region" . comment-region))
+    (define-key map [indent-region] '("Indent Region" . indent-region))
+    (define-key map [indent-line] '("Indent Line" . lisp-indent-line))))
+
+(defun emacs-lisp-byte-compile ()
+  "Byte compile the file containing the current buffer."
+  (interactive)
+  (if buffer-file-name
+      (byte-compile-file buffer-file-name)
+    (error "The buffer must be saved in a file first.")))
 
 (defun emacs-lisp-mode ()
   "Major mode for editing Lisp code to run in Emacs.