forked from jedthehumanoid/taskpaper.el
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialized repo, added README, and first version of taskpaper.el (on…
…ly features crude syntax highlightning for now)
- Loading branch information
0 parents
commit de350be
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Taskpaper major mode for emacs. | ||
|
||
Put taskpaper.el file somewhere (for instance in ~/emacs.d/taskpaper.el) | ||
In .emacs, add: | ||
(load-file "~/taskpaper.el/taskpaper.el") | ||
(require 'taskpaper-mode) | ||
Load taskpaper-mode when you are in a buffer editing a taskpaper textfile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(defvar taskpaper-mode-map nil "Keymap for taskpaper-mode") | ||
(when (not taskpaper-mode-map) | ||
(setq taskpaper-mode-map (make-sparse-keymap)) | ||
(define-key taskpaper-mode-map (kbd "<S-return>") 'taskpaper-focus-project) | ||
) | ||
|
||
(setq tpKeywords | ||
'( | ||
(".*@done.*" . font-lock-comment-face) | ||
(".*:$" . font-lock-function-name-face) | ||
("^ *[^- ].*[^:]$" . font-lock-comment-face) | ||
("@.*" . font-lock-variable-name-face) | ||
|
||
) | ||
) | ||
(defun taskpaper-mode () | ||
"Major mode for editing taskpaper styled files." | ||
(interactive) | ||
(kill-all-local-variables) | ||
|
||
(setq major-mode 'taskpaper-mode) | ||
(setq mode-name "Taskpaper") ; for display purposes in mode line | ||
(use-local-map taskpaper-mode-map) | ||
|
||
(setq font-lock-defaults '(tpKeywords)) | ||
|
||
|
||
(toggle-truncate-lines t) | ||
|
||
;; ... other code here | ||
|
||
(run-hooks 'taskpaper-mode-hook)) | ||
|
||
(provide 'taskpaper-mode) |