[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Bug: `comment-line` within a SRC block moves point to beginning
Re: [O] Bug: `comment-line` within a SRC block moves point to beginning of block [9.2 (9.2-43-gf9a8cc-elpaplus)]
Tue, 29 Jan 2019 21:32:28 +0100
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Spencer Russell <address@hidden> writes:
> I've been trying to troubleshoot an issue where running `comment-line`
> within a SRC block moves point to the beginning of the block, rather
> than after the commented line.
> I've boiled it down to a reproduction that duplicates the root cause.
> Open an org document, put point in a SRC block on some line besides the
> first, and run the following:
> (insert "FOO")))
> This duplicates what happens in `org-comment-or-uncomment-region`
> in `org.el`.
> This will add "FOO" to point, as expected, but point jumps to the
> beginning of the block (at least on my setup). According to the docs of
> `org-edit-src-code`, which is used by `org-babel-do-in-edit-buffer`, it
> removes the original code and replaces it with the edited code. That
> seems like the source of the problem, because the marker saved by `save-
> excursion` is lost.
FWIW, I cannot reproduce it.