[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master adea72f 060/399: counsel.el: Simplify counsel-compile acti
From: |
Oleh Krehel |
Subject: |
[elpa] master adea72f 060/399: counsel.el: Simplify counsel-compile action |
Date: |
Sat, 20 Jul 2019 14:56:49 -0400 (EDT) |
branch: master
commit adea72f0df45bdbcd58e735b8ea4b290ae42438e
Author: Basil L. Contovounesios <address@hidden>
Commit: Basil L. Contovounesios <address@hidden>
counsel.el: Simplify counsel-compile action
(counsel-compile--action): Rename from...
(counsel-compile--wrapper): ...this; change all callers.
Reconcile docstring with implementation. Simplify logic.
---
counsel.el | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/counsel.el b/counsel.el
index e125496..e91c2d9 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5286,21 +5286,20 @@ The optional BLDDIR is useful for other helpers that
have found
'srcdir srcdir
'blddir blddir))))
-(defun counsel-compile--wrapper (cmd)
+(defun counsel-compile--action (cmd)
"Process CMD to call `compile'.
-If CMD has the `recurse' property set we call `counsel-compile' again
-to further refine the compile options in the directory specified by `blddir'."
- (let ((blddir (get-text-property 0 'blddir cmd))
- (recursive (get-text-property 0 'recursive cmd))
- (cmdprop (get-text-property 0 'cmd cmd)))
- (if recursive
+If CMD has the `recursive' property set we call `counsel-compile'
+again to further refine the compile options in the directory
+specified by the `blddir' property."
+ (let ((blddir (get-text-property 0 'blddir cmd)))
+ (if (get-text-property 0 'recursive cmd)
(counsel-compile blddir)
+ (when (get-char-property 0 'cmd cmd)
+ (setq cmd (substring-no-properties
+ cmd 0 (next-single-property-change 0 'cmd cmd))))
(let ((default-directory blddir))
- (compile
- (substring-no-properties
- cmd 0 (if cmdprop
- (next-single-property-change 0 'cmd cmd))))))))
+ (compile cmd)))))
;;;###autoload
(defun counsel-compile (&optional dir)
@@ -5310,7 +5309,7 @@ to further refine the compile options in the directory
specified by `blddir'."
(add-hook 'compilation-start-hook #'counsel-compile--update-history)
(ivy-read "Compile command: "
(counsel--get-compile-candidates dir)
- :action #'counsel-compile--wrapper
+ :action #'counsel-compile--action
:caller 'counsel-compile))
;;* `counsel-mode'
- [elpa] master 15e2c88 051/399: Restore buffer-list after counsel-switch-buffers, (continued)
- [elpa] master 15e2c88 051/399: Restore buffer-list after counsel-switch-buffers, Oleh Krehel, 2019/07/20
- [elpa] master 80d40e4 046/399: Dynamically handle grep tool look-arounds, Oleh Krehel, 2019/07/20
- [elpa] master 0a4ad42 047/399: ivy-test.el (counsel--grep-regex): Add test for negative lookahead, Oleh Krehel, 2019/07/20
- [elpa] master 5f4e944 057/399: counsel.el: Fix finding dominating file, Oleh Krehel, 2019/07/20
- [elpa] master 3c16fa1 055/399: counsel.el (counsel-compile): Clean up, Oleh Krehel, 2019/07/20
- [elpa] master 876b4ac 059/399: counsel.el (counsel-compile): Minor cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 56201b1 056/399: counsel.el: Remove cl-extra, Oleh Krehel, 2019/07/20
- [elpa] master 859e3cb 061/399: counsel.el: Clean up compile history keeping, Oleh Krehel, 2019/07/20
- [elpa] master 072f238 058/399: counsel.el: Capitalize proper noun "Git", Oleh Krehel, 2019/07/20
- [elpa] master 5f5a263 054/399: counsel.el (counsel-compile): Add, Oleh Krehel, 2019/07/20
- [elpa] master adea72f 060/399: counsel.el: Simplify counsel-compile action,
Oleh Krehel <=
- [elpa] master 50dc9e6 065/399: counsel.el (counsel--get-build-subdirs): Fix, Oleh Krehel, 2019/07/20
- [elpa] master 4e0d403 066/399: counsel.el (counsel--find-build-subdir): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 144e7d9 069/399: counsel.el: Clean up recent compile variables, Oleh Krehel, 2019/07/20
- [elpa] master 82e6c54 067/399: counsel.el: Clean up compile make invocation, Oleh Krehel, 2019/07/20
- [elpa] master bb58a29 071/399: counsel.el (counsel-ag): Fix error in non-Git directory, Oleh Krehel, 2019/07/20
- [elpa] master f0d93cf 073/399: counsel.el (counsel-compile): counsel-compile-get-filtered-history, Oleh Krehel, 2019/07/20
- [elpa] master ce0c39e 076/399: counsel.el (counsel--git-root): Rename, Oleh Krehel, 2019/07/20
- [elpa] master a37d4e3 072/399: counsel.el (counsel-compile): fix breakage to subdir recursion, Oleh Krehel, 2019/07/20
- [elpa] master 86c904f 077/399: counsel.el (counsel-compile-root-functions): Change priority, Oleh Krehel, 2019/07/20
- [elpa] master c2788de 082/399: counsel.el (counsel--switch-buffer-update-fn): if to cond, Oleh Krehel, 2019/07/20