From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ihor Radchenko Subject: Re: Bug: org-tempo expansion comments out the following src block when org-src-tabs-natively is 't [9.3 (release_9.3 @ /home/yantar92/.emacs.d/straight/build/org/)] Date: Thu, 19 Dec 2019 22:16:34 +0800 Message-ID: <87r210cse5.fsf@gmail.com> References: <87immdn5n4.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <1FDF2AC8-7B81-4D31-A422-BD36F333CA49@ucsd.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:36780) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihwdR-0002aQ-R2 for emacs-orgmode@gnu.org; Thu, 19 Dec 2019 09:18:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihwdQ-0000uD-Gz for emacs-orgmode@gnu.org; Thu, 19 Dec 2019 09:18:37 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:44322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihwdQ-0000mB-6G for emacs-orgmode@gnu.org; Thu, 19 Dec 2019 09:18:36 -0500 Received: by mail-wr1-x435.google.com with SMTP id q10so6135125wrm.11 for ; Thu, 19 Dec 2019 06:18:35 -0800 (PST) In-Reply-To: <1FDF2AC8-7B81-4D31-A422-BD36F333CA49@ucsd.edu> 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: "Berry, Charles" Cc: "emacs-orgmode@gnu.org" > I did not need to add this line to confirm the behavior: > >> (push (cons "el" "src emacs-lisp") org-structure-template-alist) Note the 5.2 part of the recipe. It is probably caused by the same reason, but the consequence is that the following code block is being commented, sometimes out of the screen. I accidentally commented several parts of my emacs configuration because of this. > If you really need ` > You might use `C-c C-,' as long as you have no other templates > defined. I prefer to use `' instead of `C-c C-, e l C-o' simply because it takes one less key press and less modifier keys. And I do have other templates. > Right. The issue seems to be that `org-tempo-add-block' puts `>' > elements in its recipe for converting `org-structure-template-alist' > to `tempo-org-template-*' values. > > Those are innocuous when `org-src-tab-acts-natively' is nil. The most straightforward solutions are deleting the `'>' elements from the template or temporary setting the `org-src-tabs-acts-natively' to nil. Best, Ihor "Berry, Charles" writes: >> On Dec 18, 2019, at 5:07 AM, Ihor Radchenko wrote: >> >> Recipe: >> >> 1. emacs -Q >> 2. Execute the following lisp code: >> >> (setq org-src-tab-acts-natively t) >> (require 'org-tempo) > > I did not need to add this line to confirm the behavior: > >> (push (cons "el" "src emacs-lisp") org-structure-template-alist) >> >> 3. Create the following org file: >> >> >> >> #+begin_src emacs-lisp >> #+end_src >> >> 4. Put the point before the code block >> >> 5.1. Type > >> Observed behaviour: >> >> #+begin_src >> >> >> #+begin_src emacs-lisp >> #+end_src >> > > > Right. The issue seems to be that `org-tempo-add-block' puts `>' elements in its recipe for converting `org-structure-template-alist' to `tempo-org-template-*' values. > > Those are innocuous when `org-src-tab-acts-natively' is nil. > > But when `org-src-tab-acts-natively' is `t', an attempt is made to indent within the src block, which I guess is where the trouble lies as an error occurs which prevents the remainder of the template from being inserted. > > If you really need ` > You might use `C-c C-,' as long as you have no other templates defined. > > HTH, > > Chuck