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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: org-mode; Reported by: pinkanon pinkanon <pinkanon.pinkanon@HIDDEN>; dated Sun, 24 Mar 2019 16:35:01 UTC; Maintainer for org-mode is emacs-orgmode@HIDDEN.
bug reassigned from package 'emacs' to 'org-mode'. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Mar 2019 16:34:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 24 12:34:11 2019
Received: from localhost ([127.0.0.1]:56971 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h864Z-0001PL-I8
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 12:34:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51612)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pinkanon.pinkanon@HIDDEN>) id 1h864X-0001P4-5b
 for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 12:34:11 -0400
Received: from lists.gnu.org ([209.51.188.17]:42562)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <pinkanon.pinkanon@HIDDEN>)
 id 1h864R-00081k-U3
 for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 12:34:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37756)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <pinkanon.pinkanon@HIDDEN>) id 1h864Q-0000I8-Gn
 for bug-gnu-emacs@HIDDEN; Sun, 24 Mar 2019 12:34:03 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 RCVD_IN_DNSWL_LOW,URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <pinkanon.pinkanon@HIDDEN>) id 1h864P-00081G-F1
 for bug-gnu-emacs@HIDDEN; Sun, 24 Mar 2019 12:34:02 -0400
Received: from forward400p.mail.yandex.net ([77.88.28.105]:57709)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <pinkanon.pinkanon@HIDDEN>)
 id 1h864O-00080c-NH
 for bug-gnu-emacs@HIDDEN; Sun, 24 Mar 2019 12:34:01 -0400
Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net
 [IPv6:2a02:6b8:0:1a2d::1d])
 by forward400p.mail.yandex.net (Yandex) with ESMTP id 41CEB1BC101B
 for <bug-gnu-emacs@HIDDEN>; Sun, 24 Mar 2019 19:33:56 +0300 (MSK)
Received: from localhost (localhost [::1])
 by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 7KBbt1WcUg-XtRutITp; 
 Sun, 24 Mar 2019 19:33:55 +0300
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
 t=1553445235; bh=iZ3AefYxZZJe0pPLdiowo9nWHUvbhBwbZ3NiRhPK+Xs=;
 h=Message-Id:Date:Subject:To:From;
 b=ANI/HyX8JXB+9nE1NEft+vwX7sfrzMpNuq5WIMaZG1K5/VWxoAOyNmn5EUBmw+Kij
 aWEXA/wB4F+6aI8eynUY4N6yBmbPPzbifdLI/a5msIFzxbfxtnMRTKDAeNiEN2+qwh
 Ng2rXCwmhtQWa8yDVrcYYMhFaQkimeKKxQdgGrZY=
Authentication-Results: mxback3o.mail.yandex.net; dkim=pass header.i=@yandex.ru
Received: by iva1-3d0d937e850f.qloud-c.yandex.net with HTTP;
 Sun, 24 Mar 2019 19:33:55 +0300
From: pinkanon pinkanon <pinkanon.pinkanon@HIDDEN>
Envelope-From: pinkanon-pinkanon@HIDDEN
To: bug-gnu-emacs@HIDDEN
Subject: org-edit-src-code undesirable behaviour
MIME-Version: 1.0
X-Mailer: Yamail [ http://yandex.ru ] 5.0
Date: Sun, 24 Mar 2019 18:33:55 +0200
Message-Id: <3260071553445235@HIDDEN>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 77.88.28.105
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

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?




Acknowledgement sent to pinkanon pinkanon <pinkanon.pinkanon@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#34977; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 24 Mar 2019 17:00:02 UTC

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