[Orgmode] Re: [BUG/PATCH] Set fill-indent-according-to-mode to nil in Org buffers

2011-01-21 Thread Lawrence Mitchell
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 we...@gmx.li


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [BUG/PATCH] Set fill-indent-according-to-mode to nil in Org buffers

2011-01-21 Thread Nicolas Goaziou
 Lawrence Mitchell writes:

 Hopefully the example below clears things up a bit.

I cannot reproduce it, even when following your steps.

Regards,

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [BUG/PATCH] Set fill-indent-according-to-mode to nil in Org buffers

2011-01-21 Thread Lawrence Mitchell
Nicolas Goaziou wrote:
 Lawrence Mitchell writes:

 Hopefully the example below clears things up a bit.

 I cannot reproduce it, even when following your steps.

This would appear to be due to driver error on my part.  My
.emacs sets fill-indent-according-to-mode to t, whereas by
default it is nil.  So to reproduce, follow my recipe and add M-:
(setq fill-indent-according-to-mode t) RET after opening the
org-mode buffer.

Given that the default value of fill-indent-according-to-mode
does /not/ cause a problem, maybe there's no reason to explicitly
set it to nil in org-mode.  I'll leave others to decide.

Cheers,

Lawrence


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode