emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] Problem with planner-task-info-from-string


From: Toby Allsopp
Subject: [emacs-wiki-discuss] Problem with planner-task-info-from-string
Date: Fri, 11 Mar 2005 13:44:13 +1300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (cygwin)

It seems that planner-task-info-from-string only correctly identifies
a task's date from its link if the current buffer is in planner-mode
because it uses emacs-wiki-name-regexp to check if the link is
actually a link but the non-planner version of that regexp doesn't
match links to day pages.

A possible fix is included below.

Toby.

--- planner.el  2005-03-11 13:36:36.048550700 +1300
+++ planner.el~ 2005-03-09 05:25:37.000000000 +1300
@@ -1038,8 +1038,6 @@
         (insert template))
     (set-buffer-modified-p nil))))
 
-(defvar planner-total-name-regexp emacs-wiki-name-regexp)
-
 (defun planner-update-wiki-project ()
   "Update the \"planner\" project in emacs-wiki-projects."
   ;; Remove the entry associated with Planner
@@ -1051,10 +1049,10 @@
         (delq (assoc planner-project-default-name emacs-wiki-projects)
               emacs-wiki-projects))
   ;; Assign new contents to Planner entry
-  (setq planner-total-name-regexp
+  (let ((new-regexp
         (if planner-name-regexp
             (concat emacs-wiki-name-regexp "\\|" planner-name-regexp)
-          emacs-wiki-name-regexp))
+           emacs-wiki-name-regexp)))
   (add-to-list
    'emacs-wiki-projects
    `(,planner-project
@@ -1068,7 +1066,7 @@
                     emacs-wiki-publishing-markup))
         (emacs-wiki-url-or-name-regexp . nil)
         (emacs-wiki-name-regexp
-         . ,planner-total-name-regexp)
+           . ,new-regexp)
         ;; this is here just so the right
         ;; url-or-name-regexp value is used
         (emacs-wiki-highlight-regexp . nil)
@@ -1078,7 +1076,7 @@
         (emacs-wiki-publishing-directory
          . ,planner-publishing-directory)
         ,@planner-custom-variables)))
-  (emacs-wiki-update-project-interwikis))
+    (emacs-wiki-update-project-interwikis)))
 
 (defun planner-add-protocol (protocol browse-function resolve-function)
   "Add PROTOCOL to `emacs-wiki-url-protocols'.
@@ -1561,7 +1559,7 @@
        ((string-match "\\s-+$" description)
         (setq description (replace-match "" t t description))))
       (when link
-        (setq link (and (string-match planner-total-name-regexp link-text)
+        (setq link (and (string-match emacs-wiki-name-regexp link-text)
                         (planner-link-base link-text))))
       (unless (planner-local-page-p link) (setq link nil))
       (if (string-match planner-date-regexp page-name)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]