[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 3954bfe 081/399: counsel.el (counsel-compile): Don't modif
From: |
Oleh Krehel |
Subject: |
[elpa] master 3954bfe 081/399: counsel.el (counsel-compile): Don't modify compilation-start-hook permanently |
Date: |
Sat, 20 Jul 2019 14:56:53 -0400 (EDT) |
branch: master
commit 3954bfed72908998a472e5c8ebe8c0739f89a3f9
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-compile): Don't modify compilation-start-hook
permanently
---
counsel.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/counsel.el b/counsel.el
index 5ff3fcf..55bebb3 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5120,9 +5120,9 @@ This variable is suitable for addition to
`savehist-additional-variables'.")
(defvar counsel-compile-root-functions
- (list #'counsel--project-current
+ (list 'counsel--project-current
(apply-partially #'counsel--dominating-file "configure")
- #'counsel--git-root
+ 'counsel--git-root
(apply-partially #'counsel--dominating-file dir-locals-file))
"Special hook to find the project root for compile commands.
Each function on this hook is called in turn with no arguments
@@ -5293,14 +5293,16 @@ specified by the `blddir' property."
(setq cmd (substring-no-properties
cmd 0 (next-single-property-change 0 'cmd cmd))))
(let ((default-directory blddir))
- (compile cmd)))))
+ ;; No need to specify `:history' because of this hook.
+ (add-hook 'compilation-start-hook #'counsel-compile--update-history)
+ (unwind-protect
+ (compile cmd)
+ (remove-hook 'compilation-start-hook
#'counsel-compile--update-history))))))
;;;###autoload
(defun counsel-compile (&optional dir)
"Call `compile' completing with smart suggestions, optionally for DIR."
(interactive)
- ;; No need to specify `:history' because of this hook.
- (add-hook 'compilation-start-hook #'counsel-compile--update-history)
(ivy-read "Compile command: "
(counsel--get-compile-candidates dir)
:action #'counsel-compile--action
- [elpa] master 27add46 092/399: Anchor pcre lookaround patterns to bol, (continued)
- [elpa] master 27add46 092/399: Anchor pcre lookaround patterns to bol, Oleh Krehel, 2019/07/20
- [elpa] master 3e1e905 083/399: Fix virtual buffers in counsel-switch-buffer, Oleh Krehel, 2019/07/20
- [elpa] master cbdc9c9 078/399: counsel.el (counsel--compile-get-make-targets): Rename, Oleh Krehel, 2019/07/20
- [elpa] master e7146e5 089/399: counsel.el (counsel-git-grep-count-function): Fix, Oleh Krehel, 2019/07/20
- [elpa] master b180abf 087/399: counsel.el (counsel-compile): clean-up get-make-targets, Oleh Krehel, 2019/07/20
- [elpa] master 456e575 093/399: Don't bury killed buffers after counsel-switch-buffer, Oleh Krehel, 2019/07/20
- [elpa] master 1c84179 098/399: counsel.el (counsel-rg): Add an example to the doc, Oleh Krehel, 2019/07/20
- [elpa] master b154260 097/399: counsel.el (counsel-grep): Fix TRAMP problems, Oleh Krehel, 2019/07/20
- [elpa] master adab07d 101/399: counsel.el: Simplify counsel-git-grep, Oleh Krehel, 2019/07/20
- [elpa] master 5b4dbbc 096/399: ivy.el: Silence byte-compiler, Oleh Krehel, 2019/07/20
- [elpa] master 3954bfe 081/399: counsel.el (counsel-compile): Don't modify compilation-start-hook permanently,
Oleh Krehel <=
- [elpa] master d92d43a 085/399: counsel.el (counsel-compile-root-functions): Tidy, Oleh Krehel, 2019/07/20
- [elpa] master 2356a1d 091/399: ivy-test.el (counsel--grep-regex): Extend test, Oleh Krehel, 2019/07/20
- [elpa] master cdd7ada 094/399: counsel.el (counsel-url-expand): Avoid null error, Oleh Krehel, 2019/07/20
- [elpa] master 089107a 099/399: counsel.el (counsel-ag): Add a keyword argument caller, Oleh Krehel, 2019/07/20
- [elpa] master 776fbb7 103/399: Make ivy-switch-buffer-occur work with multi-pass regex builders, Oleh Krehel, 2019/07/20
- [elpa] master 8b4c939 100/399: counsel.el (counsel-cd): Add, Oleh Krehel, 2019/07/20
- [elpa] master 0c8cfe8 106/399: ivy-hydra.el (ivy-dispatching-done-idle): Add, Oleh Krehel, 2019/07/20
- [elpa] master 4c52362 110/399: swiper.el (swiper-occur): Make wgrep work for narrowed buffers, Oleh Krehel, 2019/07/20
- [elpa] master 8c1a2fa 107/399: Allow all re-builders to use ivy-highlight-grep-commands, Oleh Krehel, 2019/07/20
- [elpa] master 78b62f2 102/399: README.md: Mention char-fold-to-regexp, Oleh Krehel, 2019/07/20