[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r110892: Reword previous with-temp
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r110892: Reword previous with-temp-buffer-window doc fixes |
Date: |
Fri, 16 Nov 2012 21:03:58 -0500 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 110892
committer: Glenn Morris <address@hidden>
branch nick: emacs-24
timestamp: Fri 2012-11-16 21:03:58 -0500
message:
Reword previous with-temp-buffer-window doc fixes
* lisp/window.el (with-temp-buffer-window):
Reword the doc to be more similar to with-output-to-temp-buffer.
* lisp/subr.el (with-output-to-temp-buffer):
Add doc xref to with-temp-buffer-window.
modified:
lisp/ChangeLog
lisp/subr.el
lisp/window.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-11-17 01:29:24 +0000
+++ b/lisp/ChangeLog 2012-11-17 02:03:58 +0000
@@ -5,6 +5,8 @@
Use set-face-underline rather than the alias set-face-underline-p.
* window.el (with-temp-buffer-window): Doc fix.
+ * subr.el (with-output-to-temp-buffer):
+ Add doc xref to with-temp-buffer-window.
2012-11-16 Stefan Monnier <address@hidden>
=== modified file 'lisp/subr.el'
--- a/lisp/subr.el 2012-11-15 06:12:46 +0000
+++ b/lisp/subr.el 2012-11-17 02:03:58 +0000
@@ -3188,6 +3188,7 @@
;; Return nil.
nil)
+;; Doc is very similar to with-temp-buffer-window.
(defmacro with-output-to-temp-buffer (bufname &rest body)
"Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer.
@@ -3213,7 +3214,9 @@
`temp-buffer-show-hook' after displaying buffer BUFNAME, with that
buffer temporarily current, and the window that was used to display it
temporarily selected. But it doesn't run `temp-buffer-show-hook'
-if it uses `temp-buffer-show-function'."
+if it uses `temp-buffer-show-function'.
+
+See the related form `with-temp-buffer-window'."
(declare (debug t))
(let ((old-dir (make-symbol "old-dir"))
(buf (make-symbol "buf")))
=== modified file 'lisp/window.el'
--- a/lisp/window.el 2012-11-17 01:26:24 +0000
+++ b/lisp/window.el 2012-11-17 02:03:58 +0000
@@ -142,40 +142,46 @@
;; Return the window.
window))))
+;; Doc is very similar to with-output-to-temp-buffer.
(defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest
body)
- "Evaluate BODY and display the buffer specified by BUFFER-OR-NAME.
+ "Bind `standard-output' to BUFFER-OR-NAME, eval BODY, show the buffer.
BUFFER-OR-NAME must specify either a live buffer, or the name of a
buffer (if it does not exist, this macro creates it).
-This first empties the specified buffer. It does not make the
-buffer current, but rather binds `standard-output', so that
-output generated with `prin1' and similar functions in BODY goes
-into the buffer.
-
-After evaluating BODY, it marks the specified buffer unmodified and
-read-only, and displays it in a window via `display-buffer', passing
-ACTION as the action argument to `display-buffer'. It automatically
-shrinks the relevant window if `temp-buffer-resize-mode' is enabled.
-
-Returns the value returned by BODY, unless QUIT-FUNCTION specifies
-a function. In that case, runs the function with two arguments -
+This construct makes buffer BUFFER-OR-NAME empty before running BODY.
+It does not make the buffer current for BODY.
+Instead it binds `standard-output' to that buffer, so that output
+generated with `prin1' and similar functions in BODY goes into
+the buffer.
+
+At the end of BODY, this marks the specified buffer unmodified and
+read-only, and displays it in a window (but does not select it, or make
+the buffer current). The display happens by calling `display-buffer'
+with the ACTION argument. If `temp-buffer-resize-mode' is enabled,
+the relevant window shrinks automatically.
+
+This returns the value returned by BODY, unless QUIT-FUNCTION specifies
+a function. In that case, it runs the function with two arguments -
the window showing the specified buffer and the value returned by
BODY - and returns the value returned by that function.
-Since this macro calls `display-buffer', the window displaying
-the buffer is usually not selected and the specified buffer
-usually not made current. QUIT-FUNCTION can override that.
If the buffer is displayed on a new frame, the window manager may
decide to select that frame. In that case, it's usually a good
strategy if QUIT-FUNCTION selects the window showing the buffer
before reading any value from the minibuffer; for example, when
asking a `yes-or-no-p' question.
-This construct is similar to `with-output-to-temp-buffer', but does
-not put the buffer in help mode, or call `temp-buffer-show-function'.
-It also runs different hooks, namely `temp-buffer-window-setup-hook'
-\(with the specified buffer current) and `temp-buffer-window-show-hook'
-\(with the specified buffer current and the window showing it selected)."
+This runs the hook `temp-buffer-window-setup-hook' before BODY,
+with the specified buffer temporarily current. It runs the
+hook `temp-buffer-window-show-hook' after displaying the buffer,
+with that buffer temporarily current, and the window that was used to
+display it temporarily selected.
+
+This construct is similar to `with-output-to-temp-buffer', but
+runs different hooks. In particular, it does not run
+`temp-buffer-setup-hook', which usually puts the buffer in Help mode.
+Also, it does not call `temp-buffer-show-function' (the ACTION
+argument replaces this)."
(declare (debug t))
(let ((buffer (make-symbol "buffer"))
(window (make-symbol "window"))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r110892: Reword previous with-temp-buffer-window doc fixes,
Glenn Morris <=