org-set-tags behaviour is broken with swiper #177

Closed
srustamo opened this Issue Jul 24, 2015 · 44 comments

Comments

Projects
None yet
4 participants
@srustamo

Single tag setting with C-q (calls org-set-tags in org-mode buffer) works OK. However setting multiple tags is broken:

  1. org-mode offers ido completion with org-completion-use-ido, but it is also broken - tab will not let selecting the next candidate, but inserts : instead. So, I set org-completion-use-ido to nil
  2. Org then falls back, it seems, to the value of org-completion-fallback-command which is hippie-expand. This works more or less, allowing tab selection of next tag candidate of org-set-tags
  3. I used helm for a while, which also did not allow multiple tag candidate selection, but at least it offered helm-completing-read-handlers-alist which allowed exclusion of org-set-tags.

Now, ivy-completing-read also does not allow multiple comma or colon separated tag selection from the completion list (because it looks like ivy-partial-or-done binding the Tab).

Is there a way to fix this, so that ideally ivy-completing-read allows comma or colon separated candidates for some functions which need it?
If this is not possible, could you please consider including an option to exclude certain functions from ivy-completing-read?

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 24, 2015

Owner

Now, ivy-completing-read also does not allow multiple comma or colon separated tag selection from the completion list (because it looks like ivy-partial-or-done binding the Tab).

I understand that you don't get completion on the second tag. But does it still work if you enter the tag manually?

Is there a way to fix this, so that ideally ivy-completing-read allows comma or colon separated candidates for some functions which need it?

There's no great way to fix this problem without changing it: the problem is ill-posed. This is due to a single candidate selection interface being used by Org to select multiple things. However, the problem can be made well posed by splitting org-set-tags into org-add-tag and org-remove-tag. I could add a counsel-add-remove-tag function that adds/removes tags one-by-one, if you want. Also asking @joedicastro, since he raised a similar issue in #91.

If this is not possible, could you please consider including an option to exclude certain functions from ivy-completing-read?

Of course, such an option should definitely be added.

Owner

abo-abo commented Jul 24, 2015

Now, ivy-completing-read also does not allow multiple comma or colon separated tag selection from the completion list (because it looks like ivy-partial-or-done binding the Tab).

I understand that you don't get completion on the second tag. But does it still work if you enter the tag manually?

Is there a way to fix this, so that ideally ivy-completing-read allows comma or colon separated candidates for some functions which need it?

There's no great way to fix this problem without changing it: the problem is ill-posed. This is due to a single candidate selection interface being used by Org to select multiple things. However, the problem can be made well posed by splitting org-set-tags into org-add-tag and org-remove-tag. I could add a counsel-add-remove-tag function that adds/removes tags one-by-one, if you want. Also asking @joedicastro, since he raised a similar issue in #91.

If this is not possible, could you please consider including an option to exclude certain functions from ivy-completing-read?

Of course, such an option should definitely be added.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 24, 2015

I understand that you don't get completion on the second tag. But does it still work if you enter the tag > manually?

The swiper behaves in following way:

  1. if there are no tags at all on an org headline, swiper offers vertical list of tags for selection. Only one tag can be selected from here, after which it exists, inserting that tag on the headline.
  2. if there is at least one tag already present and org-set-tags is called, swiper does not enter into vertical mode, instead there is usual ido style completion list. See screenshot.
    And yes, manually I am able enter the second, ... n-th, tag, separating each with a ,. But I have to type each tag fully, without being able to tab complete.

I understand that you don't get completion on the second tag. But does it still work if you enter the tag > manually?

The swiper behaves in following way:

  1. if there are no tags at all on an org headline, swiper offers vertical list of tags for selection. Only one tag can be selected from here, after which it exists, inserting that tag on the headline.
  2. if there is at least one tag already present and org-set-tags is called, swiper does not enter into vertical mode, instead there is usual ido style completion list. See screenshot.
    And yes, manually I am able enter the second, ... n-th, tag, separating each with a ,. But I have to type each tag fully, without being able to tab complete.
@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 24, 2015

There's no great way to fix this problem without changing it: the problem is ill-posed. This is due to a >single candidate selection interface being used by Org to select multiple things. However, the problem >can be made well posed by splitting org-set-tags into org-add-tag and org-remove-tag. I could add a >counsel-add-remove-tag function that adds/removes tags one-by-one, if you want. Also asking >@joedicastro, since he raised a similar issue in #91.

