X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/84eb0351d8be4811897c8cf62a69757ff5d14001..e8757f091a502b858912a4c267210e009227d6e6:/lisp/ehelp.el diff --git a/lisp/ehelp.el b/lisp/ehelp.el index 7745957b4c..281148d9cf 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -1,6 +1,6 @@ -;;; ehelp.el --- bindings for electric-help mode +;;; ehelp.el --- bindings for electric-help mode -*- lexical-binding: t -*- -;; Copyright (C) 1986, 1995, 2000-2011 Free Software Foundation, Inc. +;; Copyright (C) 1986, 1995, 2000-2012 Free Software Foundation, Inc. ;; Author: Richard Mlynarik ;; (according to ack.texi and authors.el) @@ -193,7 +193,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 @@ -347,16 +349,21 @@ will select it.)" ;; This is to be bound to M-x in ehelp mode. Retains ehelp buffer and then ;; continues with execute-extended-command. -(defun electric-help-execute-extended (prefixarg) +(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) +(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))