Hello,

When auto-fill is on, planner will incorrectly break long task lines
and section headings. This patch fixes this behaviour.

-- 
Gregory Collins <[EMAIL PROTECTED]>

When auto-fill is on, planner will incorrectly break long task lines
and section headings. This patch fixes this behaviour.

diff -r 6a946e913397 planner.el
--- a/planner.el	Sun Sep 16 00:09:33 2007 -0400
+++ b/planner.el	Tue Sep 18 22:19:24 2007 -0400
@@ -1034,6 +1034,15 @@ does to the diary buffer."
 
 ;;;###autoload
 
+(defun planner-auto-fill-function ()
+  "Auto-fill function for planner mode. Doesn't break the line if
+  we are looking at a task or a section."
+  (unless (save-excursion
+            (beginning-of-line)
+            (or (looking-at "^\#")
+                (looking-at "^\\*\\s-+")))
+    (do-auto-fill)))
+
 (define-derived-mode planner-mode muse-mode "Planner"
   "A personal information manager for Emacs.
 \\{planner-mode-map}"
@@ -1053,6 +1062,8 @@ does to the diary buffer."
       (add-hook hook 'planner-renumber-tasks-maybe t t)
       (add-hook hook 'planner-align-tasks-maybe t t))
     (planner-setup-highlighting)
+    (set (make-local-variable 'normal-auto-fill-function)
+         'planner-auto-fill-function)
     (when (fboundp 'easy-menu-add)
       (easy-menu-add planner-menu planner-mode-map))
     (planner-prepare-file)))
_______________________________________________
Planner-el-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/planner-el-discuss

Reply via email to