[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] Re: {{Tasks:xx}}
From: |
Sacha Chua |
Subject: |
[emacs-wiki-discuss] Re: {{Tasks:xx}} |
Date: |
Thu, 29 Sep 2005 01:04:19 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
address@hidden (J. David Boyd) writes:
> Subject: {{Tasks:xx}}
> I know I turned this on somewhere, but I don't like seeing it in my tasks
> list.
You might like the following code. Replace the filename with one to a
suitably small image, or grab
http://sacha.free.net.ph/notebook/pics/screen/id-small.png . =)
;;;_+ Marking up IDs as images
(defun planner-id-image (id)
"Return the image to mark up ID as, or nil if none."
(save-match-data (when (string-match "Tasks" id)
"~/notebook/pics/screen/id-small.png")))
(defun planner-id-highlight-images (beg end &optional verbose)
"Highlight IDs as pictures from BEG to END.
VERBOSE is ignored."
(goto-char beg)
(while (re-search-forward "{{[^}]+}}" end t)
(let ((image (planner-id-image (match-string 0))))
(when image
(emacs-wiki-inline-image (match-beginning 0)
(match-end 0)
image
(match-string 0))))))
(add-hook 'planner-mode-hook
(lambda () (add-hook 'emacs-wiki-highlight-buffer-hook
'planner-id-highlight-images)))
> What would be the consequence of turning off whatever I turned on to make this
> show up?
Nothing bad will happen, although the old IDs won't be taken out.
Just remove (require 'planner-id) from your ~/.emacs. =)
Sacha
--
Sacha Chua <address@hidden> - open source geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, juggling
sachac on irc.freenode.net#emacs . YM: sachachua83