+(defvar emacs-lisp-mode-map
+ (let ((map (make-sparse-keymap "Emacs-Lisp"))
+ (menu-map (make-sparse-keymap "Emacs-Lisp"))
+ (lint-map (make-sparse-keymap))
+ (prof-map (make-sparse-keymap))
+ (tracing-map (make-sparse-keymap)))
+ (set-keymap-parent map lisp-mode-shared-map)
+ (define-key map "\e\t" 'completion-at-point)
+ (define-key map "\e\C-x" 'eval-defun)
+ (define-key map "\e\C-q" 'indent-pp-sexp)
+ (define-key map [menu-bar emacs-lisp] (cons (purecopy "Emacs-Lisp") menu-map))
+ (define-key menu-map [eldoc]
+ `(menu-item ,(purecopy "Auto-Display Documentation Strings") eldoc-mode
+ :button (:toggle . (bound-and-true-p eldoc-mode))
+ :help ,(purecopy "Display the documentation string for the item under cursor")))
+ (define-key menu-map [checkdoc]
+ `(menu-item ,(purecopy "Check Documentation Strings") checkdoc
+ :help ,(purecopy "Check documentation strings for style requirements")))
+ (define-key menu-map [re-builder]
+ `(menu-item ,(purecopy "Construct Regexp") re-builder
+ :help ,(purecopy "Construct a regexp interactively")))
+ (define-key menu-map [tracing] (cons (purecopy "Tracing") tracing-map))
+ (define-key tracing-map [tr-a]
+ `(menu-item ,(purecopy "Untrace All") untrace-all
+ :help ,(purecopy "Untrace all currently traced functions")))
+ (define-key tracing-map [tr-uf]
+ `(menu-item ,(purecopy "Untrace Function...") untrace-function
+ :help ,(purecopy "Untrace function, and possibly activate all remaining advice")))
+ (define-key tracing-map [tr-sep] menu-bar-separator)
+ (define-key tracing-map [tr-q]
+ `(menu-item ,(purecopy "Trace Function Quietly...") trace-function-background
+ :help ,(purecopy "Trace the function with trace output going quietly to a buffer")))
+ (define-key tracing-map [tr-f]
+ `(menu-item ,(purecopy "Trace Function...") trace-function
+ :help ,(purecopy "Trace the function given as an argument")))
+ (define-key menu-map [profiling] (cons (purecopy "Profiling") prof-map))
+ (define-key prof-map [prof-restall]
+ `(menu-item ,(purecopy "Remove Instrumentation for All Functions") elp-restore-all
+ :help ,(purecopy "Restore the original definitions of all functions being profiled")))
+ (define-key prof-map [prof-restfunc]
+ `(menu-item ,(purecopy "Remove Instrumentation for Function...") elp-restore-function
+ :help ,(purecopy "Restore an instrumented function to its original definition")))
+
+ (define-key prof-map [sep-rem] menu-bar-separator)
+ (define-key prof-map [prof-resall]
+ `(menu-item ,(purecopy "Reset Counters for All Functions") elp-reset-all
+ :help ,(purecopy "Reset the profiling information for all functions being profiled")))
+ (define-key prof-map [prof-resfunc]
+ `(menu-item ,(purecopy "Reset Counters for Function...") elp-reset-function
+ :help ,(purecopy "Reset the profiling information for a function")))
+ (define-key prof-map [prof-res]
+ `(menu-item ,(purecopy "Show Profiling Results") elp-results
+ :help ,(purecopy "Display current profiling results")))
+ (define-key prof-map [prof-pack]
+ `(menu-item ,(purecopy "Instrument Package...") elp-instrument-package
+ :help ,(purecopy "Instrument for profiling all function that start with a prefix")))
+ (define-key prof-map [prof-func]
+ `(menu-item ,(purecopy "Instrument Function...") elp-instrument-function
+ :help ,(purecopy "Instrument a function for profiling")))
+ (define-key menu-map [lint] (cons (purecopy "Linting") lint-map))
+ (define-key lint-map [lint-di]
+ `(menu-item ,(purecopy "Lint Directory...") elint-directory
+ :help ,(purecopy "Lint a directory")))
+ (define-key lint-map [lint-f]
+ `(menu-item ,(purecopy "Lint File...") elint-file
+ :help ,(purecopy "Lint a file")))
+ (define-key lint-map [lint-b]
+ `(menu-item ,(purecopy "Lint Buffer") elint-current-buffer
+ :help ,(purecopy "Lint the current buffer")))
+ (define-key lint-map [lint-d]
+ `(menu-item ,(purecopy "Lint Defun") elint-defun
+ :help ,(purecopy "Lint the function at point")))
+ (define-key menu-map [edebug-defun]
+ `(menu-item ,(purecopy "Instrument Function for Debugging") edebug-defun
+ :help ,(purecopy "Evaluate the top level form point is in, stepping through with Edebug")
+ :keys ,(purecopy "C-u C-M-x")))
+ (define-key menu-map [separator-byte] menu-bar-separator)
+ (define-key menu-map [disas]
+ `(menu-item ,(purecopy "Disassemble Byte Compiled Object...") disassemble
+ :help ,(purecopy "Print disassembled code for OBJECT in a buffer")))
+ (define-key menu-map [byte-recompile]
+ `(menu-item ,(purecopy "Byte-recompile Directory...") byte-recompile-directory
+ :help ,(purecopy "Recompile every `.el' file in DIRECTORY that needs recompilation")))
+ (define-key menu-map [emacs-byte-compile-and-load]
+ `(menu-item ,(purecopy "Byte-compile and Load") emacs-lisp-byte-compile-and-load
+ :help ,(purecopy "Byte-compile the current file (if it has changed), then load compiled code")))
+ (define-key menu-map [byte-compile]
+ `(menu-item ,(purecopy "Byte-compile This File") emacs-lisp-byte-compile
+ :help ,(purecopy "Byte compile the file containing the current buffer")))
+ (define-key menu-map [separator-eval] menu-bar-separator)
+ (define-key menu-map [ielm]
+ `(menu-item ,(purecopy "Interactive Expression Evaluation") ielm
+ :help ,(purecopy "Interactively evaluate Emacs Lisp expressions")))
+ (define-key menu-map [eval-buffer]
+ `(menu-item ,(purecopy "Evaluate Buffer") eval-buffer
+ :help ,(purecopy "Execute the current buffer as Lisp code")))
+ (define-key menu-map [eval-region]
+ `(menu-item ,(purecopy "Evaluate Region") eval-region
+ :help ,(purecopy "Execute the region as Lisp code")
+ :enable mark-active))
+ (define-key menu-map [eval-sexp]
+ `(menu-item ,(purecopy "Evaluate Last S-expression") eval-last-sexp
+ :help ,(purecopy "Evaluate sexp before point; print value in minibuffer")))
+ (define-key menu-map [separator-format] menu-bar-separator)
+ (define-key menu-map [comment-region]
+ `(menu-item ,(purecopy "Comment Out Region") comment-region
+ :help ,(purecopy "Comment or uncomment each line in the region")
+ :enable mark-active))
+ (define-key menu-map [indent-region]
+ `(menu-item ,(purecopy "Indent Region") indent-region
+ :help ,(purecopy "Indent each nonblank line in the region")
+ :enable mark-active))
+ (define-key menu-map [indent-line]
+ `(menu-item ,(purecopy "Indent Line") lisp-indent-line))
+ map)