diff --git a/README b/README new file mode 100644 index 0000000..e27ccb8 --- /dev/null +++ b/README @@ -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 + diff --git a/taskpaper.el b/taskpaper.el new file mode 100644 index 0000000..2d2c2f0 --- /dev/null +++ b/taskpaper.el @@ -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 "") '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) \ No newline at end of file