mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-21 06:55:35 +00:00
org-babel-exp-process-buffer: Fix edge case when src block ends at eob
* lisp/ob-exp.el (org-babel-exp-process-buffer): When src block ends at eob, do not leave the #+end_src behind after replacement.
This commit is contained in:
parent
e4902995a0
commit
a13d8fe83b
@ -265,8 +265,9 @@ this template."
|
||||
(if (not (eq type 'babel-call))
|
||||
(progn (skip-chars-forward " \t")
|
||||
(point))
|
||||
(skip-chars-forward " \r\t\n")
|
||||
(line-beginning-position)))))
|
||||
(unless (eobp)
|
||||
(skip-chars-forward " \r\t\n")
|
||||
(line-beginning-position))))))
|
||||
((not rep)
|
||||
;; Replacement code cannot be determined.
|
||||
;; Leave the code block as is.
|
||||
@ -291,8 +292,9 @@ this template."
|
||||
(cond ((not replacement) (goto-char end))
|
||||
((equal replacement "")
|
||||
(goto-char end)
|
||||
(skip-chars-forward " \r\t\n")
|
||||
(forward-line 0)
|
||||
(unless (eobp)
|
||||
(skip-chars-forward " \r\t\n")
|
||||
(forward-line 0))
|
||||
(delete-region begin (point)))
|
||||
(t
|
||||
(if (org-src-preserve-indentation-p element)
|
||||
|
Loading…
Reference in New Issue
Block a user