# HG changeset patch # User Karl Heuer # Date 801875247 0 # Node ID c3747e64cff067e5dfc64803ecfcaa9c03b0b0b3 # Parent 639cd125eddb684bffdaa0d5da7fb34b39add7e5 (emacs-lisp-mode-map): Add a menu. (emacs-lisp-byte-compile): New function. diff -r 639cd125eddb -r c3747e64cff0 lisp/emacs-lisp/lisp-mode.el --- 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.