From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Smart(er) word wrapping with org-mode and visual-line-mode Date: Sun, 10 Jan 2010 22:07:52 +0100 Message-ID: <141A5FC1-7E42-43B1-AC66-ADB0EDB9F67C@gmail.com> References: <4B44AB80.5070304@os.inf.tu-dresden.de> <57BC09A2-08C5-43B0-B255-E33EA8ABE4AE@gmail.com> <4B4A25E3.4020401@os.inf.tu-dresden.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NU513-00062m-1L for emacs-orgmode@gnu.org; Sun, 10 Jan 2010 16:08:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NU50x-00062P-FO for emacs-orgmode@gnu.org; Sun, 10 Jan 2010 16:08:03 -0500 Received: from [199.232.76.173] (port=34001 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NU50x-00062M-A0 for emacs-orgmode@gnu.org; Sun, 10 Jan 2010 16:07:59 -0500 Received: from mail-ew0-f214.google.com ([209.85.219.214]:63246) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NU50w-00019B-BX for emacs-orgmode@gnu.org; Sun, 10 Jan 2010 16:07:59 -0500 Received: by ewy6 with SMTP id 6so20504188ewy.9 for ; Sun, 10 Jan 2010 13:07:56 -0800 (PST) In-Reply-To: <4B4A25E3.4020401@os.inf.tu-dresden.de> 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: Martin Pohlack Cc: emacs-orgmode@gnu.org On Jan 10, 2010, at 8:09 PM, Martin Pohlack wrote: > Hi Carsten and Matthew, > > On 08.01.2010 18:24, Carsten Dominik wrote: >> On Jan 6, 2010, at 4:25 PM, Martin Pohlack wrote: >>> I just tried this out (only for headlines up to now) and it seems to >>> work great. >>> >>> Are there any plans to integrate something like this into upstream? >>> Especially the wrapping of headlines would enable extensive tag >>> usage. >> >> I have been thinking about that, but not arrived at a conclusion. >> One >> thing is the interaction with org-indent-mode. That mode already >> does >> the wrapping for headlines correctly by adding `wrap-prefix', and it >> will look really good if you set the variable word-wrap to t. > > Ah, I wasn't aware of that. I think the documentation to org-indent > doesn't mention wrapping (14.6 A cleaner outline view). How about > something like this: > > org-indent-mode also sets the wrap-prefix property, such that > visual-line-mode (or purely setting word-wrap) wraps long lines > (including headlines) correctly indented. > >> However, the showstoppers are the following: >> >> 1. I cannot bring myself to turn off truncate-lines, because it >> messes up tables and code examples badly, and these are major >> components of my work. > > Right, I haven't used it to much up to now. > >> I have actually put in a feature >> request into Emacs for a property `truncate-line', to be >> able to control this line by line. I got positive feedback, >> but I don't know when any of the developers finds time >> to implement it - I cannot do that myself. > > Awesome. This sounds like the way to go. > >> 2. Visual-line-mode is also a no go for me, I use keyboard >> macros a lot and need to be able to rely on the fact that >> [down] move the cursor into the next physical line. > > I sometimes like visual navigation in wrapped text and my own motion > commands. I have two commands to move visually explicitly (bound to > s-down, s-up (super-...)). > > (defun next-visual-line (&optional arg try-vscroll) > (interactive "^p\np") > (let ((line-move-visual t)) > (with-no-warnings > (next-line arg try-vscroll)))) > > (defun previous-visual-line (&optional arg try-vscroll) > (interactive "^p\np") > (let ((line-move-visual t)) > (with-no-warnings > (previous-line arg try-vscroll)))) Jup, good way out. > >> So I am not sure how to handle this. We could turn Matthews >> code into a module that users can turn on if they wish. > > I'm using Matthew's module right now for two reasons. > > * I had some trouble configuring org-indent-mode to only handle > line-wrapping for headlines, i.e., it shall only set wrap-prefix and > do nothing else. It always wanted to indent my headlines and body > texts additionally. Is this possible? > > * Also, emacs segfaulted deterministically after globally collapsing > all trees with org-indent-mode active. I have to look into this ... You need a bleeding-edge Emacs. The official 23.1 release indeed segfaults with this, but this bug has been fixed in the mean time. - Carsten > > Cheers, > Martin - Carsten