GNU bug report logs - #34977
org-edit-src-code undesirable behaviour

Previous Next

Package: org-mode;

Reported by: pinkanon pinkanon <pinkanon.pinkanon <at> yandex.ru>

Date: Sun, 24 Mar 2019 16:35:01 UTC

Severity: normal

Done: Bastien <bzg <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34977 in the body.
You can then email your comments to 34977 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34977; Package emacs. (Sun, 24 Mar 2019 16:35:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to pinkanon pinkanon <pinkanon.pinkanon <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 24 Mar 2019 16:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: pinkanon pinkanon <pinkanon.pinkanon <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: org-edit-src-code undesirable behaviour
Date: Sun, 24 Mar 2019 18:33:55 +0200
GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.7) of 2019-03-17
Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.1/lisp/org/)

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?




bug reassigned from package 'emacs' to 'org-mode'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 24 Mar 2019 16:49:01 GMT) Full text and rfc822 format available.

Information forwarded to emacs-orgmode <at> gnu.org:
bug#34977; Package org-mode. (Sun, 05 May 2019 10:26:02 GMT) Full text and rfc822 format available.

Message #10 received at 34977 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: pinkanon pinkanon <pinkanon.pinkanon <at> yandex.ru>
Cc: 34977 <at> debbugs.gnu.org
Subject: Re: bug#34977: org-edit-src-code undesirable behaviour
Date: Sun, 05 May 2019 12:24:57 +0200
Hello,

pinkanon pinkanon <pinkanon.pinkanon <at> 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




Reply sent to Bastien <bzg <at> gnu.org>:
You have taken responsibility. (Sun, 24 May 2020 08:20:02 GMT) Full text and rfc822 format available.

Notification sent to pinkanon pinkanon <pinkanon.pinkanon <at> yandex.ru>:
bug acknowledged by developer. (Sun, 24 May 2020 08:20:03 GMT) Full text and rfc822 format available.

Message #15 received at 34977-done <at> debbugs.gnu.org (full text, mbox):

From: Bastien <bzg <at> gnu.org>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 34977-done <at> debbugs.gnu.org, pinkanon pinkanon <pinkanon.pinkanon <at> yandex.ru>
Subject: Re: bug#34977: org-edit-src-code undesirable behaviour
Date: Sun, 24 May 2020 10:19:30 +0200
Hi,

Nicolas Goaziou <mail <at> nicolasgoaziou.fr> writes:

> I cannot reproduce any of these observations. Could you check that no
> other function is interfering?

Well, I tried and could not reproduce this either.

I am closing the bug report.

-- 
 Bastien




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 21 Jun 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.