Skip to content

Embark support #299

@akirak

Description

@akirak

Hello,

I want to get an olp entered from the user in org-ql-completing-read. Specifically, I am thinking of the following use cases:

  • Let the user choose a heading to clock into. If the heading does not exist, fire org-capture with the input as the title.
  • Let the user choose a heading to refile an entry into. If the heading does not exist, create a new heading.

This can be solved by adding a history variable for completing-read in the command. If the function returns nil, the user can get the latest item from the history and split the string with / to get an olp. This is hacky, but it achieves the desired effect with minimal changes to the implementation.

An alternative way is to change

(gethash selected table)

to

(or (gethash selected table)
            (when return-olp
              (split-string selected "/")))

and add :return-olp argument to the function. The extra argument is needed to avoid confusion in normal use cases, but it is more complicated (in API and implementation) than adding the history variable.

What is the best way to solve the problem?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions