mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-26 07:33:39 +00:00
ox: Change order of retured elements in `org-export-get-previous-element'
* lisp/ox.el (org-export-get-previous-element): Change order of retured elements in `org-export-get-previous-element'. * testing/lisp/test-ox.el: Update test.
This commit is contained in:
parent
7cd6fdcd34
commit
367e680582
@ -4800,8 +4800,8 @@ a communication channel. Return previous exportable element or
|
||||
object, a string, or nil.
|
||||
|
||||
When optional argument N is a positive integer, return a list
|
||||
containing up to N siblings before BLOB, from closest to
|
||||
farthest. With any other non-nil value, return a list containing
|
||||
containing up to N siblings before BLOB, from farthest to
|
||||
closest. With any other non-nil value, return a list containing
|
||||
all of them."
|
||||
(let ((siblings
|
||||
;; An object can belong to the contents of its parent or
|
||||
@ -4823,10 +4823,10 @@ all of them."
|
||||
(cond ((memq obj (plist-get info :ignore-list)))
|
||||
((null n) (throw 'exit obj))
|
||||
((not (wholenump n)) (push obj prev))
|
||||
((zerop n) (throw 'exit (nreverse prev)))
|
||||
((zerop n) (throw 'exit prev))
|
||||
(t (decf n) (push obj prev))))
|
||||
(cdr (memq blob (reverse siblings))))
|
||||
(nreverse prev))))
|
||||
prev)))
|
||||
|
||||
(defun org-export-get-next-element (blob info &optional n)
|
||||
"Return next element or object.
|
||||
|
@ -2340,7 +2340,7 @@ Another text. (ref:text)
|
||||
(org-element-type
|
||||
(org-export-get-previous-element
|
||||
(org-element-map
|
||||
(plist-get info :title) 'plain-text 'identity info t) info)))))
|
||||
(plist-get info :title) 'plain-text 'identity info t) info)))))
|
||||
;; Find previous element in parsed affiliated keywords.
|
||||
(should
|
||||
(eq 'verbatim
|
||||
@ -2351,7 +2351,7 @@ Another text. (ref:text)
|
||||
;; With optional argument N, return a list containing up to
|
||||
;; N previous elements.
|
||||
(should
|
||||
(equal '(bold italic underline)
|
||||
(equal '(underline italic bold)
|
||||
(org-test-with-parsed-data "_a_ /b/ *c* ~d~"
|
||||
(mapcar 'car
|
||||
(org-export-get-previous-element
|
||||
@ -2359,7 +2359,7 @@ Another text. (ref:text)
|
||||
;; When N is a positive integer, return a list containing up to
|
||||
;; N previous elements.
|
||||
(should
|
||||
(equal '(bold italic)
|
||||
(equal '(italic bold)
|
||||
(org-test-with-parsed-data "_a_ /b/ *c* ~d~"
|
||||
(mapcar 'car
|
||||
(org-export-get-previous-element
|
||||
|
Loading…
Reference in New Issue
Block a user