Skip to content

Commit

Permalink
Don't permanently change Emacs standard-output. (#46)
Browse files Browse the repository at this point in the history
The macro lean4-with-info-output-to-buffer sets the Emacs global dynamic variable standard-output to the specified buffer, and doesn't set it back to its original value. This can cause other Emacs programs to go wrong subsequently. For example, "package.el" assumes that standard-output has its default value, so after using lean4-mode, it is impossible to update Emacs packages.

This commit limits the duration of the change of standard-output by using let instead of setq.
  • Loading branch information
bustercopley authored Feb 23, 2024
1 parent ecd200b commit 6fbc181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lean4-info.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
(with-current-buffer buf
(setq buffer-read-only nil)
(erase-buffer)
(setq standard-output buf)
,@body
(let ((standard-output buf))
,@body)
(setq buffer-read-only t))))

(defun lean4-ensure-info-buffer (buffer)
Expand Down

0 comments on commit 6fbc181

Please sign in to comment.