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

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

[elpa] master 1e483c5 37/63: Fixup counsel-org-tag


From: Oleh Krehel
Subject: [elpa] master 1e483c5 37/63: Fixup counsel-org-tag
Date: Fri, 21 Aug 2015 12:08:41 +0000

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

    Fixup counsel-org-tag
    
    * counsel.el (counsel-org-tag-action): Add ::
    (counsel-org-tag): Set `org-last-tags-completion-table', otherwise
    `org-tags-completion-function' doesn't work.
---
 counsel.el |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/counsel.el b/counsel.el
index 4940281..4a014f0 100644
--- a/counsel.el
+++ b/counsel.el
@@ -790,7 +790,8 @@ 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
-            (mapconcat #'identity counsel-org-tags ":"))))
+            (format ":%s:"
+                    (mapconcat #'identity counsel-org-tags ":")))))
         ((eq this-command 'ivy-call)
          (delete-minibuffer-contents))))
 
@@ -803,10 +804,18 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and
   "Add or remove tags in org-mode."
   (interactive)
   (setq counsel-org-tags (split-string (org-get-tags-string) ":" t))
-  (ivy-read (counsel-org-tag-prompt)
-            'org-tags-completion-function
-            :history 'org-tags-history
-            :action 'counsel-org-tag-action))
+  (let ((org-setting-tags t)
+        (org-last-tags-completion-table
+         (append org-tag-persistent-alist
+                 (or org-tag-alist (org-get-buffer-tags))
+                 (and
+                  org-complete-tags-always-offer-all-agenda-tags
+                  (org-global-tags-completion-table
+                   (org-agenda-files))))))
+    (ivy-read (counsel-org-tag-prompt)
+              'org-tags-completion-function
+              :history 'org-tags-history
+              :action 'counsel-org-tag-action)))
 
 (provide 'counsel)
 



reply via email to

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