I can't at this point imagine how what you suggest would work, but please add counsel-add-remove-tag as I have a gut feeling that it would work 😄

There's no great way to fix this problem without changing it: the problem is ill-posed. This is due to a >single candidate selection interface being used by Org to select multiple things. However, the problem >can be made well posed by splitting org-set-tags into org-add-tag and org-remove-tag. I could add a >counsel-add-remove-tag function that adds/removes tags one-by-one, if you want. Also asking >@joedicastro, since he raised a similar issue in #91.

I can't at this point imagine how what you suggest would work, but please add counsel-add-remove-tag as I have a gut feeling that it would work 😄

abo-abo added a commit that referenced this issue Jul 24, 2015

counsel.el (counsel-org-tag): Replace org-set-tags
* counsel.el (counsel-org-tags): New defvar.
(counsel-org-change-tags): New defun, adapted from part of
`org-set-tags'.
(counsel-org-tag-action): New defun.
(counsel-org-tag-prompt): New defun.
(counsel-org-tag): New command.

**Using counsel-org-tag**

- The prompt is auto-updated to the currently selected tags.
- Selecting one of the already selected tags removes it from selection.

The best shortcut for selecting/removing multiple tags is "C-M-m" (or
"g" when the "C-o" hydra is active).

Re #177
Re #91
@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 24, 2015

Owner

Give it a try, and let me know what you think. Remember:

  • C-m selects and exits
  • C-M-m selects without exiting, so you can select multiple tags.
Owner

abo-abo commented Jul 24, 2015

Give it a try, and let me know what you think. Remember:

  • C-m selects and exits
  • C-M-m selects without exiting, so you can select multiple tags.
@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 24, 2015

I cloned the repo, the latest commit shows counsel-org-tag. I assume this is the function. I put the counsel.el file in swiper-20150724.739 directory in elpa on the path. Byte compiled it. However, I don't see any org-tags related added functions.

I'm sure I'm doing something wrong. Help, please.

I cloned the repo, the latest commit shows counsel-org-tag. I assume this is the function. I put the counsel.el file in swiper-20150724.739 directory in elpa on the path. Byte compiled it. However, I don't see any org-tags related added functions.

I'm sure I'm doing something wrong. Help, please.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 24, 2015

OK, I just loaded the counsel.el without compiling it. The function showed up.
However:

  1. Running C-q in an org file on a heading, which has a tag, does not show the vertical list of tag candidates. The existing tag is shown followed by [No match].
  2. If no tags are on the headline, a vertical list of tags is shown. Selecting one, then pressing C-m puts the selected tag on a headline. However, C-M-m returns M-RET is undefined.

OK, I just loaded the counsel.el without compiling it. The function showed up.
However:

  1. Running C-q in an org file on a heading, which has a tag, does not show the vertical list of tag candidates. The existing tag is shown followed by [No match].
  2. If no tags are on the headline, a vertical list of tags is shown. Selecting one, then pressing C-m puts the selected tag on a headline. However, C-M-m returns M-RET is undefined.
@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 24, 2015

Owner

Running C-q in an org file on a heading

I didn't bind it to C-q. You can call it with M-x counsel-org-tag.
Or bind it later as:

(define-key org-mode-map (kbd "C-q") 'counsel-org-tag)

Although it's not recommended to override C-q - quoted-insert is an important command.

Owner

abo-abo commented Jul 24, 2015

Running C-q in an org file on a heading

I didn't bind it to C-q. You can call it with M-x counsel-org-tag.
Or bind it later as:

(define-key org-mode-map (kbd "C-q") 'counsel-org-tag)

Although it's not recommended to override C-q - quoted-insert is an important command.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 24, 2015

Ah, amazing. This works. 😄 A bit counter-intuitive the way the last candidate is shown as No matches. See screenshot.

Ah, amazing. This works. 😄 A bit counter-intuitive the way the last candidate is shown as No matches. See screenshot.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 24, 2015

Owner

A bit counter-intuitive the way the last candidate is shown as No matches. See screenshot.

That shouldn't happen. Can you provide a test file for which this happens?

Owner

abo-abo commented Jul 24, 2015

A bit counter-intuitive the way the last candidate is shown as No matches. See screenshot.

That shouldn't happen. Can you provide a test file for which this happens?

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 24, 2015

a simple one line org heading file like this produces [No matches] when counsel-org-tag is called and shell is typed.

**** test :RM_Kitchen:shell:
I suspect you will need to have in your system some agenda files with shell tag to populate the list of candidates.

a simple one line org heading file like this produces [No matches] when counsel-org-tag is called and shell is typed.

**** test :RM_Kitchen:shell:
I suspect you will need to have in your system some agenda files with shell tag to populate the list of candidates.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 24, 2015

Owner

This is what I get:
counsel-org-tag-1

Owner

abo-abo commented Jul 24, 2015

This is what I get:
counsel-org-tag-1

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 27, 2015

Could you please share how you set up your tags in Customize group: org-tags (or however in other way you set up the tags)?

These seem to be the issues with candidates for counsel-org-tag:

  1. How the tag candidates list gets populated. It looks counsel-org-tag double (triple, etc) lists certain tags, which appear in different agenda files (I set org-complete-tags-always-offer-all-agenda-tags to t).
  2. If I have org-tag-persistent-alist populated with some tags, these also are included as candidates, double, triple etc, listing such tags, if they also appear in other agenda files).
  3. I can't comment on (No matches) at the end of the list, although there are clearly matches, as the list is not empty.

Could you please share how you set up your tags in Customize group: org-tags (or however in other way you set up the tags)?

These seem to be the issues with candidates for counsel-org-tag:

  1. How the tag candidates list gets populated. It looks counsel-org-tag double (triple, etc) lists certain tags, which appear in different agenda files (I set org-complete-tags-always-offer-all-agenda-tags to t).
  2. If I have org-tag-persistent-alist populated with some tags, these also are included as candidates, double, triple etc, listing such tags, if they also appear in other agenda files).
  3. I can't comment on (No matches) at the end of the list, although there are clearly matches, as the list is not empty.
@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 27, 2015

A bit more background to [No matches]: it looks like this is not limited to counsel-org-tag. Hitting C-s in Packages buffer, for example, also shows (No matches), where there clearly are matches. See screenshot.

A bit more background to [No matches]: it looks like this is not limited to counsel-org-tag. Hitting C-s in Packages buffer, for example, also shows (No matches), where there clearly are matches. See screenshot.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 27, 2015

Owner

I have no special setup for tags. Just navigate to a heading in a file (not in agenda) and change the tags.

As for [No matches] it may come from icomplete-mode; do you have that on?

Owner

abo-abo commented Jul 27, 2015

I have no special setup for tags. Just navigate to a heading in a file (not in agenda) and change the tags.

As for [No matches] it may come from icomplete-mode; do you have that on?

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 27, 2015

Indeed, I did. Disabled it, no more [No match]. I suppose the multiple instances of the same tag in the vertical selection list is org-mode issue.

Thank you for your help.

Indeed, I did. Disabled it, no more [No match]. I suppose the multiple instances of the same tag in the vertical selection list is org-mode issue.

Thank you for your help.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 27, 2015

Owner

I suppose the multiple instances of the same tag in the vertical selection list is org-mode issue.

I'm using org-get-tags-string almost plainly: it's probably Org that is introducing the duplicates. If you give me a minimal example of when the duplicates occur, I can debug this issue.

Owner

abo-abo commented Jul 27, 2015

I suppose the multiple instances of the same tag in the vertical selection list is org-mode issue.

I'm using org-get-tags-string almost plainly: it's probably Org that is introducing the duplicates. If you give me a minimal example of when the duplicates occur, I can debug this issue.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 27, 2015

I created to files: test.org and test2.org.
Each of them has only one heading with only one tag:

test.org

**** test :tag1:

test2.org

**** test2 :: :tag2:
(incidentally, counsel-org-tag when removing the last tag leaves behind ::).

There are only these two files in org-agenda:
org-agenda-files is a variable defined in org.el. Its value is ("~/test.org" "~/test2.org") Original value was nil

org-complete-tags-always-offer-all-agenda-tags is set to t.

Now, if you are in test2.org buffer and call counsel-org-tag, three tags are shown (i.e. tag2 is duplicated). Screenshot below.

screenshot

I created to files: test.org and test2.org.
Each of them has only one heading with only one tag:

test.org

**** test :tag1:

test2.org

**** test2 :: :tag2:
(incidentally, counsel-org-tag when removing the last tag leaves behind ::).

There are only these two files in org-agenda:
org-agenda-files is a variable defined in org.el. Its value is ("~/test.org" "~/test2.org") Original value was nil

org-complete-tags-always-offer-all-agenda-tags is set to t.

Now, if you are in test2.org buffer and call counsel-org-tag, three tags are shown (i.e. tag2 is duplicated). Screenshot below.

screenshot

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 27, 2015

Also, counsel-org-tag returns error when run on an item of org-agenda: user-error: Not on a heading.
C-q works here as described earlier.

Also, counsel-org-tag returns error when run on an item of org-agenda: user-error: Not on a heading.
C-q works here as described earlier.

abo-abo added a commit that referenced this issue Jul 27, 2015

counsel.el (counsel-org-tag): Delete dups
The issue of duplicates arises from this setting (off by default):

    (setq org-complete-tags-always-offer-all-agenda-tags t)

Re #177
@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 27, 2015

Owner

The duplicates should be gone now.

Owner

abo-abo commented Jul 27, 2015

The duplicates should be gone now.

@kaushalmodi

This comment has been minimized.

Show comment
Hide comment
@kaushalmodi

kaushalmodi Jul 27, 2015

Contributor

Sorry, now I am onto this issue. I am using the counsel.el with duplicates fix. I do not see the duplicates if I call counsel-org-tag in the org file buffer. But I see the duplicates when I call the same fn from capture buffer.

I later realized that the duplicates happen when in fact I have org-complete-tags-always-offer-all-agenda-tags set to t... and I had this in my config:

    (add-hook 'org-capture-mode-hook
              (lambda () (setq-local org-complete-tags-always-offer-all-agenda-tags t)))

If I did (setq org-complete-tags-always-offer-all-agenda-tags t), I got duplicates when calling counsel-org-tag in both file buffer and capture buffer.

Duplicates are gone in all cases if I don't set org-complete-tags-always-offer-all-agenda-tags to t at all, either globally or locally.

Contributor

kaushalmodi commented Jul 27, 2015

Sorry, now I am onto this issue. I am using the counsel.el with duplicates fix. I do not see the duplicates if I call counsel-org-tag in the org file buffer. But I see the duplicates when I call the same fn from capture buffer.

I later realized that the duplicates happen when in fact I have org-complete-tags-always-offer-all-agenda-tags set to t... and I had this in my config:

    (add-hook 'org-capture-mode-hook
              (lambda () (setq-local org-complete-tags-always-offer-all-agenda-tags t)))

If I did (setq org-complete-tags-always-offer-all-agenda-tags t), I got duplicates when calling counsel-org-tag in both file buffer and capture buffer.

Duplicates are gone in all cases if I don't set org-complete-tags-always-offer-all-agenda-tags to t at all, either globally or locally.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 28, 2015

Owner

Can't reproduce the duplicates with the test1.org and test2.org.

And I don't see how there can be duplicates anyway:

(ivy-read (counsel-org-tag-prompt)
          (lambda (str &rest _unused)
            (delete-dups
             (all-completions str 'org-tags-completion-function)))
          :history 'org-tags-history
          :action 'counsel-org-tag-action)

The only source of candidates is this call:

(delete-dups
 (all-completions str 'org-tags-completion-function))

Even if org-tags-completion-function were to return duplicates, they are removed.

Owner

abo-abo commented Jul 28, 2015

Can't reproduce the duplicates with the test1.org and test2.org.

And I don't see how there can be duplicates anyway:

(ivy-read (counsel-org-tag-prompt)
          (lambda (str &rest _unused)
            (delete-dups
             (all-completions str 'org-tags-completion-function)))
          :history 'org-tags-history
          :action 'counsel-org-tag-action)

The only source of candidates is this call:

(delete-dups
 (all-completions str 'org-tags-completion-function))

Even if org-tags-completion-function were to return duplicates, they are removed.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 28, 2015

The duplicates are gone indeed. I also don't have problems reported by @kaushalmodi in capture buffer calling counsel-org-tag. The only problem remaining it seems is calling it within org-agenda buffer after C-c a (runs the command org-agenda).

As reported earlier, "Also, counsel-org-tag returns error when run on an item of org-agenda: user-error: Not on a heading. C-q works here as described earlier."

The duplicates are gone indeed. I also don't have problems reported by @kaushalmodi in capture buffer calling counsel-org-tag. The only problem remaining it seems is calling it within org-agenda buffer after C-c a (runs the command org-agenda).

As reported earlier, "Also, counsel-org-tag returns error when run on an item of org-agenda: user-error: Not on a heading. C-q works here as described earlier."

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 28, 2015

Owner

As reported earlier, "Also, counsel-org-tag returns error when run on an item of org-agenda: user-error: Not on a heading. C-q works here as described earlier."

OK, this is expected, since C-c C-q is bound to two different command when in a buffer or agenda. I've modeled only the first one. I can work on the second one later.

Owner

abo-abo commented Jul 28, 2015

As reported earlier, "Also, counsel-org-tag returns error when run on an item of org-agenda: user-error: Not on a heading. C-q works here as described earlier."

OK, this is expected, since C-c C-q is bound to two different command when in a buffer or agenda. I've modeled only the first one. I can work on the second one later.

@kaushalmodi

This comment has been minimized.

Show comment
Hide comment
@kaushalmodi

kaushalmodi Jul 28, 2015

Contributor

The duplicates are gone indeed.

I concur. Not sure why I saw that yesterday.

Contributor

kaushalmodi commented Jul 28, 2015

The duplicates are gone indeed.

I concur. Not sure why I saw that yesterday.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 28, 2015

@abo-abo Thank you for your time!

@abo-abo Thank you for your time!

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 28, 2015

If you could also please look at org-agenda command for assigning tags to multiple org-agenda list items?

After C-c a, agenda buffer is shown, here, M marks items, B acts on marked items, showing commands in minibuffer. + or - is supposed to add or remove tags from the marked items.

If you could also please look at org-agenda command for assigning tags to multiple org-agenda list items?

After C-c a, agenda buffer is shown, here, M marks items, B acts on marked items, showing commands in minibuffer. + or - is supposed to add or remove tags from the marked items.

abo-abo added a commit that referenced this issue Jul 28, 2015

counsel.el (counsel-org-tag-agenda): New command
* counsel.el (counsel-org-tag-agenda): It's just a flet wrapper around
  `org-agenda-set-tags', changing `org-set-tags' to `counsel-org-tag'.
(counsel-org-tag-action): Don't use `with-selected-window', since
`org-agenda-set-tags' will change the buffer for us.

Re #177
@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 28, 2015

Owner

Please try the new command in agenda.

Owner

abo-abo commented Jul 28, 2015

Please try the new command in agenda.

@kaushalmodi

This comment has been minimized.

Show comment
Hide comment
@kaushalmodi

kaushalmodi Jul 28, 2015

Contributor

Thanks. It works great, but not on the marked items.

But the C-c C-q work great in both agenda and org buffers with this:

    (with-eval-after-load 'org
      (bind-key "C-c C-q" #'counsel-org-tag org-mode-map))
    (with-eval-after-load 'org-agenda
      (bind-key "C-c C-q" #'counsel-org-tag-agenda org-agenda-mode-map))
Contributor

kaushalmodi commented Jul 28, 2015

Thanks. It works great, but not on the marked items.

But the C-c C-q work great in both agenda and org buffers with this:

    (with-eval-after-load 'org
      (bind-key "C-c C-q" #'counsel-org-tag org-mode-map))
    (with-eval-after-load 'org-agenda
      (bind-key "C-c C-q" #'counsel-org-tag-agenda org-agenda-mode-map))
@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 28, 2015

Owner

but not on the marked items.

You mean marked with a region? I have left that feature out so far, since I've never used it before.

Owner

abo-abo commented Jul 28, 2015

but not on the marked items.

You mean marked with a region? I have left that feature out so far, since I've never used it before.

@kaushalmodi

This comment has been minimized.

Show comment
Hide comment
@kaushalmodi

kaushalmodi Jul 28, 2015

Contributor

You mean marked with a region?

No, marked using m and other keys (like in dired, ibuffer, etc).

You can add/remove flags on multiple items in the agenda by selecting them using m, then B (org-agenda-bulk-action) and then + (to add tags) or - (to remove tags).

But I honestly believe this should go as a separate issue item requesting this feature.

Contributor

kaushalmodi commented Jul 28, 2015

You mean marked with a region?

No, marked using m and other keys (like in dired, ibuffer, etc).

You can add/remove flags on multiple items in the agenda by selecting them using m, then B (org-agenda-bulk-action) and then + (to add tags) or - (to remove tags).

But I honestly believe this should go as a separate issue item requesting this feature.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 28, 2015

Owner

But I honestly believe this should go as a separate issue item requesting this feature.

Yes, that would be good. Also with a minimal example, since I'm still not completely sure how this marking is supposed to work.

Owner

abo-abo commented Jul 28, 2015

But I honestly believe this should go as a separate issue item requesting this feature.

Yes, that would be good. Also with a minimal example, since I'm still not completely sure how this marking is supposed to work.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 29, 2015

counsel-org-tag-agenda works with a minor quirk:
I have the following: org-use-tag-inheritance is a variable defined in org.el. Its value is t.
This allows not to set tags to subheadings, saving some typing and time.

However, it seems to append an extra : to the last tag in the list in agenda view. Having two : breaks counsel-org-tag-agenda so, that it does not list the tags already on the subheading. This means removal of such tags is impossible.

Here is a test file with relevant tags. These are scheduled, so they appear in the agenda. Once in the agenda, the tag on the subheading looks like so:

screenshot

counsel-org-tag-agenda works with a minor quirk:
I have the following: org-use-tag-inheritance is a variable defined in org.el. Its value is t.
This allows not to set tags to subheadings, saving some typing and time.

However, it seems to append an extra : to the last tag in the list in agenda view. Having two : breaks counsel-org-tag-agenda so, that it does not list the tags already on the subheading. This means removal of such tags is impossible.

Here is a test file with relevant tags. These are scheduled, so they appear in the agenda. Once in the agenda, the tag on the subheading looks like so:

screenshot

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 29, 2015

But I honestly believe this should go as a separate issue item requesting this feature.

Yes, that would be good. Also with a minimal example, since I'm still not completely sure how this marking is supposed to work.

The org-agenda-bulk-action could indeed be a separate issue. I thought that it calls the same org-set-tag, hence did not think it needs to spawn the issue list. @kaushalmodi, could you start that issue, perhaps?

But I honestly believe this should go as a separate issue item requesting this feature.

Yes, that would be good. Also with a minimal example, since I'm still not completely sure how this marking is supposed to work.

The org-agenda-bulk-action could indeed be a separate issue. I thought that it calls the same org-set-tag, hence did not think it needs to spawn the issue list. @kaushalmodi, could you start that issue, perhaps?

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 29, 2015

Owner

I just tried org-agenda-bulk-action, and it works with ivy-mode on in the same way as with ivy-mode off. It doesn't offer any tags for completion, but at least if you input the correct tag, it makes the correct change.

Owner

abo-abo commented Jul 29, 2015

I just tried org-agenda-bulk-action, and it works with ivy-mode on in the same way as with ivy-mode off. It doesn't offer any tags for completion, but at least if you input the correct tag, it makes the correct change.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 29, 2015

Yeah, this was a bit cheeky on my part, I should have told you that. I thought you could find a work-around. I did ask this question here. There is a bit larger tag issue asked on the org mailings list and copied here.

If there is no quick fix using 'counsel', this issue may indeed belong elsewhere.

Yeah, this was a bit cheeky on my part, I should have told you that. I thought you could find a work-around. I did ask this question here. There is a bit larger tag issue asked on the org mailings list and copied here.

If there is no quick fix using 'counsel', this issue may indeed belong elsewhere.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 29, 2015

counsel-org-tag-agenda works with a minor quirk:
I have the following: org-use-tag-inheritance is a variable defined in org.el. Its value is t.
This allows not to set tags to subheadings, saving some typing and time.

However, it seems to append an extra : to the last tag in the list in agenda view. Having two : breaks counsel-org-tag-agenda so, that it does not list the tags already on the subheading. This means removal of such tags is impossible.

Here is a test file with relevant tags. These are scheduled, so they appear in the agenda. Once in the agenda, the tag on the subheading looks like so:

It occurred to me that this behaviour is intended. If org-use-tag-inheritance is t, then subheadings should not be candidates for tag removal. I have not tested a scenario, where an additional to iherited tags is added. This I will test tomorrow.

counsel-org-tag-agenda works with a minor quirk:
I have the following: org-use-tag-inheritance is a variable defined in org.el. Its value is t.
This allows not to set tags to subheadings, saving some typing and time.

However, it seems to append an extra : to the last tag in the list in agenda view. Having two : breaks counsel-org-tag-agenda so, that it does not list the tags already on the subheading. This means removal of such tags is impossible.

Here is a test file with relevant tags. These are scheduled, so they appear in the agenda. Once in the agenda, the tag on the subheading looks like so:

It occurred to me that this behaviour is intended. If org-use-tag-inheritance is t, then subheadings should not be candidates for tag removal. I have not tested a scenario, where an additional to iherited tags is added. This I will test tomorrow.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo Jul 30, 2015

Looks like the non-inherited tags show up for removal as expected.

Looks like the non-inherited tags show up for removal as expected.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 30, 2015

Owner

OK, this thread has become too long to bear.
As a summary:

  1. counsel-org-tag should work now in files and in agenda for adding tags.
  2. ivy-mode doesn't give completion candidates (but still works) for agenda bulk action.
  3. counsel-org-tag has some trouble with org-use-tag-inheritance.

I'm closing this issue since it was mainly related to item 1 and is now fixed. Feel free to open new issues for items 2 and 3. But add good minimal examples, since I'm not actually using tags in my Org workflow, so I'm not familiar with all these settings and situations.

Owner

abo-abo commented Jul 30, 2015

OK, this thread has become too long to bear.
As a summary:

  1. counsel-org-tag should work now in files and in agenda for adding tags.
  2. ivy-mode doesn't give completion candidates (but still works) for agenda bulk action.
  3. counsel-org-tag has some trouble with org-use-tag-inheritance.

I'm closing this issue since it was mainly related to item 1 and is now fixed. Feel free to open new issues for items 2 and 3. But add good minimal examples, since I'm not actually using tags in my Org workflow, so I'm not familiar with all these settings and situations.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Dec 7, 2016

Are there official docs/snippets for setting up (1.)? I've been looking through these associated issues and can't get the completion to work.

ghost commented Dec 7, 2016

Are there official docs/snippets for setting up (1.)? I've been looking through these associated issues and can't get the completion to work.

@narendraj9

This comment has been minimized.

Show comment
Hide comment
@narendraj9

narendraj9 Nov 16, 2017

@abo-abo How can I remove tags with counsel-org-tag or counsel-org-tag-agenda?

narendraj9 commented Nov 16, 2017

@abo-abo How can I remove tags with counsel-org-tag or counsel-org-tag-agenda?

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Nov 16, 2017

Owner

@narendraj9 select them again, it's a toggle. C-M-m is useful here.

Owner

abo-abo commented Nov 16, 2017

@narendraj9 select them again, it's a toggle. C-M-m is useful here.

@narendraj9

This comment has been minimized.

Show comment
Hide comment
@narendraj9

narendraj9 Nov 16, 2017

@abo-abo Thanks, it works. I started using ivy, swiper and counsel today. Where can I find more bindings like C-M-m?

narendraj9 commented Nov 16, 2017

@abo-abo Thanks, it works. I started using ivy, swiper and counsel today. Where can I find more bindings like C-M-m?

@narendraj9

This comment has been minimized.

Show comment
Hide comment
@narendraj9

narendraj9 Nov 16, 2017

Thanks for these wonderful packages! :)

Thanks for these wonderful packages! :)

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Nov 16, 2017

Owner

Where can I find more bindings like C-M-m?

The manual is at http://oremacs.com/swiper/. Also here: https://github.com/abo-abo/swiper/blob/master/doc/ivy.org.

Owner

abo-abo commented Nov 16, 2017

Where can I find more bindings like C-M-m?

The manual is at http://oremacs.com/swiper/. Also here: https://github.com/abo-abo/swiper/blob/master/doc/ivy.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment