mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 20:07:46 +00:00
Merge branch 'maint'
This commit is contained in:
commit
23aa910259
|
@ -2495,6 +2495,7 @@ LIMIT bounds the search.
|
||||||
Return value is a cons cell whose CAR is `entity' or
|
Return value is a cons cell whose CAR is `entity' or
|
||||||
`latex-fragment' and CDR is beginning position."
|
`latex-fragment' and CDR is beginning position."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
(unless (bolp) (backward-char))
|
||||||
(let ((matchers
|
(let ((matchers
|
||||||
(remove "begin" (plist-get org-format-latex-options :matchers)))
|
(remove "begin" (plist-get org-format-latex-options :matchers)))
|
||||||
;; ENTITY-RE matches both LaTeX commands and Org entities.
|
;; ENTITY-RE matches both LaTeX commands and Org entities.
|
||||||
|
@ -3189,6 +3190,7 @@ LIMIT bounds the search.
|
||||||
Return value is a cons cell whose CAR is either `subscript' or
|
Return value is a cons cell whose CAR is either `subscript' or
|
||||||
`superscript' and CDR is beginning position."
|
`superscript' and CDR is beginning position."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
(unless (bolp) (backward-char))
|
||||||
(when (re-search-forward org-match-substring-regexp limit t)
|
(when (re-search-forward org-match-substring-regexp limit t)
|
||||||
(cons (if (string= (match-string 2) "_") 'subscript 'superscript)
|
(cons (if (string= (match-string 2) "_") 'subscript 'superscript)
|
||||||
(match-beginning 2)))))
|
(match-beginning 2)))))
|
||||||
|
@ -3984,8 +3986,14 @@ type, as a symbol.
|
||||||
|
|
||||||
OBJECTS is the previous candidates alist."
|
OBJECTS is the previous candidates alist."
|
||||||
;; Filter out any object found but not belonging to RESTRICTION.
|
;; Filter out any object found but not belonging to RESTRICTION.
|
||||||
(setq objects (org-remove-if-not (lambda (obj) (memq (car obj) restriction))
|
(setq objects
|
||||||
objects))
|
(org-remove-if-not
|
||||||
|
(lambda (obj)
|
||||||
|
(let ((type (car obj)))
|
||||||
|
(memq (or (cdr (assq type org-element-object-successor-alist))
|
||||||
|
type)
|
||||||
|
restriction)))
|
||||||
|
objects))
|
||||||
(let (next-candidates types-to-search)
|
(let (next-candidates types-to-search)
|
||||||
;; If no previous result, search every object type in RESTRICTION.
|
;; If no previous result, search every object type in RESTRICTION.
|
||||||
;; Otherwise, keep potential candidates (old objects located after
|
;; Otherwise, keep potential candidates (old objects located after
|
||||||
|
|
|
@ -1093,7 +1093,13 @@ e^{i\\pi}+1=0
|
||||||
(should
|
(should
|
||||||
(org-test-with-temp-text "\\[a\\]"
|
(org-test-with-temp-text "\\[a\\]"
|
||||||
(org-element-map
|
(org-element-map
|
||||||
(org-element-parse-buffer) 'latex-fragment 'identity)))))
|
(org-element-parse-buffer) 'latex-fragment 'identity)))
|
||||||
|
;; Test fragment at the beginning of an item.
|
||||||
|
(should
|
||||||
|
(eq 'latex-fragment
|
||||||
|
(org-test-with-temp-text "- $x$"
|
||||||
|
(progn (search-forward "$")
|
||||||
|
(org-element-type (org-element-context))))))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Line Break
|
;;;; Line Break
|
||||||
|
@ -1576,7 +1582,19 @@ Outside list"
|
||||||
;; With braces.
|
;; With braces.
|
||||||
(should
|
(should
|
||||||
(org-test-with-temp-text "a_{b}"
|
(org-test-with-temp-text "a_{b}"
|
||||||
(org-element-map (org-element-parse-buffer) 'subscript 'identity))))
|
(org-element-map (org-element-parse-buffer) 'subscript 'identity)))
|
||||||
|
;; At the beginning of an item.
|
||||||
|
(should
|
||||||
|
(eq 'subscript
|
||||||
|
(org-test-with-temp-text "- _b"
|
||||||
|
(progn (search-forward "_")
|
||||||
|
(org-element-type (org-element-context))))))
|
||||||
|
;; Multiple subscripts in a paragraph.
|
||||||
|
(should
|
||||||
|
(= 2
|
||||||
|
(org-test-with-temp-text "a_b and c_d"
|
||||||
|
(length
|
||||||
|
(org-element-map (org-element-parse-buffer) 'subscript 'identity))))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Superscript
|
;;;; Superscript
|
||||||
|
@ -1590,7 +1608,20 @@ Outside list"
|
||||||
;; With braces.
|
;; With braces.
|
||||||
(should
|
(should
|
||||||
(org-test-with-temp-text "a^{b}"
|
(org-test-with-temp-text "a^{b}"
|
||||||
(org-element-map (org-element-parse-buffer) 'superscript 'identity))))
|
(org-element-map (org-element-parse-buffer) 'superscript 'identity)))
|
||||||
|
;; At the beginning of an item.
|
||||||
|
(should
|
||||||
|
(eq 'superscript
|
||||||
|
(org-test-with-temp-text "- ^b"
|
||||||
|
(progn (search-forward "^")
|
||||||
|
(org-element-type (org-element-context))))))
|
||||||
|
;; Multiple superscript in a paragraph.
|
||||||
|
(should
|
||||||
|
(= 2
|
||||||
|
(org-test-with-temp-text "a^b and c^d"
|
||||||
|
(length
|
||||||
|
(org-element-map
|
||||||
|
(org-element-parse-buffer) 'superscript 'identity))))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Table
|
;;;; Table
|
||||||
|
|
Loading…
Reference in a new issue