From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Nicolas Goaziou Newsgroups: gmane.emacs.orgmode,gmane.emacs.devel Subject: Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode Date: Thu, 07 May 2020 12:48:16 +0200 Message-ID: <87ftcc9g27.fsf@nicolasgoaziou.fr> 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> 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="26743"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Org Mode list , Emacs developers To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Thu May 07 12:48:53 2020 Return-path: Envelope-to: geo-emacs-orgmode@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 1jWe5E-0006sA-KA for geo-emacs-orgmode@m.gmane-mx.org; Thu, 07 May 2020 12:48:52 +0200 Original-Received: from localhost ([::1]:60452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWe5C-0001Uq-LZ for geo-emacs-orgmode@m.gmane-mx.org; Thu, 07 May 2020 06:48:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWe4o-0001TV-B7; Thu, 07 May 2020 06:48:26 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:42737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWe4m-0007jA-4l; Thu, 07 May 2020 06:48:25 -0400 X-Originating-IP: 185.131.40.67 Original-Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 83C2F20010; Thu, 7 May 2020 10:48:17 +0000 (UTC) Mail-Followup-To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec , Org Mode list , Emacs developers In-Reply-To: <877dxpazbo.fsf_-_@gmail.com> (=?utf-8?Q?=22K=C3=A9vin?= Le Gouguec"'s message of "Wed, 06 May 2020 16:54:35 +0200") Received-SPF: pass client-ip=217.70.183.200; envelope-from=mail@nicolasgoaziou.fr; helo=relay7-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 06:48:18 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, 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: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-orgmode" Xref: news.gmane.io gmane.emacs.orgmode:128900 gmane.emacs.devel:249161 Archived-At: Hello, K=C3=A9vin Le Gouguec writes: > Here's a complete patch to make RET and C-j honor electric-indent-mode > in org-mode, targeting Org's master branch. Thank you very much. I fixed a typo and applied your patch. > +(defmacro org-test-with-minor-mode (mode state &rest body) > + "Run BODY after setting MODE to STATE. > +Restore MODE to its former state afterward." > + (declare (debug (sexp sexp body)) (indent 2)) > + `(let ((old-state ,mode)) > + (,mode (if ,state 1 0)) > + ,@body > + (,mode (if old-state 1 0)))) This is a nice macro. However, when I have to reproduce a failing test, I don't even want to think about the recipe and rather concentrate on the results. Hence, I expect `should' macro's body to be self-sufficient. Therefore, I skipped this part of the patch. Regards, --=20 Nicolas Goaziou