From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: bug#34977: org-edit-src-code undesirable behaviour Date: Sun, 05 May 2019 12:24:57 +0200 Message-ID: <875zqpfbba.fsf@nicolasgoaziou.fr> References: <3260071553445235@iva1-3d0d937e850f.qloud-c.yandex.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:48391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNELM-00042n-V1 for emacs-orgmode@gnu.org; Sun, 05 May 2019 06:26:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNELL-0007Kc-2P for emacs-orgmode@gnu.org; Sun, 05 May 2019 06:26:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNELK-0007KQ-L9 for emacs-orgmode@gnu.org; Sun, 05 May 2019 06:26:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNELK-0003zw-Eq for emacs-orgmode@gnu.org; Sun, 05 May 2019 06:26:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <3260071553445235@iva1-3d0d937e850f.qloud-c.yandex.net> (pinkanon pinkanon's message of "Sun, 24 Mar 2019 18:33:55 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: pinkanon pinkanon Cc: 34977@debbugs.gnu.org Hello, pinkanon pinkanon 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