]> code.delx.au - gnu-emacs/blobdiff - lisp/ehelp.el
Merge from emacs-24; up to 2012-05-08T14:11:47Z!monnier@iro.umontreal.ca
[gnu-emacs] / lisp / ehelp.el
index 7745957b4c31e44a68bbbfb76a96a92ec3ab9ab4..281148d9cf6772c0e0179921c7e2ce7d55f2b590 100644 (file)
@@ -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))
 
 \f