emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master a9ff1f1 38/63: counsel.el (counsel-org-change-tags): Impro


From: Oleh Krehel
Subject: [elpa] master a9ff1f1 38/63: counsel.el (counsel-org-change-tags): Improve removing tags
Date: Fri, 21 Aug 2015 12:08:41 +0000

branch: master
commit a9ff1f17646103bc825132d3b5ea6111182b35cd
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-org-change-tags): Improve removing tags
---
 counsel.el |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/counsel.el b/counsel.el
index 4a014f0..6004891 100644
--- a/counsel.el
+++ b/counsel.el
@@ -760,7 +760,10 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
       ((re-search-forward
         (concat "\\([ \t]*" (regexp-quote current) "\\)[ \t]*$")
         (point-at-eol) t)
-       (unless (equal tags "")
+       (if (equal tags "")
+           (delete-region
+            (match-beginning 0)
+            (match-end 0))
          (goto-char (match-beginning 0))
          (let* ((c0 (current-column))
                 ;; compute offset for the case of org-indent-mode active
@@ -790,8 +793,10 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
   (cond ((memq this-command '(ivy-done ivy-alt-done))
          (with-selected-window (ivy-state-window ivy-last)
            (counsel-org-change-tags
-            (format ":%s:"
-                    (mapconcat #'identity counsel-org-tags ":")))))
+            (if counsel-org-tags
+                (format ":%s:"
+                        (mapconcat #'identity counsel-org-tags ":"))
+              ""))))
         ((eq this-command 'ivy-call)
          (delete-minibuffer-contents))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]