diff options
| author | Karoly Lorentey | 2004-05-23 02:26:21 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-05-23 02:26:21 +0000 |
| commit | c3e242d33477cbd7e05f4ddb621506aa5c2b0fde (patch) | |
| tree | 721a171ce5104fa44416a55df18b741208bcf4d7 | |
| parent | b8299c66e3307372c1d5021cf420493db5d501b4 (diff) | |
| download | emacs-c3e242d33477cbd7e05f4ddb621506aa5c2b0fde.tar.gz emacs-c3e242d33477cbd7e05f4ddb621506aa5c2b0fde.zip | |
New control structure: with-selected-frame.
lisp/subr.el (with-selected-frame): New macro.
lisp/font-lock.el (lisp-font-lock-keywords-2): Add with-selected-frame.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-168
| -rw-r--r-- | lisp/font-lock.el | 2 | ||||
| -rw-r--r-- | lisp/subr.el | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 044c414d84e..96caba543c7 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1893,7 +1893,7 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 1893 | "with-current-buffer" "with-electric-help" | 1893 | "with-current-buffer" "with-electric-help" |
| 1894 | "with-local-quit" "with-no-warnings" | 1894 | "with-local-quit" "with-no-warnings" |
| 1895 | "with-output-to-string" "with-output-to-temp-buffer" | 1895 | "with-output-to-string" "with-output-to-temp-buffer" |
| 1896 | "with-selected-window" "with-syntax-table" | 1896 | "with-selected-window" "with-selected-frame" "with-syntax-table" |
| 1897 | "with-temp-buffer" "with-temp-file" "with-temp-message" | 1897 | "with-temp-buffer" "with-temp-file" "with-temp-message" |
| 1898 | "with-timeout" "with-timeout-handler") t) | 1898 | "with-timeout" "with-timeout-handler") t) |
| 1899 | "\\>") | 1899 | "\\>") |
diff --git a/lisp/subr.el b/lisp/subr.el index 5302558d834..8559de28746 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1812,6 +1812,18 @@ See also `with-temp-buffer'." | |||
| 1812 | ;; This is where the code differs from save-selected-window. | 1812 | ;; This is where the code differs from save-selected-window. |
| 1813 | (select-window save-selected-window-window 'norecord))))) | 1813 | (select-window save-selected-window-window 'norecord))))) |
| 1814 | 1814 | ||
| 1815 | (defmacro with-selected-frame (frame &rest body) | ||
| 1816 | "Execute the forms in BODY with FRAME as the selected frame. | ||
| 1817 | The value returned is the value of the last form in BODY. | ||
| 1818 | See also `with-temp-buffer'." | ||
| 1819 | (declare (indent 1) (debug t)) | ||
| 1820 | `(let ((save-selected-frame (selected-frame))) | ||
| 1821 | (unwind-protect | ||
| 1822 | (progn (select-frame ,frame) | ||
| 1823 | ,@body) | ||
| 1824 | (if (frame-live-p save-selected-frame) | ||
| 1825 | (select-frame save-selected-frame))))) | ||
| 1826 | |||
| 1815 | (defmacro with-temp-file (file &rest body) | 1827 | (defmacro with-temp-file (file &rest body) |
| 1816 | "Create a new buffer, evaluate BODY there, and write the buffer to FILE. | 1828 | "Create a new buffer, evaluate BODY there, and write the buffer to FILE. |
| 1817 | The value returned is the value of the last form in BODY. | 1829 | The value returned is the value of the last form in BODY. |