Good work Greg. My only comment is about the tests in src blocks. I'm not sure about these as I always use the special editing mode for source blocks and I would expect that when you do this, the editing buffer would adopt the semantics of the native mode for the source language being edited. (I have org-src-tab-acts-natively t in my init). Were your tests just inside a src block in an org buffer or inside the special editing buffer? From that table and what others have posted, I suspect many would be best off with org-adapt-indentation set to nil or possible 'heading-data. Personally, I've not found the change an issue, but I rarely go more than 3 or 4 levels deep in my headlines and am use to C-j to add a non-indented line. However, I'm thinking about giving heading-data a spin as I like the indentation for planning lines and have less of a preference for the entry content. Tim On Tue, 17 Nov 2020 at 15:03, Greg Minshall wrote: > 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ütfen! > > 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,headline-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-adapt-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\")"; > > done; > done > #+end_src > > untransposed table: > > | | head | head | src{ | src{ | src; | > src; | 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 | > -- regards, Tim -- Tim Cross