From: Ihor Radchenko <yantar92@posteo.net>
To: "Christopher M. Miles" <numbchild@gmail.com>
Cc: Org mode <emacs-orgmode@gnu.org>
Subject: Re: Let `org-element-at-point` or `org-element-context` return element type "tags" when point on tags.
Date: Sun, 07 Apr 2024 12:02:27 +0000 [thread overview]
Message-ID: <87jzl9nzxo.fsf@localhost> (raw)
In-Reply-To: <661252e4.170a0220.59420.c9cb@mx.google.com>
"Christopher M. Miles" <numbchild@gmail.com> writes:
> When I move point on the headline tags position. I evaluate
> `(org-element-at-point)` or `(org-element-context)`, both return element
> type is `(headline ....)`. I hope those two functions can return more
> explicit element type like "tags".
> I tried to find this type API function in existing functions. But I have
> not found. If someone knows, please let me know. I use this function to
> detect whether current point is on tags element. I try to write a simple
> extension to display tag explanation info through eldoc.
There is currently no such function.
We do not parse headline tags as a separate syntax node - they are
considered an integral part of the headline node.
In future, there is a possibility that more fine-grained information can
be obtained using WIP library org-element-match:
https://git.sr.ht/~yantar92/org-mode/tree/feature/org-font-lock-element/item/lisp/org-element-match.el#L715
For now, you may have to use regular expression for fine-grained information.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
prev parent reply other threads:[~2024-04-07 12:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-07 8:01 Let `org-element-at-point` or `org-element-context` return element type "tags" when point on tags Christopher M. Miles
2024-04-07 12:02 ` Ihor Radchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzl9nzxo.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=numbchild@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).