From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yCBhGhgRmGDsNgAAgWs5BA (envelope-from ) for ; Sun, 09 May 2021 18:43:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id NJP8FRgRmGDYZgAAB5/wlQ (envelope-from ) for ; Sun, 09 May 2021 16:43:04 +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 360CE1297E for ; Sun, 9 May 2021 18:43:03 +0200 (CEST) Received: from localhost ([::1]:43792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfmWE-0007h4-B4 for larch@yhetil.org; Sun, 09 May 2021 12:43:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfmVj-0007fH-00 for emacs-orgmode@gnu.org; Sun, 09 May 2021 12:42:31 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:36666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfmVg-0008BD-Rb; Sun, 09 May 2021 12:42:30 -0400 Received: by mail-wr1-x432.google.com with SMTP id m9so14136606wrx.3; Sun, 09 May 2021 09:42:26 -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=9VWpwNV7UMVPnURSf2TLM79han6LZ16JW85auSUgYKk=; b=COGXd0r9GI1EK0Tv7B8JFG/Muc7Yg361HfGYuQ8Ad6F31jak/ZAnKB16ZzDnRodrgr ICs/Om/UjnJiS83Kb95n8ZaaRDzFxGnLUzhn2qpwEcLR089CBDXH0nLbQe/aIlfTTuIn vnInVuUSH3Vs3yv7zvzDYGSTIQQu/bDS4rXdP5424qmwU7/kgTk1OdN7vsaFIzJw95tW m6uSSDQ5rnGT6vmjBLn5m5+IyziIG94Y4nPrlIbKn/5Ow6tkcXH2T211aUv1msNqPtPC kZNm3uWeI4qZbAXs0q5LNf/SLDB0mzunPjcfqJe5YYlGWK/HUPQu2AryIS3HYf61s2el lX9w== 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=9VWpwNV7UMVPnURSf2TLM79han6LZ16JW85auSUgYKk=; b=QunzVoEDJNx1AfFWgr6t/QC0Hg/1/wBMfxNAfs8uV+M600tzT2Je3QQNJbeyv2fVvH mXd894rXdFKkoW6NQ2g7TG2WyX3vj1VLENnHMgKT0OxSElVO/xUwps05rB74clNwQB6T GH57MsYkqs0Ij5BwfOY4qaVujp1EV6yr3BrIk2wkeBIToGlC703liUCG9thiDaKDgLw1 6qV4Z2+KrAyc1kp1kfB+oA+ASGDq/dsieDE7JXBJlotpqiG2kS+jKlQY0ztR14UCxfV1 nGeAXoCx5bNvqcimq+w0pdMiphuuHCvjQZ5uzWNTcK9PA78BLfj7KriIHbZjEItQd1WR BwtA== X-Gm-Message-State: AOAM533KN4hETmg7MTwLaZm1YLc0yTKgVwbN3nLA3q9vO9UuTmKa5r+l bNzWWRtGfs21RQ/Tq0+yuwsCwXhXzVdAVA== X-Google-Smtp-Source: ABdhPJzUhq5cCs4thVolUBwhnsNjY5RZssepLlF+QJR/hUhqdlYZ930IM/fKeKJuUOgDRIheqcFacQ== X-Received: by 2002:a5d:4145:: with SMTP id c5mr25798268wrq.252.1620578544382; Sun, 09 May 2021 09:42:24 -0700 (PDT) Received: from amdahl30 ([2a01:e0a:20e:d340:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id r5sm17597896wmh.23.2021.05.09.09.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 May 2021 09:42:23 -0700 (PDT) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Bastien Subject: Re: [POLL] Setting `org-adapt-indentation' to nil by default? References: <878s4x3bwh.fsf@gnu.org> <87lf8tk448.fsf@gnu.org> <875yzwlzlc.fsf@gnu.org> Date: Sun, 09 May 2021 18:42:22 +0200 In-Reply-To: <875yzwlzlc.fsf@gnu.org> (Bastien's message of "Thu, 06 May 2021 16:13:35 +0200") Message-ID: <871raf270x.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::432; envelope-from=kevin.legouguec@gmail.com; helo=mail-wr1-x432.google.com 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_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620578583; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9VWpwNV7UMVPnURSf2TLM79han6LZ16JW85auSUgYKk=; b=ihsE6wlxXDBMvp6k7NlaCZdsTwg8Q7lPmSKpNNqftDJWoBme09mjVlHsTikJdWFyrExFht jv+1yY65mIzsKIisowpfOPju5AJPI/m7bwVcpOXZ3Nn7bBN94PglPC3V8tBwkb9AIk9dZv i9k4rz3IwbddDDUqlm44Si34RUQpOKblsGnxht8AVkL0hBXVGbU/ZaBJHSjkS8Ri3lINsR VukKcu06wH7mUEAs942Y+eCJ1MnXUFQT8YuJJZ0Cxbs3Zh6nGmlylq849G8+iL1hk79+H5 5e8v0lxQ+987TekJ/S5EonH4CBNTuwTgiHGL6MrCBjfWa2iuGpqd8EzNqhU6eQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620578583; a=rsa-sha256; cv=none; b=rDdedjq82kHiO8Zv3NAfA0ZnblIu1+K+pkFQ0td1BLLSL+wdxQNMVrE3QIDvrG2F97sHlI Xo5REGT5GrL0ZMQXsKYXi605clfWWGGNoC3ITjfbpzU0v5sUkZ09tIwnnrnMFZkIby+EhP qpHVHBX+6BaImCP4CwFOF3K2bDmymKJ+AM4a0vGve4mmVCjPVOViaGM057v5H+XF4Yv7O7 lDxURXmzI9MLz+BtMvBSw27+dRmSatjJXgAhWv40binkMrr86N/IxNrZBY3uTxdxBL0JSF 0fvdbRfNSIS2OmYuX+PrPBQjr6iJKWeI6m0jzeL+/adBPgQogj/Hd6qcNCHiSQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=COGXd0r9; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Spam-Score: -2.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=COGXd0r9; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Queue-Id: 360CE1297E X-Spam-Score: -2.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: XRwFKH/EcLMh --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Bastien writes: >> It is now, as of commit 0a651b746. > > ... and I broke some tests. Sorry for that. I will fix this next > week, unless someone does it before me. Here are two patches that set org-adapt-indentation to t for the tests which were implicitly relying on that behavior; that lets 'make test' succeed again for me. I'm pretty sure the first one is TRT (since I'm the author of the tests), although Eventually=E2=84=A2 we should make a more exhaustive suite based on the table you referenced earlier. The second one makes the remaining tests pass again, but I couldn't tell at a glance whether their expectations still make sense. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Set-org-adapt-indentation-explicitly-in-some-tests.patch >From e136f0d3123173d947bf4c1ce06aaf5f12117ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Sun, 9 May 2021 18:05:35 +0200 Subject: [PATCH 1/2] Set org-adapt-indentation explicitly in some tests * testing/lisp/test-org.el (test-org/with-electric-indent, test-org/without-electric-indent): Make sure org-adapt-indentation is consistent with expected results. --- testing/lisp/test-org.el | 42 +++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 9f0ede1b9..5ac9173ac 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -1404,12 +1404,14 @@ (electric-indent-local-mode 1) (call-interactively 'org-return) (buffer-string)))) - (should - (equal "* heading\n body" - (org-test-with-temp-text "* headingbody" - (electric-indent-local-mode 1) - (call-interactively 'org-return) - (buffer-string)))) + ;; TODO: test more values of `org-adapt-indentation'. + (let ((org-adapt-indentation t)) + (should + (equal "* heading\n body" + (org-test-with-temp-text "* headingbody" + (electric-indent-local-mode 1) + (call-interactively 'org-return) + (buffer-string))))) ;; C-j, like `electric-newline-and-maybe-indent', should not indent. (should (equal " Para\ngraph" @@ -1423,12 +1425,14 @@ (electric-indent-local-mode 1) (call-interactively 'org-return-and-maybe-indent) (buffer-string)))) - (should - (equal "* heading\nbody" - (org-test-with-temp-text "* headingbody" - (electric-indent-local-mode 1) - (call-interactively 'org-return-and-maybe-indent) - (buffer-string))))) + ;; TODO: test more values of `org-adapt-indentation'. + (let ((org-adapt-indentation t)) + (should + (equal "* heading\nbody" + (org-test-with-temp-text "* headingbody" + (electric-indent-local-mode 1) + (call-interactively 'org-return-and-maybe-indent) + (buffer-string)))))) (ert-deftest test-org/without-electric-indent () "Test RET and C-j specifications with `electric-indent-mode' off." @@ -1467,12 +1471,14 @@ (electric-indent-local-mode 0) (call-interactively 'org-return-and-maybe-indent) (buffer-string)))) - (should - (equal "* heading\n body" - (org-test-with-temp-text "* headingbody" - (electric-indent-local-mode 0) - (call-interactively 'org-return-and-maybe-indent) - (buffer-string))))) + ;; TODO: test more values of `org-adapt-indentation'. + (let ((org-adapt-indentation t)) + (should + (equal "* heading\n body" + (org-test-with-temp-text "* headingbody" + (electric-indent-local-mode 0) + (call-interactively 'org-return-and-maybe-indent) + (buffer-string)))))) (ert-deftest test-org/meta-return () "Test M-RET (`org-meta-return') specifications." -- 2.31.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Set-org-adapt-indentation-explicitly-in-some-tests.patch >From 2a485754a7f04d00ef5e5ebed82924d44f768424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Sun, 9 May 2021 18:20:11 +0200 Subject: [PATCH 2/2] Set org-adapt-indentation explicitly in some tests * testing/lisp/test-org.el (test-org/indent-line, test-org/indent-region): Make sure org-adapt-indentation is consistent with expected results. --- testing/lisp/test-org.el | 126 ++++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 60 deletions(-) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 5ac9173ac..95ffb0a80 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -1007,22 +1007,23 @@ ;; At the first line of an element, indent like previous element's ;; first line, ignoring footnotes definitions and inline tasks, or ;; according to parent. - (should - (= 2 - (org-test-with-temp-text "A\n\n B\n\nC" - (org-indent-line) - (org-get-indentation)))) - (should - (= 1 - (org-test-with-temp-text " A\n\n[fn:1] B\n\n\nC" - (org-indent-line) - (org-get-indentation)))) - (should - (= 1 - (org-test-with-temp-text - " #+BEGIN_CENTER\n Contents\n#+END_CENTER" - (org-indent-line) - (org-get-indentation)))) + (let ((org-adapt-indentation t)) + (should + (= 2 + (org-test-with-temp-text "A\n\n B\n\nC" + (org-indent-line) + (org-get-indentation)))) + (should + (= 1 + (org-test-with-temp-text " A\n\n[fn:1] B\n\n\nC" + (org-indent-line) + (org-get-indentation)))) + (should + (= 1 + (org-test-with-temp-text + " #+BEGIN_CENTER\n Contents\n#+END_CENTER" + (org-indent-line) + (org-get-indentation))))) ;; Within code part of a source block, use language major mode if ;; `org-src-tab-acts-natively' is non-nil. Otherwise, indent ;; according to line above. @@ -1066,11 +1067,12 @@ (ert-deftest test-org/indent-region () "Test `org-indent-region' specifications." ;; Indent paragraph. - (should - (equal "A\nB\nC" - (org-test-with-temp-text " A\nB\n C" - (org-indent-region (point-min) (point-max)) - (buffer-string)))) + (let ((org-adapt-indentation t)) + (should + (equal "A\nB\nC" + (org-test-with-temp-text " A\nB\n C" + (org-indent-region (point-min) (point-max)) + (buffer-string))))) ;; Indent greater elements along with their contents. (should (equal "#+BEGIN_CENTER\nA\nB\n#+END_CENTER" @@ -1083,11 +1085,12 @@ (org-test-with-temp-text "#+BEGIN_VERSE\n A\n B\n#+END_VERSE" (org-indent-region (point-min) (point-max)) (buffer-string)))) - (should - (equal "#+BEGIN_VERSE\n A\n B\n#+END_VERSE" - (org-test-with-temp-text " #+BEGIN_VERSE\n A\n B\n #+END_VERSE" - (org-indent-region (point-min) (point-max)) - (buffer-string)))) + (let ((org-adapt-indentation t)) + (should + (equal "#+BEGIN_VERSE\n A\n B\n#+END_VERSE" + (org-test-with-temp-text " #+BEGIN_VERSE\n A\n B\n #+END_VERSE" + (org-indent-region (point-min) (point-max)) + (buffer-string))))) ;; Indent example blocks as a single block, unless indentation ;; should be preserved. In this case only indent the block markers. (should @@ -1095,36 +1098,38 @@ (org-test-with-temp-text "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE" (org-indent-region (point-min) (point-max)) (buffer-string)))) - (should - (equal "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE" - (org-test-with-temp-text " #+BEGIN_EXAMPLE\n A\n B\n #+END_EXAMPLE" - (org-indent-region (point-min) (point-max)) - (buffer-string)))) - (should - (equal "#+BEGIN_EXAMPLE -i\n A\n B\n#+END_EXAMPLE" - (org-test-with-temp-text - " #+BEGIN_EXAMPLE -i\n A\n B\n #+END_EXAMPLE" - (org-indent-region (point-min) (point-max)) - (buffer-string)))) - (should - (equal "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE" - (org-test-with-temp-text - " #+BEGIN_EXAMPLE\n A\n B\n #+END_EXAMPLE" - (let ((org-src-preserve-indentation t)) - (org-indent-region (point-min) (point-max))) - (buffer-string)))) + (let ((org-adapt-indentation t)) + (should + (equal "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE" + (org-test-with-temp-text " #+BEGIN_EXAMPLE\n A\n B\n #+END_EXAMPLE" + (org-indent-region (point-min) (point-max)) + (buffer-string)))) + (should + (equal "#+BEGIN_EXAMPLE -i\n A\n B\n#+END_EXAMPLE" + (org-test-with-temp-text + " #+BEGIN_EXAMPLE -i\n A\n B\n #+END_EXAMPLE" + (org-indent-region (point-min) (point-max)) + (buffer-string)))) + (should + (equal "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE" + (org-test-with-temp-text + " #+BEGIN_EXAMPLE\n A\n B\n #+END_EXAMPLE" + (let ((org-src-preserve-indentation t)) + (org-indent-region (point-min) (point-max))) + (buffer-string))))) ;; Treat export blocks as a whole. (should (equal "#+BEGIN_EXPORT latex\n A\n B\n#+END_EXPORT" (org-test-with-temp-text "#+BEGIN_EXPORT latex\n A\n B\n#+END_EXPORT" (org-indent-region (point-min) (point-max)) (buffer-string)))) - (should - (equal "#+BEGIN_EXPORT latex\n A\n B\n#+END_EXPORT" - (org-test-with-temp-text - " #+BEGIN_EXPORT latex\n A\n B\n #+END_EXPORT" - (org-indent-region (point-min) (point-max)) - (buffer-string)))) + (let ((org-adapt-indentation t)) + (should + (equal "#+BEGIN_EXPORT latex\n A\n B\n#+END_EXPORT" + (org-test-with-temp-text + " #+BEGIN_EXPORT latex\n A\n B\n #+END_EXPORT" + (org-indent-region (point-min) (point-max)) + (buffer-string))))) ;; Indent according to mode if `org-src-tab-acts-natively' is ;; non-nil. Otherwise, do not indent code at all. (should @@ -1160,16 +1165,17 @@ (org-indent-region (point) (point-max))) (buffer-string)))) ;; Indent plain lists. - (should - (equal "- A\n B\n - C\n\n D" - (org-test-with-temp-text "- A\n B\n - C\n\n D" - (org-indent-region (point-min) (point-max)) - (buffer-string)))) - (should - (equal "- A\n\n- B" - (org-test-with-temp-text " - A\n\n - B" - (org-indent-region (point-min) (point-max)) - (buffer-string)))) + (let ((org-adapt-indentation t)) + (should + (equal "- A\n B\n - C\n\n D" + (org-test-with-temp-text "- A\n B\n - C\n\n D" + (org-indent-region (point-min) (point-max)) + (buffer-string)))) + (should + (equal "- A\n\n- B" + (org-test-with-temp-text " - A\n\n - B" + (org-indent-region (point-min) (point-max)) + (buffer-string))))) ;; Indent footnote definitions. (should (equal "[fn:1] Definition\n\nDefinition" -- 2.31.1 --=-=-=--