From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: Reconciling org-mode idiosyncrasies with Emacs core Date: Mon, 04 May 2020 18:14:54 +0200 Message-ID: <87ftcfekxt.fsf@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="16256"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Org Mode list , Emacs developers To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 04 18:21:34 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVdqX-00047t-Rk for ged-emacs-devel@m.gmane-mx.org; Mon, 04 May 2020 18:21:33 +0200 Original-Received: from localhost ([::1]:50106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVdqW-0004Gl-Rn for ged-emacs-devel@m.gmane-mx.org; Mon, 04 May 2020 12:21:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVdkB-0002L1-EQ; Mon, 04 May 2020 12:14:59 -0400 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:39427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVdkA-0005Ot-0y; Mon, 04 May 2020 12:14:59 -0400 Original-Received: by mail-wm1-x32c.google.com with SMTP id y24so114555wma.4; Mon, 04 May 2020 09:14:57 -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:content-transfer-encoding; bh=x5JW7ArGW0Jmr5/SONnCpirl03RKuN0YZdOunuZmaco=; b=KRK/begkZKdAp4KUIou5LEo0wuT4mAwYoIAUpEacYwJd35Q7yI+OoFoJXTh5rSk+ZE OITykbad2Bb8LFzSXYA6d7l1qCKz64FhMtw/X0f6fmndN6aePate3xugkL3rrFTw8yXE Elaro4wfYtwj0ykKZayhfLSg5v2xtpGb6XE+OMfuZ+fb9+dNB7meBK+eq9ZzoMxxUpqt LLP5dwyRObgHLiMyJIYLYjsKd6+X3YTMcBaEaY+1lCG7DzGMq/j3BM74iuG3uyHtUJ+q +TvYxFQqZ8Z/E7dS4L3eet+CQTIfIscwo4BijTko1aoeeThPx3UY7WqftrXBxqgiTWSx /wog== 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:content-transfer-encoding; bh=x5JW7ArGW0Jmr5/SONnCpirl03RKuN0YZdOunuZmaco=; b=nagHcEht2iLkLwkNucZ5Plgx7GeDPixJ4qsD4c+nt9DNGPMUcyYg/TNkLkljaVMrB9 4IwVv7AsD9z+FL4A6QYPSwcRn65z73x+3aRGxqnOzb5mKp6N4ETZHa/calFkBcdgrTJk CJHFeViRBGg2vWFjrRdL1WI7oWot/XcKmOhheENhBQhQzonJWw+VU28wgyM6pOorx0vv +ruqwA/enqf8q/UPPneB626QmEcGeoyq4Hw21eF/8ZAewHEckcPBvdwdX2HsmzfrncX5 yjtGGgpehExQ/4GjC2Hm6FHc8oM6WpVfhfCdoqd87cC9aCNuUsR5AYMWROU3QACQ7fs/ qclw== X-Gm-Message-State: AGi0PubhGJy/6bxjhVJokH+dYyQpuigoALHZUy7dYmXyHZ3rMt51GQlC CcLLhsB+sBe1YZ4nf1ZkOM0A5w7R+oXa6w== X-Google-Smtp-Source: APiQypJHxRzMtTn25mYDA3mMNhTrTQTHTDmTwadzM1h+ByhmY43VmC536PJPiZBkonVDuWwSaM+5yA== X-Received: by 2002:a7b:c38b:: with SMTP id s11mr15415449wmj.55.1588608895642; Mon, 04 May 2020 09:14:55 -0700 (PDT) Original-Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id s11sm19268177wrp.79.2020.05.04.09.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 09:14:55 -0700 (PDT) In-Reply-To: <874ksv4uv1.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Mon, 04 May 2020 16:50:42 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=kevin.legouguec@gmail.com; helo=mail-wm1-x32c.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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248857 gmane.emacs.orgmode:128852 Archived-At: Nicolas Goaziou writes: > Tests for `org-return' (named "test-org/return") are in the > "test-org.el" file in the "testing/lisp" directory. We only need to test > if electric-indent-mode has an effect, but only in regular cases. Thanks for the pointer! (I forgot to mention that AFAICT, all current tests pass with this patch.) >> - INTERACTIVE is what makes 'newline' run 'post-self-insert-hook' (thus >> triggering indentation through electric-indent-mode), > > OK. I thought it was necessary to call > `electric-newline-and-maybe-indent'. Nope; took me some time to piece everything together, but the logic (as of 24.4) seems to be - RET runs `newline': if electric-indent-mode is disabled, then it's a dumb newline, otherwise electric-indent-post-self-insert-function kicks in *if run interactively*; - C-j runs `electric-newline-and-maybe-indent': it's meant to be the "smart newline" command when electric-indent-mode is disabled, otherwise it shrugs and just inserts a newline. >> I took the liberty of using >> this function in the "list item" case too, otherwise there's no way to >> indent the trailing text. > > I'm not sure what you mean. It would be a regression if you didn't use > the function there, too, wouldn't it? The "list-item" case currently calls `newline-and-indent' unconditionally, because the condition for that cond branch starts with (and indent =E2=80=A6). Therefore, to make this case work with electric-indent-mode, I had to tweak the condition; I just wanted to bring attention to this change, since it was not as "mechanical" as for the "at-headline" and "default" branches. > I cannot speak for the Emacs side, but it should land in Org 9.4, not > Org 9.3.6. > > It is a very visible change, one that every Org user is going to face. > This requires a new ORG-NEWS entry. Those only appear in new minor+ > releases. Therefore, if you apply it in Emacs 27.1, the change will be > announced nowhere. Right. Org master it is, then. >> Now for C-j, in order to minimize breakage (for anyone calling >> org-return-indent from Lisp code) and simplify disabling the new >> behaviour (by simply turning off electric-indent-mode in Org), should we >> bind C-j to a new function? E.g.: >> >> (defun org-return-and-maybe-indent () >> (interactive) >> (org-return (not electric-indent-mode))) > > I think so. Then we can mark `org-return-indent' as obsolete and suggest > to call `org-return' instead. Alright. I'll try to follow-up with this additional command, tests, and changelog/news entries in the next few days. Thank you for the review!