emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
@ 2022-12-09 16:48 Justin Silverman
  2022-12-10  9:25 ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Justin Silverman @ 2022-12-09 16:48 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 21031 bytes --]

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

<https://orgmode.org/manual/Feedback.html#Feedback>

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

texmathp when used in org-mode seems to have problems with multiline align* environments.

Consider the following math environment: 


\begin{align*}
y_{i} &\sim f(\mu_{i}) \\ 
|
\end{align*}

where cursor is at `|'. With cursor at this point try `(texmathp)'. I get `nil'. It seems to only be a problem on the start of a blank line.

Notably, I don't have the same problem if the major-mode is LaTeX-mode. Moreover, if I run `(advice-remove 'texmathp 'org--math-always-on)' then everything works as expected. 

So it seems to me this is some bug in the org--math-always-on advice... no? 

Emacs  : GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6)
 of 2022-09-12
Package: Org mode version 9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)

current state:
`============'
(setq
 org-noter--doc-goto-location-hook '(org-noter-pdftools--doc-goto-location)
 org-roam-db-location "/home/jds6696/.emacs.d/var/org/org-roam.db"
 org-noter--check-location-property-hook '(org-noter-pdftools--check-link)
 org-msg-attached-file-reference "see[ 	\n]\\(?:the[ 	\n]\\)?\\(?:\\w+[ 	\n]\\)\\{0,3\\}\\(?:attached\\|enclosed\\)\\|(\\(?:attached\\|enclosed\\))\\|\\(?:attached\\|enclosed\\)[ 	\n]\\(?:for\\|is\\)[ 	\n]"
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "~/Dropbox/org"
 org-cite-insert-processor 'citar
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"]
 org-pdftools-get-desc-function 'org-pdftools-get-desc-default
 org-agenda-custom-commands '(("d" "Custom Day View"
			       ((agenda ""
				 ((org-agenda-span 'day)
				  (org-agenda-skip-function
				   '(lambda nil (interactive) (skip-tag "mail")))
				  )
				 )
				(todo "NEXT"
				 ((org-agenda-sorting-strategy `(priority-down effort-down))
				  (org-agenda-overriding-header "Next")
				  (org-agenda-skip-function '(org-agenda-skip-entry-if 'timestamp)))
				 )
				(agenda ""
				 ((org-agenda-span 'day) (org-agenda-overriding-header "Mail")
				  (org-agenda-format-date "")
				  (org-agenda-skip-function
				   '(lambda nil (interactive) (skip-not-tag "mail")))
				  )
				 )
				(tags-todo "REFILE"
				 ((org-agenda-overriding-header "To Refile")
				  (org-tags-match-list-sublevels nil))
				 )
				)
			       )
			      ("n" "Next Items"
			       ((todo "NEXT"
				 ((org-agenda-sorting-strategy `(priority-down effort-down))
				  (org-agenda-overriding-header "Next"))
				 )
				)
			       )
			      )
 org-agenda-skip-scheduled-if-done t
 org-agenda-files '("/home/jds6696/Dropbox/org/cal-gmail.org" "/home/jds6696/Dropbox/org/cal-psu.org"
		    "/home/jds6696/Dropbox/org/calendar.org" "/home/jds6696/Dropbox/org/inbox.org"
		    "/home/jds6696/Dropbox/org/inbox_mobile.org" "/home/jds6696/Dropbox/org/mail.org"
		    "/home/jds6696/Dropbox/org/meetings_anarres.org"
		    "/home/jds6696/Dropbox/org/meetings_psu.org"
		    "/home/jds6696/Dropbox/org/mtx-andrew.org"
		    "/home/jds6696/Dropbox/org/mtx-kyle.org"
		    "/home/jds6696/Dropbox/org/mtx-michelle.org"
		    "/home/jds6696/Dropbox/org/mtx-zhaoma.org" "/home/jds6696/Dropbox/org/notes.org"
		    "/home/jds6696/Dropbox/org/tasks.org")
 org-capture-templates '(("#" "used by gnus-icalendar-org" entry
			  (file+olp "~/Dropbox/org/calendar.org" "Calendar") "%i" :immediate-finish t)
			 ("t" "todo")
			 ("ta" "todo with attachment" entry (file "~/Dropbox/org/inbox.org")
			  "* TODO %?\n %U\n %a")
			 ("te" "todo tweaks" entry (file+headline "~/Dropbox/org/tasks.org" "Emacs")
			  "* TODO %? :TWEAKS:\n %U")
			 ("tt" "plain todo" entry (file "~/Dropbox/org/inbox.org") "* TODO %?\n %U")
			 ("m" "meetings")
			 ("ma" "meeting anarres" entry
			  (file+olp+datetree "~/Dropbox/org/meetings_anarres.org")
			  "* MEETING with %? - %u :MEETING:\n %U" :jump-to-captured t :tree-type month)
			 ("mp" "meeting psu" entry
			  (file+olp+datetree "~/Dropbox/org/meetings_psu.org")
			  "* MEETING %u with %? :MEETING:\n " :jump-to-captured t :tree-type month)
			 ("mP" "meeting specific person")
			 ("mPm" "meeting Michelle" entry
			  (file+olp+datetree "~/Dropbox/org/mtx-michelle.org")
			  "* MEETING %u with Michelle :MEETING:w_michelle:\n** TRAM Manuscript :p_tram:\n** ALDEx2 Manuscript :p_tram:\n** Bacteremia :p_bacteremia:\n** Decision Theory :p_bdt:\n** Chicken Microbiome :p_chicken:\n" :jump-to-captured t :tree-type month)
			 ("mPa" "meeting Andrew" entry
			  (file+olp+datetree "~/Dropbox/org/mtx-andrew.org")
			  "* MEETING %u with Andrew :MEETING:w_andrew:\n  %?" :jump-to-captured t
			  :tree-type month)
			 ("mPd" "meeting DIHI" entry
			  (file+olp+datetree "~/Dropbox/org/mtx-michelle.org")
			  "* MEETING %u with DIHI :MEETING:w_michelle:p_bacteremia:\n  %?"
			  :jump-to-captured t :tree-type month)
			 ("mPk" "meeting Kyle" entry (file+olp+datetree "~/Dropbox/org/mtx-kyle.org")
			  "* MEETING %u with Kyle :MEETING:w_kyle:\n** cGSEA :p_cgsea:\n** Effective Scale Models :p_effscalemod:\n** Future Plans \n  %?" :jump-to-captured t :tree-type month)
			 ("mPz" "meeting Zhao Ma" entry
			  (file+olp+datetree "~/Dropbox/org/mtx-zhaoma.org")
			  "* MEETING %u with Zhao Ma :MEETING:w_zhao:\n  %?" :jump-to-captured t
			  :tree-type month)
			 ("c" "calendar event")
			 ("cc" "plain event" entry
			  (file+headline "~/Dropbox/org/calendar.org" "Calendar") "* %? \n %^T")
			 ("ca" "event with attachment" entry
			  (file+headline "~/Dropbox/org/calendar.org" "Calendar") "* %? \n %^T\n %a")
			 ("n" "note" entry (file+headline "~/Dropbox/org/notes.org" "Notes")
			  "* %? \n %U")
			 ("P" "Protocol")
			 ("Pw" "Capture Website" entry (file "~/Dropbox/org/inbox.org")
			  "* TODO %:annotation \n %i %?")
			 )
 org-roam-node-display-template #("${title:200} ${tags:30}" 13 23 (face org-tag))
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-super-links-search-function 'org-super-links-get-location
 org-refile-targets '((nil :maxlevel . 9) (org-agenda-files :maxlevel . 9))
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-default-notes-file "~/Dropbox/org/inbox.org"
 org-roam-find-file-hook '(org-roam-buffer--setup-redisplay-h
			   org-roam--register-completion-functions-h
			   org-roam--replace-roam-links-on-save-h
			   org-roam-db-autosync--setup-update-on-save-h)
 org-refile-use-outline-path 'file
 org-publish-timestamp-directory "/home/jds6696/.emacs.d/var/org/timestamps/"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cite-follow-processor 'citar
 org-noter-pdftools-markup-pointer-function 'pdf-annot-add-highlight-markup-annotation
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
		  org-cycle-optimize-window-after-visibility-change org-cycle-display-inline-images)
 org-noter--note-after-tipping-point-hook '(org-noter-pdftools--note-after-tipping-point)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-msg-options "html-postamble:nil num:nil ^:{} toc:nil author:nil email:nil \\n:t tex:dvipng eval:nil"
 org-link-from-user-regexp "\\<jds6696@lenovoGen4Sil\\>"
 org-image-actual-width nil
 org-mode-hook '(jds~org-cdlatex-hook-function org-pdftools-setup-link aas-activate-for-major-mode
		 evil-collection-mu4e-org-set-header-to-normal-mode evil-tex-mode turn-on-org-cdlatex
		 #[0 "\301\211\207" [imenu-create-index-function org-imenu-get-tree] 2]
		 org-appear-mode
		 (closure (t) nil
		  (add-hook 'evil-insert-state-entry-hook #'org-appear-manual-start nil t)
		  (add-hook 'evil-insert-state-exit-hook #'org-appear-manual-stop nil t))
		 evil-org-mode org-fragtog-mode er/add-org-mode-expansions
		 #[0 "\300\301\302\303\304$\207"
		   [add-hook change-major-mode-hook org-fold-show-all append local] 5]
		 #[0 "\300\301\302\303\304$\207"
		   [add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
		 org-babel-result-hide-spec org-babel-hide-all-hashes org-eldoc-load
		 embrace-org-mode-hook)
 org-babel-load-languages '((R . t) (emacs-lisp . t) (latex . t) (org . t) (shell . t) (stan . t))
 org-agenda-skip-deadline-if-done t
 org-src-window-setup 'plain
 org-id-locations-file "/home/jds6696/.emacs.d/var/org/id-locations.el"
 org-roam-ref-annotation-function 'org-roam-ref-read--annotation
 org-roam-directory "~/Dropbox/org/roam"
 org-noter--pretty-print-location-hook '(org-noter-pdftools--pretty-print-location)
 org-export-allow-bind-keywords t
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-ellipsis " ▾"
 org-roam-db-node-include-function '(closure (t) nil (not (member "ROAM_EXCLUDE" (org-get-tags))))
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-appear-trigger 'manual
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-msg-default-alternatives '((new text html) (reply-to-html text html) (reply-to-text text))
 org-stuck-projects '("/PROJ" ("NEXT" "TODO") nil "SCHEDULED:")
 org-startup-indented t
 org-ctrl-c-ctrl-c-final-hook '(org-msg-ctrl-c-ctrl-c)
 org-fold-catch-invisible-edits 'error
 org-latex-classes '(("beamer" "\\documentclass[presentation]{beamer}"
		      ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")
		      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
		     ("article" "\\documentclass[11pt]{article}" ("\\section{%s}" . "\\section*{%s}")
		      ("\\subsection{%s}" . "\\subsection*{%s}")
		      ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
		      ("\\paragraph{%s}" . "\\paragraph*{%s}")
		      ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
		     ("report" "\\documentclass[11pt]{report}" ("\\part{%s}" . "\\part*{%s}")
		      ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}")
		      ("\\subsection{%s}" . "\\subsection*{%s}")
		      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
		     ("book" "\\documentclass[11pt]{book}" ("\\part{%s}" . "\\part*{%s}")
		      ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}")
		      ("\\subsection{%s}" . "\\subsection*{%s}")
		      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
		     )
 org-highlight-latex-and-related '(latex entities)
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-agenda-mode-hook '(jds~org-agenda-local-bindings evil-org-agenda-set-keys
			(closure (t) nil (visual-line-mode -1)) hl-line-mode
			(closure ((mode . org-agenda-mode-hook) (--dolist-tail--) bootstrap-version t)
			 nil (display-line-numbers-mode 0))
			)
 org-roam-capture-preface-hook '(org-roam-dailies--override-capture-time-h
				 org-roam-capture--try-capture-to-ref-h)
 org-startup-truncated nil
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-capture-prepare-finalize-hook '(org-roam-capture--install-finalize-h)
 org-complete-tags-always-offer-all-agenda-tags t
 org-latex-packages-alist '(("" "minted" t))
 org-roam-preview-function 'org-roam-preview-default-function
 org-babel-tangle-lang-exts '(("latex" . "tex") ("emacs-lisp" . "el") ("elisp" . "el"))
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-appear-autolinks t
 org-roam-db-autosync-mode t
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-window-setup 'current-window
 org-latex-src-block-backend 'minted
 org-cycle-separator-lines 0
 org-log-buffer-setup-hook '(org-roam-log--setup)
 org-cite-activate-processor 'citar
 org-hide-leading-stars t
 org-src-block-faces '(("emacs-lisp" modus-themes-nuanced-magenta)
		       ("elisp" modus-themes-nuanced-magenta) ("clojure" modus-themes-nuanced-magenta)
		       ("clojurescript" modus-themes-nuanced-magenta) ("c" modus-themes-nuanced-blue)
		       ("c++" modus-themes-nuanced-blue) ("sh" modus-themes-nuanced-green)
		       ("shell" modus-themes-nuanced-green) ("html" modus-themes-nuanced-yellow)
		       ("xml" modus-themes-nuanced-yellow) ("css" modus-themes-nuanced-red)
		       ("scss" modus-themes-nuanced-red) ("python" modus-themes-nuanced-green)
		       ("ipython" modus-themes-nuanced-magenta) ("r" modus-themes-nuanced-cyan)
		       ("yaml" modus-themes-nuanced-cyan) ("conf" modus-themes-nuanced-cyan)
		       ("docker" modus-themes-nuanced-cyan))
 org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "MAYBE(m)" "PROJ(p)" "|" "DONE(d)" "CANCELED(c)")
		     (sequence "WAITING(w)" "HOLD(h)" "|" "MEETING(M)"))
 org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id
 org-roam-capture-new-node-hook '(orb--insert-captured-ref-h org-roam-capture--insert-captured-ref-h)
 org-noter-insert-heading-hook '(org-noter-pdftools--insert-heading)
 org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate)
 org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
 org-clock-persist-file "/home/jds6696/.emacs.d/var/org/clock-persist.el"
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-roam-bibtex-mode t
 org-msg-convert-citation t
 org-priority-default 67
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-persist-directory "/home/jds6696/.emacs.d/var/org/persist/"
 org-export-backends '(ascii html icalendar latex odt org)
 org-noter-notes-mode-hook '(jds~org-noter-bindings)
 org-latex-minted-options '(("bgcolor" "bg") ("frame" "lines"))
 org-confirm-babel-evaluate nil
 org-fold-core-isearch-open-function 'org-fold--isearch-reveal
 org-export-with-smart-quotes t
 org-cite-export-processors '((latex biblatex) (t csl))
 org-capture-before-finalize-hook '((closure (t) nil (org-align-tags t))
				    (closure
				     ((mode . org-capture-before-finalize-hook) (--dolist-tail--)
				      bootstrap-version t)
				     nil (display-line-numbers-mode 0))
				    )
 org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function
 org-pdftools-markup-pointer-function 'pdf-annot-add-underline-markup-annotation
 org-noter--convert-to-location-cons-hook '(org-noter-pdftools--convert-to-location-cons)
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-link-shell-confirm-function 'yes-or-no-p
 org-agenda-finalize-hook '(fw/org-agenda-to-appt)
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-attach-id-dir "~/Dropbox/org/.attach"
 org-todo-keyword-faces '(("TODO" :foreground "orange" :weight bold)
			  ("NEXT" :foreground "red" :weight bold)
			  ("DONE" :foreground "forest green" :weight bold)
			  ("PROJ" :foreground "light blue" :weight bold)
			  ("MAYBE" :foreground "light orange" :weight bold)
			  ("WAITING" :foreground "orange" :weight bold)
			  ("CANCELED" :foreground "magenta" :weight bold)
			  ("HOLD" :foreground "magenta" :weight bold)
			  ("MEETING" :foreground "forest green" :weight bold))
 org-cite-global-bibliography '("~/Dropbox/org/roam/references/references.bib")
 org-noter--get-precise-info-hook '(org-noter-pdftools--get-precise-info)
 org-capture-mode-hook '(evil-insert-state)
 org-noter--parse-location-property-hook '(org-noter-pdftools--parse-link)
 org-noter-notes-search-path '("~/Dropbox/org/roam/references/notes/")
 org-msg-startup "hidestars indent inlineimages"
 org-occur-hook '(org-first-headline-recenter)
 org-capture-after-finalize-hook '(orb-make-notes-cache)
 org-roam-log-setup-hook '(org-roam--register-completion-functions-h)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-treat-S-cursor-todo-selection-as-state-change nil
 org-noter--doc-approx-location-hook '(org-noter-pdftools--doc-approx-location)
 org-roam-node-annotation-function 'org-roam-node-read--annotation
 org-link-parameters '(("helpful" :store helpful--org-link-store)
		       ("pdf" :follow org-pdftools-open :complete org-pdftools-complete-link :store
			org-pdftools-store-link :export org-pdftools-export)
		       ("emacs-slack" :follow ol/slack-follow-link :export ol/slack-export :store
			ol/slack-store-link)
		       ("roam" :follow org-roam-link-follow-link)
		       ("attachment" :follow org-attach-follow :complete org-attach-complete-link)
		       ("mu4e" :follow mu4e-org-open :store mu4e-org-store-link)
		       ("zoom" :follow jds~launch-zoom-by-conference-number)
		       ("eww" :follow org-eww-open :store org-eww-store-link)
		       ("rmail" :follow org-rmail-open :store org-rmail-store-link)
		       ("mhe" :follow org-mhe-open :store org-mhe-store-link)
		       ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export)
		       ("info" :follow org-info-open :export org-info-export :store
			org-info-store-link :insert-description org-info-description-as-command)
		       ("gnus" :follow org-gnus-open :store org-gnus-store-link)
		       ("docview" :follow org-docview-open :export org-docview-export :store
			org-docview-store-link)
		       ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
		       ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
			org-bbdb-complete-link :store org-bbdb-store-link)
		       ("w3m" :store org-w3m-store-link)
		       ("doi" :follow org-link-doi-open :export org-link-doi-export)
		       ("id" :follow org-roam-id-open) ("file+sys") ("file+emacs")
		       ("shell" :follow org-link--open-shell)
		       ("news" :follow
			#[514 "\301\300\302Q\"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"])
		       ("mailto" :follow
			#[514 "\301\300\302Q\"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]
			)
		       ("https" :follow
			#[514 "\301\300\302Q\"\207" ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"])
		       ("http" :follow
			#[514 "\301\300\302Q\"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"])
		       ("ftp" :follow
			#[514 "\301\300\302Q\"\207" ["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"])
		       ("help" :follow helpful--org-link-follow :store org-link--store-help)
		       ("file" :complete org-link-complete-file)
		       ("elisp" :follow org-link--open-elisp))
 org-roam-ui-browser-function 'browse-url
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-roam-capture-templates '(("d" "default" plain "%?" :if-new
			       (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
				"#+title: ${title}\n#+date: %U\n#+STARTUP: latexpreview\n")
			       :unnarrowed t)
			      ("l" "lecturenotes" plain "%?" :if-new
			       (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
				"#+title: %u ${title}\n#+date: %U\n#+filetags: :lecture:\n#+STARTUP: latexpreview\n")
			       :unnarrowed t :jump-to-captured t)
			      ("r" "bibliography reference" plain
			       (file "~/.emacs.d/capture-templates/org-roam-bibtex-noter-template.org")
			       :target
			       (file+head "references/notes/${citekey}.org"
				"#+title: ${author-abbrev} :: ${title}\n#+filetags: :reference:\n#+STARTUP: latexpreview\n")
			       :unnarrowed t)
			      )
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-agenda-skip-additional-timestamps-same-entry t
 org-refile-allow-creating-parent-nodes 'confirm
 org-use-fast-todo-selection t
 org-noter--relative-position-to-view-hook '(org-noter-pdftools--relative-position-to-view)
 org-latex-pdf-process '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
			 "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
			 "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")
 org-return-follows-link t
 org-outline-path-complete-in-steps nil
 org-msg-mode t
 org-noter-always-create-frame nil
 org-special-ctrl-a/e t
 org-tags-column -70
 org-agenda-current-time-string ">>>>>>>>>> NOW <<<<<<<<<<"
 org-attach-store-link-p 'attached
 org-agenda-block-separator nil
 org-roam-indirect-buffer-hook '(org-roam--register-completion-functions-h)
 org-refile-target-verify-function 'bh/verify-refile-target
 org-noter-kill-frame-at-session-end nil
 )

[-- Attachment #1.2.1: Type: text/html, Size: 25051 bytes --]

[-- Attachment #1.2.2: latexKc7TUK_7a83e2e9546ab500caa28fc5bb9093fe128c15a8.png --]
[-- Type: image/png, Size: 607 bytes --]

[-- Attachment #1.2.3: latexDlsTdN_70e4ace3b4586773196b2531edcc3db9d2aeacdf.png --]
[-- Type: image/png, Size: 525 bytes --]

[-- Attachment #1.2.4: latexkmrOwH_caf9c102f2109e1ad071b818099f0dcde0d6e7fe.png --]
[-- Type: image/png, Size: 483 bytes --]

[-- Attachment #1.2.5: latexvgufzI_1ebee24d4fcc4b7904e0e045922167e6df16d879.png --]
[-- Type: image/png, Size: 1001 bytes --]

[-- Attachment #1.2.6: latexJKuoJa_1ebee24d4fcc4b7904e0e045922167e6df16d879.png --]
[-- Type: image/png, Size: 1001 bytes --]

[-- Attachment #1.2.7: latexddMNEH_1ebee24d4fcc4b7904e0e045922167e6df16d879.png --]
[-- Type: image/png, Size: 1001 bytes --]

[-- Attachment #1.2.8: latexWcW7hS_dc06cccd021026b1e334ca436327af0faa3dfca0.png --]
[-- Type: image/png, Size: 645 bytes --]

[-- Attachment #1.2.9: latexFR7xsg_1c6d454e7f77b335d19e18ce83e014bbf1d5e60e.png --]
[-- Type: image/png, Size: 240098 bytes --]

[-- Attachment #1.2.10: latexP33gR2_4df3b72f8e9da2fe94e65bc25e29640ba7ab38e7.png --]
[-- Type: image/png, Size: 1923 bytes --]

[-- Attachment #1.2.11: latexxHFqRf_1baba453f46a62ec4ded04356cc649aabf994d48.png --]
[-- Type: image/png, Size: 5709 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
  2022-12-09 16:48 [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)] Justin Silverman
@ 2022-12-10  9:25 ` Ihor Radchenko
  2022-12-13 19:48   ` Justin Silverman
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2022-12-10  9:25 UTC (permalink / raw)
  To: Justin Silverman; +Cc: emacs-orgmode

Justin Silverman <jsilve24@gmail.com> writes:

> texmathp when used in org-mode seems to have problems with multiline align* environments.
>
> Consider the following math environment: 
>
>
> \begin{align*}
> y_{i} &\sim f(\mu_{i}) \\ 
> |
> \end{align*}
>
> where cursor is at `|'. With cursor at this point try `(texmathp)'. I get `nil'. It seems to only be a problem on the start of a blank line.

Thanks for reporting!
Fixed on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f01390cf0

-- 
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>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
  2022-12-10  9:25 ` Ihor Radchenko
@ 2022-12-13 19:48   ` Justin Silverman
  2022-12-14  8:15     ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Justin Silverman @ 2022-12-13 19:48 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

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

Thanks for the quick response. I just had a chance to check it out. Unfortunately (unless I am mistaken), with the change, `texmathp' is now always returning t... which is not very helpful.

Justin 

Ihor Radchenko <yantar92@posteo.net> writes:

> Justin Silverman <jsilve24@gmail.com> writes:
>
>> texmathp when used in org-mode seems to have problems with multiline align* environments.
>>
>> Consider the following math environment: 
>>
>>
>> \begin{align*}
>> y_{i} &~ f(mu_{i}) 
>> |
>> \end{align*}
>>
>> where cursor is at `|'. With cursor at this point try `(texmathp)'. I get `nil'. It seems to only
>> be a problem on the start of a blank line.
>
> Thanks for reporting!
> Fixed on main.
> <https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f01390cf0>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
  2022-12-13 19:48   ` Justin Silverman
@ 2022-12-14  8:15     ` Ihor Radchenko
  2022-12-18 15:17       ` Justin Silverman
  2023-01-06 10:45       ` Daniel Fleischer
  0 siblings, 2 replies; 10+ messages in thread
From: Ihor Radchenko @ 2022-12-14  8:15 UTC (permalink / raw)
  To: Justin Silverman; +Cc: emacs-orgmode

Justin Silverman <jsilve24@gmail.com> writes:

> Thanks for the quick response. I just had a chance to check it out. Unfortunately (unless I am mistaken), with the change, `texmathp' is now always returning t... which is not very helpful.

Not exactly. I just tried to follow the docstring

(defun org--math-always-on (orig-fun &rest args)
  "Always return t in Org buffers.
This is because we want to insert math symbols without dollars even outside
the LaTeX math segments.  If Org mode thinks that point is actually inside
an embedded LaTeX fragment, let `texmathp' do its job.
`\\[org-cdlatex-mode-map]'"

So, `texmathp' will return t outside latex, inside inline latex, and
_maybe_ inside latex environments. Only inside latex environments, Org
delegates the job to `textmathp'.

Let me know if this change broke any real workflows.

-- 
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>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
  2022-12-14  8:15     ` Ihor Radchenko
@ 2022-12-18 15:17       ` Justin Silverman
  2023-01-06 10:45       ` Daniel Fleischer
  1 sibling, 0 replies; 10+ messages in thread
From: Justin Silverman @ 2022-12-18 15:17 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

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

That makes sense. Yes it breaks some of my snippets which have a condition texmathp (I don't write latex without enclosing in latex math environment in org).
Its an easy enough fix for me though:

(add-hook 'org-cdlatex-mode-hook
	  (lambda () (advice-remove 'texmathp 'org--math-always-on)))

does the trick.

Justin 

Ihor Radchenko <yantar92@posteo.net> writes:

> Justin Silverman <jsilve24@gmail.com> writes:
>
>> Thanks for the quick response. I just had a chance to check it out. Unfortunately (unless I am mistaken), with the change, `texmathp' is now always returning t... which is not very helpful.
>
> Not exactly. I just tried to follow the docstring
>
> (defun org--math-always-on (orig-fun &rest args)
>   "Always return t in Org buffers.
> This is because we want to insert math symbols without dollars even outside
> the LaTeX math segments.  If Org mode thinks that point is actually inside
> an embedded LaTeX fragment, let `texmathp' do its job.
> `\\[org-cdlatex-mode-map]'"
>
> So, `texmathp' will return t outside latex, inside inline latex, and
> _maybe_ inside latex environments. Only inside latex environments, Org
> delegates the job to `textmathp'.
>
> Let me know if this change broke any real workflows.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
  2022-12-14  8:15     ` Ihor Radchenko
  2022-12-18 15:17       ` Justin Silverman
@ 2023-01-06 10:45       ` Daniel Fleischer
  2023-01-07 11:23         ` Ihor Radchenko
  1 sibling, 1 reply; 10+ messages in thread
From: Daniel Fleischer @ 2023-01-06 10:45 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Justin Silverman, emacs-orgmode

I just found this thread after math-related things stopped working. I
have two use cases that don't work now:

1. Inserting a dollar pair $$ using `cdlatex-dollar` (it thinks we're
inside a math environment).

2. Inserting of cdlatex environments using their built-in completions, e.g.
        ali<TAB>
        eqn<TAB>
   stopped working.

Previously org-cdlatex worked perfectly, you could insert \alpha using
`a and it compiled to HTML/latex (without $$), have $...$ compiled into
an inline equation and insert latex environment like
\begin{align}...\end{align} without explicit math environment and was
also compiled perfectly to HTML/latex.

-- 
Daniel Fleischer


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
  2023-01-06 10:45       ` Daniel Fleischer
@ 2023-01-07 11:23         ` Ihor Radchenko
  2023-01-07 13:49           ` Daniel Fleischer
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2023-01-07 11:23 UTC (permalink / raw)
  To: Daniel Fleischer; +Cc: Justin Silverman, emacs-orgmode

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

Daniel Fleischer <danflscr@gmail.com> writes:

> I just found this thread after math-related things stopped working. I
> have two use cases that don't work now:
>
> 1. Inserting a dollar pair $$ using `cdlatex-dollar` (it thinks we're
> inside a math environment).
>
> 2. Inserting of cdlatex environments using their built-in completions, e.g.
>         ali<TAB>
>         eqn<TAB>
>    stopped working.

Thanks for reporting!
So, the docstring was erroneous at the end.

Can you try to test the attached patch?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-cdlatex-mode-Fix-regression-from-f01390cf05.patch --]
[-- Type: text/x-patch, Size: 3600 bytes --]

From bce44c75b73fa0b935a9f991624a292e061f5c73 Mon Sep 17 00:00:00 2001
Message-Id: <bce44c75b73fa0b935a9f991624a292e061f5c73.1673090538.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Sat, 7 Jan 2023 14:17:26 +0300
Subject: [PATCH] org-cdlatex-mode: Fix regression from f01390cf05

* lisp/org.el (org--math-always-on): Rename to `org--math-p' and only
override `texmathp' when current command is `cdlatex-math-symbol' or
when we are inside Org LaTeX math fragment.  Only these two scenarios
are the places where `texmathp' may not work properly in Org files.
We must not return t outside latex fragments as initially suggested by
the docstring because it would break, for example, `cdlatex-dollar'
command.
(org-cdlatex-mode): Use the new function name for advice.
* lisp/org-compat.el (org--math-always-on): Declare obsolete.

Reported-by: Daniel Fleischer <danflscr@gmail.com>
Link: https://orgmode.org/list/m2cz7sj5zt.fsf@gmail.com
---
 lisp/org-compat.el |  3 +++
 lisp/org.el        | 27 ++++++++++++++++-----------
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 6c5085255..0f6dc831a 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -568,6 +568,9 @@ (defun org-let2 (list1 list2 &rest body) ;FIXME: Where did our karma go?
 (make-obsolete 'org-let "to be removed" "9.6")
 (make-obsolete 'org-let2 "to be removed" "9.6")
 
+(define-obsolete-function-alias 'org--math-always-on
+  'org--math-p "9.7")
+
 (defun org-compatible-face (inherits specs)
   "Make a compatible face specification.
 If INHERITS is an existing face and if the Emacs version supports
diff --git a/lisp/org.el b/lisp/org.el
index ae6250e52..44c41a729 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15434,13 +15434,15 @@ (define-minor-mode org-cdlatex-mode
     (cdlatex-compute-tables))
   (unless org-cdlatex-texmathp-advice-is-done
     (setq org-cdlatex-texmathp-advice-is-done t)
-    (advice-add 'texmathp :around #'org--math-always-on)))
+    (advice-add 'texmathp :around #'org--math-p)))
 
-(defun org--math-always-on (orig-fun &rest args)
-  "Always return t in Org buffers.
-This is because we want to insert math symbols without dollars even outside
-the LaTeX math segments.  If Org mode thinks that point is actually inside
-an embedded LaTeX fragment, let `texmathp' do its job.
+(defun org--math-p (orig-fun &rest args)
+  "Return t inside math fragments or running `cdlatex-math-symbol'.
+This function is intended to be an :around advice for `texmathp'.
+
+If Org mode thinks that point is actually inside
+an embedded LaTeX environment, return t when the environment is math
+or let `texmathp' do its job otherwise.
 `\\[org-cdlatex-mode-map]'"
   (interactive)
   (cond
@@ -15450,11 +15452,14 @@ (defun org--math-always-on (orig-fun &rest args)
     t)
    (t
     (let ((element (org-element-context)))
-      (or (not (org-inside-LaTeX-fragment-p element))
-          (if (not (eq (org-element-type element) 'latex-fragment))
-              (apply orig-fun args)
-            (setq texmathp-why '("Org mode embedded math" . 0))
-	    t))))))
+      (when (org-inside-LaTeX-fragment-p element)
+        (pcase (substring-no-properties
+                (org-element-property :value element)
+                0 2)
+          ((or "\\(" "\\[" (pred (string-match-p (rx string-start "$"))))
+           (setq texmathp-why '("Org mode embedded math" . 0))
+           t)
+          (_ (apply orig-fun args))))))))
 
 (defun turn-on-org-cdlatex ()
   "Unconditionally turn on `org-cdlatex-mode'."
-- 
2.38.1


[-- Attachment #3: Type: text/plain, Size: 224 bytes --]


-- 
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>

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
  2023-01-07 11:23         ` Ihor Radchenko
@ 2023-01-07 13:49           ` Daniel Fleischer
  2023-01-07 15:03             ` Ihor Radchenko
  2023-01-11 11:00             ` Ihor Radchenko
  0 siblings, 2 replies; 10+ messages in thread
From: Daniel Fleischer @ 2023-01-07 13:49 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Justin Silverman, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Can you try to test the attached patch?

Looks good. Now these work again: `cdlatex-dollar`, inserting symbols
using ` outside math environments and inserting cdlatex environments
with completion also outside math environments. Need to make sure the
issue of the OP didn't regress.

BTW, I haven't follow any discussions about org syntax and math
environments inside org (the use of \...[\] instead $...$ etc.) These
usecases I mentioned are what I'm used to and perhaps they are not
consistent with changes made to the org syntax, demanding every math
should be inside a math environment for easier parsing and you still
managed to solve that without all the previous regexps.

Thank you,

-- 
Daniel Fleischer


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
  2023-01-07 13:49           ` Daniel Fleischer
@ 2023-01-07 15:03             ` Ihor Radchenko
  2023-01-11 11:00             ` Ihor Radchenko
  1 sibling, 0 replies; 10+ messages in thread
From: Ihor Radchenko @ 2023-01-07 15:03 UTC (permalink / raw)
  To: Daniel Fleischer; +Cc: Justin Silverman, emacs-orgmode

Daniel Fleischer <danflscr@gmail.com> writes:

> BTW, I haven't follow any discussions about org syntax and math
> environments inside org (the use of \...[\] instead $...$ etc.) These
> usecases I mentioned are what I'm used to and perhaps they are not
> consistent with changes made to the org syntax, demanding every math
> should be inside a math environment for easier parsing and you still
> managed to solve that without all the previous regexps.

We did not make changes to syntax. Just decided to aim towards less
visibility of $..$ in the documentation.

At the end, we don't want to break existing documents, just to
discourage people from using $...$ syntax.

-- 
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>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)]
  2023-01-07 13:49           ` Daniel Fleischer
  2023-01-07 15:03             ` Ihor Radchenko
@ 2023-01-11 11:00             ` Ihor Radchenko
  1 sibling, 0 replies; 10+ messages in thread
From: Ihor Radchenko @ 2023-01-11 11:00 UTC (permalink / raw)
  To: Daniel Fleischer; +Cc: Justin Silverman, emacs-orgmode

Daniel Fleischer <danflscr@gmail.com> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> Can you try to test the attached patch?
>
> Looks good. Now these work again: `cdlatex-dollar`, inserting symbols
> using ` outside math environments and inserting cdlatex environments
> with completion also outside math environments. Need to make sure the
> issue of the OP didn't regress.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=dfcf500df

-- 
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>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-01-11 11:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-09 16:48 [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)] Justin Silverman
2022-12-10  9:25 ` Ihor Radchenko
2022-12-13 19:48   ` Justin Silverman
2022-12-14  8:15     ` Ihor Radchenko
2022-12-18 15:17       ` Justin Silverman
2023-01-06 10:45       ` Daniel Fleischer
2023-01-07 11:23         ` Ihor Radchenko
2023-01-07 13:49           ` Daniel Fleischer
2023-01-07 15:03             ` Ihor Radchenko
2023-01-11 11:00             ` Ihor Radchenko

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).