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 mORsDI5jGl9YSQAA0tVLHw (envelope-from ) for ; Fri, 24 Jul 2020 04:29:02 +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 oPX9B45jGl+PbwAAbx9fmQ (envelope-from ) for ; Fri, 24 Jul 2020 04:29:02 +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 5A5F094005D for ; Fri, 24 Jul 2020 04:29:01 +0000 (UTC) Received: from localhost ([::1]:36526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jypKN-00082t-HF for larch@yhetil.org; Fri, 24 Jul 2020 00:28:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jypI0-00082U-2H for emacs-orgmode@gnu.org; Fri, 24 Jul 2020 00:26:32 -0400 Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:60658 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 1jypHy-0000Cn-6j for emacs-orgmode@gnu.org; Fri, 24 Jul 2020 00:26:31 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jypHt-000826-TG for emacs-orgmode@gnu.org; Fri, 24 Jul 2020 06:26:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Jarmo Hurri Subject: Re: Binding RET to org-return-and-maybe-indent Date: Fri, 24 Jul 2020 07:26:17 +0300 Message-ID: <87pn8l5yja.fsf@iki.fi> References: <878sfbycip.fsf@iki.fi> <87sgdjhad8.fsf@gmail.com> <871rl2y2wa.fsf@iki.fi> <878sfaxoly.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:L1jKlPqc+IVNB3Kw+QZVLZjaTJ8= 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/07/23 17:55:47 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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.51 X-TUID: BmhvQY1Prvgi Hi Kévin. Kévin Le Gouguec writes: >>> #+begin_src emacs-lisp >>> (add-hook 'org-mode-hook (lambda () (electric-indent-mode -1))) >>> #+end_src >> >> Unfortunately this has side effects: it changes at least the way >> parentheses and indentation interact when opening a Babel source code >> block. It might be a good idea to mention this in ORG-NEWS. > > Could you give us a precise recipe? (Starting from emacs -Q and an > empty Org buffer) > > I've fiddled a bit with source blocks just now and I'm noticing some > weirdness that I suspect might be due to electric-indent-mode > re-indenting the previous line when hitting RET (or C-j when disabling > electric-indent-mode), but nothing specific to parentheses. At the minimum it changes the way parentheses indent automatically when editing source code blocks. Below is a minimal demo, documented using our favorite system. All the best, and stay safe. Jarmo * Demo of the effect of disabling elint 1. Save this org into file =org-elint-disable.org= 2. Save the following elisp into =minimal-org.el=, replacing the location of org mode with your path: #+begin_src elisp (add-to-list 'load-path (expand-file-name "~/src/org-mode/lisp")) (add-to-list 'load-path (expand-file-name "~/src/org-mode/contrib/lisp" t)) (add-hook 'org-mode-hook (lambda () (electric-indent-mode -1))) #+end_src 3. Toggle the last line #+begin_src elisp (add-hook 'org-mode-hook (lambda () (electric-indent-mode -1))) #+end_src in =minimal-org.el= to see the following effect: 1. Open this file with #+begin_src sh emacs -Q -l minimal-org.el org-elint-disable.org #+end_src 2. Type C-c ' for (org-edit-special) in the source code block below, and follow the instructions on the comment line. #+begin_src java :exports none :classname Demo class Demo { // 1st press RET at the end of this line, then type TAB and } #+end_src