From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Deric Bytes Newsgroups: gmane.emacs.bugs Subject: bug#36984: 27.0.50; Calling newline in org src opens org src edit Date: Fri, 9 Aug 2019 15:26:59 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003d3da9058faff890" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160057"; mail-complaints-to="usenet@blaine.gmane.org" To: 36984@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 09 16:28:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hw5sK-000fUH-0S for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Aug 2019 16:28:12 +0200 Original-Received: from localhost ([::1]:59774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw5sI-0000V6-KA for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Aug 2019 10:28:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39941) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw5sD-0000Tm-Iq for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2019 10:28:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hw5sA-0006c2-Ns for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2019 10:28:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34285) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hw5sA-0006bv-KX for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2019 10:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hw5sA-0002PB-FN for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2019 10:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Deric Bytes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Aug 2019 14:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36984 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15653608399189 (code B ref -1); Fri, 09 Aug 2019 14:28:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Aug 2019 14:27:19 +0000 Original-Received: from localhost ([127.0.0.1]:43106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hw5rS-0002O9-LD for submit@debbugs.gnu.org; Fri, 09 Aug 2019 10:27:19 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hw5rQ-0002O1-I4 for submit@debbugs.gnu.org; Fri, 09 Aug 2019 10:27:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39799) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw5rO-0000Pl-JR for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2019 10:27:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hw5rM-0006EI-Jo for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2019 10:27:14 -0400 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:33583) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hw5rM-0006Dn-9h for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2019 10:27:12 -0400 Original-Received: by mail-wm1-x32b.google.com with SMTP id p77so6317435wme.0 for ; Fri, 09 Aug 2019 07:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=/8Rz8jETCqyHV+mG8cEE9WPCfpwMu4HSWXLlZ7dld2o=; b=PbNTO34UX7sOcaN/Evyfgrm7u/AppOiFXI+q86VWV7DHdGWEJA4dYtk9wy89ESDANO Qdg++2HbQfJcQ4uKDh4blcxoU7KxgcM8f6xnQ0eza4Y/erKyDYFE0WBJyLG/hoRWZCG7 qA/ToEizJi3GL0LgMkHJXndfcWYY7iL2IRsOoOSX9o7ATNAqm859V6WuqY1WPvz9Qzd8 LM0koPQdpsAfD4B6HWs4xleVnx8wemmwOH8CPug2YTpkI35gxnrgwTDbG3+WpUs0DCgZ hR0rMQkLTE3KEPWNVskUoI6UTR1nBVmxrBfy5c9HApHrOOR2xtEEnTQwljPOjg2E1s24 6VEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/8Rz8jETCqyHV+mG8cEE9WPCfpwMu4HSWXLlZ7dld2o=; b=LsdYM0kcZw3Dx+nmVsSEvQvTBTpBqg/Qyjaa3Q6vcMf/As1IFtMb4+o2Ennk58ZkNy sav3oyRuMXyI+ltEC8DwIkDHt0YXxbHbzhM/eBJwiFi3qsCO4Qmi7jfCjL0XHhmzHxDF fQ48uh4y2rTC9Nue4rdmL1bM8fHLF+p75Lf868HJ30RmDa1lN+Bigu2tuEBz9UyETKBA dgij6TCJxBHGtLD+W97v+KUbolkLd8K2F6aEUy9lZ5I7YCbFpsztmqjPjVFihk2TZYh5 dT7kVBxfVI13CC1T1Wa6nxUy/v/rrRNZhnO254dxZt3KqVwPG0TkW0jRTuzT6+x9rlrE qOcw== X-Gm-Message-State: APjAAAVwzHxNBA2wteVs1BYplp3AWfpRwZBRp9GIENWOhWAYRAjEi+vU J9gPhrKDi4+PjJ3eECNMzsDLvFI9TKJmU1xP+c+W5gCC+kc= X-Google-Smtp-Source: APXvYqyYhX5aVhP9qCyL35Smt17v8b8bG9IDr2Cc/64L9nDayOYdm2e3VxstR+yxwTOe1A1mIyJAFIkwet9ipnPhL9I= X-Received: by 2002:a7b:c4c1:: with SMTP id g1mr11664933wmk.14.1565360830363; Fri, 09 Aug 2019 07:27:10 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164805 Archived-At: --0000000000003d3da9058faff890 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Calling M-x newline when in org src block. Turns it yellow and prevents editing (it opens org edit src ) I have tried the latest emacs and org-mode. And run the following code in an emacs -q note: I changed the key-maps to include just ones available in default emac= s (defun setup-buf1 () (with-current-buffer (get-buffer-create test-buffer-name) (erase-buffer) (insert " #+begin_src elisp :result output (setq a \"grass\") #+end_src ") (org-mode))) (defun code-that-activates-bad-behaviour () (interactive) (switch-to-buffer test-buffer-name) (goto-char (point-min)) (save-excursion (search-forward "grass") (goto-char (point-at-eol)) (call-interactively 'newline) (insert "h") (forward-sexp 1))) (progn (add-to-list 'load-path "~/emacsd-main/el-get/org-mode/lisp") (require 'org) (setq test-buffer-name "my-test-buf") (setq org-src-preserve-indentation t) (setq org-src-window-setup 'current-window) (setq org-src-strip-leading-and-trailing-blank-lines t) (setq org-edit-src-content-indentation 2) (setq org-src-tab-acts-natively t)) (add-to-list 'load-path "~/emacs-config/dem/setup-dem/") (defun org-src-edit-mode-setup () (let* ((b (ignore-errors (current-buffer))) (bufn (and b (buffer-name b)))) (when (string-match "\\`*Org Src " bufn) (let ((mpk-map (copy-keymap org-mode-map)) (qa-map (copy-keymap emacs-lisp-mode-map)) (f-map (copy-keymap abbrev-map))) (define-key mpk-map (kbd "o") qa-map) (define-key qa-map (kbd "f") f-map) (define-key f-map (kbd "s") 'find-file) (define-key mpk-map (kbd "s") Info-mode-map) (define-key org-src-mode-map (kbd "b") mpk-map))))) (add-hook 'org-src-mode-hook 'org-src-edit-mode-setup) (setup-buf1) (code-that-activates-bad-behaviour) In GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10) of 2019-07-02 built on Slug Repository revision: b35f378d6e7d52393f1afc32a6f9880b9240af91 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 18.04.2 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Invalid image =E2=80=98:rotation=E2=80=99 parameter [10 times] delete-backward-char: Text is read-only Making completion list... Loading /home/dericbytes/emacs-config/dem/test-init/init-org-src-fix-test.el (source)...done Configured using: 'configure --with-mailutils --with-xwidgets --with-cairo --with-modules --with-imagemagick' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY GNUTLS LIBXML2 FREETYPE HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS PDUMPER LCMS2 GMP Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Org Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug sendmail edmacro kmacro org-element cl-seq avl-tree generator ol-eww ol-rmail ol-mhe ol-irc ol-info ol-gnus nnir gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message rmc puny rfc822 mml mml-sec password-cache epa derived epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search seq byte-opt gv bytecomp byte-compile cconv mail-utils mm-util mail-prsvr wid-edit ol-docview doc-view jka-compr image-mode ol-bibtex bibtex ol-bbdb ol-w3m org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete comint ansi-color ring org-list org-faces org-entities time-date noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat advice org-macs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs cl-loaddefs cl-lib vc-git diff-mode easymenu easy-mmode dired dired-loaddefs elec-pair mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting xwidget-internal cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 142197 9860) (symbols 48 16806 1) (strings 32 53628 2358) (string-bytes 1 1847588) (vectors 16 25566) (vector-slots 8 280844 11248) (floats 8 174 71) (intervals 56 416 0) (buffers 992 17)) --0000000000003d3da9058faff890 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Calling M-x newline when in org src block. Turns it yellow= and prevents
editing (it opens org edit src )

