From 95fc334b2fcdb816cf5eb468d7fe54907a298f89 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 3 Nov 2013 16:49:42 +0100 Subject: Update emacs configuration --- .emacs.d/Makefile | 6 +- .emacs.d/gnus.el | 84 ----------------- .emacs.d/init.el | 184 ++++++++++++++------------------------ .emacs.d/site-lisp/Makefile | 2 +- .emacs.d/site-lisp/gnus-init.el | 105 ++++++++++++++++++++++ .emacs.d/site-lisp/jabber-init.el | 6 +- .emacs.d/site-lisp/org-init.el | 64 ++++++++----- 7 files changed, 222 insertions(+), 229 deletions(-) delete mode 100644 .emacs.d/gnus.el create mode 100644 .emacs.d/site-lisp/gnus-init.el (limited to '.emacs.d') diff --git a/.emacs.d/Makefile b/.emacs.d/Makefile index 4d4f681..c4ce570 100644 --- a/.emacs.d/Makefile +++ b/.emacs.d/Makefile @@ -1,9 +1,13 @@ .PHONY: all site-lisp -all: init.elc gnus.elc site-lisp/ +all: init2.elc init.elc site-lisp/ %.elc: %.el emacs -Q -batch -eval "(byte-compile-file \"$<\")" +init2.el: init.org + emacs -Q -batch -l org -l ob-tangle \ + -eval "(org-babel-tangle-file \"$^\")" + %/: % $(MAKE) -C "$(CURDIR)/$*" diff --git a/.emacs.d/gnus.el b/.emacs.d/gnus.el deleted file mode 100644 index 3118a13..0000000 --- a/.emacs.d/gnus.el +++ /dev/null @@ -1,84 +0,0 @@ -(eval-when-compile - (require 'gnus) - (require 'gnus-start) - (require 'gnus-sum) - (require 'gnus-art) - (require 'gnus-msg)) - -(defvar oni:mail-adresses - (rx (or "tom@ryuslash.org" "ryuslash@ninthfloor.org" - "ryuslash@gmail.com" "thomas@aethon.nl" "tom@aethon.nl"))) - -(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))) - "~" - " ")))) - -(setq gnus-ignored-from-addresses oni:mail-adresses) -(setq message-alternative-emails 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%(%[%4L: %-23,23f%]%) %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"))) -(setq gnus-auto-subscribed-groups nil) -(setq gnus-extra-headers '(To)) -(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 - (eval-when-compile - (regexp-opt '("gmail:inbox" - "aethon:inbox" - "ninthfloor:inbox" - "ryuslash:inbox")))) -;; (setq nntp-marks-is-evil t) -(setq gnus-check-new-newsgroups 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/init.el b/.emacs.d/init.el index af4d432..93bc348 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1,8 +1,10 @@ -;;; init.el --- My Emacs init +;;; init.el --- My Emacs init -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: -(require 'uniquify) +(eval-and-compile + (add-to-list 'load-path user-emacs-directory) + (load "init2")) (eval-when-compile (package-initialize) @@ -12,7 +14,6 @@ (require 'esh-proc) (require 'dash)) -(autoload 'gtags-mode "gtags" nil t) (autoload 'jabber-connect "jabber" nil t) (autoload 'jabber-message-libnotify "jabber-libnotify") (autoload 'jabber-muc-libnotify "jabber-libnotify") @@ -31,6 +32,12 @@ (defvar elnode-do-init) (defvar whitespace-style) (defvar eshell-prompt-regexp) +(defvar sql-product) +(defvar sql-prompt-regexp) + +(defvar init-stumpish-program + (expand-file-name + "~/.local/share/quicklisp/local-projects/stumpwm/contrib/stumpish")) (defadvice org-agenda-redo (after ext:org-agenda-redo-add-appts) "Pressing `r' on the agenda will also add appointments." @@ -42,14 +49,35 @@ "Kill the term buffer if the process finished." (kill-buffer (current-buffer))) +(defadvice windmove-do-window-select + (around init-windmove-stumpwm activate) + "If no window can be moved to, move stumpwm." + (condition-case err + ad-do-it + (error (stumpwm-command (format "move-focus %s" (ad-get-arg 0)))))) + (defmacro addf (place value) "Prepend to PLACE VALUE." `(setf ,place (cons ,value ,place))) -(defmacro eval-after-init (&rest body) - "Defer execution of BODY until after Emacs init." +(defmacro stumpwm (&rest body) + "Execute BODY in stumpwm." (declare (indent 0)) - `(add-hook 'emacs-startup-hook #'(lambda () ,@body))) + `(call-process init-stumpish-program nil nil nil + ,(format "eval '%S'" `(progn ,@body)))) + +(defun stumpwm-command (cmd) + "Execute CMD in stumpwm." + (call-process init-stumpish-program nil nil nil cmd)) + +(defun init-augment-sql-prompt () + "Add the MariaDB prompt to the `sql-pomrpt-regexp'." + (if (eq sql-product 'mysql) + (setq sql-prompt-regexp + (rx (and line-start + (or "mysql" + (and "MariaDB [" (1+ nonl) "]")) + "> "))))) (defun init-eshell-C-d () "Either call `delete-char' interactively or quit." @@ -65,6 +93,11 @@ "Make non-programming buffers a little more readable." (setq line-spacing .2)) +(defun init-maybe-fci-mode () + "Turn on `fci-mode' if there is a filename for the buffer." + (when (buffer-file-name) + (fci-mode))) + (defun init-set-keys-for-eshell () "Set some keybindings for `eshell'." (local-set-key (kbd "C-d") #'init-eshell-C-d)) @@ -78,6 +111,12 @@ "Set some keybindings for `tagedit-mode'." (local-set-key (kbd "M-k") #'tagedit-kill-attribute)) +(defun init-set-python-imenu-function () + "Set the `imenu-create-index-function' variable. + +For `python-mode' I prefer `python-imenu-create-flat-index'." + (setq imenu-create-index-function #'python-imenu-create-flat-index)) + (defmacro mode-hooks (&rest lst) "Apply `add-mode-hooks' to each element of LST." (declare (indent 0)) @@ -86,25 +125,6 @@ #'(lambda (itm) (add-mode-hooks (car itm) (list 'quote (cadr itm)))) lst)))) -(defmacro stante-after (feature &rest forms) - "After FEATURE is loaded, evaluate FORMS. - -FEATURE may be an unquoted feature symbol or a file name, see -`eval-after-load'." - (declare (indent 1) (debug t)) - ;; Byte compile the body. If the feature is not available, ignore - ;; warnings. Taken from - ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-11/msg01262.html - (let ((loaded (if (symbolp feature) - (require feature nil :no-error) - (load feature :no-error :no-message)))) - `(,(if loaded - 'progn - (message "stante-after: cannot find %s" feature) - 'with-no-warnings) - (eval-after-load ',feature - `(funcall (function ,(lambda () ,@forms))))))) - (eval-and-compile (defun add-hooks (hooks function &optional append local) "`add-hook' for each in HOOKS." @@ -138,13 +158,6 @@ FEATURE may be an unquoted feature symbol or a file name, see (apply #'append lsts)))) (eval-and-compile - (defun loadpath-add-and-autoload (path) - "Add PATH to `load-path' and load a `loaddefs.el' if it exists." - (add-to-list 'load-path path) - (let ((loaddefs (concat path "/loaddefs.el"))) - (when (file-exists-p loaddefs) - (load loaddefs)))) - (defun make-mode-hook-name (mode) "Get the hook name for MODE." (intern (concat (symbol-name mode) "-mode-hook")))) @@ -182,15 +195,6 @@ FEATURE may be an unquoted feature symbol or a file name, see 'face 'font-lock-function-name-face)) " \n> "))) -(defun pp^L-ruler (win) - "Just make a string ruler. - -Of either `fci-rule-column' or `fill-column' length -1. Use the -`-' character. WIN is ignored." - (ignore win) - (make-string - (1- (if (boundp 'fci-rule-column) fci-rule-column fill-column)) ?-)) - (defun raise-eshell () "Start or switch back to `eshell'. @@ -227,29 +231,10 @@ Also change directories to current working directory." (local-set-key (kbd "M-J") 'sp-join-sexp) (local-set-key (kbd "M-S") 'sp-split-sexp)) -(defun turn-off (modes) - "Turn off each mode in MODES." - (mapc (lambda (m) (funcall m -1)) modes)) - (defun turn-on-compilation-shell-for-pony () "Turn on option `compilation-shell-minor-mode' for `pony-minor-mode'." (add-hook 'pony-minor-mode-hook 'compilation-shell-minor-mode nil t)) -(defalias 'yes-or-no-p 'y-or-n-p) -(defalias 'list-buffers 'ibuffer) -(defalias 'dabbrev-expand 'hippie-expand) - -;; Get rid of annoying and useless -(turn-off '(menu-bar-mode scroll-bar-mode tool-bar-mode blink-cursor-mode - column-number-mode line-number-mode tooltip-mode)) - -(eval-and-compile - (mapc #'loadpath-add-and-autoload - '("~/.emacs.d/site-lisp" "~/projects/emacs/pony-mode/src" - "~/.emacs.d/vendor-lisp/org/lisp" - "~/.emacs.d/vendor-lisp/org/contrib/lisp" - "~/.emacs.d/vendor-lisp/eap" "/usr/share/emacs/site-lisp"))) - (stante-after appt (setq appt-disp-window-function #'oni:appt-display-window-and-jabber) (setq appt-display-diary nil)) @@ -260,7 +245,6 @@ Also change directories to current working directory." (stante-after auto-complete (add-to-list 'ac-modes 'slime-repl-mode) (setq-default ac-sources '(ac-source-imenu - ac-source-gtags ac-source-abbrev ac-source-yasnippet ac-source-words-in-buffer @@ -270,7 +254,8 @@ Also change directories to current working directory." ac-source-symbols ac-source-variables ac-source-features)) - (setq ac-auto-show-menu nil)) + (setq ac-auto-show-menu nil + ac-use-quick-help nil)) (stante-after browse-url (setq browse-url-browser-function 'browse-url-generic) @@ -298,14 +283,15 @@ Also change directories to current working directory." (stante-after custom (setq custom-theme-directory "~/.emacs.d/themes") - (eval-after-init (load-theme 'yoshi t))) + ;; (eval-after-init (load-theme 'yoshi t)) + ) (stante-after desktop (setq desktop-restore-frames nil) (setq desktop-load-locked-desktop t) (setq desktop-clear-preserve-buffers (append (list (rx (and bol (or (and "+" (1+ nonl)) - "dailies" "work" "tasks" + "dailies" "work" "tasks" "org" (or "bookmarks.org" "contacts.org")) eol)) (rx (or "*ielm*" "*-jabber-roster-*" "*eshell*" @@ -318,7 +304,7 @@ Also change directories to current working directory." desktop-clear-preserve-buffers)) (setq desktop-files-not-to-save (rx (or (regexp "\\(^/[^/:]*:\\|(ftp)$\\)") - (and "/" (or "dailies" "tasks" "bookmarks.org" + (and "/" (or "dailies" "tasks" "org" "bookmarks.org" "contacts.org" "work") eol)))) (add-to-list 'desktop-globals-to-clear 'desktop-dirname)) @@ -403,19 +389,14 @@ Also change directories to current working directory." (stante-after geiser-repl (setq geiser-repl-history-filename "~/.emacs.d/geiser-history")) -(stante-after gnus - (setq gnus-novice-user nil)) - -(stante-after gnus-start - (setq gnus-init-file "~/.emacs.d/gnus")) - (stante-after gnutls (add-to-list 'gnutls-trustfiles (expand-file-name "~/ssl_20130810/sub.class1.server.ca.pem"))) (stante-after grep - (add-to-list 'grep-find-ignored-directories "migrations")) + (add-to-list 'grep-find-ignored-directories "migrations") + (add-to-list 'grep-find-ignored-files "TAGS")) (stante-after help-at-pt (setq help-at-pt-display-when-idle t)) @@ -431,10 +412,6 @@ Also change directories to current working directory." (setq ido-max-window-height 1) (setq ido-save-directory-list-file nil)) -(stante-after ido-ubiquitous - (setq ido-ubiquitous-command-exceptions - '(org-refile org-capture-refile))) - (stante-after imenu (setq imenu-auto-rescan t)) @@ -477,8 +454,7 @@ Also change directories to current working directory." '(("melpa" . "http://melpa.milkbox.net/packages/") ("marmalade" . "http://marmalade-repo.org/packages/") ("gnu" . "http://elpa.gnu.org/packages/"))) - (setq package-load-list '((dispass "1.1.2.1") - (desktop-registry "1.1.0") + (setq package-load-list '((dispass "1.1.2.2") all))) (stante-after "paragraphs" @@ -489,10 +465,6 @@ Also change directories to current working directory." (setq php-function-call-face 'font-lock-function-name-face) (setq php-mode-force-pear t)) -(stante-after pp-c-l - (setq pp^L-^L-string-function 'pp^L-ruler) - (setq pp^L-^L-string-pre nil)) - (stante-after sendmail (setq send-mail-function 'sendmail-send-it) (setq sendmail-program "/usr/bin/msmtp")) @@ -500,9 +472,6 @@ Also change directories to current working directory." (stante-after simple (setq read-mail-command 'gnus)) -(stante-after slime - (setq inferior-lisp-program "sbcl --noinform --no-linedit")) - (stante-after smartparens (setq sp-cancel-autoskip-on-backward-movement nil sp-autoskip-closing-pair 'always)) @@ -511,9 +480,6 @@ Also change directories to current working directory." (setq smex-key-advice-ignore-menu-bar t) (setq smex-save-file "~/.emacs.d/smex-items")) -(stante-after smiley - (setq smiley-style 'medium)) - (stante-after "startup" (setq inhibit-default-init t) (setq inhibit-startup-message t) @@ -530,9 +496,6 @@ Also change directories to current working directory." (setq type-break-interval (* 60 50)) (setq type-break-keystroke-threshold '(nil . nil))) -(stante-after uniquify - (setq uniquify-buffer-name-style 'post-forward)) - (stante-after w3m (setq w3m-fill-column 72)) @@ -566,7 +529,7 @@ Also change directories to current working directory." ((git-commit text) auto-fill-mode) ((git-commit text) flyspell-mode) ((html org prog) yas-minor-mode) - ((html prog) fci-mode) + ((html prog) init-maybe-fci-mode) ((html) tagedit-mode) ((html) turn-off-flyspell) ((html) turn-off-auto-fill) @@ -578,20 +541,18 @@ Also change directories to current working directory." info org-agenda jabber-chat) init-make-readable) ((prog) rainbow-delimiters-mode) + ((python) init-set-python-imenu-function) ((python) jedi:setup) ((python) subword-mode) ((slime slime-repl) set-up-slime-ac) ((smartparens) set-smartparens-keys) + ((sql-interactive) init-augment-sql-prompt) ((tagedit) tagedit-add-experimental-features) ((tagedit) tagedit-add-paredit-like-keybindings) ((tagedit) init-set-keys-for-tagedit) ((vala) oni:vala-mode-func)) -(add-hook 'emacs-startup-hook 'pretty-control-l-mode) -(add-hook 'after-make-frame-functions - '(lambda (arg) (pretty-control-l-mode))) - (setq-default bidi-paragraph-direction 'left-to-right) (setq-default tab-width 4) (setq-default indent-tabs-mode nil) @@ -603,7 +564,7 @@ Also change directories to current working directory." (vertical-scroll-bars . nil) (menu-bar-lines . nil) (tool-bar-lines . nil) - (font . "PT Mono:pixelsize=16"))) + (font . "PT Mono:pixelsize=15"))) (setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) (setq message-log-max 1000) (setq redisplay-dont-pause t) @@ -647,7 +608,6 @@ Also change directories to current working directory." (add-hook 'css-mode-hook 'oni:css-mode-func) (add-hook 'diary-display-hook 'oni:diary-display-func) (add-hook 'go-mode-hook 'oni:go-mode-func) -(add-hook 'gtags-mode-hook 'oni:gtags-mode-func) (add-hook 'haskell-mode-hook 'oni:haskell-mode-func) (add-hook 'java-mode-hook 'oni:java-mode-func) (add-hook 'js-mode-hook 'oni:js-mode-func) @@ -703,6 +663,7 @@ Also change directories to current working directory." (global-set-key (kbd "C-c m") 'gnus) (global-set-key (kbd "C-c g s") 'magit-status) (global-set-key (kbd "C-c g i") 'magit-init) +(global-set-key (kbd "C-c g b") 'magit-checkout) (global-set-key (kbd "C-c h r") 'hypo-region) (if (daemonp) @@ -759,6 +720,7 @@ Depending on the value of `buffer-narrowed-p'." "Turn arguments into an email address. The resulting email address will look like: USER@HOST.COM, AT and DOT are intentionally being skipped." + (ignore at dot) (concat (symbol-name user) "@" (symbol-name host) "." (symbol-name com))) @@ -833,11 +795,6 @@ DOT are intentionally being skipped." (setq indent-tabs-mode nil) (local-set-key "\C-j" 'oni:newline-and-indent)) -(defun oni:gtags-mode-func () - "Function for `gtags-mode-hook'." - (local-set-key "\M-," 'gtags-find-tag) - (local-set-key "\M-." 'gtags-find-rtag)) - (defun oni:haskell-mode-func () "Function for `haskell-mode-hook'." (turn-on-haskell-indentation)) @@ -934,14 +891,12 @@ code. Found at http://xahlee.org/emacs/elisp_parse_time.html" EMMS only shows me the absolute path of a song, this function extracts the parts I want to know about." - (let* ((song (emms-track-name (emms-playlist-current-selected-track))) - (matchp (string-match "\\([^/]+\\)/\\([0-9]\\{4\\}\\) - \\(.+\\)/\\([0-9]\\{2,3\\}\\) - \\(.+\\)\\..\\{3,4\\}$" song)) - (band (substring song (match-beginning 1) (match-end 1))) - (year (substring song (match-beginning 2) (match-end 2))) - (album (substring song (match-beginning 3) (match-end 3))) - (track (substring song (match-beginning 4) (match-end 4))) - (title (substring song (match-beginning 5) (match-end 5)))) - (format "[%s - %s]" band title))) + (let ((song (emms-track-name (emms-playlist-current-selected-track)))) + (if (string-match "\\([^/]+\\)/\\([0-9]\\{4\\}\\) - \\(.+\\)/\\([0-9]\\{2,3\\}\\) - \\(.+\\)\\..\\{3,4\\}$" song) + (let ((band (substring song (match-beginning 1) (match-end 1))) + (title (substring song (match-beginning 5) (match-end 5)))) + (format "[%s - %s]" band title)) + song))) (defun oni:move-end-of-dwim () "Move to end of line, either before any comments or after." @@ -1109,13 +1064,6 @@ insert at the end of the region and at the beginning." (interactive) (find-file "~/documents/org/index.org")) -(defun oni:skip-ex-tag () - (let ((tags (org-entry-get (point) "TAGS"))) - (when (and tags (string-match-p ":ex:" tags)) - (save-excursion - (org-forward-element) - (point))))) - (defun oni:split-window-interactive (dir) "Split windows in direction DIR. 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) -- cgit v1.2.3-54-g00ecf