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 ms11 with LMTPS id qMGVI7VLs1+QAwAA0tVLHw (envelope-from ) for ; Tue, 17 Nov 2020 04:04:05 +0000 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 sHV0H7VLs19rEwAAB5/wlQ (envelope-from ) for ; Tue, 17 Nov 2020 04:04:05 +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 00F9C940415 for ; Tue, 17 Nov 2020 04:04:04 +0000 (UTC) Received: from localhost ([::1]:60618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kesDq-0006xM-TV for larch@yhetil.org; Mon, 16 Nov 2020 23:04:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kesDT-0006ww-VR for emacs-orgmode@gnu.org; Mon, 16 Nov 2020 23:03:39 -0500 Received: from hiwela.pair.com ([209.68.5.201]:26718) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kesDR-0001QR-TM for emacs-orgmode@gnu.org; Mon, 16 Nov 2020 23:03:39 -0500 Received: from hiwela.pair.com (localhost [127.0.0.1]) by hiwela.pair.com (Postfix) with ESMTP id 9B83F980554; Mon, 16 Nov 2020 23:03:34 -0500 (EST) Received: from minshall-entroware-apollo.cliq.com (unknown [95.8.197.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by hiwela.pair.com (Postfix) with ESMTPSA id 46E948F0953; Mon, 16 Nov 2020 23:03:34 -0500 (EST) Received: from apollo2.minshall.org (localhost [IPv6:::1]) by minshall-entroware-apollo.cliq.com (Postfix) with ESMTP id C557D602F6; Tue, 17 Nov 2020 07:03:31 +0300 (+03) From: Greg Minshall To: Tim Cross Subject: Re: Changed list indentation behavior: how to revert? In-reply-to: Your message of "Mon, 16 Nov 2020 18:12:35 +1100." <874klpbwrg.fsf@gmail.com> X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 27.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 17 Nov 2020 07:03:31 +0300 Message-ID: <816918.1605585811@apollo2.minshall.org> Received-SPF: softfail client-ip=209.68.5.201; envelope-from=minshall@umich.edu; helo=hiwela.pair.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/16 23:03:34 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no 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-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=umich.edu (policy=none); 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-Spam-Score: 0.09 X-TUID: gZfneMtGjAPa hi, Tim, et al. i started feeling guilty yesterday, partly for being party to prolonging this discussion (though i do think it may be important?). but also for realizing i had *not* explored the alternatives Tim, Gustavo, and others have suggested. the following is *clearly* the department of irreproducible results. but, i've tried to document the effects of 'electric-indent-mode' and 'org-adapt-indentation' on a number of scenarios. i present the results with some explanation, but without much analysis. the irreproducibility is just (afaict) a function of my not being able to type the same thing over and over again, and/or transcribe the results correctly. the results here are, for the most part, the result of several runs, trying to eliminate disparities, and add new forms of results (such as, "two , then third returns to column one"). but, if anyone wants to try on their own, or automate further (the possibilities are endless! :), please, l=C3=BCtfen! there's an e-lisp function, and the shell double for loop towards the end of this e-mail. first, here's the *transposed* table, as i think it is more readable. (the word "transpose" should show up in the info pages!). at the end of the e-mail, though, i'll put the non-transposed -- maybe one sees some things there easier. | | t,t | t,headline-data | t,nil | nil,t | nil,headlin= e-data | nil,nil | |-----------+---------+-----------------+---------+-----------+------------= -------+-----------| | head | n | n,nbl,1 | 1 | 1 | = 1 | 1 | | head | 1 | 1 | 1 | n | n= ,nbl,1 | 1 | | src{ | n | n+2 | n+2 | 1 | = 1 | 1 | | src{ | 1 | 1 | 1 | n+2 [t-2] | n+2= [t-2] | n+2 [t-2] | | src; | n-4 | n-2 | n-2 | 1 | = 1 | 1 | | src; | 1 | 1 | 1 | n-2 [t+2] | n-2= [t+2] | n-2 [t+2] | | list | n+2*2,1 | 1 | n+2*2,1 | 1 | = 1 | 1 | | list | 1 | 1 | 1 | n+2*2,1 | = 1 | n+2*2,1 | | line | n | 1 | n | 1 | = 1 | 1 | | line | 1 | 1 | 1 | n | = 1 | n | the columns are (electric-indent,org-adapt-indentation) pairs. here are the cases (rows) and results (contents of cells). the ""-suffixed cases use C-j rather than . - head :: from a headline - n :: stays indented for "infinite" blank - n,nbl,1 :: n, then after first non-blank line, goes to 1 - 1 :: goes - src{ :: from, e.g., 'if (x) {' - n-2 :: undents by 2 - n+2 :: indents - n+2 [t-2] :: goes to n+2 (but, of non-blank line goes to n+4) - n-2 [t+2] :: goes to n-2 (but, that 2 past the previous indentation level) - src; :: from a regular program statement - list :: from item in list - n+2 :: indents once - n+2*2,1 :: indents once, stays on next , then 1 on next (three total) - 1 :: column 1 - line :: from an indented line - n :: never goes to 1 - 1 :: goes to 1 brute force lisp code #+begin_src elisp (defun feorge (el oai fname) (progn (add-hook 'org-mode-hook (electric-indent-mode (if el 1 0))) (find-file fname) (setq org-adapt-indentation oai) (let ((header "| |head | head | src{ | src{ | src; | src;= | list | list | line | line|") (hline "|-+-+-+-+-+-+-+-+-+-+-|") (results (format "| %s,%s | ||||||||||" electric-indent-mode org-a= dapt-indentation))) (goto-char (point-max)) (insert (format "el %s; oai %s" el oai)) (goto-char (point-max)) (newline) (insert (version)) (goto-char (point-max)) (newline) (insert (org-version)) (goto-char (point-max)) (newline) (insert header) (goto-char (point-max)) (newline) (insert hline) (goto-char (point-max)) (newline) (insert results) (goto-char (point-max)) (newline) (goto-char (point-max)) (newline)))) #+end_src and, the shell loop-de-loop #+begin_src sh for el in t nil; do for oai in t \'headline-data nil; do rm -f *x.org*; emacs -l ~/tmp/feorge.el --eval "(feorge ${el} ${oai} \"x.org\")"= ;=20=20=20=20=20 done;=20=20=20 done #+end_src untransposed table: | | head | head | src{ | src{ | src; | src;<= C-j> | list | list | line | line | |-------------------+---------+-----------+------+-----------+------+------= -----+-----------+-----------+------+-----------| | t,t | n | 1 | n | 1 | n-4 | 1 = | n+2*2,1 | 1 | n | 1 | | t,headline-data | n,nbl,1 | 1 | n+2 | 1 | n-2 | 1 = | 1 | 1 | 1 | 1 | | t,nil | 1 | 1 | n+2 | 1 | n-2 | 1 = | n+2*2,1 | 1 | n | 1 | | nil,t | 1 | n | 1 | n+2 [t-2] | 1 | n-2 [= t+2] | 1 | n+2*2,1 | 1 | n | | nil,headline-data | 1 | n,nbl,1 | 1 | n+2 [t-2] | 1 | n-2 [= t+2] | 1 | 1 | 1 | 1 | | nil,nil | 1 | 1 | 1 | n+2 [t-2] | 1 | n-2 [= t+2] | 1 | n+2*2,1 | 1 | n |