From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Mitchell Subject: Re: [BUG/PATCH] Set fill-indent-according-to-mode to nil in Org buffers Date: Fri, 21 Jan 2011 14:21:38 +0000 Message-ID: References: <1295606863-16627-1-git-send-email-wence@gmx.li> <871v46tm6g.wl%n.goaziou@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=50340 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgHsB-00044h-7t for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 09:21:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgHs9-0005Ed-PW for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 09:21:55 -0500 Received: from lo.gmane.org ([80.91.229.12]:37812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgHs9-0005E1-Ff for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 09:21:53 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PgHs7-0002m5-Rr for emacs-orgmode@gnu.org; Fri, 21 Jan 2011 15:21:51 +0100 Received: from e4300lm.epcc.ed.ac.uk ([129.215.63.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Jan 2011 15:21:51 +0100 Received: from wence by e4300lm.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Jan 2011 15:21:51 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Nicolas Goaziou 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