summaryrefslogtreecommitdiffstats
path: root/.emacs.d/site-lisp
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/site-lisp')
-rw-r--r--.emacs.d/site-lisp/Makefile7
-rw-r--r--.emacs.d/site-lisp/dzen.el61
-rw-r--r--.emacs.d/site-lisp/metalexpress.el38
-rw-r--r--.emacs.d/site-lisp/newsticker-init.el101
-rw-r--r--.emacs.d/site-lisp/oni.el28
-rw-r--r--.emacs.d/site-lisp/org-init.el44
6 files changed, 233 insertions, 46 deletions
diff --git a/.emacs.d/site-lisp/Makefile b/.emacs.d/site-lisp/Makefile
new file mode 100644
index 0000000..bbccbb7
--- /dev/null
+++ b/.emacs.d/site-lisp/Makefile
@@ -0,0 +1,7 @@
+DESTDIR:=$(DESTDIR)/site-lisp
+objects=dzen.elc dzen.el eltuki.elc eltuki.el ext.elc ext.el \
+ metalexpress.elc metalexpress.el mu4e-init.elc mu4e-init.el \
+ newsticker-init.elc newsticker-init.el oni.elc oni.el org-init.elc \
+ org-init.el quick-edit-mode.elc quick-edit-mode.el
+
+include ../../dotfiles.mk
diff --git a/.emacs.d/site-lisp/dzen.el b/.emacs.d/site-lisp/dzen.el
new file mode 100644
index 0000000..a28418b
--- /dev/null
+++ b/.emacs.d/site-lisp/dzen.el
@@ -0,0 +1,61 @@
+;;; dzen.el --- Control DZEN2 from emacs
+
+;; Copyright (C) 2012 Tom Willemsen
+
+;; Author: Tom Willemsen <slash@drd>
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(require 'newst-backend)
+(require 'sawfish)
+
+(defun get-mail-count (account)
+ (length (directory-files (concat "/home/slash/documents/mail/"
+ account "/inbox/new") nil "^[^.]")))
+
+(defun dzen-start ()
+ (interactive)
+ (let ((proc (start-process "dzen2" "*dzen2*" "dzen2"
+ "-w" "1920"
+ "-fn" "Monaco-12"
+ "-bg" "#222224"
+ "-fg" "#eeeeec"))
+ (strl (format
+ "%s"
+ (sawfish-eval-expression '(window-name (input-focus)))))
+ (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
+ proc (format "^p(_LEFT)%s^p(_RIGHT)^p(-%d)%s"
+ strl (+ 9 (* 9 (length strr))) strr))))
+
+(defun dzen-stop ()
+ (interactive)
+ (kill-process "dzen2"))
+
+(provide 'dzen)
+;;; dzen.el ends here
diff --git a/.emacs.d/site-lisp/metalexpress.el b/.emacs.d/site-lisp/metalexpress.el
index 9d57c19..2f77638 100644
--- a/.emacs.d/site-lisp/metalexpress.el
+++ b/.emacs.d/site-lisp/metalexpress.el
@@ -30,20 +30,50 @@
(defcustom metal-express-radio-playlist-url
"http://usa7-vn.mixstream.net/listen/8248.m3u"
- "The URL of the Metal Express Radio stream.")
+ "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))
+ (apply '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)
- (async-shell-command
- (concat "mplayer " metal-express-radio-playlist-url)
- "*Metal Express Radio*"))
+ (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*")))
+(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/newsticker-init.el b/.emacs.d/site-lisp/newsticker-init.el
new file mode 100644
index 0000000..da166d1
--- /dev/null
+++ b/.emacs.d/site-lisp/newsticker-init.el
@@ -0,0 +1,101 @@
+(defmacro reddit-feed (name)
+ "Return a reddit feed url"
+ (concat "http://www.reddit.com/r/" name "/new/.rss?sort=new"))
+
+(setq newsticker-automatically-mark-items-as-old nil)
+(setq newsticker-html-renderer 'w3m-region)
+(setq newsticker-obsolete-item-max-age 604800)
+(setq newsticker-url-list
+ `(("Irreal"
+ "http://irreal.org/blog/?feed=rss2" nil nil nil)
+ ("Arch Linux - Keeping it Simple"
+ ,(reddit-feed "archlinux") nil nil nil)
+ ("The C programming language"
+ ,(reddit-feed "c_language") nil nil nil)
+ ("C"
+ ,(reddit-feed "C_Programming") nil nil nil)
+ ("coding"
+ ,(reddit-feed "coding") nil nil nil)
+ ("Command Line"
+ ,(reddit-feed "commandline") nil nil nil)
+ ("Django"
+ ,(reddit-feed "django") nil nil nil)
+ ("M-x emacs-reddit"
+ ,(reddit-feed "emacs") nil nil nil)
+ ("git"
+ ,(reddit-feed "git") nil nil nil)
+ ("JavaScript"
+ ,(reddit-feed "javascript") nil nil nil)
+ ("r/Linux"
+ ,(reddit-feed "linux") nil nil nil)
+ ("Linux Gaming on Reddit"
+ ,(reddit-feed "linux_gaming") nil nil nil)
+ ("Lisp"
+ ,(reddit-feed "lisp") nil nil nil)
+ ("Open Source on Reddit"
+ ,(reddit-feed "opensource") nil nil nil)
+ ("PHP: The latest news in the PHP world"
+ ,(reddit-feed "PHP") nil nil nil)
+ ("programming"
+ ,(reddit-feed "programming") nil nil nil)
+ ("Python"
+ ,(reddit-feed "Python") nil nil nil)
+ ("Scheme Programming Language articles"
+ ,(reddit-feed "scheme") nil nil nil)
+ ("The Wayland Display Server"
+ ,(reddit-feed "wayland") nil nil nil)
+ ("Identity at Mozilla"
+ "http://identity.mozilla.com/rss" nil nil nil)
+ ("jd:/dev/blog"
+ "http://julien.danjou.info/blog/index.xml" nil nil nil)
+ ("KaKaRoTo's Blog"
+ "http://kakaroto.homelinux.net/feed/" nil nil nil)
+ ("Awhan Patnaik"
+ "http://awhan.wordpress.com/feed/" nil nil nil)
+ ("The Gitorious Blog"
+ "http://blog.gitorious.org/feed/" nil nil nil)
+ ;; ("Dieter on the web"
+ ;; "http://dieter.plaetinck.be/index.rss" nil nil nil)
+ ("Public Git Hosting - conkeror.git/atom log"
+ "http://repo.or.cz/w/conkeror.git/atom" nil nil nil)
+ ("Stevey's Blog Rants"
+ "http://steve-yegge.blogspot.com/feeds/posts/default"
+ nil nil nil)
+ ("Script Tutorials"
+ "http://www.script-tutorials.com/feed/rss/" nil nil nil)
+ ("Hacker News"
+ "http://news.ycombinator.com/rss" nil nil nil)
+ ("HowtoForge - Linux Howtos and Tutorials -"
+ "http://www.howtoforge.com/node/feed" nil nil nil)
+ ("IBM developerWorks : Linux"
+ "http://www.ibm.com/developerworks/views/linux/rss/libraryview.jsp"
+ nil nil nil)
+ ("Linuxtoday.com"
+ "http://linuxtoday.com/backend/biglt.rss" nil nil nil)
+ ("Linux.com - Content Feed"
+ "http://linux.com/rss/feeds.php" nil nil nil)
+ ("TuxRadar feed"
+ "http://www.tuxradar.com/rss" nil nil nil)
+ ("Planet Emacsen"
+ "http://planet.emacsen.org/atom.xml" nil nil nil)
+ ("M-x all-things-emacs"
+ "http://emacsblog.org/feed/" nil nil nil)
+ ;; ("Xah Emacs Blog"
+ ;; "http://feeds.feedburner.com/XahsEmacsBlog" nil nil nil)
+ ;; ("Mastering Emacs"
+ ;; "http://www.masteringemacs.org/feed/" nil nil nil)
+ ("WikEmacs - Recent changes [en]"
+ "http://wikemacs.org/w/index.php?title=Special:RecentChanges&feed=atom"
+ nil nil nil)
+ ("newest questions tagged emacs - Stack Overflow"
+ "http://stackoverflow.com/feeds/tag?tagnames=emacs&sort=newest"
+ nil nil nil)
+ ("newest questions tagged elisp - Stack Overflow"
+ "http://stackoverflow.com/feeds/tag?tagnames=elisp&sort=newest"
+ nil nil nil)
+ ("Recent Commits to python-django.el:master"
+ "https://github.com/fgallina/python-django.el/commits/master.atom"
+ nil nil nil)))
+(setq newsticker-use-full-width nil)
+
+(provide 'newsticker-init)
diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el
index 251dca2..376c996 100644
--- a/.emacs.d/site-lisp/oni.el
+++ b/.emacs.d/site-lisp/oni.el
@@ -58,11 +58,9 @@ DOT are intentionally being skipped."
"A mailbox map for use with `tmm-prompt'.")
(defvar oni:required-packages
- '(graphviz-dot-mode htmlize magit rainbow-delimiters
- rainbow-mode markdown-mode flymake
- flymake-cursor pony-mode sauron dispass
- expand-region fill-column-indicator
- git-auto-commit-mode idomenu magit smex)
+ '(graphviz-dot-mode htmlize magit rainbow-delimiters rainbow-mode
+ yasnippet markdown-mode flymake flymake-cursor sauron expand-region
+ fill-column-indicator git-auto-commit-mode idomenu magit smex)
"List of all the packages I have (want) installed.")
(defun oni:after-save-func ()
@@ -71,7 +69,8 @@ DOT are intentionally being skipped."
(executable-make-buffer-file-executable-if-script-p)
(let ((dom-dir (locate-dominating-file (buffer-file-name) "Makefile")))
(when dom-dir
- (shell-command (concat "make -C " dom-dir " TAGS >/dev/null 2>&1")))))
+ (shell-command
+ (concat "make -C " dom-dir " TAGS >/dev/null 2>&1")))))
(defun oni:before-save-func ()
"Function for `before-save-hook'."
@@ -104,6 +103,13 @@ DOT are intentionally being skipped."
(local-set-key "\C-j" 'oni:newline-and-indent)
(rainbow-mode))
+(defun oni:current-jabber-status ()
+ "Return a string representing the current jabber status."
+ (or (and (not *jabber-connected*) "Offline")
+ (and (not (string= *jabber-current-status* ""))
+ *jabber-current-status*)
+ "Online"))
+
(defun oni:diary-display-func ()
"Function for `diary-display-hook'."
(diary-fancy-display))
@@ -227,7 +233,8 @@ If COUNT has been specified indent by that much, otherwise look at
(visual-line-mode)
(setq mode-line-format (append (cddr jabber-chat-header-line-format)
'(global-mode-string))
- header-line-format nil))
+ header-line-format nil
+ wrap-prefix (make-string 8 ?\ )))
(defun oni:jabber-roster-mode-func ()
"Function for `jabber-roster-mode-hook'."
@@ -277,7 +284,7 @@ If COUNT has been specified indent by that much, otherwise look at
to add yasnippet's expand function to hippie-expand."
(require other)
(add-to-list 'hippie-expand-try-functions-list
- 'yas/hippie-try-expand))
+ 'yas/hippie-try-expand t))
(defun oni:lua-mode-func()
"Function for `lua-mode-hook'."
@@ -607,6 +614,11 @@ for easy selection."
"Function for `write-file-hooks'."
(time-stamp))
+(defun oni:yas-minor-mode-func ()
+ "Function for `yas-minor-mode-hook'."
+ (define-key yas-minor-mode-map (kbd "TAB") nil)
+ (define-key yas-minor-mode-map [(tab)] nil))
+
(define-skeleton html-tag
"Testing creation of an html tag"
"Tagname:"
diff --git a/.emacs.d/site-lisp/org-init.el b/.emacs.d/site-lisp/org-init.el
index 6f28432..3bacaad 100644
--- a/.emacs.d/site-lisp/org-init.el
+++ b/.emacs.d/site-lisp/org-init.el
@@ -34,24 +34,13 @@
'(org-crypt-use-before-save-magic))
(setq org-agenda-custom-commands
- '(("pa" "Avandu" tags-todo "slug=\"avandu\"")
- ("pb" "Blog" tags-todo "slug=\"blog\"")
- ("pc" "Configuration" tags-todo "slug=\"configuration\"")
- ("pd" "dispass.el" tags-todo "slug=\"dispass.el\"")
- ("pD" "DVDroid" tags-todo "slug=\"dvdroid\"")
- ("pe" "Eye on Manga" tags-todo "slug=\"eye-on-manga\"")
- ("pG" "gDisPass" tags-todo "slug=\"gdispass\"")
- ("pg" "gitto" tags-todo "slug=\"gitto\"")
- ("pi" "Ideas" tags-todo "slug=\"ideas\"")
- ("pM" "Maintenance" tags-todo "slug=\"maintenance\"")
- ("pme" "Metal Express Radio.el" tags-todo
- "slug=\"metal-express-radio.el\"")
- ("pmo" "Mode Icons" tags-todo "slug=\"mode-icons\"")
- ("pmy1" "myAethon" tags-todo "slug=\"myaethon\"")
- ("pmy2" "myAethon2" tags-todo "slug=\"myaethon2\"")
- ("ps" "Sawfish Naquadah theme" tags-todo
- "slug=\"sawfish-naquadah-theme\"")
- ("w" "Work todo." tags-todo "work")))
+ '(("w" "Work todo." tags-todo "work")))
+(setq org-agenda-prefix-format
+ '((agenda . " %i %-12:c%?-12t% s")
+ (timeline . " % s")
+ (todo . " %i %-12:c %(concat \"[ \"(org-format-outline-path (org-get-outline-path)) \" ]\") ")
+ (tags . " %i %-12:c %(concat \"[ \"(org-format-outline-path (org-get-outline-path)) \" ]\") ")
+ (search . " %i %-12:c")))
(setq org-agenda-sorting-strategy
'((agenda habit-down time-up priority-down category-keep)
(todo priority-down category-keep)
@@ -61,22 +50,8 @@
(setq org-capture-templates
'(("t" "Task" entry (file "~/documents/org/tasks")
"* TODO %?")
- ("h" "Habit" entry (file "")
- (concat "* TODO %^{Description}\n"
- " SCHEDULED: %^T\n"
- " :PROPERTIES:\n"
- " :STYLE: habit\n"
- " :END:")
- :immediate-finish t)
- ("l" "Log" entry (file+headline "" "notes")
- (concat "* %n %<%d-%m-%Y %H:%M:%S>\n"
- " %a\n\n"
- " %?")
- :prepend t :empty-lines 1)
- ("a" "Appointment" entry (file+headline "" "appointments")
- "* %^{Description} %^T" :immediate-finish t)
- ("b" "Bookmark" entry (file "~/documents/org/misc/bookmarks.org")
- "* %c\n\n %:initial")))
+ ("T" "Linked task" entry (file "~/documents/org/tasks")
+ "* TODO %?\n\n %a")))
(setq org-contacts-files '("~/documents/org/misc/contacts.org"))
(setq org-directory (expand-file-name "~/documents/org"))
(setq org-agenda-files
@@ -85,6 +60,7 @@
,(concat org-directory "/misc/contacts.org")
,(concat org-directory "/misc/bookmarks.org"))
org-agenda-files))
+(setq org-agenda-show-outline-path nil)
(setq org-agenda-todo-ignore-deadlines 'far)
(setq org-agenda-todo-ignore-scheduled t)
(setq org-default-notes-file (concat org-directory "/org"))