From aaa9e1a953d8db0e974db9b09b2fe0b19751e3d9 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 13 Aug 2013 22:20:08 +0200 Subject: Initial commit of my Emacs configuration in vcsh --- .emacs.d/site-lisp/.gitignore | 1 + .emacs.d/site-lisp/Makefile | 5 + .emacs.d/site-lisp/dzen.el | 86 +++++++++++ .emacs.d/site-lisp/eltuki.el | 266 ++++++++++++++++++++++++++++++++++ .emacs.d/site-lisp/metalexpress.el | 80 ++++++++++ .emacs.d/site-lisp/mu4e-init.el | 54 +++++++ .emacs.d/site-lisp/org-init.el | 151 +++++++++++++++++++ .emacs.d/site-lisp/quick-edit-mode.el | 74 ++++++++++ .emacs.d/site-lisp/wm-init.el | 3 + 9 files changed, 720 insertions(+) create mode 100644 .emacs.d/site-lisp/.gitignore create mode 100644 .emacs.d/site-lisp/Makefile create mode 100644 .emacs.d/site-lisp/dzen.el create mode 100644 .emacs.d/site-lisp/eltuki.el create mode 100644 .emacs.d/site-lisp/metalexpress.el create mode 100644 .emacs.d/site-lisp/mu4e-init.el create mode 100644 .emacs.d/site-lisp/org-init.el create mode 100644 .emacs.d/site-lisp/quick-edit-mode.el create mode 100644 .emacs.d/site-lisp/wm-init.el (limited to '.emacs.d/site-lisp') diff --git a/.emacs.d/site-lisp/.gitignore b/.emacs.d/site-lisp/.gitignore new file mode 100644 index 0000000..813048b --- /dev/null +++ b/.emacs.d/site-lisp/.gitignore @@ -0,0 +1 @@ +rudel/ diff --git a/.emacs.d/site-lisp/Makefile b/.emacs.d/site-lisp/Makefile new file mode 100644 index 0000000..0925ac7 --- /dev/null +++ b/.emacs.d/site-lisp/Makefile @@ -0,0 +1,5 @@ +.PHONY: all +all: org-init.elc + +%.elc: %.el + emacs -Q -batch -eval "(byte-compile-file \"$<\")" diff --git a/.emacs.d/site-lisp/dzen.el b/.emacs.d/site-lisp/dzen.el new file mode 100644 index 0000000..da83099 --- /dev/null +++ b/.emacs.d/site-lisp/dzen.el @@ -0,0 +1,86 @@ +;;; dzen.el --- Control DZEN2 from emacs + +;; Copyright (C) 2012 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: convenience + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'newst-backend) +(require 'sawfish) + +(defvar dzen-process nil + "Dzen2's process.") + +(defvar dzen-timer nil + "Timer used to update the dzen line.") + +(defun get-mail-count (account) + (length (directory-files (concat "/home/slash/documents/mail/" + account "/inbox/new") nil "^[^.]"))) + +(defun dzen-update () + (let ((strl "") + (strc (if (boundp 'metal-express-radio-currently-playing) + metal-express-radio-currently-playing + "")) + (strr (format + "jabber: %s ryu: %d gm: %d aet: %d 9n: %d rss: %d\n" + (oni:current-jabber-status) + (get-mail-count "ryuslash.org") + (get-mail-count "gmail") + (get-mail-count "aethon") + (get-mail-count "ninthfloor") + (newsticker--stat-num-items-total 'new)))) + (process-send-string + "dzen2" (format "%s^p(_CENTER)^p(-%d)%s^p(_RIGHT)^p(-%d)%s" + strl + (* (floor (/ (length strc) 2)) 8) strc + (+ 8 (* 8 (length strr))) strr)))) + +(defun dzen-start () + (interactive) + (if (or (null dzen-process) (not (process-live-p dzen-process))) + (progn + (setq dzen-process + (start-process "dzen2" "*dzen2*" "dzen2" + "-w" "1920" + "-fn" "Monaco-10" + "-bg" "#222224" + "-fg" "#eeeeec" + "-y" "1060")) + (dzen-update) + (setq dzen-timer (run-with-timer 1 1 #'dzen-update))) + (message "Dzen2 already running"))) + +(defun dzen-stop () + (interactive) + (if (and dzen-process (process-live-p dzen-process)) + (progn + (when dzen-timer + (cancel-timer dzen-timer)) + (kill-process "dzen2")) + (message "Dzen2 is not running")) + (setq dzen-process nil + dzen-timer nil)) + +(provide 'dzen) +;;; dzen.el ends here diff --git a/.emacs.d/site-lisp/eltuki.el b/.emacs.d/site-lisp/eltuki.el new file mode 100644 index 0000000..b64f786 --- /dev/null +++ b/.emacs.d/site-lisp/eltuki.el @@ -0,0 +1,266 @@ +;;; eltuki.el --- Tekuti functions + +;; Copyright (C) 2012 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: convenience + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Tekuti functions. + +;;; Code: + +(require 'org) + +(defgroup eltuki + nil + "tekuti functions in Emacs." + :group 'external) + +(defcustom eltuki-blog-dir "~/blog" + "Plain blog post directory, not the git repository." + :group 'eltuki + :type 'string) + +(defcustom eltuki-default-status "publish" + "Default status to use when status is unknown." + :group 'eltuki + :type 'string) + +(defcustom eltuki-default-comment-status "open" + "Default status for comments." + :group 'eltuki + :type 'string) + +(define-skeleton eltuki-post + "Create a post template for eltuki." + "" + "#+TITLE: " (skeleton-read "Title: ") "\n" + "#+TIMESTAMP: \n" + "#+TAGS: " (skeleton-read "Tags (comma separated): ") "\n" + "\n" + _) + +(defun eltuki-new-post () + (interactive) + (switch-to-buffer (get-buffer-create "*eltuki*")) + (org-mode) + (eltuki-post)) + +(defun eltuki-get-title () + (save-excursion + (goto-char (point-min)) + (if (re-search-forward "^#\\+TITLE: \\(.*\\)$" nil t) + (buffer-substring-no-properties + (match-beginning 1) (match-end 1)) + (error "Post has no title.")))) + +(defun eltuki-set-title (title) + (interactive "MTitle: ") + (setq title (concat " " title)) + (save-excursion + (goto-char (point-min)) + (if (re-search-forward "^#\\+TITLE:\\(.*\\)$" nil t) + (replace-match title t t nil 1) + (insert "#+TITLE:" title "\n") + (unless (= (char-after) ?\n) + (insert-char ?\n))))) + +(defun eltuki-get-timestamp () + (save-excursion + (goto-char (point-min)) + (if (re-search-forward "^#\\+TIMESTAMP: \\([[:digit:]]+\\)$" nil t) + (match-string 1) + (format-time-string "%s")))) + +(defun eltuki-set-timestamp () + (interactive) + (save-excursion + (goto-char (point-min)) + (let ((newtime (format-time-string " %s"))) + (if (re-search-forward "^#\\+TIMESTAMP:\\(.*\\)$" nil t) + (replace-match newtime nil t nil 1) + (when (search-forward "\n\n" nil t) + (backward-char)) + (insert "#+TIMESTAMP:" newtime "\n"))))) + +(defun eltuki-get-tags () + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "^#\\+TAGS: \\(.*\\)$" nil t) + (buffer-substring-no-properties + (match-beginning 1) (match-end 1))))) + +(defun eltuki-set-tags (tags) + (interactive "MTags: ") + (setq tags (concat " " tags)) + (save-excursion + (goto-char (point-min)) + (if (re-search-forward "^#\\+TAGS:\\(.*\\)$" nil t) + (replace-match tags t t nil 1) + (when (search-forward "\n\n" nil t) + (backward-char)) + (insert "#+TAGS:" tags "\n")))) + +(defun eltuki-get-status () + (save-excursion + (goto-char (point-min)) + (if (re-search-forward "^#\\+STATUS: \\(draft\\|publish\\)$" nil t) + (buffer-substring-no-properties + (match-beginning 1) (match-end 1)) + eltuki-default-status))) + +(defun eltuki-toggle-status () + (interactive) + (save-excursion + (goto-char (point-min)) + (let ((newstatus (if (string= (eltuki-get-status) "draft") + " publish" + " draft"))) + (if (re-search-forward "^#\\+STATUS:\\(.*\\)$" nil t) + (replace-match newstatus t t nil 1) + (when (search-forward "\n\n" nil t) + (backward-char)) + (insert "#+STATUS:" newstatus "\n"))))) + +(defun eltuki-get-comment-status () + (save-excursion + (goto-char (point-min)) + (if (re-search-forward + "^#\\+COMMENTSTATUS: \\(open\\|closed\\)$" nil t) + (buffer-substring-no-properties + (match-beginning 1) (match-end 1)) + eltuki-default-comment-status))) + +(defun eltuki-toggle-comment-status () + (interactive) + (save-excursion + (goto-char (point-min)) + (let ((newstatus (if (string= (eltuki-get-comment-status) "closed") + " open" + " closed"))) + (if (re-search-forward "^#\\+COMMENTSTATUS:\\(.*\\)$" nil t) + (replace-match newstatus t t nil 1) + (when (search-forward "\n\n" nil t) + (backward-char)) + (insert "#+COMMENTSTATUS:" newstatus "\n"))))) + +(defun eltuki-slugify-string (str) + (while (string-match "[^a-zA-Z0-9 ]+" str) + (setq str (replace-match "" nil t str))) + (while (string-match " +" str) + (setq str (replace-match "-" nil t str))) + (downcase str)) + +(defun eltuki-get-directory () + (concat + eltuki-blog-dir "/" + (format-time-string "%Y%%2f%m%%2f%d%%2f") + (eltuki-slugify-string (eltuki-get-title)))) + +(defun eltuki-write-content (dir) + (let ((org-export-with-toc nil) + (org-export-with-section-numbers nil) + (filename (concat dir "/content")) + (org-export-show-temporary-export-buffer nil)) + (org-html-export-as-html nil nil nil t) + (with-current-buffer "*Org HTML Export*" + (write-region (point-min) (point-max) filename) + (kill-buffer)) + filename)) + +(defun eltuki-write-metadata (dir) + (let ((timestamp (eltuki-get-timestamp)) + (tags (eltuki-get-tags)) + (status (eltuki-get-status)) + (title (eltuki-get-title)) + (name (eltuki-slugify-string (eltuki-get-title))) + (commentstatus (eltuki-get-comment-status)) + (filename (concat dir "/metadata"))) + (with-temp-buffer + (insert "timestamp: " timestamp "\n" + "tags: " tags "\n" + "status: " status "\n" + "title: " title "\n" + "name: " name "\n" + "comment_status: " commentstatus) + (write-region (point-min) (point-max) filename)) + filename)) + +(defun eltuki-save-org (buffer dir) + (let ((filename (concat dir "/post.org"))) + (with-current-buffer buffer + (write-file filename)) + filename)) + +(defun eltuki-git-add (file) + (shell-command (concat "cd " eltuki-blog-dir "; git add '" (expand-file-name file) "'"))) + +(defun eltuki-commit () + (shell-command (concat "cd " eltuki-blog-dir "; git commit -m \"new post: \\\"" (eltuki-get-title) + "\\\"\""))) + +(defun eltuki-finish () + (interactive) + (let ((buffer (or (get-buffer "*eltuki*") + (current-buffer))) + (dest (eltuki-get-directory))) + (unless (file-exists-p dest) + (mkdir dest)) + + (mapc #'eltuki-git-add + (list (eltuki-write-content dest) + (eltuki-write-metadata dest) + (eltuki-save-org buffer dest))) + + (eltuki-commit) + (kill-buffer buffer))) + +(defun eltuki-process-sentinel (proc status) + "Print PROC's STATUS." + (message "git %s" (substring status 0 -1))) + +(defun eltuki--passwd-prompt (string) + "Decide on what to prompt based on STRING." + (cond + ((or + (string-match "^Enter passphrase for key '\\\(.*\\\)': $" string) + (string-match "^\\\(.*\\\)'s password:" string)) + (format "Password for '%s': " (match-string 1 string))) + ((string-match "^[pP]assword:" string) + "Password:"))) + +(defun eltuki-process-filter (proc string) + "Check if PROC is asking for a password in STRING." + (with-current-buffer (process-buffer proc) + (let ((inhibit-read-only t) + (ask (eltuki--passwd-prompt string))) + (if ask + (process-send-string proc (concat (read-passwd ask nil) "\n")) + (insert string))))) + +(defun eltuki-publish () + "Publish posts." + (interactive) + (let* ((default-directory (concat eltuki-blog-dir "/")) + (proc (start-process "eltuki-publish" "*eltuki-publish*" + "git" "push"))) + (set-process-sentinel proc 'eltuki-process-sentinel) + (set-process-filter proc 'eltuki-process-filter))) + +(provide 'eltuki) +;;; eltuki.el ends here diff --git a/.emacs.d/site-lisp/metalexpress.el b/.emacs.d/site-lisp/metalexpress.el new file mode 100644 index 0000000..619e4e3 --- /dev/null +++ b/.emacs.d/site-lisp/metalexpress.el @@ -0,0 +1,80 @@ +;;; metalexpress.el --- Listen to Metal Express Radio + +;; Copyright (C) 2012 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: multimedia + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Functions for easily listening to Metal Express Radio. + +;;; Code: + +(defgroup metal-express-radio nil + "Group for the Metal Express Radio listening functions." + :group 'multimedia) + +(defcustom metal-express-radio-playlist-url + "http://usa7-vn.mixstream.net/listen/8248.m3u" + "The URL of the Metal Express Radio stream." + :group 'metal-express-radio + :type 'string) + +(defcustom metal-express-radio-song-changed-hook nil + "Hook run when the currently playing song changes." + :type 'hook + :group 'metal-express-radio) + +(defvar metal-express-radio-currently-playing nil + "The currently playing song.") + +(defun mer-proc-filter (proc string) + (when (string-match "^ICY Info: StreamTitle='\\(.*\\)';StreamUrl='';" + string) + (setq metal-express-radio-currently-playing (match-string 1 string)) + (run-hooks 'metal-express-radio-song-changed-hook))) + +(defun metal-express-radio-echo-currently-playing () + (interactive) + (message metal-express-radio-currently-playing)) + +(defun metal-express-radio-notify () + (interactive) + (notifications-notify :title "Now playing:" + :body metal-express-radio-currently-playing)) + +;;;###autoload +(defun metal-express-radio-start () + "Start listening to Metal Express Radio." + (interactive) + (let ((proc (start-process "metalexpress" "*Metal Express Radio*" + "mplayer" metal-express-radio-playlist-url))) + (set-process-filter proc #'mer-proc-filter))) + +(defun metal-express-radio-stop () + "Stop listening to Metal Express Radio." + (interactive) + (kill-process (get-buffer-process "*Metal Express Radio*")) + (setq metal-express-radio-currently-playing nil)) + +(add-hook 'metal-express-radio-song-changed-hook + 'metal-express-radio-echo-currently-playing) +(add-hook 'metal-express-radio-song-changed-hook + 'metal-express-radio-notify) + +(provide 'metalexpress) +;;; metalexpress.el ends here diff --git a/.emacs.d/site-lisp/mu4e-init.el b/.emacs.d/site-lisp/mu4e-init.el new file mode 100644 index 0000000..e11baf5 --- /dev/null +++ b/.emacs.d/site-lisp/mu4e-init.el @@ -0,0 +1,54 @@ +;;; mu4e-init.el --- mu4e initialization + +;; Copyright (C) 2012 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'oni) + +(oni:define-mailbox "aethon" + (oni:email thomas at aethon dot nl) + (expand-file-name "~/documents/work/aethon/signature.txt")) +(oni:define-mailbox "gmail" (oni:email ryuslash at gmail dot com)) +(oni:define-mailbox "ninthfloor" + (oni:email ryuslash at ninthfloor dot org)) +(oni:define-mailbox "ryuslash" (oni:email tom at ryuslash dot org) + nil "ryuslash.org") + +(setq mu4e-headers-date-format "%d-%m %H:%M") +(setq mu4e-headers-fields '((:date . 11) + (:flags . 6) + (:to . 22) + (:from . 22) + (:subject))) +(setq mu4e-headers-show-threads nil) +(setq mu4e-headers-sort-revert nil) +(setq mu4e-html2text-command "w3m -dump -T text/HTML -cols 72") +(setq mu4e-my-email-addresses (list + (oni:email tom at ryuslash dot org) + (oni:email ryuslash at gmail dot com) + (oni:email ryuslash at ninthfloor dot org) + (oni:email thomas at aethon dot nl))) + +(provide 'mu4e-init) +;;; mu4e-init.el ends here diff --git a/.emacs.d/site-lisp/org-init.el b/.emacs.d/site-lisp/org-init.el new file mode 100644 index 0000000..e3d0044 --- /dev/null +++ b/.emacs.d/site-lisp/org-init.el @@ -0,0 +1,151 @@ +;;; org-init.el --- Org initialization + +;; Copyright (C) 2012 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'appt) +(require 'org-habit) +(require 'org-protocol) + +(eval-after-load "org" + '(require 'org-contacts)) + +(eval-when-compile + (require 'desktop) + (require 'org-capture)) + +(autoload 'org-clocking-p "org-clock") + +(eval-after-load "org-crypt" + '(org-crypt-use-before-save-magic)) + +(defun tagify (str) + "Remove dots, replace - with _ in STR." + (replace-regexp-in-string + "-" "_" (replace-regexp-in-string "\\." "" (downcase str)))) + +(defun filter-by-agenda (entry) + "Return ENTRY if it has no tags or a tag corresponding to the desktop." + (require 'desktop) + (let ((label (when desktop-dirname + (tagify (file-name-base + (directory-file-name + (expand-file-name desktop-dirname)))))) + (tags (get-text-property 0 'tags entry))) + (when (or (null desktop-dirname) (null tags) (member label tags)) + entry))) + +(defun oni:note-template () + (concat + "* %<%c>\n" + " :DIRECTORY: =" default-directory "=\n" + (when (buffer-file-name) " :FILE: [[file:%F][%F]]\n") + (when (org-clocking-p) " :TASK: %K\n") + "\n %?")) + +(defun oni:org-maybe-outline-path () + (let ((outline-path (org-format-outline-path (org-get-outline-path)))) + (unless (string= outline-path "") + (setq outline-path (concat "[ " outline-path " ] "))) + outline-path)) + +(setq org-agenda-files '("~/documents/org/tasks")) + +(setq org-agenda-before-sorting-filter-function #'filter-by-agenda) +(setq org-agenda-cmp-user-defined (lambda (a b) 1)) +(setq org-agenda-prefix-format + '((agenda . " %i %-12:c%?-12t% s") + (timeline . " % s") + (todo . " %i %-12:c %(oni:org-maybe-outline-path)") + (tags . " %i %-12:c %(oni:org-maybe-outline-path)") + (search . " %i %-12:c"))) +(setq org-agenda-sorting-strategy + '((agenda habit-down time-up priority-down category-keep) + (todo priority-down user-defined-down) + (tags priority-down category-keep) + (search category-keep))) +(setq org-agenda-tags-column (1+ (- (window-width)))) +(setq org-directory (expand-file-name "~/documents/org")) +(setq org-default-notes-file (concat org-directory "/org")) +(setq org-capture-templates + `(("t" "Task" entry (file "~/documents/org/tasks") + "* TODO %? %(let ((dname (desktop-registry-current-desktop))) + (if dname + (concat \":\" dname \":\") + \"\"))") + ("T" "Linked task" entry (file "~/documents/org/tasks") + "* TODO %? %(let ((dname (desktop-registry-current-desktop))) + (if dname + (concat \":\" dname \":\") + \"\"))\n\n %a") + ("a" "Appointment" entry (file "~/documents/org/tasks") + "* %?\n %^T\n\n %a") + ("n" "General note" entry (file ,org-default-notes-file) + (function oni:note-template)))) +(setq org-contacts-files '("~/documents/org/misc/contacts.org")) +(setq org-agenda-show-outline-path nil) +(setq org-agenda-todo-ignore-deadlines 'far) +(setq org-agenda-todo-ignore-scheduled t) +(setq org-export-htmlize-output-type 'css) +(setq org-feed-alist + '(("MyEpisodes" + "http://www.myepisodes.com/rss.php?feed=mylist&uid=Slash&pwdmd5=04028968e1f0b7ee678b748a4320ac17" + "~/documents/org/tasks" "MyEpisodes" + :formatter oni:myepisodes-formatter))) +(setq org-fontify-done-headline t) +(setq org-hide-emphasis-markers t) +(setq org-outline-path-complete-in-steps t) +(setq org-refile-allow-creating-parent-nodes t) +(setq org-refile-use-outline-path 'file) +(setq org-return-follows-link t) +(setq org-src-fontify-natively t) +(setq org-tags-column (- 70)) +(setq org-tags-exclude-from-inheritance '("crypt")) +(setq org-todo-keyword-faces + '(("TODO" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830")) + ("DONE" :foreground "#9ad870" :background "#222224" :box (:width 1 :color "#333335")) + ("SUCCEEDED" :foreground "#9ad870" :background "#222224" :box (:width 1 :color "#333335")) + ("WAITING" :foreground "#ffbb56" :background "#171719" :box (:width 1 :color "#282830")) + ("CANCELLED" :foreground "#93d8d8" :background "#222224" :box (:width 1 :color "#333335")) + ("FAILED" :foreground "#93d8d8" :background "#222224" :box (:width 1 :color "#333335")) + ("WIP" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830")) + ("HOLD" :foreground "#ffbb56" :background "#171719" :box (:width 1 :color "#282830")) + ("ACQUIRE" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830")) + ("IGNORED" :foreground "#999999" :background "#222224" :box (:width 1 :color "#333335")) + ("COMMENT" :foreground "#969696" :background "#3d3d3d" :box (:line-width 2 :color "#3d3d3d")))) +(setq org-use-fast-todo-selection t) +(setq org-agenda-skip-function-global 'oni:skip-ex-tag) +(setq org-use-property-inheritance '("slug")) + +(add-hook 'org-agenda-mode-hook 'org-agenda-to-appt) + +(add-to-list 'org-modules 'habit) + +(org-indent-mode t) + +(org-agenda-to-appt) +(ad-activate 'org-agenda-redo) + +(provide 'org-init) +;;; org-init.el ends here diff --git a/.emacs.d/site-lisp/quick-edit-mode.el b/.emacs.d/site-lisp/quick-edit-mode.el new file mode 100644 index 0000000..898d7c2 --- /dev/null +++ b/.emacs.d/site-lisp/quick-edit-mode.el @@ -0,0 +1,74 @@ +;;; quick-edit-mode.el --- Quickly edit stuff + +;; Copyright (C) 2012 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: convenience + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Quickly edit stuff + +;;; Code: + +(defvar quick-edit-map + (let ((map (make-sparse-keymap))) + (define-key map "/" 'undo) + (define-key map "0" 'delete-window) + (define-key map "1" 'delete-other-windows) + (define-key map "2" 'split-window-below) + (define-key map "3" 'split-window-right) + (define-key map "K" 'kill-whole-line) + (define-key map "V" 'scroll-down-command) + (define-key map "a" 'oni:move-beginning-of-dwim) + (define-key map "b" 'backward-char) + (define-key map "d" 'oni:kill-region-or-forward-char) + (define-key map "e" 'oni:move-end-of-dwim) + (define-key map "f" 'forward-char) + (define-key map "j" 'newline-and-indent) + (define-key map "k" 'oni:kill-region-or-line) + (define-key map "n" 'next-line) + (define-key map "o" 'other-window) + (define-key map "p" 'previous-line) + (define-key map "v" 'scroll-up-command) + (define-key map "w" 'oni:kill-region-or-backward-char) + (define-key map (kbd "C-b") 'electric-buffer-list) + (define-key map (kbd "C-g") 'quick-edit-mode) + (define-key map (kbd "RET") 'quick-edit-mode) + map) + "Keymap for quick-edit-mode.") + +(defun qe-locally-disable () + "Disable quick-edit mode in the minibuffer" + (when (eq overriding-local-map quick-edit-map) + (setq-local overriding-local-map nil))) + +;;;###autoload +(define-minor-mode quick-edit-mode + "Quickly edit stuff." + :lighter " qe" + :global t + (if quick-edit-mode + (progn + (setq overriding-local-map quick-edit-map) + (add-hook 'minibuffer-setup-hook 'qe-locally-disable) + (add-hook 'special-mode-hook 'qe-locally-disable)) + (setq overriding-local-map nil) + (remove-hook 'minibuffer-setup-hook 'qe-locally-disable) + (remove-hook 'special-mode-hook 'qe-locally-disable))) + +(provide 'quick-edit-mode) +;;; quick-edit-mode.el ends here diff --git a/.emacs.d/site-lisp/wm-init.el b/.emacs.d/site-lisp/wm-init.el new file mode 100644 index 0000000..694acab --- /dev/null +++ b/.emacs.d/site-lisp/wm-init.el @@ -0,0 +1,3 @@ +(async-shell-command "herbstluftwm" " herbstluftwm") +(async-shell-command "dunst" " dunst") +(async-shell-command "xbindkeys" " xbindkeys") -- cgit v1.2.3-54-g00ecf