emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Garid Zorigoo <garidzorigoo@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] A custom org-num-format-function causes org-latex-preview warn when it called. [9.6.15 (release_9.6.15 @ /usr/share/emacs/29.3/lisp/org/)]
Date: Sat, 13 Apr 2024 17:34:16 +0900	[thread overview]
Message-ID: <CAEDgBW4GMfmpt4-W6eDRh7POAPd5DrARBtUsfuLRQ7VBvtuuPw@mail.gmail.com> (raw)

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

* What I'm experiencing:
A custom ~org-num-format-function~ causes ~org-latex-preview~ warn when it
is called.

* Exact "Warning" I'm getting.
⛔ Warning (org-element-cache): org-element--cache: Org parser error in
ask.org::648. Resetting.
 The error was: (error "Invalid search bound (wrong side of point)")
 Backtrace:
nil

* Info about when this Warning comes:
- Warning comes up when equation change from "previewed-state (image)" back
to "text-state"
- Warning only comes when the equation is changed.

* Setup (the custom ~org-num-format-function~)
#+begin_src elisp
(defun my/org-num-format (numbering)
    (concat
     (number-to-string (car numbering)) "." (mapconcat (lambda (x) (format
"%02d" x)) (cdr numbering) ".") " "))

(setq org-num-format-function #'my/org-num-format)
#+end_src

#+RESULTS:
: my/org-num-format

* To Reproduce

1. Change the org-num-format-function as written above
2. (In org-file) Turn-on ~org-num-mode~
3. (In org-file) On any equation, change it.
4. run ~org-latex-preview~ to preview the equation image.
5, run ~org-latex-preview~ go back to text mode. (here warning comes)
(If warning doesn't appear try from step 3 again)
(When org-num-mode turned off, it doesn't produce warning)

   $\alpha$


Emacs  : GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.41, cairo version 1.18.0)
Package: Org mode version 9.6.15 (release_9.6.15 @
/usr/share/emacs/29.3/lisp/org/)

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

             reply	other threads:[~2024-04-13  8:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-13  8:34 Garid Zorigoo [this message]
2024-04-13 13:00 ` [BUG] A custom org-num-format-function causes org-latex-preview warn when it called. [9.6.15 (release_9.6.15 @ /usr/share/emacs/29.3/lisp/org/)] Ihor Radchenko
2024-04-19 12:20   ` 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=CAEDgBW4GMfmpt4-W6eDRh7POAPd5DrARBtUsfuLRQ7VBvtuuPw@mail.gmail.com \
    --to=garidzorigoo@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).