mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-21 06:55:35 +00:00
org-comment-or-uncomment-region: Fix comment boundaries inside src blocks
* lisp/org.el (org-comment-or-uncomment-region): When calculating region boundaries inside src edit buffer, do not assume that region length does not change - it may, when the indentation inside src edit buffer is different from the Org buffer. Reported-by: Stephanus Comnenus <linjt267@gmail.com> Link: https://orgmode.org/list/CAHqtn=fWq6E5_pm72AB9vFxwjS0a8ma=UvVjMrgeivE9pa13ZQ@mail.gmail.com TINYCHANGE
This commit is contained in:
parent
b457dbfe5a
commit
19d462e7a7
@ -20557,11 +20557,15 @@ strictly within a source block, use appropriate comment syntax."
|
||||
end)))
|
||||
;; Translate region boundaries for the Org buffer to the source
|
||||
;; buffer.
|
||||
(let ((offset (- end beg)))
|
||||
(let (src-end)
|
||||
(save-excursion
|
||||
(goto-char end)
|
||||
(org-babel-do-in-edit-buffer
|
||||
(setq src-end (point))))
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(org-babel-do-in-edit-buffer
|
||||
(comment-or-uncomment-region (point) (+ offset (point))))))
|
||||
(comment-or-uncomment-region (point) src-end))))
|
||||
(save-restriction
|
||||
;; Restrict region
|
||||
(narrow-to-region (save-excursion (goto-char beg)
|
||||
|
Loading…
Reference in New Issue
Block a user