Merge branch 'maint'
This commit is contained in:
commit
88101ef434
|
@ -4492,7 +4492,6 @@ indentation is not done with TAB characters."
|
||||||
(let* ((min-ind most-positive-fixnum)
|
(let* ((min-ind most-positive-fixnum)
|
||||||
find-min-ind ; For byte-compiler.
|
find-min-ind ; For byte-compiler.
|
||||||
(find-min-ind
|
(find-min-ind
|
||||||
(function
|
|
||||||
;; Return minimal common indentation within BLOB. This is
|
;; Return minimal common indentation within BLOB. This is
|
||||||
;; done by walking recursively BLOB and updating MIN-IND
|
;; done by walking recursively BLOB and updating MIN-IND
|
||||||
;; along the way. FIRST-FLAG is non-nil when the first
|
;; along the way. FIRST-FLAG is non-nil when the first
|
||||||
|
@ -4503,18 +4502,19 @@ indentation is not done with TAB characters."
|
||||||
(dolist (object (org-element-contents blob))
|
(dolist (object (org-element-contents blob))
|
||||||
(when (and first-flag (stringp object))
|
(when (and first-flag (stringp object))
|
||||||
(setq first-flag nil)
|
(setq first-flag nil)
|
||||||
(string-match "\\`\\( *\\)" object)
|
(string-match "\\` *" object)
|
||||||
(let ((len (length (match-string 1 object))))
|
(let ((len (match-end 0)))
|
||||||
;; An indentation of zero means no string will be
|
;; An indentation of zero means no string will be
|
||||||
;; modified. Quit the process.
|
;; modified. Quit the process.
|
||||||
(if (zerop len) (throw 'zero (setq min-ind 0))
|
(if (zerop len) (throw 'zero (setq min-ind 0))
|
||||||
(setq min-ind (min len min-ind)))))
|
(setq min-ind (min len min-ind)))))
|
||||||
(cond
|
(cond
|
||||||
((stringp object)
|
((stringp object)
|
||||||
(dolist (line (delq "" (cdr (org-split-string object " *\n"))))
|
(dolist (line (cdr (org-split-string object " *\n")))
|
||||||
(setq min-ind (min (org-get-indentation line) min-ind))))
|
(unless (string= line "")
|
||||||
|
(setq min-ind (min (org-get-indentation line) min-ind)))))
|
||||||
((memq (org-element-type object) org-element-recursive-objects)
|
((memq (org-element-type object) org-element-recursive-objects)
|
||||||
(funcall find-min-ind object first-flag))))))))
|
(funcall find-min-ind object first-flag)))))))
|
||||||
;; Find minimal indentation in ELEMENT.
|
;; Find minimal indentation in ELEMENT.
|
||||||
(catch 'zero (funcall find-min-ind element (not ignore-first)))
|
(catch 'zero (funcall find-min-ind element (not ignore-first)))
|
||||||
(if (or (zerop min-ind) (= min-ind most-positive-fixnum)) element
|
(if (or (zerop min-ind) (= min-ind most-positive-fixnum)) element
|
||||||
|
|
|
@ -2957,6 +2957,11 @@ Text
|
||||||
'(paragraph nil " Two spaces\n" (verbatim nil "V") "\n Two spaces")
|
'(paragraph nil " Two spaces\n" (verbatim nil "V") "\n Two spaces")
|
||||||
(org-element-normalize-contents
|
(org-element-normalize-contents
|
||||||
'(paragraph nil " Two spaces\n " (verbatim nil "V") "\n Two spaces"))))
|
'(paragraph nil " Two spaces\n " (verbatim nil "V") "\n Two spaces"))))
|
||||||
|
(should
|
||||||
|
(equal
|
||||||
|
'(verse-block nil "line 1\n\nline 2")
|
||||||
|
(org-element-normalize-contents
|
||||||
|
'(verse-block nil " line 1\n\n line 2"))))
|
||||||
;; Recursively enter objects in order to compute common indentation.
|
;; Recursively enter objects in order to compute common indentation.
|
||||||
(should
|
(should
|
||||||
(equal
|
(equal
|
||||||
|
|
Loading…
Reference in New Issue