From: Lawrence Mitchell <wence@gmx.li>
To: emacs-orgmode@gnu.org
Cc: Nicolas Goaziou <n.goaziou@gmail.com>
Subject: Re: [BUG/PATCH] Set fill-indent-according-to-mode to nil in Org buffers
Date: Fri, 21 Jan 2011 14:21:38 +0000 [thread overview]
Message-ID: <m31v46tk0d.fsf@gmx.li> (raw)
In-Reply-To: 871v46tm6g.wl%n.goaziou@gmail.com
Nicolas Goaziou wrote:
> Hello,
>> This is defeated by the indentation code, which does not recognise
>> sublists correctly and gets the indentation wrong.
> Would you mind elaborating? I fail to see where the indentation code
> has some problem recognizing lists.
Hopefully the example below clears things up a bit.
>> By setting `fill-indent-according-to-mode' to nil, we tell Emacs'
>> filling code to pay attention to `adaptive-fill-prefix' rather than
>> using `indent-line-function'.
> Not using `org-indent-line-function' sounds like a very bad idea to
> me. Before ignoring this function, perhaps we could try to see what is
> wrong with it.
>> This is not a perfect solution, since refilling a list entry still
>> does not work correctly unless the entire item is on a single line.
> Huh? Again, could you provide an example, please?
emacs -Q
C-x C-f $TMP/foo.org
M-: (erase-buffer) RET
M-x auto-fill-mode RET
M-: (insert "* Header\n- List entry\n - Sublist entry") RET
Now type some more text so that the sublist entry line goes past
the fill column. Note where the line-wrapping puts the
continuation of the sublist entry:
1 | * Header
2 | - List entry
3 | - Sublist entry here we have some more text to make the line very
4 | very long and trigger line-wrapping.
So the text on line 4 is considered to be part of the sublist
entry, while I would expect it to be so (it would have been if
auto-fill-mode were off).
If fill-indent-according-to-mode is set to nil then doing the
same thing leads to:
1 | * Header
2 | - List entry
3 | - Sublist entry here we have some more text to make the line very
4 | very long and trigger line-wrapping.
Notice how in this case the continuation of the sublist entry is
correct.
Furthermore, if you've formatted the document as in the second
example by hand, but fill-indent-according-to-mode is t, and you
hit M-q on the sublist entry, the indentation of line 4 is
changed from 4 spaces to 2 spaces. This changes line 4 from
being part of the sublist entry to being part of the list entry
from line 2.
Hope this clarifies things.
Cheers,
Lawrence
--
Lawrence Mitchell <wence@gmx.li>
next prev parent reply other threads:[~2011-01-21 14:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-21 10:47 [BUG/PATCH] Set fill-indent-according-to-mode to nil in Org buffers Lawrence Mitchell
2011-01-21 13:34 ` Nicolas Goaziou
2011-01-21 14:21 ` Lawrence Mitchell [this message]
2011-01-21 16:00 ` Nicolas Goaziou
2011-01-21 16:09 ` Lawrence Mitchell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m31v46tk0d.fsf@gmx.li \
--to=wence@gmx.li \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).