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/Makefile2
-rw-r--r--.emacs.d/site-lisp/gnus-init.el105
-rw-r--r--.emacs.d/site-lisp/jabber-init.el6
-rw-r--r--.emacs.d/site-lisp/org-init.el64
4 files changed, 151 insertions, 26 deletions
diff --git a/.emacs.d/site-lisp/Makefile b/.emacs.d/site-lisp/Makefile
index 4017893..c1976e2 100644
--- a/.emacs.d/site-lisp/Makefile
+++ b/.emacs.d/site-lisp/Makefile
@@ -1,5 +1,5 @@
.PHONY: all
-all: jabber-init.elc org-init.elc
+all: jabber-init.elc org-init.elc gnus-init.elc
%.elc: %.el
emacs -Q -batch -eval "(byte-compile-file \"$<\")"
diff --git a/.emacs.d/site-lisp/gnus-init.el b/.emacs.d/site-lisp/gnus-init.el
new file mode 100644
index 0000000..1b4a96d
--- /dev/null
+++ b/.emacs.d/site-lisp/gnus-init.el
@@ -0,0 +1,105 @@
+(eval-when-compile
+ (require 'gnus)
+ (require 'gnus-start)
+ (require 'gnus-sum)
+ (require 'gnus-art)
+ (require 'gnus-msg))
+
+(defvar gnus-tmp-from)
+
+(defvar oni:mail-adresses
+ (rx (or "tom@ryuslash.org" "ryuslash@ninthfloor.org"
+ "ryuslash@gmail.com" "thomas@aethon.nl" "tom@aethon.nl")))
+
+(defvar gnus-init-subscribed-lists
+ #s(hash-table size 5
+ data ("gnu-emacs-bug?@" "Emacs bugs"
+ "help-gnu-emacs@gnu.org" "Emacs help"
+ "emacs-devel@gnu.org" "Emacs developers"
+ "@debbugs.gnu.org" "GNU Bug Tracker"
+ "it@aethon.nl" "IT bij Aethon")))
+
+(defun gnus-user-format-function-a (headers)
+ (let ((to (gnus-extra-header 'To headers)))
+ (if (string-match oni:mail-adresses to)
+ (if (string-match "," to) "~" "ยป")
+ (if (or (string-match oni:mail-adresses
+ (gnus-extra-header 'Cc headers))
+ (string-match oni:mail-adresses
+ (gnus-extra-header 'BCc headers)))
+ "~"
+ " "))))
+
+(defun gnus-user-format-function-b (headers)
+ (let ((to (gnus-extra-header 'To headers))
+ (cc (gnus-extra-header 'Cc headers)))
+ (or (and to
+ (catch 'newsgroup
+ (maphash (lambda (key val)
+ (when (or (string-match key to)
+ (string-match key cc))
+ (throw 'newsgroup val)))
+ gnus-init-subscribed-lists)))
+ (gnus-summary-from-or-to-or-newsgroups headers gnus-tmp-from))))
+
+(setq gnus-ignored-from-addresses oni:mail-adresses)
+(setq message-alternative-emails oni:mail-adresses)
+(setq message-dont-reply-to-names oni:mail-adresses)
+
+(setq gnus-group-line-format "%P %(%C%) %B%60=%4y%-2M%S\n")
+(setq gnus-summary-line-format "%U%R%z%ua%I%(%*%[%-23,23ub%]%) %s\n")
+(setq gnus-select-method '(nntp "news.gmane.org"))
+(setq gnus-secondary-select-methods
+ '((nnmaildir "gmail"
+ (directory "~/documents/mail/gmail/"))
+ (nnmaildir "ninthfloor"
+ (directory "~/documents/mail/ninthfloor/"))
+ (nnmaildir "aethon"
+ (directory "~/documents/mail/aethon/"))
+ (nnmaildir "ryuslash"
+ (directory "~/documents/mail/ryuslash.org/"))
+ (nntp "news.gwene.org")
+ (nnrss "http://projects.ryuslash.org/test/NEWS.rss")))
+(setq gnus-auto-subscribed-groups nil)
+(setq gnus-save-newsrc-file nil)
+(setq gnus-read-newsrc-file nil)
+(setq gnus-article-truncate-lines nil)
+;; (setq gnus-parameters
+;; '(("gmail"
+;; (display . all))
+;; ("aethon"
+;; (display . all)
+;; ("arch"
+;; (display . all)))))
+(setq gnus-permanently-visible-groups
+ (rx (and (or "gmail" "aethon" "ninthfloor" "ryuslash")
+ ":inbox")))
+;; (setq nntp-marks-is-evil t)
+(setq gnus-check-new-newsgroups nil)
+(setq gnus-novice-user nil)
+(setq gnus-posting-styles
+ '((".*"
+ (address "tom@ryuslash.org")
+ (eval (setq message-sendmail-extra-arguments '("-a" "ryuslash")
+ flyspell-default-dictionary "en")))
+ ("gmail:"
+ (address "ryuslash@gmail.com")
+ (eval (setq message-sendmail-extra-arguments '("-a" "gmail"))))
+ ("ninthfloor:"
+ (address "ryuslash@ninthfloor.org")
+ (eval (setq message-sendmail-extra-arguments '("-a" "ninthfloor"))))
+ ("arch:"
+ (address "tom.willemsen@archlinux.us")
+ (eval (setq message-sendmail-extra-arguments '("-a" "arch"))))
+ ("aethon:"
+ (name "Tom Willemsen")
+ (address "thomas@aethon.nl")
+ (signature-file "~/documents/work/aethon/signature.txt")
+ (eval (setq message-sendmail-extra-arguments '("-a" "aethon")
+ flyspell-default-dictionary "nl")))))
+(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
+;-----[ BBDB ]--------------------------------------------------------
+;; (require 'bbdb)
+;; (bbdb-initialize 'gnus 'message)
+;; (bbdb-insinuate-gnus)
+;; (setq bbdb-north-american-phone-numbers-p nil)
diff --git a/.emacs.d/site-lisp/jabber-init.el b/.emacs.d/site-lisp/jabber-init.el
index 76a57b0..15f3f9d 100644
--- a/.emacs.d/site-lisp/jabber-init.el
+++ b/.emacs.d/site-lisp/jabber-init.el
@@ -20,10 +20,11 @@
OLDSTATUS, NEWSTATUS and STATUSTEXT are ignored.
Insert PROPOSED-ALERT in the buffer if it is non-nil."
- (let ((buffer (get-buffer (jabber-chat-get-buffer who))))
+ (let ((buffer (get-buffer (jabber-chat-get-buffer (symbol-name who)))))
(when (and buffer proposed-alert)
(with-current-buffer buffer
- (insert proposed-alert "\n")))))
+ (ewoc-enter-last jabber-chat-ewoc (list :notice proposed-alert
+ :time (current-time)))))))
(setq jabber-account-list
(mapcar (lambda (str) (list (concat str "/" (hostname))))
@@ -34,6 +35,7 @@ Insert PROPOSED-ALERT in the buffer if it is non-nil."
jabber-chat-foreign-prompt-format "%t %u/%r <\n"
jabber-chat-local-prompt-format "%t %u/%r >\n"
jabber-chat-buffer-show-avatar nil
+ jabber-chat-fill-long-lines nil
jabber-chatstates-confirm nil
diff --git a/.emacs.d/site-lisp/org-init.el b/.emacs.d/site-lisp/org-init.el
index 0894d8b..ff42043 100644
--- a/.emacs.d/site-lisp/org-init.el
+++ b/.emacs.d/site-lisp/org-init.el
@@ -62,11 +62,27 @@
(defun org-init-filter-by-desktop ()
"Filter agenda by current label."
(when desktop-dirname
- (let ((label (tagify (file-name-base
+ (let ((label (tagify (file-name-nondirectory
(directory-file-name
(expand-file-name desktop-dirname))))))
(org-agenda-filter-apply (cons label nil) 'tag))))
+(defun org-init-skip-tags ()
+ "Skip the \"ex\" and \"unconfirmed\" tags."
+ (let ((tags (org-entry-get (point) "TAGS")))
+ (when (and tags (string-match-p
+ (rx (and ":" (or "ex" "unconfirmed") ":")) tags))
+ (save-excursion
+ (org-forward-element)
+ (point)))))
+
+(defun org-init-get-tag-name ()
+ "Get the name for a new tag for the currently loaded desktop."
+ (let ((dname (desktop-registry-current-desktop)))
+ (if dname
+ (format ":%s:" (tagify dname))
+ "")))
+
(setq org-agenda-files '("~/documents/org/tasks"))
(setq org-agenda-cmp-user-defined (lambda (a b) 1))
@@ -86,19 +102,17 @@
(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 \":\")
- \"\"))")
+ "* TODO %? %(org-init-get-tag-name)"
+ :empty-lines-before 1)
("T" "Linked task" entry (file "~/documents/org/tasks")
- "* TODO %? %(let ((dname (desktop-registry-current-desktop)))
- (if dname
- (concat \":\" dname \":\")
- \"\"))\n\n %a")
+ "* TODO %? %(org-init-get-tag-name)\n\n %a"
+ :empty-lines-before 1)
("a" "Appointment" entry (file "~/documents/org/tasks")
- "* %?\n %^T\n\n %a")
+ "* %?\n %^T\n\n %a"
+ :empty-lines-before 1)
("n" "General note" entry (file ,org-default-notes-file)
- (function oni:note-template))))
+ (function oni:note-template)
+ :empty-lines-before 1)))
(setq org-contacts-files '("~/documents/org/misc/contacts.org"))
(setq org-agenda-show-outline-path nil)
(setq org-agenda-todo-ignore-deadlines 'far)
@@ -119,20 +133,24 @@
(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"))))
+ '(("TODO" 'font-lock-constant-face)
+ ("HOLD" 'font-lock-keyword-face)
+ ("WIP" 'font-lock-variable-name-face)
+ ("REVIEW" 'font-lock-builtin-face)
+ ("DONE" 'font-lock-function-name-face)
+ ("CANCELLED" 'font-lock-comment-face)
+ ("FAILED" 'font-lock-type-face)
+ ("ACQUIRE" 'font-lock-constant-face)
+ ("IGNORED" 'font-lock-comment-face)
+ ("COMMENT" 'font-lock-comment-delimiter-face)
+ ("GOT" 'font-lock-function-name-face)))
(setq org-use-fast-todo-selection t)
-(setq org-agenda-skip-function-global 'oni:skip-ex-tag)
+(setq org-agenda-skip-function-global 'org-init-skip-tags)
(setq org-use-property-inheritance '("slug"))
+(setq org-M-RET-may-split-line '((default . t)
+ (headline)))
+(setq org-insert-heading-respect-content t)
+(setf (cdar org-blank-before-new-entry) t)
(add-hook 'org-agenda-mode-hook 'org-agenda-to-appt)
(add-hook 'org-agenda-finalize-hook 'org-init-filter-by-desktop)