Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc for :transfomer #272

Open
hermanhel opened this issue Dec 1, 2024 · 1 comment
Open

doc for :transfomer #272

hermanhel opened this issue Dec 1, 2024 · 1 comment

Comments

@hermanhel
Copy link

hermanhel commented Dec 1, 2024

One important tip I found about using :transformer is that if you prepend any text, you need to make sure the returned string have the proper text-property org-marker at position 0, or org-agenda-goto (usually bound to TAB that let you jump to the headline in file) would not work.

Since this is a must I think it's probably good idea to include in the doc? Following is an example

                 :transformer (let* ((effort (get-text-property 0 'effort it))
                                     (org-marker (get-text-property 0 'org-marker it))
                                     )
                                (concat (propertize (concat "[effort: " effort "]")
                                                    'face 'italic
                                                    'org-marker org-marker ;; (1)
                                                    )
                                        it)
                                )


If remove line (1), in resulting org-agenda buffer, TAB on those lines will show in message org-agenda-error: Command not allowed in this line; if with, will behave as intended and jump to the corresponding position.

@alphapapa
Copy link
Owner

Hello Herman,

Thanks for noticing this; it's a good point.

We could "fix" this by documenting this requirement, but it would probably be better to fix the code to ensure that the necessary text properties are taken from the original string and applied to the transformed string.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants