[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 859e3cb 061/399: counsel.el: Clean up compile history keep
From: |
Oleh Krehel |
Subject: |
[elpa] master 859e3cb 061/399: counsel.el: Clean up compile history keeping |
Date: |
Sat, 20 Jul 2019 14:56:49 -0400 (EDT) |
branch: master
commit 859e3cbb422e02b6b040da545153f82a655383ee
Author: Basil L. Contovounesios <address@hidden>
Commit: Basil L. Contovounesios <address@hidden>
counsel.el: Clean up compile history keeping
(counsel-compile--update-history): Use add-to-history instead of
add-to-list and file-equal-p instead of string-equal. Avoid one
level of unneeded string consing.
---
counsel.el | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/counsel.el b/counsel.el
index e91c2d9..1c2fa61 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5267,24 +5267,20 @@ The optional BLDDIR is useful for other helpers that
have found
(setq cands (nconc cands more-cands)))))
cands)))
-;; This is a workaround to ensure we tag all the relevant meta-data in
-;; our compile history. This also allows M-x compile to do fancy
-;; things like infer default-directory from cd's in the string.
+;; This is a workaround to ensure we tag all the relevant metadata in
+;; our compile history. This also allows M-x compile to do fancy
+;; things like infer `default-directory' from 'cd's in the string.
(defun counsel-compile--update-history (_proc)
"Update `counsel-compile-history' from the compilation state."
- (let ((srcdir (funcall counsel-compile-root-function))
- (blddir default-directory)
- (command (car compilation-arguments)))
- (add-to-list
- 'counsel-compile-history
- (propertize
- (concat
- (propertize command 'cmd 't)
- (when (not (string-equal blddir srcdir))
- (concat (propertize " in " 'face 'font-lock-warning-face)
- (propertize blddir 'face 'dired-directory))))
- 'srcdir srcdir
- 'blddir blddir))))
+ (let* ((srcdir (funcall counsel-compile-root-function))
+ (blddir default-directory)
+ (cmd (concat
+ (propertize (car compilation-arguments) 'cmd t)
+ (unless (file-equal-p blddir srcdir)
+ (concat (propertize " in " 'face 'font-lock-warning-face)
+ (propertize blddir 'face 'dired-directory))))))
+ (add-text-properties 0 (length cmd) `(srcdir ,srcdir blddir ,blddir) cmd)
+ (add-to-history 'counsel-compile-history cmd)))
(defun counsel-compile--action (cmd)
"Process CMD to call `compile'.
- [elpa] master 84b5ece 050/399: counsel.el (counsel-find-file-copy): Use ivy-inhibit-action, (continued)
- [elpa] master 84b5ece 050/399: counsel.el (counsel-find-file-copy): Use ivy-inhibit-action, Oleh Krehel, 2019/07/20
- [elpa] master 9e3c855 052/399: ivy.el (ivy-make-magic-action): Fix bug, Oleh Krehel, 2019/07/20
- [elpa] master 9cf3f08 045/399: swiper.el (swiper-use-visual-line-p): New variable, Oleh Krehel, 2019/07/20
- [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 <=
- [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, 2019/07/20
- [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