From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WAJODBlIsF4nCQAA0tVLHw (envelope-from ) for ; Mon, 04 May 2020 16:51:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yKNUHCNIsF4yEAAA1q6Kng (envelope-from ) for ; Mon, 04 May 2020 16:51:47 +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 3F457945722 for ; Mon, 4 May 2020 16:31:15 +0000 (UTC) Received: from localhost ([::1]:42554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVdzv-0005OO-GT for larch@yhetil.org; Mon, 04 May 2020 12:31:15 -0400 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 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 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) 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) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Juri Linkov Subject: Re: Reconciling org-mode idiosyncrasies with Emacs core 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> Date: Mon, 04 May 2020 18:14:54 +0200 In-Reply-To: <874ksv4uv1.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Mon, 04 May 2020 16:50:42 +0200") Message-ID: <87ftcfekxt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-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: Org Mode list , Emacs developers Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -1.71 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=KRK/begk; dmarc=pass (policy=none) header.from=gmail.com; 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 [-1.71 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49493977888485]; DWL_DNSWL_BLOCKED(0.00)[gmail.com:dkim,2001:470:142::17:from]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.13), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[109.13.143.200:received]; MIME_TRACE(0.00)[0:+]; 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)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; URIBL_BLOCKED(0.00)[nicolasgoaziou.fr:email]; FROM_NEQ_ENVFROM(0.00)[kevinlegouguec@gmail.com,emacs-orgmode-bounces@gnu.org]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: QM7m3Bb9x1lZ 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!