I have tried the l= atest emacs and org-mode. And run the following code
in an emacs -q
<= br>note: I changed the key-maps to include just ones available in default e= macs


(defun setup-buf1 ()
=C2=A0 (with-current-buffer (get-bu= ffer-create test-buffer-name)
=C2=A0 =C2=A0 (erase-buffer)
=C2=A0 =C2= =A0 (insert "
=C2=A0 #+begin_src elisp :result output
=C2=A0 =C2= =A0 (setq a \"grass\")
=C2=A0 #+end_src
")
=C2=A0 = =C2=A0 (org-mode)))


(defun code-that-activates-bad-behaviour ()<= br>=C2=A0 (interactive)
=C2=A0 (switch-to-buffer test-buffer-name)
= =C2=A0 (goto-char (point-min))
=C2=A0 (save-excursion
=C2=A0 =C2=A0 (= search-forward "grass")
=C2=A0 =C2=A0 (goto-char (point-at-eol= ))
=C2=A0 =C2=A0 (call-interactively 'newline)
=C2=A0 =C2=A0 (ins= ert "h")
=C2=A0 =C2=A0 (forward-sexp 1)))


(progn=C2=A0 (add-to-list 'load-path "~/emacsd-main/el-get/org-mode/lis= p")
=C2=A0 (require 'org)
=C2=A0 (setq test-buffer-name &quo= t;my-test-buf")
=C2=A0 (setq org-src-preserve-indentation t)
=C2= =A0 (setq org-src-window-setup 'current-window)
=C2=A0 (setq org-src= -strip-leading-and-trailing-blank-lines t)
=C2=A0 (setq org-edit-src-con= tent-indentation 2)
=C2=A0 (setq org-src-tab-acts-natively t))

(add-to-list 'load-path "~/emacs-config/dem/setup-dem/")

(defun org-src-edit-mode-setup ()
=C2=A0 (let* ((b (ignore-erro= rs
=C2=A0 =C2=A0 =C2=A0(current-buffer)))
(bufn (and b
=C2= =A0 =C2=A0(buffer-name b))))
=C2=A0 =C2=A0 (when (string-match "\\`= *Org Src " bufn)

=C2=A0 =C2=A0 =C2=A0 (let ((mpk-map (copy-keym= ap org-mode-map))
=C2=A0 =C2=A0(qa-map (copy-keymap emacs-lisp-mode-ma= p))
=C2=A0 =C2=A0(f-map (copy-keymap abbrev-map)))

(define-key= mpk-map (kbd "o") qa-map)
(define-key qa-map (kbd "f&qu= ot;) f-map)
(define-key f-map (kbd "s") 'find-file)
<= br> (define-key mpk-map =C2=A0(kbd "s") =C2=A0Info-mode-map)
=
(define-key org-src-mode-map (kbd "b") mpk-map)))))

(= add-hook 'org-src-mode-hook 'org-src-edit-mode-setup)


(s= etup-buf1)
(code-that-activates-bad-behaviour)






In GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.22= .30, cairo version 1.15.10)
=C2=A0of 2019-07-02 built on Slug
Reposit= ory revision: b35f378d6e7d52393f1afc32a6f9880b9240af91
Repository branch= : master
Windowing system distributor 'The X.Org Foundation', ve= rsion 11.0.11906000
System Description: Ubuntu 18.04.2 LTS

Recent= messages:
For information about GNU Emacs and the GNU system, type C-h = C-a.
Invalid image =E2=80=98:rotation=E2=80=99 parameter [10 times]
d= elete-backward-char: Text is read-only
Making completion list...
Load= ing /home/dericbytes/emacs-config/dem/test-init/init-org-src-fix-test.el (s= ource)...done

Configured using:
=C2=A0'configure --with-mailu= tils --with-xwidgets --with-cairo --with-modules
=C2=A0--with-imagemagic= k'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO IMAG= EMAGICK SOUND DBUS GSETTINGS GLIB
NOTIFY INOTIFY GNUTLS LIBXML2 FREETYPE= HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XDBE XIM MODULES THREADS XWI= DGETS PDUMPER LCMS2 GMP

Important settings:
=C2=A0 value of $LANG= : en_GB.UTF-8
=C2=A0 locale-coding-system: utf-8-unix

Major mode:= Org

Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 glob= al-eldoc-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mo= de: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-= name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-= mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-composition-mode: t=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2= =A0 line-number-mode: t
=C2=A0 transient-mark-mode: t

Load-path s= hadows:
None found.

Features:
(shadow sort mail-extr emacsbug = sendmail edmacro kmacro org-element
cl-seq avl-tree generator ol-eww ol-= rmail ol-mhe ol-irc ol-info ol-gnus
nnir gnus-sum gnus-group gnus-undo g= nus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo parse-tim= e gnus-spec gnus-int gnus-range
message rmc puny rfc822 mml mml-sec pass= word-cache epa derived epg
epg-config mm-decode mm-bodies mm-encode mail= -parse rfc2231 mailabbrev
gmm-utils mailheader gnus-win gnus nnheader gn= us-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-se= arch seq
byte-opt gv bytecomp byte-compile cconv mail-utils mm-util mail= -prsvr
wid-edit ol-docview doc-view jka-compr image-mode ol-bibtex bibte= x
ol-bbdb ol-w3m org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macr= o
org-footnote org-src ob-comint org-pcomplete pcomplete comint ansi-col= or
ring org-list org-faces org-entities time-date noutline outline
or= g-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys
org-compat= advice org-macs org-loaddefs format-spec find-func cal-menu
calendar ca= l-loaddefs cl-loaddefs cl-lib vc-git diff-mode easymenu
easy-mmode dired= dired-loaddefs elec-pair mule-util tooltip eldoc
electric uniquify edif= f-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win = x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replac= e newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu= -bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-loc= k syntax facemenu font-core
term/tty-colors frame cl-generic cham georgi= an utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japa= nese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiop= ic indian cyrillic
chinese composite charscript charprop case-table epa-= hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded na= dvice loaddefs
button faces cus-face macroexp files text-properties over= lay sha1 md5
base64 format env code-pages mule custom widget hashtable-p= rint-readable
backquote threads dbusbind inotify lcms2 dynamic-settingsystem-font-setting font-render-setting xwidget-internal cairo
move-to= olbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory i= nformation:
((conses 16 142197 9860)
=C2=A0(symbols 48 16806 1)
= =C2=A0(strings 32 53628 2358)
=C2=A0(string-bytes 1 1847588)
=C2=A0(v= ectors 16 25566)
=C2=A0(vector-slots 8 280844 11248)
=C2=A0(floats 8 = 174 71)
=C2=A0(intervals 56 416 0)
=C2=A0(buffers 992 17))
--0000000000003d3da9058faff890--