aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-07-21 09:57:01 +0000
committerRichard M. Stallman2003-07-21 09:57:01 +0000
commit4df623c0738b6a333dae9e170376f62f426b9d25 (patch)
treed0f688781a34fce171536dd817a26e307b84fea4
parent3479c8063517133c84c42a7145f1876ca9dca7c2 (diff)
downloademacs-4df623c0738b6a333dae9e170376f62f426b9d25.tar.gz
emacs-4df623c0738b6a333dae9e170376f62f426b9d25.zip
(with-selected-window): Copy code form save-selected-window
so as to call select-window with norecord arg. (dynamic-completion-table): Doc fix. (lazy-completion-table): Doc fix.
-rw-r--r--lisp/subr.el36
1 files changed, 26 insertions, 10 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 0251180f8f9..702a960ca41 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1622,11 +1622,24 @@ See also `with-temp-buffer'."
1622(defmacro with-selected-window (window &rest body) 1622(defmacro with-selected-window (window &rest body)
1623 "Execute the forms in BODY with WINDOW as the selected window. 1623 "Execute the forms in BODY with WINDOW as the selected window.
1624The value returned is the value of the last form in BODY. 1624The value returned is the value of the last form in BODY.
1625This does not alter the buffer list ordering.
1625See also `with-temp-buffer'." 1626See also `with-temp-buffer'."
1626 (declare (indent 1) (debug t)) 1627 (declare (indent 1) (debug t))
1627 `(save-selected-window 1628 ;; Most of this code is a copy of save-selected-window.
1628 (select-window ,window 'norecord) 1629 `(let ((save-selected-window-window (selected-window))
1629 ,@body)) 1630 (save-selected-window-alist
1631 (mapcar (lambda (frame) (list frame (frame-selected-window frame)))
1632 (frame-list))))
1633 (unwind-protect
1634 (progn (select-window ,window 'norecord)
1635 ,@body)
1636 (dolist (elt save-selected-window-alist)
1637 (and (frame-live-p (car elt))
1638 (window-live-p (cadr elt))
1639 (set-frame-selected-window (car elt) (cadr elt))))
1640 (if (window-live-p save-selected-window-window)
1641 ;; This is where the code differs from save-selected-window.
1642 (select-window save-selected-window-window 'norecord))))
1630 1643
1631(defmacro with-temp-file (file &rest body) 1644(defmacro with-temp-file (file &rest body)
1632 "Create a new buffer, evaluate BODY there, and write the buffer to FILE. 1645 "Create a new buffer, evaluate BODY there, and write the buffer to FILE.
@@ -1783,11 +1796,14 @@ Value is what BODY returns."
1783 "Use function FUN as a dynamic completion table. 1796 "Use function FUN as a dynamic completion table.
1784FUN is called with one argument, the string for which completion is required, 1797FUN is called with one argument, the string for which completion is required,
1785and it should return an alist containing all the intended possible 1798and it should return an alist containing all the intended possible
1786completions. This alist may be a full list of possible completions so that FUN 1799completions. This alist may be a full list of possible completions so that FUN
1787can ignore the value of its argument. If completion is performed in the 1800can ignore the value of its argument. If completion is performed in the
1788minibuffer, FUN will be called in the buffer from which the minibuffer was 1801minibuffer, FUN will be called in the buffer from which the minibuffer was
1789entered. `dynamic-completion-table' then computes the completion, see Info 1802entered.
1790node `(elisp)Programmed Completion'." 1803
1804The result of the `dynamic-completion-table' form is a function
1805that can be used as the ALIST argument to `try-completion' and
1806`all-completion'. See Info node `(elisp)Programmed Completion'."
1791 (let ((win (make-symbol "window")) 1807 (let ((win (make-symbol "window"))
1792 (string (make-symbol "string")) 1808 (string (make-symbol "string"))
1793 (predicate (make-symbol "predicate")) 1809 (predicate (make-symbol "predicate"))
@@ -1805,9 +1821,9 @@ node `(elisp)Programmed Completion'."
1805 "Initialize variable VAR as a lazy completion table. 1821 "Initialize variable VAR as a lazy completion table.
1806If the completion table VAR is used for the first time (e.g., by passing VAR 1822If the completion table VAR is used for the first time (e.g., by passing VAR
1807as an argument to `try-completion'), the function FUN is called with arguments 1823as an argument to `try-completion'), the function FUN is called with arguments
1808ARGS. FUN must return the completion table that will be stored in VAR. If 1824ARGS. FUN must return the completion table that will be stored in VAR.
1809completion is requested in the minibuffer, FUN will be called in the buffer 1825If completion is requested in the minibuffer, FUN will be called in the buffer
1810from which the minibuffer was entered. The return value of 1826from which the minibuffer was entered. The return value of
1811`lazy-completion-table' must be used to initialize the value of VAR." 1827`lazy-completion-table' must be used to initialize the value of VAR."
1812 (let ((str (make-symbol "string"))) 1828 (let ((str (make-symbol "string")))
1813 `(dynamic-completion-table 1829 `(dynamic-completion-table