Re: splitting tasks

Jim Ottaway <[email protected]>
Newsgroups gmane.emacs.wiki.general
Message-ID <[email protected]>
>>>>> thomas knoll <[email protected]> writes:  > I had trouble 
with tasks splitting and inserting in the middle of > other 
tasks. But I haven't found a way to intentionally recreate the > 
problem. The only two things I can think of that might have 
something > to do with it are: > - I use long-lines-mode a lot 
That looks like a likely candidate if tasks are long enough to be 
wrapped: forward-line, which is used in quite a few planner 
functions, will end up in the middle of a task.   If this turns 
out to be the cause, you could disable wrapping just for task 
lines.  There is a variable called `fill-nobreak-predicate' that 
you can use to do that. In Emacs 22 it is a list so you could 
have:  (add-to-list
 'fill-nobreak-predicate
 #'(lambda ()
     (and (eq major-mode 'planner-mode)
          (save-excursion
            (goto-char (planner-line-beginning-position))
            (looking-at planner-task-regexp))))) 
             
In Emacs < 22, I think it is not a list, and you would have to do 
something like:  (add-hook
 'planner-mode-hook
 #'(lambda ()
     (set (make-local-variable 'fill-nobreak-predicate)
          #'(lambda ()
              (save-excursion
                (goto-char (planner-line-beginning-position))
                (looking-at planner-task-regexp))))))

[not tested!]

> - My tasks are numbering themselves, but I don't have that turned on
> in my .emacs (is it default now?)

It shouldn't be: planner-use-task-numbers defaults to nil.

-- 
Jim Ottaway
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.