emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Spencer Russell <spencer.f.russell@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: `comment-line` within a SRC block moves point to beginning of block [9.2 (9.2-43-gf9a8cc-elpaplus)]
Date: Tue, 29 Jan 2019 21:32:28 +0100	[thread overview]
Message-ID: <87zhrjdx2b.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <1548704097.24632.1645495648.784E662C@webmail.messagingengine.com> (Spencer Russell's message of "Mon, 28 Jan 2019 14:34:57 -0500")

Hello,

Spencer Russell <spencer.f.russell@gmail.com> 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:
> ```
> (save-excursion
>   (org-babel-do-in-edit-buffer
>     (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.

Regards,
-- 
Nicolas Goaziou

  reply	other threads:[~2019-01-29 20:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28 19:34 Bug: `comment-line` within a SRC block moves point to beginning of block [9.2 (9.2-43-gf9a8cc-elpaplus)] Spencer Russell
2019-01-29 20:32 ` Nicolas Goaziou [this message]
2019-01-30 14:46   ` Spencer Russell
2019-01-30 21:13     ` Nicolas Goaziou
2019-01-30 21:22       ` kadal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zhrjdx2b.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=spencer.f.russell@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).