diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-01-03 17:25:06 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-01-03 17:25:06 -0500 |
commit | 20ad0cc03b73f6576ece195bb16878415c313d45 (patch) | |
tree | 165f3b0ee99677ce7f4557dc5be81e2c4955aaa7 /admin | |
parent | c2e0f1982f886a9c269fed50a3fc904ca2e1655a (diff) | |
download | emacs-20ad0cc03b73f6576ece195bb16878415c313d45.tar.gz emacs-20ad0cc03b73f6576ece195bb16878415c313d45.tar.bz2 emacs-20ad0cc03b73f6576ece195bb16878415c313d45.zip |
* admin/last-chance.el (last-chance): Use `grep`s return value
(compilation-finish-functions): Only set it buffer-locally.
Diffstat (limited to 'admin')
-rw-r--r-- | admin/last-chance.el | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/admin/last-chance.el b/admin/last-chance.el index fd5b8e9bd7a..e8021129e30 100644 --- a/admin/last-chance.el +++ b/admin/last-chance.el @@ -105,18 +105,14 @@ defaulting to the one at point." "Symbol: " obarray nil nil one nil one))))) - (let ((default-directory (or (vc-root-dir) - default-directory))) - (grep (format "%s %s" - last-chance-grep-command - symbol))) - (setf (buffer-local-value 'last-chance-symbol - (process-buffer - (car compilation-in-progress))) - symbol)) - -(add-to-list 'compilation-finish-functions - 'last-chance-cleanup) + (with-current-buffer + (let ((default-directory (or (vc-root-dir) + default-directory))) + (grep (format "%s %s" + last-chance-grep-command + symbol))) + (add-hook 'compilation-finish-functions #'last-chance-cleanup nil t) + (setq-local last-chance-symbol symbol))) (provide 'last-chance) |