diff options
| author | Tom Tromey <tromey@redhat.com> | 2012-12-17 07:56:22 -0700 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2012-12-17 07:56:22 -0700 |
| commit | 3d6eced1ae51ffd0a782130e7c334052277e2724 (patch) | |
| tree | 5d1d2ad7cd3374f922886c4a72062511a035c168 /lisp/ehelp.el | |
| parent | bf69f522a9e135f9aa483cedd53e71e915f2bf75 (diff) | |
| parent | 7c3d167f48d6262ee4e5512aa50a07ee96bc1509 (diff) | |
| download | emacs-3d6eced1ae51ffd0a782130e7c334052277e2724.tar.gz | |
merge from trunk
Diffstat (limited to 'lisp/ehelp.el')
| -rw-r--r-- | lisp/ehelp.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/ehelp.el b/lisp/ehelp.el index abb897f73f6..a1bd4d65385 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -61,6 +61,8 @@ (defvar electric-help-map (let ((map (make-keymap))) + ;; FIXME fragile. Should derive from help-mode-map in a smarter way. + (set-keymap-parent map button-buffer-map) ;; allow all non-self-inserting keys - search, scroll, etc, but ;; let M-x and C-x exit ehelp mode and retain buffer: (suppress-keymap map) @@ -102,7 +104,7 @@ (setq buffer-read-only t) (setq electric-help-orig-major-mode major-mode) (setq mode-name "Help") - (setq major-mode 'help) + (setq major-mode 'help-mode) (setq mode-line-buffer-identification '(" Help: %b")) (use-local-map electric-help-map) (add-hook 'mouse-leave-buffer-hook 'electric-help-retain) @@ -193,7 +195,9 @@ BUFFER is put back into its original major mode." (replace-buffer-in-windows buffer) ;; must do this outside of save-window-excursion (bury-buffer buffer)) - (eval electric-help-form-to-execute)))) + (if (functionp electric-help-form-to-execute) + (funcall electric-help-form-to-execute) + (eval electric-help-form-to-execute))))) (defun electric-help-command-loop () (catch 'exit @@ -349,14 +353,19 @@ will select it.)" ;; continues with execute-extended-command. (defun electric-help-execute-extended (_prefixarg) (interactive "p") - (setq electric-help-form-to-execute '(execute-extended-command nil)) + (setq electric-help-form-to-execute + (lambda () (execute-extended-command nil))) (electric-help-retain)) ;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then ;; continues with ctrl-x prefix. (defun electric-help-ctrl-x-prefix (_prefixarg) (interactive "p") - (setq electric-help-form-to-execute '(progn (message nil) (setq unread-command-char ?\C-x))) + (setq electric-help-form-to-execute + (lambda () + (message nil) + (setq unread-command-events + (append unread-command-events '(?\C-x))))) (electric-help-retain)) |
