Mercurial > emacs
comparison lisp/subr.el @ 99124:a96e658622b6
(with-current-buffer): Rename buffer argument to buffer-or-name.
author | Martin Rudalics <rudalics@gmx.at> |
---|---|
date | Sat, 25 Oct 2008 09:17:44 +0000 |
parents | 814d2d823dd7 |
children | fc215de0bf93 |
comparison
equal
deleted
inserted
replaced
99123:b86c228e54c9 | 99124:a96e658622b6 |
---|---|
2481 (if (file-remote-p default-directory) "-c" shell-command-switch) | 2481 (if (file-remote-p default-directory) "-c" shell-command-switch) |
2482 (mapconcat 'identity (cons command args) " "))) | 2482 (mapconcat 'identity (cons command args) " "))) |
2483 | 2483 |
2484 ;;;; Lisp macros to do various things temporarily. | 2484 ;;;; Lisp macros to do various things temporarily. |
2485 | 2485 |
2486 (defmacro with-current-buffer (buffer &rest body) | 2486 (defmacro with-current-buffer (buffer-or-name &rest body) |
2487 "Execute the forms in BODY with BUFFER temporarily current. | 2487 "Execute the forms in BODY with BUFFER-OR-NAME temporarily current. |
2488 BUFFER can be a buffer or a buffer name. | 2488 BUFFER-OR-NAME must be a buffer or the name of an existing buffer. |
2489 The value returned is the value of the last form in BODY. | 2489 The value returned is the value of the last form in BODY. See |
2490 See also `with-temp-buffer'." | 2490 also `with-temp-buffer'." |
2491 (declare (indent 1) (debug t)) | 2491 (declare (indent 1) (debug t)) |
2492 `(save-current-buffer | 2492 `(save-current-buffer |
2493 (set-buffer ,buffer) | 2493 (set-buffer ,buffer-or-name) |
2494 ,@body)) | 2494 ,@body)) |
2495 | 2495 |
2496 (defmacro with-selected-window (window &rest body) | 2496 (defmacro with-selected-window (window &rest body) |
2497 "Execute the forms in BODY with WINDOW as the selected window. | 2497 "Execute the forms in BODY with WINDOW as the selected window. |
2498 The value returned is the value of the last form in BODY. | 2498 The value returned is the value of the last form in BODY. |