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 kITkKXE8tF6oLAAA0tVLHw (envelope-from ) for ; Thu, 07 May 2020 16:50:57 +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 eC0rOX08tF7lYQAAbx9fmQ (envelope-from ) for ; Thu, 07 May 2020 16:51:09 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::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 E7CBE9402A0 for ; Thu, 7 May 2020 16:51:07 +0000 (UTC) Received: from localhost ([::1]:52020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWjjo-0000Zq-ID for larch@yhetil.org; Thu, 07 May 2020 12:51:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWjjG-0000Yh-Kc; Thu, 07 May 2020 12:50:34 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:44904) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWjjF-0006lh-N8; Thu, 07 May 2020 12:50:34 -0400 Received: by mail-wr1-x444.google.com with SMTP id y4so7209502wrm.11; Thu, 07 May 2020 09:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=dPT0xlgrMci3ajJBE8F+WYdetl5fl6Xu9GLWF9c3f0M=; b=T+K9ZYFi1rvKbiwCblWDgRj2QE6mNF7z9ehlKu8/iHI72TWgHdJmzwb7LkhmgYbffh /0z5C6d/CUZyic2cfgogS0Gs5eaAR2GgeMPySPlNOxBJq8DgPmG6A5qBxB8cjH4xFIzs UF2G8U2CmnWBiRWvhHdiX7J+QATHdni2GMrRAx2mZPP+SBt10S+37SiZPZV5A+XWxkwp LPBA3CwtnYFz7DVr1sEipjCni+BaYwunJYHvgvixrYZjEN1vKUcj75RUQm9ThEKNf7A6 ldOPArObkhwrkOkKfBryxeeuyE20F4KIS/2P+RzKCY6Sti15aard00x+QdEf19RGMPnh TW7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=dPT0xlgrMci3ajJBE8F+WYdetl5fl6Xu9GLWF9c3f0M=; b=XtRpL4LO2sy6LuLMnRIp5hhsjXBmKHYdlDXUzzHROqEtaaKfMPvj6lmvmzvJd5r7Gc fH1NZBtWa4wh0/ot1xhKZeKuEU0LTBsoNZKt5l0dvKjqCMSDgtx1BakMXGmIRklGjEQk 3DQByoz8zZUI5jsUV/W1n2EwAw/4nUTCuPjnNkiWp0s5/slzJOYC9nwAppL1JOZ9IrIt x4bAcw5wPmSpVl9zf8hgtBNzGcT7WgXI8MFU6ERLm7iIQQZPoDtnhoqoaPMQxnsveAaW 5dDiPzCli+FIgPMGrmfREddIQs6A8b/EsFWDvVRHxij7h0VtXIIv6eGNfFiISw9rUcaq THkA== X-Gm-Message-State: AGi0PuaJs3FYJtqIN9JVQ1h0qkC0N0y13IdaHlzhJmuLCllEA0uv84RV QRVFAr6L5gnOUucPeA2LuYOfGKauTabrwQ== X-Google-Smtp-Source: APiQypJX9DNQD+CqZqknl1aDNjEkZ4iby4J027ixEGGyOwHZSHdxbcMY9IV38kD4EQFuaWO2HDYy6A== X-Received: by 2002:adf:bc41:: with SMTP id a1mr7526124wrh.302.1588870231750; Thu, 07 May 2020 09:50:31 -0700 (PDT) Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id q184sm8971298wma.25.2020.05.07.09.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 09:50:31 -0700 (PDT) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Org Mode list Subject: Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode References: <20200426172206.GC18629@ACM> <87y2qhnc9a.fsf@gmail.com> <20200427102311.GA4976@ACM> <87mu6xtano.fsf@gmail.com> <87k120ohsq.fsf@mail.linkov.net> <87blnbir01.fsf@nicolasgoaziou.fr> <87o8rbmbfa.fsf@mail.linkov.net> <87k11yftqo.fsf@nicolasgoaziou.fr> <87pnbqo74t.fsf_-_@gmail.com> <87ees6fp8r.fsf@nicolasgoaziou.fr> <87y2q89dx7.fsf@gmail.com> <874ksv4uv1.fsf@nicolasgoaziou.fr> <87ftcfekxt.fsf@gmail.com> <877dxpazbo.fsf_-_@gmail.com> <87ftcc9g27.fsf@nicolasgoaziou.fr> <87wo5ogdfl.fsf@gmail.com> <874kss9bqx.fsf@nicolasgoaziou.fr> <87368br8wi.fsf@gmail.com> Date: Thu, 07 May 2020 18:50:30 +0200 In-Reply-To: <87368br8wi.fsf@gmail.com> (=?utf-8?Q?=22K=C3=A9vin?= Le Gouguec"'s message of "Thu, 07 May 2020 18:45:33 +0200") Message-ID: <87v9l7pu3t.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=kevin.legouguec@gmail.com; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: , Cc: Emacs developers Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=T+K9ZYFi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [0.09 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49827266601131]; DWL_DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; HAS_ATTACHMENT(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.11), country: US(-0.00), ip: 2001:470:142::17(-0.50)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:-]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; MIME_TRACE(0.00)[0:+,1:+,2:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[kevinlegouguec@gmail.com,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; HAS_LIST_UNSUB(-0.01)[]; RECEIVED_SPAMHAUS_PBL(0.00)[109.13.143.200:received]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: cIPS+iiO4pcD --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable K=C3=A9vin Le Gouguec writes: > (I hope I got that right.) Except I forgot the explanatory comment, and I left a typo in the docstring. Ahem. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 2b35535fa..caaf5ce58 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -102,6 +102,12 @@ is nil)." (defun org-time-convert-to-list (time) (seconds-to-time (float-time time)))) +;; `newline-and-indent' did not take a numeric argument before 27.1. +(if (version< emacs-version "27") + (defsubst org-newline-and-indent (&optional _arg) + (newline-and-indent)) + (defalias 'org-newline-and-indent #'newline-and-indent)) + ;;; Emacs < 26.1 compatibility diff --git a/lisp/org.el b/lisp/org.el index 8ad437a20..142bfb999 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17649,12 +17649,12 @@ call `open-line' on the very first character." (defun org--newline (indent arg interactive) "Call `newline-and-indent' or just `newline'. -If INDENT is non-nil, call `newline-and-indent' to indent -unconditionally; otherwise, call `newline' with ARG and -INTERACTIVE, which can trigger indentation if +If INDENT is non-nil, call `newline-and-indent' with ARG (if +supported) to indent unconditionally; otherwise, call `newline' +with ARG and INTERACTIVE, which can trigger indentation if `electric-indent-mode' is enabled." (if indent - (newline-and-indent) + (org-newline-and-indent arg) (newline arg interactive))) (defun org-return (&optional indent arg interactive) --=-=-=--