From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 8NfSCp4bdl8zBwAA0tVLHw (envelope-from ) for ; Thu, 01 Oct 2020 18:10:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id MMaKBp4bdl8YFAAAbx9fmQ (envelope-from ) for ; Thu, 01 Oct 2020 18:10:38 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7BCD2940105 for ; Thu, 1 Oct 2020 18:10:37 +0000 (UTC) Received: from localhost ([::1]:52728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kO32K-0002qq-7U for larch@yhetil.org; Thu, 01 Oct 2020 14:10:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kO2QP-00036B-8f for emacs-orgmode@gnu.org; Thu, 01 Oct 2020 13:31:25 -0400 Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:45750 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kO2QM-00055D-If for emacs-orgmode@gnu.org; Thu, 01 Oct 2020 13:31:24 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kO2QJ-0001BA-6X for emacs-orgmode@gnu.org; Thu, 01 Oct 2020 19:31:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Rasmus Subject: Re: org-tempo insertion incoherence (lack of indentation) or misunderstanding Date: Thu, 01 Oct 2020 19:31:13 +0200 Message-ID: <87v9ft97ku.fsf@gmx.us> References: <20200907051510.fnfm745xttyghhaj@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Emacs Gnus Cancel-Lock: sha1:VxLkVxJ5Y5+AAxbXnpeSZppYzbE= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/01 13:31:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.50 X-TUID: H/Qy3MqmUWVy Hi Bruno, Bruno BEAUFILS writes: > Let us imagine this simple org file : > > #+NAME: first > #+begin_src org > > - an item > - subitem > > #+end_src > > If the cursor is at the last line and I want to insert an org block, > let's say an example, using org-tempo feature, I can type = followed by tabulation. > > In that case I get something like > > #+NAME: second > #+begin_src org > > - an item > - subitem > > #+begin_example > > #+end_example > > #+end_src > > However if I get indentation role (for instance in exports) well I do > not expect that but instead something like: > > #+NAME: third > #+begin_src org > > - an item > - subitem > > #+begin_example > > #+end_example > > #+end_src > > Are my expectations (and thus my use of indentation by org-mode > understandings) wrong or is it a bug? Whether the inserted block is indented depends on ‘org-get-indentation’ and thus the cursor’s position, at least in some cases. In particular, if | is the cursor, run org-get-indentation for these two examples to understand when you get indentation and when not: 1. - a | 2: - a | In 1. you are making a new block outside the list, in 2. it is part of the first item of the list. Both are valid. > In the same spirit if before trying that I type tabulation then = then tabulation again, nothing is inserted, aka org-tempo seems to work > only when cursor is at the beginning of line. > > Am I right? Is it a feature or a bug? You can have any amount of whitespace before expanding something a tempo snippet. You can’t have anything but whitespace before expanding a tempo snippet as a block must be the only thing on the line. (there does appear to be a bug in expanding when there’s something after the snippet: - a I expected that the example block would have been inserted /correctly/ > indented as in my third example above. > > > The only solution I found for getting things right is to type spaces > instead of tabulation to let my cursor go to the right column. > > Let us consider this snippet. > > #+NAME: fourth > #+begin_src org > > - an item > - subitem > H > #+end_src > > If the cursor is in the =H= position, then if I type = tabulation everything seems right and I get the same result as in > <>. > > Any help would appreciated. AFAICT everything is working as expected. Kind regards, Rasmus -- Even a three-legged dog has three good legs to lose