emacs-helm / emacs-helm/helm-org

helm-completing-read-handlers-alist: Use "org-set-tags-command" instead of "org-set-tags"

Open
#3 6 comments 5 reactions 1 assignee Claimed by @alphapapa View on GitHub
Dominant language
Emacs Lisp
Stars
58
Forks
9
PR merge metrics
No merged PRs in 30d

Description

I copied this issue from the helm project [0] to the helm-org project:

When using org-mode 9.2 and higher, set-tags was broken. It was displaying the
set of tags correctly when a heading had no tags. However, if a heading had 1+ tags
already, then Helm was not displaying the list of available tags.

I think I found the issue (it's quite simple). The `org-set-tags` function is not called by
org-mode when pressing C-c C-q. The function is called `org-set-tags-command`.

Adding the entry
`(org-set-tags-command . helm-org-completing-read-tags)` to `helm-completing-read-handlers-alist`
fixed the problem.

https://github.com/emacs-helm/helm-org/blob/bc27669fdc699e65d5162b6e0a0d1bc1d87250a3/helm-org.el#L38

However, after looking a bit further, the old emacs versions also called "org-set-tags-command" when pressing C-c C-q.

`org-set-tags-command` calls `org-set-tags`. So, why does this fix work? Any more insight is appreciated.

I don't know enough about the magic of Helm to know why this fix works (being
that org versions 9.1.x and 9.2.x both call org-set-tags-command which calls
org-set-tags.

The definitions of org-set-tags-command and org-set-tags changed quite a bit
from org 9.1.x to Org 9.2.x. One difference that I notice is that the old version of
org-set-tags [1] was an (interactive) function and the new version of org-set-tags is
not [2].

Any ideas?

[1] 9.1.14 https://code.orgmode.org/bzg/org-mode/src/release_9.1.14/lisp/org.el#L14883
[2] 9.2.5 https://code.orgmode.org/bzg/org-mode/src/master/lisp/org.el#L12334

Possibly related issues:
https://github.com/emacs-helm/helm/issues/2063

Spacemacs issue:
syl20bnr/spacemacs#3738

[0] https://github.com/emacs-helm/helm/issues/2183

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.