mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix(org): don't expand latex snippets in latex segments
Yasnippet expanding snippets (on TAB) from another mode can cause org-element warnings. Until this interop is resolved, best to not make TAB too smart. It still works in src blocks, however. Fix: #8363
This commit is contained in:
@ -472,11 +472,9 @@ Made for `org-tab-first-hook'."
|
|||||||
(when (and (modulep! :editor snippets)
|
(when (and (modulep! :editor snippets)
|
||||||
(require 'yasnippet nil t)
|
(require 'yasnippet nil t)
|
||||||
(bound-and-true-p yas-minor-mode))
|
(bound-and-true-p yas-minor-mode))
|
||||||
(let ((major-mode (cond ((org-in-src-block-p t)
|
(let ((major-mode (if (org-in-src-block-p t)
|
||||||
(org-src-get-lang-mode (org-eldoc-get-src-lang)))
|
(org-src-get-lang-mode (org-eldoc-get-src-lang))
|
||||||
((org-inside-LaTeX-fragment-p)
|
major-mode))
|
||||||
'latex-mode)
|
|
||||||
(major-mode)))
|
|
||||||
(org-src-tab-acts-natively nil) ; causes breakages
|
(org-src-tab-acts-natively nil) ; causes breakages
|
||||||
;; Smart indentation doesn't work with yasnippet, and painfully slow
|
;; Smart indentation doesn't work with yasnippet, and painfully slow
|
||||||
;; in the few cases where it does.
|
;; in the few cases where it does.
|
||||||
|
Reference in New Issue
Block a user