org-ql icon indicating copy to clipboard operation
org-ql copied to clipboard

Add org-category property when formatting elements.

Open xtofian opened this issue 3 years ago • 1 comments

This allows org-agenda-filter-by-category to work as expected for org-ql-block agendas.

xtofian avatar Nov 22 '21 00:11 xtofian

Thanks.

I'm not sure this will work properly in all cases; I'm guessing it will need to move point to the entry before calling org-get-category, in case an entry has a locally set category property. AFAIK that is allowed in Org, but I'm not sure.

alphapapa avatar Mar 01 '22 10:03 alphapapa

I'm afraid I lost track of this -- very sorry for taking so long to respond!

I've added (org-with-wide-buffer (goto-char marker) ...), is that what you had in mind?

Out of curiosity, org-get-category uses org-with-point-at which looks to me like it also moves point? Is there something else that needs to be done? (Sorry I'm very much an emacs-lisp and org-mode-internals novice)

Thanks for this great package btw!

xtofian avatar Jan 08 '23 07:01 xtofian

@xtofian Thanks for your patience. A few thoughts:

  1. Are we sure that the commented out code that this patch replaces isn't sufficient? i.e. does the org-element not already include the category?
  2. If it is necessary to call org-get-category at the entry, it could probably be as simple as (org-with-point-at MARKER (org-get-category)).

What do you think? Thanks.

alphapapa avatar Mar 10 '23 10:03 alphapapa

Fixed separately in https://github.com/alphapapa/org-ql/commit/a31baebc4ffb75649825683fb1fcf897bf4bebef.

alphapapa avatar Dec 16 '23 11:12 alphapapa