diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-29 23:27:56 -0400 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-29 23:27:56 -0400 |
| commit | 9dba2c644978f9c51ad38da97134fca7d8cf29e2 (patch) | |
| tree | 39d758fb7dfcaa19c343a019ee1ad270dd2dcecb /lisp/subr.el | |
| parent | 06788a55302c7da6566c7efe8d8d800538a22c0a (diff) | |
| download | emacs-9dba2c644978f9c51ad38da97134fca7d8cf29e2.tar.gz | |
* lisp/subr.el (with-output-to-temp-buffer): Don't change current-buffer to
standard-output while running the body.
* lisp/Makefile.in (COMPILE_FIRST): Remove pcase; it's not so important.
* lisp/startup.el: Fix up warnings, move lambda expressions
outside of quote.
Diffstat (limited to 'lisp/subr.el')
| -rw-r--r-- | lisp/subr.el | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 9f4e35fcbe0..c5fedae2bfc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2871,22 +2871,23 @@ temporarily selected. But it doesn't run `temp-buffer-show-hook' if it uses `temp-buffer-show-function'." (let ((old-dir (make-symbol "old-dir")) (buf (make-symbol "buf"))) - `(let ((,old-dir default-directory)) - (with-current-buffer (get-buffer-create ,bufname) - (kill-all-local-variables) - ;; FIXME: delete_all_overlays - (setq default-directory ,old-dir) - (setq buffer-read-only nil) - (setq buffer-file-name nil) - (setq buffer-undo-list t) - (let ((,buf (current-buffer))) - (let ((inhibit-read-only t) - (inhibit-modification-hooks t)) - (erase-buffer) - (run-hooks 'temp-buffer-setup-hook)) - (let ((standard-output ,buf)) - (prog1 (progn ,@body) - (internal-temp-output-buffer-show ,buf)))))))) + `(let* ((,old-dir default-directory) + (,buf + (with-current-buffer (get-buffer-create ,bufname) + (prog1 (current-buffer) + (kill-all-local-variables) + ;; FIXME: delete_all_overlays + (setq default-directory ,old-dir) + (setq buffer-read-only nil) + (setq buffer-file-name nil) + (setq buffer-undo-list t) + (let ((inhibit-read-only t) + (inhibit-modification-hooks t)) + (erase-buffer) + (run-hooks 'temp-buffer-setup-hook))))) + (standard-output ,buf)) + (prog1 (progn ,@body) + (internal-temp-output-buffer-show ,buf))))) (defmacro with-temp-file (file &rest body) "Create a new buffer, evaluate BODY there, and write the buffer to FILE. |
