]> code.delx.au - gnu-emacs/blobdiff - lisp/help.el
* proced.el (proced-tree-flag): Fix typo in docstring.
[gnu-emacs] / lisp / help.el
index 44e3f707af10be0b2ce78b0ca39e02c1b506bd7c..f2b7cf0a6c7f81790334a0b4493d0368d14b510e 100644 (file)
@@ -221,7 +221,7 @@ i           Start the Info documentation reader: read on-line manuals.
 I METHOD    Describe a specific input method, or RET for current.
 k KEYS      Display the full documentation for the key sequence.
 K KEYS      Show the on-line manual's section for the command bound to KEYS.
-l           Show last 100 characters you typed (lossage).
+l           Show last 300 input keystrokes (lossage).
 L LANG-ENV  Describes a specific language environment, or RET for current.
 m           Display documentation of current minor modes and current major mode,
               including their special commands.
@@ -453,7 +453,7 @@ is specified by the variable `message-log-max'."
   (view-help-file "MORE.STUFF"))
 
 (defun view-lossage ()
-  "Display last 100 input keystrokes.
+  "Display last 300 input keystrokes.
 
 To record all your input on a file, use `open-dribble-file'."
   (interactive)
@@ -1207,7 +1207,7 @@ window itself is specified by the variable `help-window'."
 (defmacro with-help-window (buffer-name &rest body)
   "Display buffer BUFFER-NAME in a help window evaluating BODY.
 Select help window if the actual value of the user option
-`help-window-select' says so."
+`help-window-select' says so.  Return last value in BODY."
   (declare (indent 1) (debug t))
   ;; Bind list-of-frames to `frame-list' and list-of-window-tuples to a
   ;; list of one <window window-buffer window-start window-point> tuple
@@ -1222,23 +1222,22 @@ Select help window if the actual value of the user option
                     list))
             'no-mini t)
            list)))
-     ;; We set `help-window' to t in order to trigger `help-mode-finish'
-     ;; to set `help-window' to the actual help window.
+     ;; Make `help-window' t to trigger `help-mode-finish' to set
+     ;; `help-window' to the actual help window.
      (setq help-window t)
      ;; Make `help-window-point-marker' point nowhere (the only place
      ;; where this should be set to a buffer position is within BODY).
      (set-marker help-window-point-marker nil)
-
-     (with-output-to-temp-buffer ,buffer-name
-       (progn ,@body))
-
-     (when (windowp help-window)
-       ;; Set up help window.
-       (help-window-setup list-of-frames list-of-window-tuples))
-
-     ;; Reset `help-window' to nil to avoid confusing future calls of
-     ;; `help-mode-finish' by "plain" `with-output-to-temp-buffer'.
-     (setq help-window nil)))
+     (prog1
+        ;; Return value returned by `with-output-to-temp-buffer'.
+        (with-output-to-temp-buffer ,buffer-name
+          (progn ,@body))
+       (when (windowp help-window)
+        ;; Set up help window.
+        (help-window-setup list-of-frames list-of-window-tuples))
+       ;; Reset `help-window' to nil to avoid confusing future calls of
+       ;; `help-mode-finish' with plain `with-output-to-temp-buffer'.
+       (setq help-window nil))))
 \f
 (provide 'help)