From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: pinkanon pinkanon <pinkanon.pinkanon@yandex.ru>
Cc: 34977@debbugs.gnu.org
Subject: bug#34977: org-edit-src-code undesirable behaviour
Date: Sun, 05 May 2019 12:24:57 +0200 [thread overview]
Message-ID: <875zqpfbba.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <3260071553445235@iva1-3d0d937e850f.qloud-c.yandex.net> (pinkanon pinkanon's message of "Sun, 24 Mar 2019 18:33:55 +0200")
Hello,
pinkanon pinkanon <pinkanon.pinkanon@yandex.ru> writes:
> There are two things that work undesirably for me when using org-edit-src-code:
> (1) With a selected region, the point in the edit buffer will be one line below the bottom of the selection.
> (2) After closing the edit buffer, if it was modified, the point jumps to the beginning of the block.
> (3) If I wanted to programmatically edit src code in the block, is calling 'org-edit-src-code the right way anyway? Because there seems to be some lag, besides the points mentioned above.
>
> Steps to reproduce:
>
> M-x org-mode
>
> Eval this function:
>
> (defun commit-bad-deeds ()
> (interactive)
> (let* ((p (point))
> (w (get-buffer-window (current-buffer))))
> (org-edit-src-code)
> (gnus-delete-line) ; any code that modifies buffer
> (org-edit-src-exit)
> (set-window-point w p)))
>
> Bind it:
>
> (global-set-key (kbd "M-w") 'commit-bad-deeds)
>
> Paste this code:
>
> #+BEGIN_SRC elisp
> (1) cursor jumps to the beginning of this line
> (2) lawfully-good line to be selected
> (3) and this line to be murdered instead
> (4) w/ no witnesses
> #+END_SRC
>
> - Jump to line (2)
> - Select whole line: (progn (end-of-line) (set-mark (line-beginning-position))) or any other way
> - press M-w
>
> Observe:
> (1) Line (3) removed instead of (2)
> (2) Point jumping to the beginning of the block
> (3) Lag?
I cannot reproduce any of these observations. Could you check that no
other function is interfering?
Regards,
--
Nicolas Goaziou
next parent reply other threads:[~2019-05-05 10:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3260071553445235@iva1-3d0d937e850f.qloud-c.yandex.net>
2019-05-05 10:24 ` Nicolas Goaziou [this message]
2020-05-24 8:19 ` bug#34977: org-edit-src-code undesirable behaviour Bastien
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=875zqpfbba.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=34977@debbugs.gnu.org \
--cc=pinkanon.pinkanon@yandex.ru \
/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).