emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Weiner <rsw@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Gregor Zattler <grfz@gmx.de>,
	emacs-orgmode@gnu.org, hyperbole-users@gnu.org
Subject: Re: [BUG] hyperbole action key on path name results in org-element-cache warning [9.6-pre (release_9.5.5-997-ge58bd0 @ /home/grfz/src/org-mode/lisp/)]
Date: Sun, 11 Dec 2022 13:13:10 -0500	[thread overview]
Message-ID: <CA+OMD9jO6f=NRJ3eoX8y+50ymipGKuN+iT=0iaqts+Oe4SEf1Q@mail.gmail.com> (raw)
In-Reply-To: <87czak1ex8.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 1929 bytes --]

Hi Ihor:

So if we want to determine the Org type of an element outside of an Org
buffer (when using org-type minor modes for example), how would we change
this 'let' code:

 (let* ((context
         ;; Only consider supported types, even if they are not
         ;; the closest one.
         (org-element-lineage
          ;; Next line can trigger an error when `looking-at' is called
          ;; with a `nil' value of `org-complex-heading-regexp'.
          (org-element-context)
          '(clock footnote-definition footnote-reference headline
            inlinetask link timestamp)
          t))
        (type (org-element-type context))
     ...)

Thanks,

Bob

On Sat, Oct 22, 2022 at 3:53 AM Ihor Radchenko <yantar92@posteo.net> wrote:

> Gregor Zattler <grfz@gmx.de> writes:
>
> > Dear org-mode and hyperbole developers, hitting hyperbole's
> > action-key with point in "~/src/org-mode/contrilb/lisp" in a
> > *Pp Eval Output* buffer holding my complete load-path
> > resulted in this org-element--cache warning:
> >
> >  ■  Warning (org-element-cache): org-element--cache: Org parser error in
> *Pp Eval Output*::5288. Resetting.
> >  The error was: (error "rx ‘**’ range error")
> >  Backtrace:
> > "  backtrace-to-string(nil)
> >   org-element-at-point()
> >   org-element-context()
> >   hsys-org-link-at-p()
>
> This is a hyperbole bug.
> The latest version of Org no longer supports calling
> org-element-at-point in non-Org buffers. Previously it worked by
> accident and did not throw an error.
>
> I recommend using regexp constants from Org to match against org-like
> constructs outside Org mode buffers.
>
> --
> 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>
>
>

[-- Attachment #2: Type: text/html, Size: 3486 bytes --]

  reply	other threads:[~2022-12-11 18:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 22:28 [BUG] hyperbole action key on path name results in org-element-cache warning [9.6-pre (release_9.5.5-997-ge58bd0 @ /home/grfz/src/org-mode/lisp/)] Gregor Zattler
2022-10-22  7:43 ` Ihor Radchenko
2022-12-11 18:13   ` Robert Weiner [this message]
2022-12-12 11:47     ` Ihor Radchenko

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='CA+OMD9jO6f=NRJ3eoX8y+50ymipGKuN+iT=0iaqts+Oe4SEf1Q@mail.gmail.com' \
    --to=rsw@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=grfz@gmx.de \
    --cc=hyperbole-users@gnu.org \
    --cc=rswgnu@gmail.com \
    --cc=yantar92@posteo.net \
    /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).