[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master b65cdb5 274/399: counsel.el (counsel-compile): track build
From: |
Oleh Krehel |
Subject: |
[elpa] master b65cdb5 274/399: counsel.el (counsel-compile): track build dir for the benefit of M-i |
Date: |
Sat, 20 Jul 2019 14:57:39 -0400 (EDT) |
branch: master
commit b65cdb52aac4e2fbff0629c0d3f7e72cc927abcd
Author: Alex Bennée <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-compile): track build dir for the benefit of M-i
We can't recover the current build directory when the user invokes M-i
so let's track it in a variable. The user still has to delete the
extra verbiage but at least won't be surprised about where the command
is run.
Fixes #2077
---
counsel.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/counsel.el b/counsel.el
index c56487b..10b2390 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5498,6 +5498,12 @@ This is determined by `counsel-compile-local-builds',
which see."
`(srcdir ,srcdir blddir ,blddir bldenv ,bldenv) cmd)
(add-to-history 'counsel-compile-history cmd)))
+(defvar counsel-compile--current-build-dir nil
+ "Tracks the last directory `counsel-compile' was called with.
+
+This state allows us to set it correctly if the user has manually
+edited the command loosing our embedded state.")
+
(defun counsel-compile--action (cmd)
"Process CMD to call `compile'.
@@ -5511,7 +5517,9 @@ specified by the `blddir' property."
(when (get-char-property 0 'cmd cmd)
(setq cmd (substring-no-properties
cmd 0 (next-single-property-change 0 'cmd cmd))))
- (let ((default-directory (or blddir default-directory))
+ (let ((default-directory (or blddir
+ counsel-compile--current-build-dir
+ default-directory))
(compilation-environment bldenv))
;; No need to specify `:history' because of this hook.
(add-hook 'compilation-start-hook #'counsel-compile--update-history)
@@ -5523,6 +5531,7 @@ specified by the `blddir' property."
(defun counsel-compile (&optional dir)
"Call `compile' completing with smart suggestions, optionally for DIR."
(interactive)
+ (setq counsel-compile--current-build-dir (or dir default-directory))
(ivy-read "Compile command: "
(counsel--get-compile-candidates dir)
:action #'counsel-compile--action
- [elpa] master a2af29b 271/399: ivy.el (ivy--occur-insert-lines): Fix missing line numbers, (continued)
- [elpa] master a2af29b 271/399: ivy.el (ivy--occur-insert-lines): Fix missing line numbers, Oleh Krehel, 2019/07/20
- [elpa] master 9a9e3e4 251/399: ivy-test.el (swiper--isearch-format): Add test, Oleh Krehel, 2019/07/20
- [elpa] master 76ef143 258/399: swiper.el (swiper-isearch): Fix ivy-occur, Oleh Krehel, 2019/07/20
- [elpa] master c6977eb 266/399: ivy.el (ivy-read): Add :multi-action arg, Oleh Krehel, 2019/07/20
- [elpa] master df0d980 267/399: Modify counsel-unicode-char's copy action to use actual result, Oleh Krehel, 2019/07/20
- [elpa] master 19ff7cf 270/399: counsel.el (counsel-register-action): Tweak error, Oleh Krehel, 2019/07/20
- [elpa] master 4898a5e 272/399: counsel.el (counsel-compile): better handling for counsel--get-build-subdirs, Oleh Krehel, 2019/07/20
- [elpa] master e95a16b 275/399: Shrink ivy window after read action., Oleh Krehel, 2019/07/20
- [elpa] master 226171b 268/399: ivy.el (ivy--occur-insert-lines): Don't highlight the file name part, Oleh Krehel, 2019/07/20
- [elpa] master e8f9370 273/399: counsel.el (counsel-compile): nreverse recent history, Oleh Krehel, 2019/07/20
- [elpa] master b65cdb5 274/399: counsel.el (counsel-compile): track build dir for the benefit of M-i,
Oleh Krehel <=
- [elpa] master a18de2f 269/399: counsel.el (counsel-register): Add, Oleh Krehel, 2019/07/20
- [elpa] master fbf654c 276/399: counsel.el (counsel-company): Rely on company-prefix if company-common is nil, Oleh Krehel, 2019/07/20
- [elpa] master 2410219 284/399: swiper.el (swiper-isearch-highlight-delay): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master bc2dcbe 279/399: counsel.el (counsel--find-build-subdir): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 13da38a 287/399: ivy.el (ivy-help): Hide Org markup buffer-locally, Oleh Krehel, 2019/07/20
- [elpa] master 0134255 281/399: ivy.el (ivy--highlight-default): Use single face for adjacent groups, Oleh Krehel, 2019/07/20
- [elpa] master b7e9dfd 277/399: counsel.el: Fix a couple of typos, Oleh Krehel, 2019/07/20
- [elpa] master 92d5335 291/399: Add counsel-up-level command, Oleh Krehel, 2019/07/20
- [elpa] master 7e8622f 286/399: ivy.el (ivy-read-action): Fix, Oleh Krehel, 2019/07/20
- [elpa] master 0a26144 280/399: ivy.el (ivy--highlight-default): Handle unmatched groups, Oleh Krehel, 2019/07/20