org-element: Remove now useless function
* lisp/org-element.el (org-element-remove-indentation): Mark as an obsolete replacement for `org-remove-indentation'. (org-element-example-block-parser): (org-element-example-block-interpreter): (org-element-src-block-parser): * lisp/ox.el (org-export-unravel-code): Apply obsolescence.
This commit is contained in:
parent
44cb8b1656
commit
348890f79b
|
@ -43,12 +43,18 @@ details.
|
||||||
** New functions
|
** New functions
|
||||||
~org-show-children~ is a faster implementation of
|
~org-show-children~ is a faster implementation of
|
||||||
~outline-show-children~.
|
~outline-show-children~.
|
||||||
|
** Removed functions
|
||||||
|
*** ~org-element-remove-indentation~ in an obsolete alias for ~org-remove-indentation~
|
||||||
** Removed options
|
** Removed options
|
||||||
*** Remove ~org-list-empty-line-terminates-plain-lists~
|
*** Remove ~org-list-empty-line-terminates-plain-lists~
|
||||||
Two consecutive blank lines always terminate all levels of current
|
Two consecutive blank lines always terminate all levels of current
|
||||||
plain list.
|
plain list.
|
||||||
*** ~fixltx2e~ is removed from ~org-latex-default-packages-alist~
|
*** ~fixltx2e~ is removed from ~org-latex-default-packages-alist~
|
||||||
fixltx2e is obsolete, see LaTeX News 22.
|
fixltx2e is obsolete, see LaTeX News 22.
|
||||||
|
** Miscellaneous
|
||||||
|
*** Function ~org-remove-indentation~ changes.
|
||||||
|
The new algorithm doesn't remove TAB characters not used for
|
||||||
|
indentation.
|
||||||
* Version 8.3
|
* Version 8.3
|
||||||
|
|
||||||
** Incompatible changes
|
** Incompatible changes
|
||||||
|
|
|
@ -1898,7 +1898,7 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent',
|
||||||
(post-affiliated (point))
|
(post-affiliated (point))
|
||||||
(block-ind (progn (skip-chars-forward " \t") (current-column)))
|
(block-ind (progn (skip-chars-forward " \t") (current-column)))
|
||||||
(contents-begin (progn (forward-line) (point)))
|
(contents-begin (progn (forward-line) (point)))
|
||||||
(value (org-element-remove-indentation
|
(value (org-remove-indentation
|
||||||
(org-unescape-code-in-string
|
(org-unescape-code-in-string
|
||||||
(buffer-substring-no-properties
|
(buffer-substring-no-properties
|
||||||
contents-begin contents-end))
|
contents-begin contents-end))
|
||||||
|
@ -1933,7 +1933,7 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent',
|
||||||
(if (or org-src-preserve-indentation
|
(if (or org-src-preserve-indentation
|
||||||
(org-element-property :preserve-indent example-block))
|
(org-element-property :preserve-indent example-block))
|
||||||
value
|
value
|
||||||
(org-element-remove-indentation value))))
|
(org-remove-indentation value))))
|
||||||
"#+END_EXAMPLE")))
|
"#+END_EXAMPLE")))
|
||||||
|
|
||||||
|
|
||||||
|
@ -2404,7 +2404,7 @@ Assume point is at the beginning of the block."
|
||||||
;; Indentation.
|
;; Indentation.
|
||||||
(block-ind (progn (skip-chars-forward " \t") (current-column)))
|
(block-ind (progn (skip-chars-forward " \t") (current-column)))
|
||||||
;; Retrieve code.
|
;; Retrieve code.
|
||||||
(value (org-element-remove-indentation
|
(value (org-remove-indentation
|
||||||
(org-unescape-code-in-string
|
(org-unescape-code-in-string
|
||||||
(buffer-substring-no-properties
|
(buffer-substring-no-properties
|
||||||
(progn (forward-line) (point)) contents-end))
|
(progn (forward-line) (point)) contents-end))
|
||||||
|
@ -5954,35 +5954,9 @@ end of ELEM-A."
|
||||||
(move-overlay (car o) (- (nth 1 o) offset) (- (nth 2 o) offset))))
|
(move-overlay (car o) (- (nth 1 o) offset) (- (nth 2 o) offset))))
|
||||||
(goto-char (org-element-property :end elem-B)))))
|
(goto-char (org-element-property :end elem-B)))))
|
||||||
|
|
||||||
(defun org-element-remove-indentation (s &optional n)
|
;; For backward-compatibility with Org < 8.4
|
||||||
"Remove maximum common indentation in string S and return it.
|
(define-obsolete-function-alias
|
||||||
When optional argument N is a positive integer, remove exactly
|
'org-element-remove-indentation 'org-remove-indentation "25.1")
|
||||||
that much characters from indentation, if possible, or return
|
|
||||||
S as-is otherwise. Unlike to `org-remove-indentation', this
|
|
||||||
function doesn't call `untabify' on S."
|
|
||||||
(catch 'exit
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert s)
|
|
||||||
(goto-char (point-min))
|
|
||||||
;; Find maximum common indentation, if not specified.
|
|
||||||
(setq n (or n
|
|
||||||
(let ((min-ind (point-max)))
|
|
||||||
(save-excursion
|
|
||||||
(while (re-search-forward "^[ \t]*\\S-" nil t)
|
|
||||||
(let ((ind (1- (current-column))))
|
|
||||||
(if (zerop ind) (throw 'exit s)
|
|
||||||
(setq min-ind (min min-ind ind))))))
|
|
||||||
min-ind)))
|
|
||||||
(if (zerop n) s
|
|
||||||
;; Remove exactly N indentation, but give up if not possible.
|
|
||||||
(while (not (eobp))
|
|
||||||
(let ((ind (progn (skip-chars-forward " \t") (current-column))))
|
|
||||||
(cond ((eolp) (delete-region (line-beginning-position) (point)))
|
|
||||||
((< ind n) (throw 'exit s))
|
|
||||||
(t (org-indent-line-to (- ind n))))
|
|
||||||
(forward-line)))
|
|
||||||
(buffer-string)))))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'org-element)
|
(provide 'org-element)
|
||||||
|
|
|
@ -4353,7 +4353,7 @@ reference on that line (string)."
|
||||||
(if (or org-src-preserve-indentation
|
(if (or org-src-preserve-indentation
|
||||||
(org-element-property :preserve-indent element))
|
(org-element-property :preserve-indent element))
|
||||||
value
|
value
|
||||||
(org-element-remove-indentation value)))))
|
(org-remove-indentation value)))))
|
||||||
;; Get format used for references.
|
;; Get format used for references.
|
||||||
(label-fmt (regexp-quote
|
(label-fmt (regexp-quote
|
||||||
(or (org-element-property :label-fmt element)
|
(or (org-element-property :label-fmt element)
|
||||||
|
|
Loading…
Reference in New Issue