[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-wiki-discuss] Re: bugs?
From: |
fouvry+emacs-wiki |
Subject: |
Re: [emacs-wiki-discuss] Re: bugs? |
Date: |
Wed, 13 Apr 2005 19:17:25 +0200 (CEST) |
,-- On Wed, 13 Apr 2005 23:48:43 +0800, Sacha Chua wrote:
|
[...]
| It should be easy to modify this code to replace all links that match
| or do not match a regexp filter with "", which means the file won't be
| linked.
Indeed. Thanks.
[...]
| Try out the following code and see if you like it. =)
|
| (defun sacha/planner-markup-tasks ()
| (while (re-search-forward planner-task-regexp nil t)
| ;; Insert "<ul>\n"
| (goto-char (line-beginning-position))
| (insert "<ul>\n")
| (while (looking-at "^#\\([A-C]\\)\\([0-9]*\\)\\s-+\\(.\\)\\s-+\\(.+\\)")
| (let ((priority (match-string 1))
| (number (match-string 2))
| (status (match-string 3))
| (text (match-string 4)))
| (delete-region (line-beginning-position)
| (min (point-max) (1+ (line-end-position))))
| (insert (format "<li class=\"%s\"><span class=\"%s\">%s</span>
%s</li>\n"
| (cond
| ((string= status "_") "task_")
| ((string= status "o") "tasko")
| ((string= status ">") "taskd")
| ((string= status "P") "taskp")
| ((string= status "X") "taskX")
| ((string= status "C") "task_cancelled")
| (t "task"))
| (cond
| ((string= priority "A") "taskA")
| ((string= priority "B") "taskB")
| ((string= priority "C") "taskC")
| (t "task"))
| (concat priority number " " status)
| text))))
| (insert "</ul>\n")))
| (add-to-list 'planner-publishing-markup (function sacha/planner-markup-tasks))
| (planner-update-wiki-project)
That seems to work nicely. Only, the strikethrough as defined in
CSS does not seem to work anymore on <li>. But I'm not sure
whose problem that is ...
Thanks!
Frederik