summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-01-03 17:25:06 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2021-01-03 17:25:06 -0500
commit20ad0cc03b73f6576ece195bb16878415c313d45 (patch)
tree165f3b0ee99677ce7f4557dc5be81e2c4955aaa7 /admin
parentc2e0f1982f886a9c269fed50a3fc904ca2e1655a (diff)
downloademacs-20ad0cc03b73f6576ece195bb16878415c313d45.tar.gz
* 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.el20
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)