[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] Skeletons for planner/emacs-wiki
From: |
Chris Parsons |
Subject: |
[emacs-wiki-discuss] Skeletons for planner/emacs-wiki |
Date: |
Wed, 12 Jan 2005 21:15:18 +0000 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (windows-nt) |
Hi there planner types,
I've discovered abbrev and skeleton mode today, and thought I'd share
some of the skeletons I've written to help with planner (applies to
emacs-wiki in general also). If anyone has any suggestions on improving
these please let me know....
(defun chrismdp/skeleton-read-or-use-region (prompt)
(if mark-active
(save-excursion
(delete-and-extract-region (region-beginning)
(region-end)))
(skeleton-read prompt)))
(define-skeleton chrismdp/planner-skeleton-company-bug-link
"Insert a link to the company bug list"
'(setq str (chrismdp/skeleton-read-or-use-region "Bug #: "))
"[[http://bugs.company.co.uk/show_bug.cgi?id=" str "][Bug " str "]]")
(define-skeleton chrismdp/planner-skeleton-bbdb-link
"Insert a link to the BBDB"
""
'(setq str (chrismdp/skeleton-read-or-use-region "Name: "))
"[[bbdb://"
(if (featurep 'xemacsp)
(replace-in-string " " "." str)
(replace-regexp-in-string " " "." str))
"][" str "]]")
I've got these mapped as follows:
(global-set-key (kbd "<f9> <f10> m")
'chrismdp/planner-skeleton-company-bug-link)
(global-set-key (kbd "<f9> <f10> b") 'chrismdp/planner-skeleton-bbdb-link)
Now I can planner-edit-task-description, type a name, select it as the
region and type <f9> <f10> b and I have a bbdb link for it in my task.
Theoretically the bug one can be useful for any type of link... perhaps
planner-skeleton-zipcode-link where you type a zipcode and have it link
to your favourite mapping site? In theory, anything that would be useful
as a firefox search engine might be of some use here...
Maybe useful to someone else too. Certainly useful for me...
Chris
--
Chris Parsons
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [emacs-wiki-discuss] Skeletons for planner/emacs-wiki,
Chris Parsons <=