From 79b8394ba39d7a82636aa15f2ee9f29fab5b5565 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 15 Feb 2013 23:08:41 +0100 Subject: emacs: Don't auto push When using git-auto-commit-mode, don't automatically push by default. --- .emacs.d/init.el | 1 - 1 file changed, 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 232f9cf..e97eb06 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -57,7 +57,6 @@ (setq-default bidi-paragraph-direction 'left-to-right) (setq-default c-basic-offset 4) (setq-default fci-rule-column 73) -(setq-default gac-automatically-push-p t) (setq-default indent-tabs-mode nil) (setq-default php-mode-warn-if-mumamo-off nil) (setq-default require-final-newline t) -- cgit v1.2.3-54-g00ecf From cfab9a2faa90b460bee61dd61aab2764eb2af951 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 15 Feb 2013 23:08:59 +0100 Subject: xmonad: Set chromium fully opaque --- xmonad/xmonad.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs index 40ec269..780f58b 100644 --- a/xmonad/xmonad.hs +++ b/xmonad/xmonad.hs @@ -18,8 +18,10 @@ fadeRules :: Query Rational fadeRules = do fullscreen <- isFullscreen conkeror <- className =? "Conkeror" + chromium <- className =? "Chromium" return $ case () of _ | fullscreen -> 1 | conkeror -> 0.95 + | chromium -> 1 | otherwise -> 0.9 main = xmonad $ defaultConfig -- cgit v1.2.3-54-g00ecf From 3070f08c78151170897b2cd9b80cd94cd7f5799a Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 17 Feb 2013 10:39:02 +0100 Subject: xmonad: Run script which runs emacs Apparently the `runOrRaiseNext' function doesn't like programs with arguments. --- xmonad/xmonad.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs index 780f58b..9a80be4 100644 --- a/xmonad/xmonad.hs +++ b/xmonad/xmonad.hs @@ -37,9 +37,9 @@ main = xmonad $ defaultConfig ("C-z ,", screenWorkspace 0 >>= flip whenJust (windows . W.view)), ("C-z .", screenWorkspace 1 >>= flip whenJust (windows . W.view)), ("C-z S-c", spawn "urxvt"), - ("C-z S-e", spawn "emacsclient -ca emacs"), + ("C-z S-e", spawn "editor"), ("C-z c", runOrRaiseNext "urxvt" (className =? "URxvt")), - ("C-z e", runOrRaiseNext "emacsclient -ca emacs" (className =? "Emacs")), + ("C-z e", runOrRaiseNext "editor" (className =? "Emacs")), ("C-z w", runOrRaiseNext "conkeror" (className =? "Conkeror")), ("M-S-1", spawn "dmenu_run"), ("M-n", windows W.focusDown), -- cgit v1.2.3-54-g00ecf From b9c0e3838ff4fe1793893e37cfe882d1336724ae Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 17 Feb 2013 22:22:10 +0100 Subject: emacs: Add org ELPA repository --- .emacs.d/init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index e97eb06..c74f62e 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -141,7 +141,8 @@ (setq message-send-mail-function 'message-send-mail-with-sendmail) (setq message-sendmail-extra-arguments '("-a" "ryuslash")) (setq package-archives - '(("melpa" . "http://melpa.milkbox.net/packages/") + '(("org" . "http://orgmode.org/elpa/") + ("melpa" . "http://melpa.milkbox.net/packages/") ("marmalade" . "http://marmalade-repo.org/packages/") ("gnu" . "http://elpa.gnu.org/packages/"))) (setq package-load-list '((htmlize "1.39") -- cgit v1.2.3-54-g00ecf From 3e5421e79d47d4a40b540869f1b18288285e0025 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 17 Feb 2013 22:22:55 +0100 Subject: emacs: Move pp^L configuration to org --- .emacs.d/init.el | 2 - .emacs.d/init.org | 189 +++++++++++++++++++++++++++------------------- .emacs.d/site-lisp/oni.el | 7 -- 3 files changed, 110 insertions(+), 88 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index c74f62e..0296816 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -151,8 +151,6 @@ (setq php-function-call-face 'font-lock-function-name-face) (setq php-mode-force-pear t) (setq pony-tpl-indent-moves t) -(setq pp^L-^L-string-function 'oni:pretty-control-l-function) -(setq pp^L-^L-string-pre nil) (setq rainbow-delimiters-max-face-count 12) (setq redisplay-dont-pause t) (setq send-mail-function 'smtpmail-send-it) diff --git a/.emacs.d/init.org b/.emacs.d/init.org index f4acfca..95b935f 100644 --- a/.emacs.d/init.org +++ b/.emacs.d/init.org @@ -216,95 +216,126 @@ '(python-pylint python-pyflakes)))) #+END_SRC -** Eshell +* pretty-control-l-mode - Add ~unison~ to the list of =eshell-visual-commands= because it - expects unbuffered input and eshell just doesn't give that. + Make the ~C-l~ look like a line of ~-~ up to =fill-column= or + =fci-rule-column= and remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp :tangle init2.el - (eval-after-load "em-term" - '(add-to-list 'eshell-visual-commands "unison")) - #+END_SRC + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:pretty-control-l-function (win) + "Just make a string of either `fci-rule-column' or + `fill-column' length -1. Use the `-' character. WIN is ignored." + (make-string + (1- (if (boundp 'fci-rule-column) + fci-rule-column fill-column)) ?-)) + + (setq pp^L-^L-string-function 'oni:pretty-control-l-function) + #+END_SRC - Don't let eshell highlight it's prompt, this way I can decide the - colors for it myself. + Remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp :tangle init2.el - (setq eshell-highlight-prompt nil) - #+END_SRC + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq pp^L-^L-string-pre nil) + #+END_SRC - In the prompt: + Enable =pretty-control-l-mode= at startup and whenever a new frame is + created. - - Show the exit status of the last program/command run represented - by a green ~+~ and a red ~-~ sign. - - Show the current hostname with the =mode-line-buffer-id= face. - - Show an abbreviation of the current directory (as seen in ~fish~) - using the =font-lock-string-face= face. - - If we're in a git repository, show the current branch with the - =font-lock-function-name-face= face. - - Show the status of priviledges in blue. + #+BEGIN_SRC emacs-lisp :tangle init2.el + (add-hook 'emacs-startup-hook 'pretty-control-l-mode) + (add-hook 'after-make-frame-functions + '(lambda (arg) (pretty-control-l-mode))) + #+END_SRC - And set the =eshell-prompt-regexp= to +* Eshell - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:eshell-prompt-function () - "Show a pretty shell prompt." - (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) - (hostname (shell-command-to-string "hostname")) - (dir (abbreviate-file-name (eshell/pwd))) - (branch - (shell-command-to-string - "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) - (userstatus (if (zerop (user-uid)) ?# ?$))) - (concat - (propertize (char-to-string status) - 'face `(:foreground ,(if (= status ?+) - "green" - "red"))) - " " - (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) - " " - (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) - " " - (when (not (string= branch "")) - (propertize - ;; Cut off "* " and "\n" - (substring branch 2 -1) - 'face 'font-lock-function-name-face)) - " \n" - (propertize (char-to-string userstatus) - 'face `(:foreground "blue")) - "> "))) - - (setq eshell-prompt-function 'oni:eshell-prompt-function - eshell-prompt-regexp "^[#$]> ") - #+END_SRC + Add ~unison~ to the list of =eshell-visual-commands= because it + expects unbuffered input and eshell just doesn't give that. - Don't truncate lines in eshell, wrap them. + #+BEGIN_SRC emacs-lisp :tangle init2.el + (eval-after-load "em-term" + '(add-to-list 'eshell-visual-commands "unison")) + #+END_SRC - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:eshell-mode-func () - "Function for `eshell-mode-hook'." - (setq truncate-lines nil)) + Don't let eshell highlight it's prompt, this way I can decide the + colors for it myself. - (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) - #+END_SRC + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq eshell-highlight-prompt nil) + #+END_SRC - Bind the ~f8~ key to easily show eshell. + In the prompt: - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:raise-eshell () - "Start or switch back to `eshell'. - Also change directories to current working directory." - (interactive) - (let ((dir (file-name-directory - (or (buffer-file-name) "~/"))) - (hasfile (not (eq (buffer-file-name) nil)))) - (eshell) - (if (and hasfile (eq eshell-process-list nil)) - (progn - (eshell/cd dir) - (eshell-reset))))) - - (global-set-key (kbd "") 'oni:raise-eshell) - #+END_SRC + - Show the exit status of the last program/command run represented + by a green ~+~ and a red ~-~ sign. + - Show the current hostname with the =mode-line-buffer-id= face. + - Show an abbreviation of the current directory (as seen in ~fish~) + using the =font-lock-string-face= face. + - If we're in a git repository, show the current branch with the + =font-lock-function-name-face= face. + - Show the status of priviledges in blue. + + And set the =eshell-prompt-regexp= to + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:eshell-prompt-function () + "Show a pretty shell prompt." + (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) + (hostname (shell-command-to-string "hostname")) + (dir (abbreviate-file-name (eshell/pwd))) + (branch + (shell-command-to-string + "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) + (userstatus (if (zerop (user-uid)) ?# ?$))) + (concat + (propertize (char-to-string status) + 'face `(:foreground ,(if (= status ?+) + "green" + "red"))) + " " + (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) + " " + (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) + " " + (when (not (string= branch "")) + (propertize + ;; Cut off "* " and "\n" + (substring branch 2 -1) + 'face 'font-lock-function-name-face)) + " \n" + (propertize (char-to-string userstatus) + 'face `(:foreground "blue")) + "> "))) + + (setq eshell-prompt-function 'oni:eshell-prompt-function + eshell-prompt-regexp "^[#$]> ") + #+END_SRC + + Don't truncate lines in eshell, wrap them. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:eshell-mode-func () + "Function for `eshell-mode-hook'." + (setq truncate-lines nil)) + + (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) + #+END_SRC + + Bind the ~f8~ key to easily show eshell. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:raise-eshell () + "Start or switch back to `eshell'. + Also change directories to current working directory." + (interactive) + (let ((dir (file-name-directory + (or (buffer-file-name) "~/"))) + (hasfile (not (eq (buffer-file-name) nil)))) + (eshell) + (if (and hasfile (eq eshell-process-list nil)) + (progn + (eshell/cd dir) + (eshell-reset))))) + + (global-set-key (kbd "") 'oni:raise-eshell) + #+END_SRC diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index 1afe1d6..a5ee2eb 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -369,13 +369,6 @@ When dealing with braces, add another line and indent that too." (setq-local fci-rule-column 80) (flycheck-mode)) -(defun oni:pretty-control-l-function (win) - "Just make a string of either `fci-rule-column' or -`fill-column' length -1. Use the `-' character. WIN is ignored." - (make-string - (1- (if (boundp 'fci-rule-column) - fci-rule-column fill-column)) ?-)) - (defun oni:prog-mode-func () "Function for `prog-mode-hook'." (rainbow-delimiters-mode) -- cgit v1.2.3-54-g00ecf From 791d7fd3a2fe6ae4407fe6fe9f2ea86e84dd315c Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 17 Feb 2013 22:23:36 +0100 Subject: emacs: Close compilation buffer on success --- .emacs.d/init.el | 2 ++ .emacs.d/site-lisp/ext.el | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 0296816..217eb26 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -271,6 +271,8 @@ 'display-buffer-alist '("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil)))) +(add-to-list 'compilation-finish-functions 'ext:comp-finish-function) + (blink-cursor-mode -1) (column-number-mode -1) (line-number-mode -1) diff --git a/.emacs.d/site-lisp/ext.el b/.emacs.d/site-lisp/ext.el index 2ed65d4..d6abaa6 100644 --- a/.emacs.d/site-lisp/ext.el +++ b/.emacs.d/site-lisp/ext.el @@ -38,6 +38,15 @@ buffer-file-name)))) (list "pycheck.sh" (list local-file)))) +(defun ext:comp-finish-function (buf str) + "Don't show compilation window if everything went ok" + (if (string-match "exited abnormally" str) + ;; there were errors + (message "compilation errors, press C-x ` to visit") + ;; no errors, make the compilation window go away in 0.5 seconds + (run-at-time 0.5 nil 'delete-windows-on buf) + (message "No compilation errors!"))) + (defun ext:reload-buffer () "Reload current buffer." (interactive) -- cgit v1.2.3-54-g00ecf From 50ab6deeabf2769ed3c4ff67385fae768ff41ee2 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 17 Feb 2013 22:53:36 +0100 Subject: emacs: Move ERC config to org --- .emacs.d/init.el | 8 ----- .emacs.d/init.org | 81 ++++++++++++++++++++++++++++++++++++++++------- .emacs.d/site-lisp/oni.el | 6 ---- 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 217eb26..816c03d 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -96,13 +96,6 @@ (font . "Envy Code R:pixelsize=18") (alpha 90 90))) (setq elnode-do-init nil) -(setq erc-autojoin-channels-alist - '(("freenode.net" "#ninthfloor" "#emacs"))) -(setq erc-hide-list '("JOIN" "PART" "QUIT")) -(setq erc-insert-timestamp-function 'erc-insert-timestamp-left) -(setq erc-nick "ryuslash") -(setq erc-timestamp-format "[%H:%M] ") -(setq erc-timestamp-only-if-changed-flag nil) (setq fci-rule-color "darkred") (setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) (setq geiser-repl-history-filename "~/.emacs.d/geiser-history") @@ -181,7 +174,6 @@ (add-hook 'diary-display-hook 'oni:diary-display-func) (add-hook 'emacs-startup-hook 'oni:emacs-startup-func) (add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-func) -(add-hook 'erc-mode-hook 'oni:erc-mode-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) diff --git a/.emacs.d/init.org b/.emacs.d/init.org index 95b935f..2687290 100644 --- a/.emacs.d/init.org +++ b/.emacs.d/init.org @@ -4,7 +4,18 @@ #+STARTUP: showall #+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html -* Emacs init +* gui + + Remove the ~menu-bar~, ~tool-bar~ and ~scroll-bar~ from the UI since I + don't use them at all. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (menu-bar-mode -1) + (scroll-bar-mode -1) + (tool-bar-mode -1) + #+END_SRC + +* load-path Before doing anything else I should make sure that both the directories ~/usr/local/emacs/share/emacs/site-lisp~ and @@ -33,15 +44,6 @@ (load-theme 'yoshi t) #+END_SRC - Remove the ~menu-bar~, ~tool-bar~ and ~scroll-bar~ from the UI since I - don't use them at all. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (menu-bar-mode -1) - (scroll-bar-mode -1) - (tool-bar-mode -1) - #+END_SRC - Add any other interesting paths to =load-path= and, if it exists, load the ~loaddefs.el~ file from these directories. @@ -55,6 +57,8 @@ "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode")) #+END_SRC +* y-or-n-p + Don't ask ~yes~ or ~no~, ask ~y~ or ~n~, I've never had an accidental ~y~ so far. @@ -62,6 +66,8 @@ (defalias 'yes-or-no-p 'y-or-n-p) #+END_SRC +* ibuffer + Use =ibuffer= instead of the default =list-buffers= because it has many more features. @@ -69,12 +75,16 @@ (defalias 'list-buffers 'ibuffer) #+END_SRC +* hippie-expand + Do the same with =hippie-expand= and =dabbrev-expand=. #+BEGIN_SRC emacs-lisp :tangle init2.el (defalias 'dabbrev-expand 'hippie-expand) #+END_SRC +* eldoc + Don't show it when ~eldoc~ is running, I almost assume that it is whenever I'm working in a mode that supports it anyway. This should only execute once ~eldoc~ has been loaded. @@ -83,6 +93,8 @@ (eval-after-load "eldoc" '(diminish 'eldoc-mode)) #+END_SRC +* emms + Use the standard EMMS configuration and add some MPD settings. #+BEGIN_SRC emacs-lisp :tangle init2.el @@ -129,6 +141,8 @@ (global-set-key (kbd "") 'oni:start-emms) #+END_SRC +* flymake + Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to "allowed" files and add go error output to error patterns. @@ -206,6 +220,8 @@ "Access to a protected member")))) #+END_SRC +* flycheck + After loading ~flycheck~ Remove the default python checkers and replace them with my own, which tries both ~flake8~ and ~pylint~. @@ -247,7 +263,50 @@ '(lambda (arg) (pretty-control-l-mode))) #+END_SRC -* Eshell +* erc + + Automatically join some channels when connecting to freenode.net. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq erc-autojoin-channels-alist + '(("freenode.net" "#ninthfloor" "#emacs"))) + #+END_SRC + + Don't show ~PART~ messages. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq erc-hide-list '("PART")) + #+END_SRC + + Insert a timestamp every time a message comes in, print it on the + left and print the hour and minute parts of the time. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) + (setq erc-timestamp-format "[%H:%M] ") + (setq erc-timestamp-only-if-changed-flag nil) + #+END_SRC + + Set my nickname. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq erc-nick "ryuslash") + #+END_SRC + + When starting ERC disable truncating lines, don't let ERC fill each + line and enable =visual-line-mode=. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:erc-mode-func () + "Function for `erc-mode-hook'." + (erc-fill-mode -1) + (visual-line-mode) + (setq truncate-lines nil)) + + (add-hook 'erc-mode-hook 'oni:erc-mode-func) + #+END_SRC + +* eshell Add ~unison~ to the list of =eshell-visual-commands= because it expects unbuffered input and eshell just doesn't give that. diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index a5ee2eb..80d1b01 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -109,12 +109,6 @@ DOT are intentionally being skipped." (require 'auto-complete-config) (ac-config-default)) -(defun oni:erc-mode-func () - "Function for `erc-mode-hook'." - (erc-fill-mode -1) - (visual-line-mode) - (setq truncate-lines nil)) - (defun oni:go-mode-func () "Function for `go-mode-hook'." (setq indent-tabs-mode nil) -- cgit v1.2.3-54-g00ecf From a281f040cd35dffe171d5b7d6b00fe03163be6a0 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 17 Feb 2013 23:09:24 +0100 Subject: Move .emacs.d to emacs Since it's no longer placed directly in the home directory it doesn't need to be named exacly the same. --- .emacs.d/.gitignore | 17 - .emacs.d/Makefile | 11 - .emacs.d/eshell/Makefile | 5 - .emacs.d/eshell/alias | 9 - .emacs.d/gnus.el | 57 --- .emacs.d/init.el | 301 ------------- .emacs.d/init.org | 400 ----------------- .emacs.d/site-lisp/Makefile | 7 - .emacs.d/site-lisp/dzen.el | 86 ---- .emacs.d/site-lisp/eltuki.el | 232 ---------- .emacs.d/site-lisp/ext.el | 56 --- .emacs.d/site-lisp/metalexpress.el | 80 ---- .emacs.d/site-lisp/mu4e-init.el | 54 --- .emacs.d/site-lisp/newsticker-init.el | 6 - .emacs.d/site-lisp/oni.el | 574 ------------------------- .emacs.d/site-lisp/org-init.el | 164 ------- .emacs.d/site-lisp/quick-edit-mode.el | 74 ---- .emacs.d/site-lisp/wm-init.el | 3 - .emacs.d/snippets/Makefile | 4 - .emacs.d/snippets/html-mode/Makefile | 4 - .emacs.d/snippets/html-mode/for | 8 - .emacs.d/snippets/html-mode/generic-block | 8 - .emacs.d/snippets/org-mode/Makefile | 4 - .emacs.d/snippets/org-mode/codeblock | 7 - .emacs.d/snippets/org-mode/heading | 9 - .emacs.d/snippets/org-mode/project | 51 --- .emacs.d/snippets/org-mode/snippet | 14 - .emacs.d/snippets/python-mode/Makefile | 4 - .emacs.d/snippets/python-mode/defm_empty | 7 - .emacs.d/snippets/python-mode/form | 9 - .emacs.d/snippets/python-mode/form_valid | 8 - .emacs.d/snippets/python-mode/import_from | 6 - .emacs.d/snippets/python-mode/permission_guard | 9 - .emacs.d/snippets/python-mode/url | 5 - Makefile | 2 +- emacs/.gitignore | 17 + emacs/Makefile | 11 + emacs/eshell/Makefile | 5 + emacs/eshell/alias | 9 + emacs/gnus.el | 57 +++ emacs/init.el | 301 +++++++++++++ emacs/init.org | 400 +++++++++++++++++ emacs/site-lisp/Makefile | 7 + emacs/site-lisp/dzen.el | 86 ++++ emacs/site-lisp/eltuki.el | 232 ++++++++++ emacs/site-lisp/ext.el | 56 +++ emacs/site-lisp/metalexpress.el | 80 ++++ emacs/site-lisp/mu4e-init.el | 54 +++ emacs/site-lisp/newsticker-init.el | 6 + emacs/site-lisp/oni.el | 574 +++++++++++++++++++++++++ emacs/site-lisp/org-init.el | 164 +++++++ emacs/site-lisp/quick-edit-mode.el | 74 ++++ emacs/site-lisp/wm-init.el | 3 + emacs/snippets/Makefile | 4 + emacs/snippets/html-mode/Makefile | 4 + emacs/snippets/html-mode/for | 8 + emacs/snippets/html-mode/generic-block | 8 + emacs/snippets/org-mode/Makefile | 4 + emacs/snippets/org-mode/codeblock | 7 + emacs/snippets/org-mode/heading | 9 + emacs/snippets/org-mode/project | 51 +++ emacs/snippets/org-mode/snippet | 14 + emacs/snippets/python-mode/Makefile | 4 + emacs/snippets/python-mode/defm_empty | 7 + emacs/snippets/python-mode/form | 9 + emacs/snippets/python-mode/form_valid | 8 + emacs/snippets/python-mode/import_from | 6 + emacs/snippets/python-mode/permission_guard | 9 + emacs/snippets/python-mode/url | 5 + 69 files changed, 2294 insertions(+), 2294 deletions(-) delete mode 100644 .emacs.d/.gitignore delete mode 100644 .emacs.d/Makefile delete mode 100644 .emacs.d/eshell/Makefile delete mode 100644 .emacs.d/eshell/alias delete mode 100644 .emacs.d/gnus.el delete mode 100644 .emacs.d/init.el delete mode 100644 .emacs.d/init.org delete mode 100644 .emacs.d/site-lisp/Makefile delete mode 100644 .emacs.d/site-lisp/dzen.el delete mode 100644 .emacs.d/site-lisp/eltuki.el delete mode 100644 .emacs.d/site-lisp/ext.el delete mode 100644 .emacs.d/site-lisp/metalexpress.el delete mode 100644 .emacs.d/site-lisp/mu4e-init.el delete mode 100644 .emacs.d/site-lisp/newsticker-init.el delete mode 100644 .emacs.d/site-lisp/oni.el delete mode 100644 .emacs.d/site-lisp/org-init.el delete mode 100644 .emacs.d/site-lisp/quick-edit-mode.el delete mode 100644 .emacs.d/site-lisp/wm-init.el delete mode 100644 .emacs.d/snippets/Makefile delete mode 100644 .emacs.d/snippets/html-mode/Makefile delete mode 100644 .emacs.d/snippets/html-mode/for delete mode 100644 .emacs.d/snippets/html-mode/generic-block delete mode 100644 .emacs.d/snippets/org-mode/Makefile delete mode 100644 .emacs.d/snippets/org-mode/codeblock delete mode 100644 .emacs.d/snippets/org-mode/heading delete mode 100644 .emacs.d/snippets/org-mode/project delete mode 100644 .emacs.d/snippets/org-mode/snippet delete mode 100644 .emacs.d/snippets/python-mode/Makefile delete mode 100644 .emacs.d/snippets/python-mode/defm_empty delete mode 100644 .emacs.d/snippets/python-mode/form delete mode 100644 .emacs.d/snippets/python-mode/form_valid delete mode 100644 .emacs.d/snippets/python-mode/import_from delete mode 100644 .emacs.d/snippets/python-mode/permission_guard delete mode 100644 .emacs.d/snippets/python-mode/url create mode 100644 emacs/.gitignore create mode 100644 emacs/Makefile create mode 100644 emacs/eshell/Makefile create mode 100644 emacs/eshell/alias create mode 100644 emacs/gnus.el create mode 100644 emacs/init.el create mode 100644 emacs/init.org create mode 100644 emacs/site-lisp/Makefile create mode 100644 emacs/site-lisp/dzen.el create mode 100644 emacs/site-lisp/eltuki.el create mode 100644 emacs/site-lisp/ext.el create mode 100644 emacs/site-lisp/metalexpress.el create mode 100644 emacs/site-lisp/mu4e-init.el create mode 100644 emacs/site-lisp/newsticker-init.el create mode 100644 emacs/site-lisp/oni.el create mode 100644 emacs/site-lisp/org-init.el create mode 100644 emacs/site-lisp/quick-edit-mode.el create mode 100644 emacs/site-lisp/wm-init.el create mode 100644 emacs/snippets/Makefile create mode 100644 emacs/snippets/html-mode/Makefile create mode 100644 emacs/snippets/html-mode/for create mode 100644 emacs/snippets/html-mode/generic-block create mode 100644 emacs/snippets/org-mode/Makefile create mode 100644 emacs/snippets/org-mode/codeblock create mode 100644 emacs/snippets/org-mode/heading create mode 100644 emacs/snippets/org-mode/project create mode 100644 emacs/snippets/org-mode/snippet create mode 100644 emacs/snippets/python-mode/Makefile create mode 100644 emacs/snippets/python-mode/defm_empty create mode 100644 emacs/snippets/python-mode/form create mode 100644 emacs/snippets/python-mode/form_valid create mode 100644 emacs/snippets/python-mode/import_from create mode 100644 emacs/snippets/python-mode/permission_guard create mode 100644 emacs/snippets/python-mode/url diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore deleted file mode 100644 index 0b490df..0000000 --- a/.emacs.d/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -tramp -elpa -bookmarks -abbrev_defs -custom.el -*.elc -ac-comphist.dat -auto-save-list/ -url/ -packages/ -newsticker/ -templates/ -rinit.* -!rinit.org -history -init2.el -*.html diff --git a/.emacs.d/Makefile b/.emacs.d/Makefile deleted file mode 100644 index fc17095..0000000 --- a/.emacs.d/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -DESTDIR:=$(DESTDIR)/.emacs.d -objects=init.elc init.el gnus.elc gnus.el init2.elc init2.el -modules=eshell site-lisp snippets - -EMACS=emacs - -include ../dotfiles.mk - -init2.el: init.org - $(EMACS) -Q -batch \ - -eval "(progn (require 'org) (require 'ob-tangle) (org-babel-tangle-file \"$^\"))" diff --git a/.emacs.d/eshell/Makefile b/.emacs.d/eshell/Makefile deleted file mode 100644 index fd3b0f2..0000000 --- a/.emacs.d/eshell/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -DESTDIR:=$(DESTDIR)/eshell -objects=alias -modules= - -include ../../dotfiles.mk diff --git a/.emacs.d/eshell/alias b/.emacs.d/eshell/alias deleted file mode 100644 index d98e2f5..0000000 --- a/.emacs.d/eshell/alias +++ /dev/null @@ -1,9 +0,0 @@ -alias hgit hgit --no-pager $* -alias newsbeuter ansi-term newsbeuter newsbeuter -alias d dired $1 -alias o find-file $1 -alias listen eshell-exec-visual mplayer http://usa7-vn.mixstream.net/listen/8248.pls -alias ncmpcpp ansi-term ncmpcpp ncmpcpp -alias sudo *sudo $* -alias rm rm -v $* -alias git git --no-pager $* diff --git a/.emacs.d/gnus.el b/.emacs.d/gnus.el deleted file mode 100644 index 7301231..0000000 --- a/.emacs.d/gnus.el +++ /dev/null @@ -1,57 +0,0 @@ -(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-novice-user t) -(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:" - (address "thomas@aethon.nl") - (signature-file "~/documents/work/aethon/signature.txt") - (eval (setq message-sendmail-extra-arguments '("-a" "aethon") - flyspell-default-dictionary "nl"))))) - -;-----[ 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 deleted file mode 100644 index 816c03d..0000000 --- a/.emacs.d/init.el +++ /dev/null @@ -1,301 +0,0 @@ -;;; init.el --- ryuslash's emacs init - -;;; Commentary: -;; Does so much and changes so often - - -;;; Code: - -(load (concat user-emacs-directory "init2")) - -(defface git-commit-summary-face - '((t (:inherit org-level-1))) - "Face for the git title line." - :group 'local) - -(defface git-commit-overlong-summary-face - '((t (:background "#873732"))) - "Face for commit titles that are too long." - :group 'local) - -(defface git-commit-nonempty-second-line-face - '((t (:inherit git-commit-overlong-summary-face))) - "Face for the supposedly empty line in commit messages." - :group 'local) - -(eval-after-load "ido" '(oni:ido-init)) -(eval-after-load "jabber" '(oni:jabber-init)) -(eval-after-load "newst-treeview" '(require 'newsticker-init)) -(eval-after-load "org" '(require 'org-init)) -(eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) -(eval-after-load "smex" '(oni:smex-init)) -(eval-after-load "yasnippet" '(oni:yasnippet-init)) - -(autoload 'define-slime-contrib "slime") -(autoload 'gtags-mode "gtags" nil t) -(autoload 'jabber-connect "jabber" nil t) -(autoload 'php-mode "php-mode" nil t) -(autoload 'po-mode "po-mode" nil t) -(autoload 'pony-mode "pony-mode" nil t) -(autoload 'sawfish-mode "sawfish" nil t) -(autoload 'server-running-p "server") -(autoload 'slime-js-minor-mode "slime-js" nil t) -(autoload 'xmodmap-mode "xmodmap-mode" nil t) -(autoload 'w3m-bookmark-view "w3m" nil t) -(autoload 'w3m-goto-url "w3m" nil t) - -(require 'geiser-install) -(require 'uniquify) -(require 'ext) -(require 'oni) - -(put 'upcase-region 'disabled nil) -(put 'downcase-region 'disabled nil) -(put 'narrow-to-region 'disabled nil) -(put 'scroll-left 'disabled nil) - -(setq-default bidi-paragraph-direction 'left-to-right) -(setq-default c-basic-offset 4) -(setq-default fci-rule-column 73) -(setq-default indent-tabs-mode nil) -(setq-default php-mode-warn-if-mumamo-off nil) -(setq-default require-final-newline t) -(setq-default tab-width 4) -(setq-default truncate-lines t) - -(setq appt-disp-window-function #'oni:appt-display-window-and-jabber) -(setq appt-display-diary nil) -(setq auto-mode-case-fold nil) -(setq auto-save-file-name-transforms oni:auto-save-name-transforms) -(setq avandu-article-render-function #'avandu-view-w3m) -(setq backup-directory-alist oni:backup-directory-alist) -(setq browse-url-browser-function 'browse-url-generic) -(setq browse-url-generic-program (getenv "BROWSER")) -(setq c-offsets-alist '((statement-block-intro . +) - (knr-argdecl-intro . 5) - (substatement-open . +) - (substatement-label . 0) - (label . 0) - (statement-case-open . +) - (statement-cont . +) - (arglist-intro . +) - (arglist-close . 0) - (inline-open . 0) - (brace-list-open . +) - (topmost-intro-cont first c-lineup-topmost-intro-cont - c-lineup-gnu-DEFUN-intro-cont))) -(setq comment-auto-fill-only-comments t) -(setq custom-file "~/.emacs.d/custom.el") -(setq custom-theme-directory "~/.emacs.d/themes") -(setq default-frame-alist - `((border-width . 0) - (internal-border-width . 0) - (vertical-scroll-bars . nil) - (menu-bar-lines . nil) - (tool-bar-lines . nil) - (font . "Envy Code R:pixelsize=18") - (alpha 90 90))) -(setq elnode-do-init nil) -(setq fci-rule-color "darkred") -(setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) -(setq geiser-repl-history-filename "~/.emacs.d/geiser-history") -(setq gnus-init-file "~/.emacs.d/gnus") -(setq gtags-auto-update t) -(setq help-at-pt-display-when-idle t) -(setq highlight-80+-columns 72) -(setq identica-enable-striping t) -(setq ido-auto-merge-delay-time 1000000) -(setq ido-default-buffer-method 'selected-window) -(setq ido-max-window-height 1) -(setq ido-save-directory-list-file nil) -(setq ido-ubiquitous-command-exceptions - '(org-refile org-capture-refile)) -(setq inferior-lisp-program "sbcl") -(setq inhibit-default-init t) -(setq inhibit-local-menu-bar-menus t) -(setq inhibit-startup-message t) -(setq initial-major-mode 'emacs-lisp-mode) -(setq initial-scratch-message nil) -(setq jabber-account-list '(("ryuslash@jabber.org") - ("tom@ryuslash.org/Emacs" - (:connection-type . ssl)))) -(setq jabber-chat-buffer-format "*jab:%n*") -(setq jabber-chat-buffer-show-avatar nil) -(setq jabber-chat-fill-long-lines nil) -(setq jabber-chat-foreign-prompt-format "%t %u/%r <\n") -(setq jabber-chat-local-prompt-format "%t %u/%r >\n") -(setq jabber-chatstates-confirm nil) -(setq jabber-history-dir "~/.emacs.d/jabber") -(setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) -(setq jabber-roster-show-bindings nil) -(setq jit-lock-defer-time 0.2) -(setq magit-repo-dirs '("~/projects/" "~/var/src/")) -(setq message-log-max 1000) -(setq message-send-mail-function 'message-send-mail-with-sendmail) -(setq message-sendmail-extra-arguments '("-a" "ryuslash")) -(setq package-archives - '(("org" . "http://orgmode.org/elpa/") - ("melpa" . "http://melpa.milkbox.net/packages/") - ("marmalade" . "http://marmalade-repo.org/packages/") - ("gnu" . "http://elpa.gnu.org/packages/"))) -(setq package-load-list '((htmlize "1.39") - (lua-mode "20111107") - all)) -(setq php-function-call-face 'font-lock-function-name-face) -(setq php-mode-force-pear t) -(setq pony-tpl-indent-moves t) -(setq rainbow-delimiters-max-face-count 12) -(setq redisplay-dont-pause t) -(setq send-mail-function 'smtpmail-send-it) -(setq sendmail-program "/usr/bin/msmtp") -(setq sentence-end-double-space nil) -(setq smex-key-advice-ignore-menu-bar t) -(setq smex-save-file "~/.emacs.d/smex-items") -(setq split-height-threshold 40) -(setq time-stamp-active t) -(setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") -(setq type-break-good-rest-interval (* 60 10)) -(setq type-break-interval (* 60 50)) -(setq type-break-keystroke-threshold '(nil . nil)) -(setq uniquify-buffer-name-style 'post-forward) -(setq use-dialog-box nil) -(setq user-full-name "Tom Willemsen") -(setq user-mail-address "tom@ryuslash.org") -(setq w3m-fill-column 72) -(setq window-combination-resize t) -(setq yas-fallback-behavior nil) -(setq yas-prompt-functions '(yas-ido-prompt)) - -(add-hook 'after-change-major-mode-hook 'set-current-mode-icon) -(add-hook 'after-save-hook 'oni:after-save-func t) -(add-hook 'before-save-hook 'oni:before-save-func) -(add-hook 'c-mode-hook 'oni:c-mode-func) -(add-hook 'css-mode-hook 'oni:css-mode-func) -(add-hook 'diary-display-hook 'oni:diary-display-func) -(add-hook 'emacs-startup-hook 'oni:emacs-startup-func) -(add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-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 'html-mode-hook 'oni:html-mode-func) -(add-hook 'jabber-alert-message-hooks 'oni:jabber-alert-message-func) -(add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func) -(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func) -(add-hook 'java-mode-hook 'oni:java-mode-func) -(add-hook 'js-mode-hook 'oni:js-mode-func) -(add-hook 'js2-mode-hook 'oni:js2-mode-func) -(add-hook 'lua-mode-hook 'oni:lua-mode-func) -(add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func) -(add-hook 'markdown-mode-hook 'oni:markdown-mode-func) -(add-hook 'message-mode-hook 'oni:message-mode-func) -(add-hook 'org-mode-hook 'oni:org-mode-func) -(add-hook 'php-mode-hook 'oni:php-mode-func) -(add-hook 'prog-mode-hook 'oni:prog-mode-func) -(add-hook 'python-mode-hook 'oni:python-mode-func) -(add-hook 'rst-mode-hook 'oni:rst-mode-func) -(add-hook 'term-mode-hook 'oni:term-mode-func) -(add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func) -(add-hook 'write-file-hooks 'oni:write-file-func) -(add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func) - -(define-key key-translation-map (kbd "C-j") (kbd "C-l")) -(define-key key-translation-map (kbd "C-l") (kbd "C-j")) - -(global-set-key (kbd "'") 'oni:self-insert-dwim) -(global-set-key (kbd "") 'oni:raise-scratch) -(global-set-key (kbd "") 'oni:view-mail) -(global-set-key (kbd "") 'git-project-show-files) -(global-set-key (kbd "") 'ext:reload-buffer) -(global-set-key (kbd "") 'jabber-switch-to-roster-buffer) -(global-set-key (kbd "") 'magit-status) -(global-set-key (kbd "") 'oni:show-org-index) -(global-set-key (kbd "C-<") 'oni:indent-shift-left) -(global-set-key (kbd "C->") 'oni:indent-shift-right) -(global-set-key (kbd "C-M-4") 'split-window-vertically) -(global-set-key (kbd "C-M-SPC") 'er/expand-region) -(global-set-key (kbd "C-M-d") 'kill-word) -(global-set-key (kbd "C-M-w") 'backward-kill-word) -(global-set-key (kbd "C-S-k") 'kill-whole-line) -(global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim) -(global-set-key (kbd "C-c a") 'org-agenda) -(global-set-key (kbd "C-c c") 'org-capture) -(global-set-key (kbd "C-c i p") 'identica-update-status-interactive) -(global-set-key (kbd "C-c p") 'oni:show-buffer-position) -(global-set-key (kbd "C-c t") 'oni:raise-ansi-term) -(global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char) -(global-set-key (kbd "C-e") 'oni:move-end-of-dwim) -(global-set-key (kbd "C-k") 'oni:kill-region-or-line) -(global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char) -(global-set-key (kbd "M-0") 'delete-window) -(global-set-key (kbd "M-1") 'delete-other-windows) -(global-set-key (kbd "M-2") 'split-window-below) -(global-set-key (kbd "M-3") 'split-window-right) -(global-set-key (kbd "M-4") 'split-window-horizontally) -(global-set-key (kbd "M-n") 'idomenu) -(global-set-key (kbd "M-o") 'other-window) -(global-set-key (kbd "\"") 'oni:self-insert-dwim) - -(if (daemonp) - (global-set-key "\C-x\C-c" 'oni:close-client-window)) - -(when (or window-system (daemonp)) - (global-unset-key "\C-z")) - -(add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode)) -(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode)) -(add-to-list 'auto-mode-alist - '("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode)) -(add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode)) -(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) -(add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode)) -(add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode)) -(add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode)) - -(add-to-list 'debug-ignored-errors "^Can't shift all lines enough") - -(add-to-list - 'display-buffer-alist - '("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil)))) -(add-to-list - 'display-buffer-alist - '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) -(add-to-list - 'display-buffer-alist - '("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil)))) - -(add-to-list 'compilation-finish-functions 'ext:comp-finish-function) - -(blink-cursor-mode -1) -(column-number-mode -1) -(line-number-mode -1) -(tooltip-mode -1) - -(package-initialize) - -(auto-insert-mode) -(cua-selection-mode t) -(electric-indent-mode) -(electric-pair-mode) -(ido-mode) -(ido-ubiquitous-mode) -(savehist-mode) -(show-paren-mode) -(winner-mode) - -(smex-initialize) -(help-at-pt-set-timer) -(windmove-default-keybindings) -(global-diff-hl-mode) - -(load custom-file) -;; (load "rudel-loaddefs.el") -(load (expand-file-name "~/quicklisp/slime-helper.el")) - -(unless (server-running-p) - (server-start)) - -(diminish 'auto-fill-function "_") - -(provide 'init) - -;;; init.el ends here diff --git a/.emacs.d/init.org b/.emacs.d/init.org deleted file mode 100644 index 2687290..0000000 --- a/.emacs.d/init.org +++ /dev/null @@ -1,400 +0,0 @@ -#+TITLE: Emacs init -#+STYLE: -#+OPTIONS: author:nil -#+STARTUP: showall -#+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html - -* gui - - Remove the ~menu-bar~, ~tool-bar~ and ~scroll-bar~ from the UI since I - don't use them at all. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (menu-bar-mode -1) - (scroll-bar-mode -1) - (tool-bar-mode -1) - #+END_SRC - -* load-path - - Before doing anything else I should make sure that both the - directories ~/usr/local/emacs/share/emacs/site-lisp~ and - ~/usr/share/emacs/site-list~ are included in =load-path=, along with - their subdirectories, but only if they haven't already been added - and exist. Place them at the end of =load-path= so they don't mess up - package precedence. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (eval-and-compile - (defun oni:path-init (dir) - "Add DIR to `load-path' and all its subdirectories, unless - DIR is already in `load-path'." - (unless (or (member dir load-path) (not (file-exists-p dir))) - (let ((default-directory dir)) - (add-to-list 'load-path dir t) - (normal-top-level-add-subdirs-to-load-path)))) - (oni:path-init "/usr/share/emacs/site-lisp") - (oni:path-init "/usr/local/emacs/share/emacs/site-lisp")) - #+END_SRC - - Add my project [[yoshi-theme]] to =custom-theme-load-path= and load it. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (add-to-list 'custom-theme-load-path "~/projects/emacs/yoshi-theme/") - (load-theme 'yoshi t) - #+END_SRC - - Add any other interesting paths to =load-path= and, if it exists, - load the ~loaddefs.el~ file from these directories. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (mapc #'(lambda (dir) - (add-to-list 'load-path dir) - (let ((loaddefs (concat dir "/loaddefs.el"))) - (when (file-exists-p loaddefs) - (load loaddefs)))) - '("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp" - "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode")) - #+END_SRC - -* y-or-n-p - - Don't ask ~yes~ or ~no~, ask ~y~ or ~n~, I've never had an accidental ~y~ so - far. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defalias 'yes-or-no-p 'y-or-n-p) - #+END_SRC - -* ibuffer - - Use =ibuffer= instead of the default =list-buffers= because it has many - more features. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defalias 'list-buffers 'ibuffer) - #+END_SRC - -* hippie-expand - - Do the same with =hippie-expand= and =dabbrev-expand=. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defalias 'dabbrev-expand 'hippie-expand) - #+END_SRC - -* eldoc - - Don't show it when ~eldoc~ is running, I almost assume that it is - whenever I'm working in a mode that supports it anyway. This should - only execute once ~eldoc~ has been loaded. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (eval-after-load "eldoc" '(diminish 'eldoc-mode)) - #+END_SRC - -* emms - - Use the standard EMMS configuration and add some MPD settings. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:emms-init () - "Initialization function for EMMS." - (require 'emms-setup) - (require 'emms-player-mpd) - - (emms-standard) - - (add-to-list 'emms-info-functions 'emms-info-mpd) - (add-to-list 'emms-player-list 'emms-player-mpd) - - (setq emms-player-mpd-server-name "localhost") - (setq emms-player-mpd-server-port "6600") - (setq emms-player-mpd-music-directory "/mnt/music/mp3")) - - (eval-after-load "emms-source-file" '(oni:emms-init)) - (setq emms-source-file-default-directory "/mnt/music/") - #+END_SRC - - Add some keybindings for EMMS. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:emms-toggle-playing () - "Toggle between playing/paused states." - (interactive) - (if (eq emms-player-playing-p nil) - (emms-start) - (emms-pause))) - - (defun oni:start-emms () - "Check to see if the function `emms' exists, if not call - `emms-player-mpd-connect' and assume that will have loaded it." - (interactive) - (unless (fboundp 'emms) - (emms-player-mpd-connect)) - (emms)) - - (global-set-key (kbd "") 'emms-next) - (global-set-key (kbd "") 'oni:emms-toggle-playing) - (global-set-key (kbd "") 'emms-previous) - (global-set-key (kbd "") 'emms-stop) - (global-set-key (kbd "") 'oni:start-emms) - #+END_SRC - -* flymake - - Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to - "allowed" files and add go error output to error patterns. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:flymake-init () - "Initialization function for flymake." - (require 'flymake-cursor) - - (add-to-list ; Make sure pyflakes is loaded - 'flymake-allowed-file-name-masks ; for python files. - '("\\.py\\'" ext:flymake-pyflakes-init)) - - (add-to-list ; Error line repexp for go - 'flymake-err-line-patterns ; compilation. - '("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$" - 1 2 nil 3)) - - (add-to-list ; Go uses makefiles, makes - 'flymake-allowed-file-name-masks ; flymaking 'easy'. - '("\\.go$" flymake-simple-make-init))) - - (eval-after-load "flymake" '(oni:flymake-init)) - #+END_SRC - - Disable the GUI for flymake errors, add a bunch of pep8, flymake - and pyflakes messages to warning and info patterns, set the log - file to somewhere in my home directory and set logging level to 0. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (setq flymake-gui-warnings-enabled nil) - (setq flymake-info-line-regexp - (eval-when-compile - (regexp-opt - '("Invalid name" - "String statement has no effect" - "Missing docstring" - "Empty docstring" - "multiple imports on one line" - "expected 2 blank lines, found 1" - "expected 2 blank lines, found 0" - "TODO:" - "whitespace after '{'" - "whitespace before '}'" - "whitespace before ':'" - "whitespace after '('" - "whitespace before ')'" - "whitespace after '['" - "whitespace before ']'" - "the backslash is redundant between brackets" - "continuation line over-indented for visual indent" - "continuation line under-indented for visual indent" - "Too many statements" - "comparison to None should be" - "missing whitespace around operator" - "missing whitespace after ','" - "line too long" - "at least two spaces before inline comment" - "trailing whitespace" - "imported but unused" - "Unused import" - "too many blank lines")))) - (setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log")) - (setq flymake-log-level 0) - (setq flymake-warn-line-regexp - (eval-when-compile - (regexp-opt '("warning" - "Warning" - "redefinition of unused" - "Redefining built-in" - "Redefining name" - "Unused argument" - "Unused variable" - "Dangerous default value {} as argument" - "no newline at end of file" - "Access to a protected member")))) - #+END_SRC - -* flycheck - - After loading ~flycheck~ Remove the default python checkers and - replace them with my own, which tries both ~flake8~ and ~pylint~. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (eval-after-load "flycheck" - '(progn - (mapc (lambda (c) (delete c flycheck-checkers)) - '(python-pylint python-pyflakes)))) - #+END_SRC - -* pretty-control-l-mode - - Make the ~C-l~ look like a line of ~-~ up to =fill-column= or - =fci-rule-column= and remove the string displayed before the ~C-l~. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:pretty-control-l-function (win) - "Just make a string of either `fci-rule-column' or - `fill-column' length -1. Use the `-' character. WIN is ignored." - (make-string - (1- (if (boundp 'fci-rule-column) - fci-rule-column fill-column)) ?-)) - - (setq pp^L-^L-string-function 'oni:pretty-control-l-function) - #+END_SRC - - Remove the string displayed before the ~C-l~. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (setq pp^L-^L-string-pre nil) - #+END_SRC - - Enable =pretty-control-l-mode= at startup and whenever a new frame is - created. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (add-hook 'emacs-startup-hook 'pretty-control-l-mode) - (add-hook 'after-make-frame-functions - '(lambda (arg) (pretty-control-l-mode))) - #+END_SRC - -* erc - - Automatically join some channels when connecting to freenode.net. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (setq erc-autojoin-channels-alist - '(("freenode.net" "#ninthfloor" "#emacs"))) - #+END_SRC - - Don't show ~PART~ messages. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (setq erc-hide-list '("PART")) - #+END_SRC - - Insert a timestamp every time a message comes in, print it on the - left and print the hour and minute parts of the time. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) - (setq erc-timestamp-format "[%H:%M] ") - (setq erc-timestamp-only-if-changed-flag nil) - #+END_SRC - - Set my nickname. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (setq erc-nick "ryuslash") - #+END_SRC - - When starting ERC disable truncating lines, don't let ERC fill each - line and enable =visual-line-mode=. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:erc-mode-func () - "Function for `erc-mode-hook'." - (erc-fill-mode -1) - (visual-line-mode) - (setq truncate-lines nil)) - - (add-hook 'erc-mode-hook 'oni:erc-mode-func) - #+END_SRC - -* eshell - - Add ~unison~ to the list of =eshell-visual-commands= because it - expects unbuffered input and eshell just doesn't give that. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (eval-after-load "em-term" - '(add-to-list 'eshell-visual-commands "unison")) - #+END_SRC - - Don't let eshell highlight it's prompt, this way I can decide the - colors for it myself. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (setq eshell-highlight-prompt nil) - #+END_SRC - - In the prompt: - - - Show the exit status of the last program/command run represented - by a green ~+~ and a red ~-~ sign. - - Show the current hostname with the =mode-line-buffer-id= face. - - Show an abbreviation of the current directory (as seen in ~fish~) - using the =font-lock-string-face= face. - - If we're in a git repository, show the current branch with the - =font-lock-function-name-face= face. - - Show the status of priviledges in blue. - - And set the =eshell-prompt-regexp= to - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:eshell-prompt-function () - "Show a pretty shell prompt." - (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) - (hostname (shell-command-to-string "hostname")) - (dir (abbreviate-file-name (eshell/pwd))) - (branch - (shell-command-to-string - "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) - (userstatus (if (zerop (user-uid)) ?# ?$))) - (concat - (propertize (char-to-string status) - 'face `(:foreground ,(if (= status ?+) - "green" - "red"))) - " " - (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) - " " - (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) - " " - (when (not (string= branch "")) - (propertize - ;; Cut off "* " and "\n" - (substring branch 2 -1) - 'face 'font-lock-function-name-face)) - " \n" - (propertize (char-to-string userstatus) - 'face `(:foreground "blue")) - "> "))) - - (setq eshell-prompt-function 'oni:eshell-prompt-function - eshell-prompt-regexp "^[#$]> ") - #+END_SRC - - Don't truncate lines in eshell, wrap them. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:eshell-mode-func () - "Function for `eshell-mode-hook'." - (setq truncate-lines nil)) - - (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) - #+END_SRC - - Bind the ~f8~ key to easily show eshell. - - #+BEGIN_SRC emacs-lisp :tangle init2.el - (defun oni:raise-eshell () - "Start or switch back to `eshell'. - Also change directories to current working directory." - (interactive) - (let ((dir (file-name-directory - (or (buffer-file-name) "~/"))) - (hasfile (not (eq (buffer-file-name) nil)))) - (eshell) - (if (and hasfile (eq eshell-process-list nil)) - (progn - (eshell/cd dir) - (eshell-reset))))) - - (global-set-key (kbd "") 'oni:raise-eshell) - #+END_SRC diff --git a/.emacs.d/site-lisp/Makefile b/.emacs.d/site-lisp/Makefile deleted file mode 100644 index bbccbb7..0000000 --- a/.emacs.d/site-lisp/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 6cc3eae..0000000 --- a/.emacs.d/site-lisp/dzen.el +++ /dev/null @@ -1,86 +0,0 @@ -;;; dzen.el --- Control DZEN2 from emacs - -;; Copyright (C) 2012 Tom Willemsen - -;; Author: Tom Willemsen -;; 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 deleted file mode 100644 index 224e9ab..0000000 --- a/.emacs.d/site-lisp/eltuki.el +++ /dev/null @@ -1,232 +0,0 @@ -;;; eltuki.el --- Tekuti functions - -;; Copyright (C) 2012 Tom Willemsen - -;; Author: Tom Willemsen -;; 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) - (filename (concat dir "/content"))) - (with-current-buffer (org-export-region-as-html - (point-min) (point-max) t "*eltuki-html*") - (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))) - -(provide 'eltuki) -;;; eltuki.el ends here diff --git a/.emacs.d/site-lisp/ext.el b/.emacs.d/site-lisp/ext.el deleted file mode 100644 index d6abaa6..0000000 --- a/.emacs.d/site-lisp/ext.el +++ /dev/null @@ -1,56 +0,0 @@ -;;; ext.el --- More emacs functions - -;; Copyright (C) 2012 Tom Willemsen - -;; Author: Tom Willemsen -;; Keywords: local - -;; 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: - -(defadvice org-agenda-redo (after ext:org-agenda-redo-add-appts) - "Pressing `r' on the agenda will also add appointments." - (progn - (setq appt-time-msg-list nil) - (org-agenda-to-appt))) - -(defun ext:flymake-pyflakes-init () - "Initialize function for flymake with pyflakes." - (let* ((temp-file (flymake-init-create-temp-buffer-copy - 'flymake-create-temp-inplace)) - (local-file (file-relative-name temp-file (file-name-directory - buffer-file-name)))) - (list "pycheck.sh" (list local-file)))) - -(defun ext:comp-finish-function (buf str) - "Don't show compilation window if everything went ok" - (if (string-match "exited abnormally" str) - ;; there were errors - (message "compilation errors, press C-x ` to visit") - ;; no errors, make the compilation window go away in 0.5 seconds - (run-at-time 0.5 nil 'delete-windows-on buf) - (message "No compilation errors!"))) - -(defun ext:reload-buffer () - "Reload current buffer." - (interactive) - (revert-buffer nil t nil)) - -(provide 'ext) -;;; ext.el ends here diff --git a/.emacs.d/site-lisp/metalexpress.el b/.emacs.d/site-lisp/metalexpress.el deleted file mode 100644 index 0c4539a..0000000 --- a/.emacs.d/site-lisp/metalexpress.el +++ /dev/null @@ -1,80 +0,0 @@ -;;; metalexpress.el --- Listen to Metal Express Radio - -;; Copyright (C) 2012 Tom Willemsen - -;; Author: Tom Willemsen -;; 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)) - (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) - (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 deleted file mode 100644 index 258a6ef..0000000 --- a/.emacs.d/site-lisp/mu4e-init.el +++ /dev/null @@ -1,54 +0,0 @@ -;;; mu4e-init.el --- mu4e initialization - -;; Copyright (C) 2012 Tom Willemsen - -;; Author: Tom Willemsen -;; 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/newsticker-init.el b/.emacs.d/site-lisp/newsticker-init.el deleted file mode 100644 index c393df1..0000000 --- a/.emacs.d/site-lisp/newsticker-init.el +++ /dev/null @@ -1,6 +0,0 @@ -(setq newsticker-automatically-mark-items-as-old nil) -(setq newsticker-html-renderer 'w3m-region) -(setq newsticker-obsolete-item-max-age 604800) -(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 deleted file mode 100644 index 80d1b01..0000000 --- a/.emacs.d/site-lisp/oni.el +++ /dev/null @@ -1,574 +0,0 @@ -;;; oni.el --- Functions for emacs - -;; Copyright (C) 2012 Tom Willemsen - -;; Author: Tom Willemsen -;; Keywords: local - -;; 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: - -(autoload 'notifications-notify "notifications") -(autoload 'jabber-send-message "jabber-chat") - -(defmacro oni:email (user at host dot com) - "Turn arguments into an email address. -The resulting email address will look like: USER@HOST.COM, AT and -DOT are intentionally being skipped." - (concat (symbol-name user) "@" (symbol-name host) "." - (symbol-name com))) - -(defun oni:after-save-func () - "Function for `after-save-hook'." - (oni:compile-el) - (executable-make-buffer-file-executable-if-script-p) - (let* ((dom-dir (locate-dominating-file (buffer-file-name) "Makefile")) - (TAGSp (not (string= "" (shell-command-to-string - (concat "grep \"^TAGS:\" " dom-dir "Makefile")))))) - (when (and dom-dir TAGSp) - (shell-command - (concat "make -C " dom-dir " TAGS >/dev/null 2>&1"))))) - -(defun oni:appt-display-window-and-jabber (min-to-app new-time appt-msg) - "Send a message to my phone jabber account." - (jabber-send-message (car jabber-connections) "phone@ryuslash.org" - nil (format "%s%s (in %s minutes)" - new-time appt-msg min-to-app) nil) - (appt-disp-window min-to-app new-time appt-msg)) -;; (jabber-send-message (car jabber-connections) -;; "aethon@muc.ryuslash.org" nil "Hi, I'm a programmatic message; this -;; upens up possibilities :)" "groupchat") -(defun oni:before-save-func () - "Function for `before-save-hook'." - (if (eq major-mode 'html-mode) - (oni:replace-html-special-chars)) - (if (not (eq major-mode 'markdown-mode)) - (delete-trailing-whitespace))) - -(defun oni:c-mode-func () - "Function for `c-mode-hook'." - (local-set-key [f9] 'compile) - (local-set-key "\C-j" 'oni:newline-and-indent)) - -(defun oni:close-client-window () - "Close a client's frames." - (interactive) - (server-save-buffers-kill-terminal nil)) - -(defun oni:color-for (object) - "Generate a hex color by taking the first 6 characters of OBJECT's MD5 sum." - (format "#%s" (substring (md5 object) 0 6))) - -(defun oni:compile-el () - "Compile the current buffer file if it is an .el file." - (let* ((full-file-name (buffer-file-name)) - (file-name (file-name-nondirectory full-file-name)) - (suffix (file-name-extension file-name))) - (if (and (not (string-equal file-name ".dir-locals.el")) - (string-equal suffix "el")) - (byte-compile-file full-file-name)))) - -(defun oni:css-mode-func () - "Function for `css-mode-hook'." - (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)) - -(defun oni:emacs-lisp-mode-func () - "Function for `emacs-lisp-mode-hook'." - (eldoc-mode)) - -(defun oni:emacs-startup-func () - "Function for `emacs-init-hook'." - (require 'auto-complete-config) - (ac-config-default)) - -(defun oni:go-mode-func () - "Function for `go-mode-hook'." - (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)) - -(defun oni:html-mode-func () - "Function for `html-mode-hook'." - (yas-minor-mode) - (fci-mode) - (flycheck-mode)) - -(defun oni:ido-init () - "Initialization functionn for ido." - (setq ido-ignore-buffers - (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" - (eval-when-compile - (regexp-opt - '("*-jabber-roster-*" - "*Messages*" - "*fsm-debug*" - "*magit-process*" - "*magit-edit-log*" - "*Backtrace*")))))) - -(defun oni:indent-shift-left (start end &optional count) - "Rigidly indent region. -Region is from START to END. Move -COUNT number of spaces if it is non-nil otherwise use -`tab-width'." - (interactive - (if mark-active - (list (region-beginning) (region-end) current-prefix-arg) - (list (line-beginning-position) - (line-end-position) - current-prefix-arg))) - (if count - (setq count (prefix-numeric-value count)) - (setq count tab-width)) - (when (> count 0) - (let ((deactivate-mark nil)) - (save-excursion - (goto-char start) - (while (< (point) end) - (if (and (< (current-indentation) count) - (not (looking-at "[ \t]*$"))) - (error "Can't shift all lines enough")) - (forward-line)) - (indent-rigidly start end (- count)))))) - -(defun oni:indent-shift-right (start end &optional count) - "Indent region between START and END rigidly to the right. -If COUNT has been specified indent by that much, otherwise look at -`tab-width'." - (interactive - (if mark-active - (list (region-beginning) (region-end) current-prefix-arg) - (list (line-beginning-position) - (line-end-position) - current-prefix-arg))) - (let ((deactivate-mark nil)) - (if count - (setq count (prefix-numeric-value count)) - (setq count tab-width)) - (indent-rigidly start end count))) - -(defun oni:jabber-alert-message-func (from buffer text title) - (notifications-notify :title title - :body text)) - -(defun oni:jabber-chat-mode-func () - "Function for `jabber-chat-mode-hook'." - (visual-line-mode) - (setq mode-line-format (append (cddr jabber-chat-header-line-format) - '(global-mode-string)) - header-line-format nil)) - -(defun oni:jabber-init () - "Initialization function for jabber." - (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) - -(defun oni:jabber-roster-mode-func () - "Function for `jabber-roster-mode-hook'." - (setq mode-line-format - (list (propertize " %m" 'face 'mode-line-buffer-id)))) - -(defun oni:java-mode-func () - "Function for `java-mode-hook'." - (local-set-key "\C-j" 'oni:newline-and-indent)) - -(defun oni:js-mode-func () - "Function for `js-mode-hook'." - (rainbow-delimiters-mode) - (local-set-key "\C-j" 'oni:newline-and-indent)) - -(defun oni:js2-mode-func () - "Function for `js2-mode-hook'." - (oni:prog-mode-func) - (oni:js-mode-func) - (local-set-key (kbd "") #'slime-js-reload) - (slime-js-minor-mode)) - -(defun oni:kill-region-or-backward-char () - "Either `kill-region' or `backward-delete-char-untabify'." - (interactive) - (if (region-active-p) - (kill-region (region-beginning) (region-end)) - (backward-delete-char-untabify 1))) - -(defun oni:kill-region-or-forward-char () - "Either `kill-region' or `delete-forward-char'." - (interactive) - (if (region-active-p) - (kill-region (region-beginning) (region-end)) - (delete-forward-char 1))) - -(defun oni:kill-region-or-line () - "Either `kill-region' or `kill-line'." - (interactive) - (if (region-active-p) - (kill-region (region-beginning) (region-end)) - (kill-line))) - -(defun oni:lua-mode-func() - "Function for `lua-mode-hook'." - (local-unset-key (kbd ")")) - (local-unset-key (kbd "]")) - (local-unset-key (kbd "}")) - (flycheck-mode)) - -(defun oni:magit-log-edit-mode-func () - "Function for `magit-log-edit-mode-hook'." - (auto-fill-mode) - (font-lock-add-keywords - nil - '(("\\`\\(.\\{,50\\}\\)\\(.*\\)\n?\\(.*\\)$" - (1 'git-commit-summary-face) - (2 'git-commit-overlong-summary-face) - (3 'git-commit-nonempty-second-line-face)) - ("`\\([^']+\\)'" 1 font-lock-constant-face)) - t)) - -(defun oni:markdown-mode-func () - "Function for `markdown-mode-hook'." - (setq-local comment-auto-fill-only-comments nil) - (setq-local whitespace-style '(face trailing)) - (auto-fill-mode) - (whitespace-mode)) - -(defun oni:message-mode-func () - "Function for `message-mode-hook'." - (setq-local comment-auto-fill-only-comments nil) - (auto-fill-mode) - (flyspell-mode)) - -(defun oni:mini-fix-timestamp-string (date-string) - "A minimal version of Xah Lee's `fix-timestamp-string'. -Turn DATE-STRING into something else that can be worked with in -code. Found at http://xahlee.org/emacs/elisp_parse_time.html" - (setq date-string (replace-regexp-in-string "Jan" "01" date-string) - date-string (replace-regexp-in-string "Feb" "02" date-string) - date-string (replace-regexp-in-string "Mar" "03" date-string) - date-string (replace-regexp-in-string "Apr" "04" date-string) - date-string (replace-regexp-in-string "May" "05" date-string) - date-string (replace-regexp-in-string "Jun" "06" date-string) - date-string (replace-regexp-in-string "Jul" "07" date-string) - date-string (replace-regexp-in-string "Aug" "08" date-string) - date-string (replace-regexp-in-string "Sep" "09" date-string) - date-string (replace-regexp-in-string "Oct" "10" date-string) - date-string (replace-regexp-in-string "Nov" "11" date-string) - date-string (replace-regexp-in-string "Dec" "12" date-string)) - (string-match - "^\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{4\\}\\)$" - date-string) - (format "%s-%s-%s" - (match-string 3 date-string) - (match-string 2 date-string) - (match-string 1 date-string))) - -(defun oni:move-beginning-of-dwim () - "Move to beginning of line either after indentation or before." - (interactive) - (let ((start (point))) - (back-to-indentation) - (if (= start (point)) - (beginning-of-line)))) - -(defun oni:move-end-of-dwim () - "Move to end of line, either before any comments or after." - (interactive) - (let ((start (point)) - (eolpos (line-end-position))) - (beginning-of-line) - (if (and comment-start - (comment-search-forward eolpos t)) - (progn - (search-backward-regexp (concat "[^ \t" comment-start "]")) - (forward-char) - - (when (or (bolp) - (= start (point))) - (end-of-line))) - (end-of-line)))) - -(defun oni:myepisodes-formatter (plist) - "Format RSS items from MyEpisodes as org tasks. -PLIST contains all the pertinent information." - (let ((str (plist-get plist :title))) - (string-match - "^\\[ \\([^\]]+\\) \\]\\[ \\([^\]]+\\) \\]\\[ \\([^\]]+\\) \\]\\[ \\([^\]]+\\) \\]$" - str) - (let* ((title (match-string 1 str)) - (episode (match-string 2 str)) - (name (match-string 3 str)) - (date (oni:mini-fix-timestamp-string (match-string 4 str)))) - (format "* ACQUIRE %s %s - %s \n SCHEDULED: <%s>" - title episode name date)))) - -(defun oni:newline-and-indent () - "`newline-and-indent', but with a twist. -When dealing with braces, add another line and indent that too." - (interactive) - (if (and (not (or (= (point) (point-max)) - (= (point) (point-min)))) - (or (and (char-equal (char-before) ?{) - (char-equal (char-after) ?})) - (and (char-equal (char-before) ?\() - (char-equal (char-after) ?\))))) - (save-excursion (newline-and-indent))) - (newline-and-indent)) - -(defun oni:org-mode-func () - "Function for `org-mode-hook'." - (auto-fill-mode) - (yas-minor-mode) - (setq-local comment-auto-fill-only-comments nil)) - -(defun oni:php-mode-func () - "Function for `php-mode-hook'." - (local-set-key "\C-j" 'oni:newline-and-indent) - (c-set-offset 'arglist-intro '+) - (c-set-offset 'arglist-close '0) - (rainbow-delimiters-mode) - (setq-local fci-rule-column 80) - (flycheck-mode)) - -(defun oni:prog-mode-func () - "Function for `prog-mode-hook'." - (rainbow-delimiters-mode) - (fci-mode) - (yas-minor-mode) - (auto-fill-mode)) - -(defun oni:python-mode-func () - "Function for `python-mode-hook'." - (flycheck-mode) - (local-set-key (kbd "C->") 'python-indent-shift-right) - (local-set-key (kbd "C-<") 'python-indent-shift-left) - (set (make-local-variable 'electric-indent-chars) nil) - (rainbow-delimiters-mode) - (setq fci-rule-column 79 - fill-column 72) - (setq-local whitespace-style '(tab-mark)) - (fci-mode) - (whitespace-mode)) - -(defun oni:rainbow-mode-init () - "Initialization function for rainbow-mode." - (diminish 'rainbow-mode)) - -(defun oni:raise-ansi-term (arg) - "Create or show an `ansi-term' buffer." - (interactive "P") - (let ((buffer (get-buffer "*ansi-term*"))) - (if (and buffer (not arg)) - (switch-to-buffer buffer) - (call-interactively 'ansi-term)))) - -(defun oni:raise-scratch (&optional mode) - "Show the *scratch* buffer. -If called with a universal argument, ask the user which mode to -use. If MODE is not nil, open a new buffer with the name -*MODE-scratch* and load MODE as its major mode." - (interactive (list (if current-prefix-arg - (read-string "Mode: ") - nil))) - (let* ((bname (if mode - (concat "*" mode "-scratch*") - "*scratch*")) - (buffer (get-buffer bname)) - (mode-sym (intern (concat mode "-mode")))) - - (unless buffer - (setq buffer (generate-new-buffer bname)) - (with-current-buffer buffer - (when (fboundp mode-sym) - (funcall mode-sym)))) - - (select-window (display-buffer buffer)))) - -(defun oni:replace-html-special-chars () - "Replace special characters with HTML escaped entities." - (oni:replace-occurrences "é" "é")) - -(defun oni:replace-occurrences (from to) - "Replace all occurrences of FROM with TO in the current buffer." - (save-excursion - (goto-char (point-min)) - (while (search-forward from nil t) - (replace-match to)))) - -(defun oni:request-pull () - "Start a mail to request pulling from a git repository." - (interactive) - (let* ((default-directory - (expand-file-name - (or (locate-dominating-file default-directory ".git") - (magit-read-top-dir nil)))) - (refs (magit-list-interesting-refs magit-uninteresting-refs)) - (from (cdr (assoc (completing-read "From: " refs) refs))) - (url (read-from-minibuffer "Pull URL: ")) - (to (symbol-name (read-from-minibuffer "Up to (HEAD): " - nil nil t nil "HEAD"))) - (patchp (and current-prefix-arg (listp current-prefix-arg)))) - (message "Requesting pull for %s from %s to %s at %s with%s patch" - default-directory from to url (if patchp "" "out")) - - (compose-mail - nil (concat - "Requesting pull for " - (file-name-base (directory-file-name default-directory)))) - - (save-excursion - (goto-char (point-max)) - (insert - (shell-command-to-string - (concat "git --git-dir='" default-directory ".git' --work-tree='" - default-directory "' request-pull " (when patchp "-p ") - from " " url " " to)))))) - -(defun oni:rst-mode-func () - "Function for `rst-mode-hook'." - (auto-fill-mode)) - -(defun oni:self-insert-dwim () - "Execute self insert, but when the region is active call self -insert at the end of the region and at the beginning." - (interactive) - (if (region-active-p) - (let ((electric-pair-mode nil) - (beginning (region-beginning)) - (end (region-end))) - (goto-char end) - (self-insert-command 1) - (save-excursion - (goto-char beginning) - (self-insert-command 1))) - (self-insert-command 1))) - -(defun oni:shorten-dir (dir) - "Shorten a directory, (almost) like fish does it." - (while (string-match "\\(/\\.?[^./]\\)[^/]+/" dir) - (setq dir (replace-match "\\1/" nil nil dir))) - dir) - -(defun oni:show-buffer-position () - "Show the position in the current buffer." - (interactive) - (message (format "%d:%d" (line-number-at-pos) (current-column)))) - -(defun oni:show-org-index () - "Show the index of my org files." - (interactive) - (find-file "~/documents/org/index.org")) - -(defun oni:smex-init () - "Initialization function for smex." - (global-set-key (kbd "M-x") 'smex) - (global-set-key (kbd "C-M-x") 'smex-major-mode-commands)) - -(defun oni:split-window-interactive (dir) - "Split windows in direction DIR. - -Can also delete or switch to another window." - (interactive - (list (read-char "Direction (h,v,q,d,o): "))) - (case dir - ((?v) (split-window-vertically)) - ((?h) (split-window-horizontally)) - ((?q) (delete-other-windows)) - ((?d) (delete-window)) - ((?o) (other-window 1)))) - -(defun oni:split-window-interactively (window) - "Ask for a direction and split WINDOW that way. - -If no direction is given, don't split." - (let ((dir (read-char "Direction (h,v): "))) - (case dir - ((?v) (split-window-vertically)) - ((?h) (split-window-horizontally)) - (t window)))) - -(defun oni:start-python-test-mail-server () - "Run the python test mailserver." - (interactive) - (start-process "python-test-mail-server" "*py-mail-server*" "python" "-m" - "smtpd" "-n" "-c" "DebuggingServer" "localhost:1025")) - -(defun oni:stop-python-test-mail-server () - "Stop the python test mailserver." - (interactive) - (kill-process "python-test-mail-server")) - -(defun oni:term-mode-func () - "Function for `term-mode-hook'." - (setq truncate-lines nil)) - -(defun oni:texinfo-mode-func () - "Function for `texinfo-mode-hook'." - (setq-local comment-auto-fill-only-comments nil) - (auto-fill-mode)) - -(defun oni:write-file-func () - "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-key yas-minor-mode-map (kbd "C-\\") 'yas-expand)) - -(defun oni:yasnippet-init () - "Initialization function for yasnippet." - (diminish 'yas-minor-mode)) - -(defvar oni:auto-save-name-transforms - `((".*" ,temporary-file-directory t)) - "Place all auto-save files in `temporary-file-directory'.") - -(defvar oni:backup-directory-alist - `((".*" . ,temporary-file-directory)) - "Palce all backup files in `temporary-file-directory'.") - -(defvar oni:mailbox-map - '("top" ("menu" - ("ryulash.org" . "ryuslash") - ("ninthfloor" . "ninthfloor") - ("gmail" . "gmail") - ("aethon" . "aethon"))) - "A mailbox map for use with `tmm-prompt'.") - -(provide 'oni) -;;; oni.el ends here diff --git a/.emacs.d/site-lisp/org-init.el b/.emacs.d/site-lisp/org-init.el deleted file mode 100644 index 4033c30..0000000 --- a/.emacs.d/site-lisp/org-init.el +++ /dev/null @@ -1,164 +0,0 @@ -;;; org-init.el --- Org initialization - -;; Copyright (C) 2012 Tom Willemsen - -;; Author: Tom Willemsen -;; 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 'oni) -(require 'org-contacts) -(require 'org-habit) -(require 'org-protocol) - -(autoload 'org-clocking-p "org-clock") - -(eval-after-load "org-crypt" - '(org-crypt-use-before-save-magic)) - -(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)) - -(defun oni:set-org-agenda-files () - "Set `org-agenda-files` according to the current time." - (interactive) - (let* ((current-time (decode-time)) - (current-hour (nth 2 current-time)) - (current-dow (nth 6 current-time))) - (if (or (= current-dow 6) (= current-dow 0) ; Saturday or Sunday - (< current-hour 9) (>= current-hour 17)) - (setq org-agenda-files - (append oni:personal-agenda-files oni:common-agenda-files)) - (setq org-agenda-files - (append oni:work-agenda-files oni:common-agenda-files))))) - -(defvar oni:personal-agenda-files - (list (expand-file-name "~/documents/org/tasks")) - "My personal agenda, should only show up at times I don't have - to work.") - -(defvar oni:work-agenda-files - (list (expand-file-name "~/documents/org/work")) - "My work agenda, should only show up at times I work.") - -(defvar oni:common-agenda-files - (list (expand-file-name "~/documents/org/dailies") - (expand-file-name "~/documents/org/misc/contacts.org") - (expand-file-name "~/documents/org/misc/bookmarks.org")) - "Agenda files that are work-agnostic, should always show up.") - -(setq org-agenda-custom-commands - '(("P" . "Personal only") - ("Pa" "Personal agenda" agenda "" - ((org-agenda-files (append oni:personal-agenda-files - oni:common-agenda-files)))) - ("Pt" "Personal todo" todo "" - ((org-agenda-files (append oni:personal-agenda-files - oni:common-agenda-files)))) - ("W" . "Work only") - ("Wa" "Work agenda" agenda "" - ((org-agenda-files (append oni:work-agenda-files - oni:common-agenda-files)))) - ("Wt" "Work todo" todo "" - ((org-agenda-files (append oni:work-agenda-files - oni:common-agenda-files)))))) -(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 category-keep) - (tags priority-down category-keep) - (search category-keep))) -(setq org-agenda-tags-column -101) -(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 %?") - ("T" "Linked task" entry (file "~/documents/org/tasks") - "* TODO %?\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-targets '((nil . (:maxlevel . 6)))) -(setq org-refile-use-outline-path 'file) -(setq org-return-follows-link t) -(setq org-src-fontify-natively t) -(setq org-tags-column -101) -(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")))) -(setq org-use-fast-todo-selection t) -(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) - -(oni:set-org-agenda-files) -(run-at-time "09:01" (* 60 60 24) 'oni:set-org-agenda-files) -(run-at-time "17:01" (* 60 60 24) 'oni:set-org-agenda-files) - -(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 deleted file mode 100644 index 821c738..0000000 --- a/.emacs.d/site-lisp/quick-edit-mode.el +++ /dev/null @@ -1,74 +0,0 @@ -;;; quick-edit-mode.el --- Quickly edit stuff - -;; Copyright (C) 2012 Tom Willemsen - -;; Author: Tom Willemsen -;; 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 deleted file mode 100644 index 694acab..0000000 --- a/.emacs.d/site-lisp/wm-init.el +++ /dev/null @@ -1,3 +0,0 @@ -(async-shell-command "herbstluftwm" " herbstluftwm") -(async-shell-command "dunst" " dunst") -(async-shell-command "xbindkeys" " xbindkeys") diff --git a/.emacs.d/snippets/Makefile b/.emacs.d/snippets/Makefile deleted file mode 100644 index 12ff544..0000000 --- a/.emacs.d/snippets/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -DESTDIR:=$(DESTDIR)/snippets -modules=html-mode org-mode python-mode - -include ../../dotfiles.mk diff --git a/.emacs.d/snippets/html-mode/Makefile b/.emacs.d/snippets/html-mode/Makefile deleted file mode 100644 index b2dff78..0000000 --- a/.emacs.d/snippets/html-mode/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -DESTDIR:=$(DESTDIR)/html-mode -objects=for generic-block - -include ../../../dotfiles.mk diff --git a/.emacs.d/snippets/html-mode/for b/.emacs.d/snippets/html-mode/for deleted file mode 100644 index 01d9c44..0000000 --- a/.emacs.d/snippets/html-mode/for +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: for -# key: for -# condition: pony-tpl-minor-mode -# -- -{% for $1 in $2 %} - $0 -{% endfor %} \ No newline at end of file diff --git a/.emacs.d/snippets/html-mode/generic-block b/.emacs.d/snippets/html-mode/generic-block deleted file mode 100644 index 82d40c7..0000000 --- a/.emacs.d/snippets/html-mode/generic-block +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: Template Block -# key: % -# condition: pony-tpl-minor-mode -# -- -{% $1 %} - $0 -{% end$1 %} \ No newline at end of file diff --git a/.emacs.d/snippets/org-mode/Makefile b/.emacs.d/snippets/org-mode/Makefile deleted file mode 100644 index 34d4cd9..0000000 --- a/.emacs.d/snippets/org-mode/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -DESTDIR:=$(DESTDIR)/org-mode -objects=codeblock heading project snippet - -include ../../../dotfiles.mk diff --git a/.emacs.d/snippets/org-mode/codeblock b/.emacs.d/snippets/org-mode/codeblock deleted file mode 100644 index a200b08..0000000 --- a/.emacs.d/snippets/org-mode/codeblock +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: codeblock -# key: code -# -- -#+begin_src $1 - $0 -#+end_src \ No newline at end of file diff --git a/.emacs.d/snippets/org-mode/heading b/.emacs.d/snippets/org-mode/heading deleted file mode 100644 index 9d5451e..0000000 --- a/.emacs.d/snippets/org-mode/heading +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: Heading -# key: * -# -- -${1:*} ${2:TODO} $3 -${1:$(make-string (length text) ?\ )} :PROPERTIES: -${1:$(make-string (length text) ?\ )} :CATEGORY: $4 -${1:$(make-string (length text) ?\ )} :END: -${1:$(make-string (length text) ?\ )} $0 \ No newline at end of file diff --git a/.emacs.d/snippets/org-mode/project b/.emacs.d/snippets/org-mode/project deleted file mode 100644 index 269d655..0000000 --- a/.emacs.d/snippets/org-mode/project +++ /dev/null @@ -1,51 +0,0 @@ -# -*- mode: snippet -*- -# name: project -# key: project -# -- -#+TITLE: ${1:project_name} -#+LINK: src ${2:http://code.ryuslash.org/cgit.cgi/$3$1/} -#+LINK: tar_gz $2${4:snapshot/$1-master}.tar.gz -#+LINK: zip $2$4.zip -#+STARTUP: showall - -#+begin_html - - -#+end_html - -#+INCLUDE: "dlmenu.inc" - -* About - - ${5:A short description about $1} - - | $0Status | $6 | - | Language | $7 | - | License | ${8:GPLv3} | - -* Why? - - ${9:Why did you even think of writing $1?} - -* Features - - ${10:$1 does...} - -* Dependencies - - ${11:$1 needs to have...} - -* Download - - ${12:To download $1...} - -* Install - - ${13:To install $1...} - -* Usage - - ${14:Using $1...} \ No newline at end of file diff --git a/.emacs.d/snippets/org-mode/snippet b/.emacs.d/snippets/org-mode/snippet deleted file mode 100644 index 67f15d5..0000000 --- a/.emacs.d/snippets/org-mode/snippet +++ /dev/null @@ -1,14 +0,0 @@ -# -*- mode: snippet -*- -# name: snippet -# key: snippet -# -- -#+TITLE: ${1:snippet-name} -#+OPTIONS: toc:nil - -* $1 - - ${2:A short description abount $1} - - #+BEGIN_SRC $3 :tangle yes -$0 - #+END_SRC \ No newline at end of file diff --git a/.emacs.d/snippets/python-mode/Makefile b/.emacs.d/snippets/python-mode/Makefile deleted file mode 100644 index 192657b..0000000 --- a/.emacs.d/snippets/python-mode/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -DESTDIR:=$(DESTDIR)/python-mode -objects=defm_empty form form_valid import_from permission_guard url - -include ../../../dotfiles.mk diff --git a/.emacs.d/snippets/python-mode/defm_empty b/.emacs.d/snippets/python-mode/defm_empty deleted file mode 100644 index baa976e..0000000 --- a/.emacs.d/snippets/python-mode/defm_empty +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# name: Empty Defmethod -# key: defm -# -- -def ${1:name}(self, *args, **kwargs): - '''$2''' - return super(${3:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).$1(*args, **kwargs) \ No newline at end of file diff --git a/.emacs.d/snippets/python-mode/form b/.emacs.d/snippets/python-mode/form deleted file mode 100644 index 225d5e4..0000000 --- a/.emacs.d/snippets/python-mode/form +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: Model Form -# key: form -# -- -class ${1:Model}Form(forms.ModelForm): - '''Form for the $1 model.''' - - class Meta: - model = $1 \ No newline at end of file diff --git a/.emacs.d/snippets/python-mode/form_valid b/.emacs.d/snippets/python-mode/form_valid deleted file mode 100644 index c5a7e58..0000000 --- a/.emacs.d/snippets/python-mode/form_valid +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: Record form -# key: defm -# -- -@record_activity(model=${1:`(progn (re-search-backward "^[ \t]*model = \\([a-zA-Z_].*\\)$") (match-string 1))`}) -def form_valid(self, form): - '''Make sure any changes to the $1 model get logged.''' - return super(${2:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).form_valid(form) \ No newline at end of file diff --git a/.emacs.d/snippets/python-mode/import_from b/.emacs.d/snippets/python-mode/import_from deleted file mode 100644 index 5c23b8e..0000000 --- a/.emacs.d/snippets/python-mode/import_from +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# name: from ... import ... -# contributor: Tom Willemsen -# key: from -# -- -from ${1:module} import ${2:class_or_module} \ No newline at end of file diff --git a/.emacs.d/snippets/python-mode/permission_guard b/.emacs.d/snippets/python-mode/permission_guard deleted file mode 100644 index ab53895..0000000 --- a/.emacs.d/snippets/python-mode/permission_guard +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: Permission guard -# key: defm -# -- -@method_decorator(permission_required('$1', - raise_exception=True)) -def dispatch(self, *args, **kwargs): - '''Make sure the user has the $1 permission.''' - return super(${3:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).dispatch(*args, **kwargs) \ No newline at end of file diff --git a/.emacs.d/snippets/python-mode/url b/.emacs.d/snippets/python-mode/url deleted file mode 100644 index 00ade72..0000000 --- a/.emacs.d/snippets/python-mode/url +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: url -# key: url -# -- -url(r'^$1', $2, name='$3'), \ No newline at end of file diff --git a/Makefile b/Makefile index d0deef8..911aaf0 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ export DESTDIR:=$(HOME) -modules=.emacs.d .config .conkerorrc .local .moc .mutt .ncmpcpp \ +modules=emacs .config .conkerorrc .local .moc .mutt .ncmpcpp \ .pentadactyl .sawfish .ssh .w3m .weechat .zsh xmonad objects=.bash_profile .beetsconfig .conky_box.lua .conkyrc .gitconfig \ .guile .hgrc .offlineimap.py .offlineimaprc .screenrc .scwmrc \ diff --git a/emacs/.gitignore b/emacs/.gitignore new file mode 100644 index 0000000..0b490df --- /dev/null +++ b/emacs/.gitignore @@ -0,0 +1,17 @@ +tramp +elpa +bookmarks +abbrev_defs +custom.el +*.elc +ac-comphist.dat +auto-save-list/ +url/ +packages/ +newsticker/ +templates/ +rinit.* +!rinit.org +history +init2.el +*.html diff --git a/emacs/Makefile b/emacs/Makefile new file mode 100644 index 0000000..fc17095 --- /dev/null +++ b/emacs/Makefile @@ -0,0 +1,11 @@ +DESTDIR:=$(DESTDIR)/.emacs.d +objects=init.elc init.el gnus.elc gnus.el init2.elc init2.el +modules=eshell site-lisp snippets + +EMACS=emacs + +include ../dotfiles.mk + +init2.el: init.org + $(EMACS) -Q -batch \ + -eval "(progn (require 'org) (require 'ob-tangle) (org-babel-tangle-file \"$^\"))" diff --git a/emacs/eshell/Makefile b/emacs/eshell/Makefile new file mode 100644 index 0000000..fd3b0f2 --- /dev/null +++ b/emacs/eshell/Makefile @@ -0,0 +1,5 @@ +DESTDIR:=$(DESTDIR)/eshell +objects=alias +modules= + +include ../../dotfiles.mk diff --git a/emacs/eshell/alias b/emacs/eshell/alias new file mode 100644 index 0000000..d98e2f5 --- /dev/null +++ b/emacs/eshell/alias @@ -0,0 +1,9 @@ +alias hgit hgit --no-pager $* +alias newsbeuter ansi-term newsbeuter newsbeuter +alias d dired $1 +alias o find-file $1 +alias listen eshell-exec-visual mplayer http://usa7-vn.mixstream.net/listen/8248.pls +alias ncmpcpp ansi-term ncmpcpp ncmpcpp +alias sudo *sudo $* +alias rm rm -v $* +alias git git --no-pager $* diff --git a/emacs/gnus.el b/emacs/gnus.el new file mode 100644 index 0000000..7301231 --- /dev/null +++ b/emacs/gnus.el @@ -0,0 +1,57 @@ +(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-novice-user t) +(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:" + (address "thomas@aethon.nl") + (signature-file "~/documents/work/aethon/signature.txt") + (eval (setq message-sendmail-extra-arguments '("-a" "aethon") + flyspell-default-dictionary "nl"))))) + +;-----[ BBDB ]-------------------------------------------------------- +;; (require 'bbdb) +;; (bbdb-initialize 'gnus 'message) +;; (bbdb-insinuate-gnus) +;; (setq bbdb-north-american-phone-numbers-p nil) diff --git a/emacs/init.el b/emacs/init.el new file mode 100644 index 0000000..816c03d --- /dev/null +++ b/emacs/init.el @@ -0,0 +1,301 @@ +;;; init.el --- ryuslash's emacs init + +;;; Commentary: +;; Does so much and changes so often + + +;;; Code: + +(load (concat user-emacs-directory "init2")) + +(defface git-commit-summary-face + '((t (:inherit org-level-1))) + "Face for the git title line." + :group 'local) + +(defface git-commit-overlong-summary-face + '((t (:background "#873732"))) + "Face for commit titles that are too long." + :group 'local) + +(defface git-commit-nonempty-second-line-face + '((t (:inherit git-commit-overlong-summary-face))) + "Face for the supposedly empty line in commit messages." + :group 'local) + +(eval-after-load "ido" '(oni:ido-init)) +(eval-after-load "jabber" '(oni:jabber-init)) +(eval-after-load "newst-treeview" '(require 'newsticker-init)) +(eval-after-load "org" '(require 'org-init)) +(eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) +(eval-after-load "smex" '(oni:smex-init)) +(eval-after-load "yasnippet" '(oni:yasnippet-init)) + +(autoload 'define-slime-contrib "slime") +(autoload 'gtags-mode "gtags" nil t) +(autoload 'jabber-connect "jabber" nil t) +(autoload 'php-mode "php-mode" nil t) +(autoload 'po-mode "po-mode" nil t) +(autoload 'pony-mode "pony-mode" nil t) +(autoload 'sawfish-mode "sawfish" nil t) +(autoload 'server-running-p "server") +(autoload 'slime-js-minor-mode "slime-js" nil t) +(autoload 'xmodmap-mode "xmodmap-mode" nil t) +(autoload 'w3m-bookmark-view "w3m" nil t) +(autoload 'w3m-goto-url "w3m" nil t) + +(require 'geiser-install) +(require 'uniquify) +(require 'ext) +(require 'oni) + +(put 'upcase-region 'disabled nil) +(put 'downcase-region 'disabled nil) +(put 'narrow-to-region 'disabled nil) +(put 'scroll-left 'disabled nil) + +(setq-default bidi-paragraph-direction 'left-to-right) +(setq-default c-basic-offset 4) +(setq-default fci-rule-column 73) +(setq-default indent-tabs-mode nil) +(setq-default php-mode-warn-if-mumamo-off nil) +(setq-default require-final-newline t) +(setq-default tab-width 4) +(setq-default truncate-lines t) + +(setq appt-disp-window-function #'oni:appt-display-window-and-jabber) +(setq appt-display-diary nil) +(setq auto-mode-case-fold nil) +(setq auto-save-file-name-transforms oni:auto-save-name-transforms) +(setq avandu-article-render-function #'avandu-view-w3m) +(setq backup-directory-alist oni:backup-directory-alist) +(setq browse-url-browser-function 'browse-url-generic) +(setq browse-url-generic-program (getenv "BROWSER")) +(setq c-offsets-alist '((statement-block-intro . +) + (knr-argdecl-intro . 5) + (substatement-open . +) + (substatement-label . 0) + (label . 0) + (statement-case-open . +) + (statement-cont . +) + (arglist-intro . +) + (arglist-close . 0) + (inline-open . 0) + (brace-list-open . +) + (topmost-intro-cont first c-lineup-topmost-intro-cont + c-lineup-gnu-DEFUN-intro-cont))) +(setq comment-auto-fill-only-comments t) +(setq custom-file "~/.emacs.d/custom.el") +(setq custom-theme-directory "~/.emacs.d/themes") +(setq default-frame-alist + `((border-width . 0) + (internal-border-width . 0) + (vertical-scroll-bars . nil) + (menu-bar-lines . nil) + (tool-bar-lines . nil) + (font . "Envy Code R:pixelsize=18") + (alpha 90 90))) +(setq elnode-do-init nil) +(setq fci-rule-color "darkred") +(setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) +(setq geiser-repl-history-filename "~/.emacs.d/geiser-history") +(setq gnus-init-file "~/.emacs.d/gnus") +(setq gtags-auto-update t) +(setq help-at-pt-display-when-idle t) +(setq highlight-80+-columns 72) +(setq identica-enable-striping t) +(setq ido-auto-merge-delay-time 1000000) +(setq ido-default-buffer-method 'selected-window) +(setq ido-max-window-height 1) +(setq ido-save-directory-list-file nil) +(setq ido-ubiquitous-command-exceptions + '(org-refile org-capture-refile)) +(setq inferior-lisp-program "sbcl") +(setq inhibit-default-init t) +(setq inhibit-local-menu-bar-menus t) +(setq inhibit-startup-message t) +(setq initial-major-mode 'emacs-lisp-mode) +(setq initial-scratch-message nil) +(setq jabber-account-list '(("ryuslash@jabber.org") + ("tom@ryuslash.org/Emacs" + (:connection-type . ssl)))) +(setq jabber-chat-buffer-format "*jab:%n*") +(setq jabber-chat-buffer-show-avatar nil) +(setq jabber-chat-fill-long-lines nil) +(setq jabber-chat-foreign-prompt-format "%t %u/%r <\n") +(setq jabber-chat-local-prompt-format "%t %u/%r >\n") +(setq jabber-chatstates-confirm nil) +(setq jabber-history-dir "~/.emacs.d/jabber") +(setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) +(setq jabber-roster-show-bindings nil) +(setq jit-lock-defer-time 0.2) +(setq magit-repo-dirs '("~/projects/" "~/var/src/")) +(setq message-log-max 1000) +(setq message-send-mail-function 'message-send-mail-with-sendmail) +(setq message-sendmail-extra-arguments '("-a" "ryuslash")) +(setq package-archives + '(("org" . "http://orgmode.org/elpa/") + ("melpa" . "http://melpa.milkbox.net/packages/") + ("marmalade" . "http://marmalade-repo.org/packages/") + ("gnu" . "http://elpa.gnu.org/packages/"))) +(setq package-load-list '((htmlize "1.39") + (lua-mode "20111107") + all)) +(setq php-function-call-face 'font-lock-function-name-face) +(setq php-mode-force-pear t) +(setq pony-tpl-indent-moves t) +(setq rainbow-delimiters-max-face-count 12) +(setq redisplay-dont-pause t) +(setq send-mail-function 'smtpmail-send-it) +(setq sendmail-program "/usr/bin/msmtp") +(setq sentence-end-double-space nil) +(setq smex-key-advice-ignore-menu-bar t) +(setq smex-save-file "~/.emacs.d/smex-items") +(setq split-height-threshold 40) +(setq time-stamp-active t) +(setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") +(setq type-break-good-rest-interval (* 60 10)) +(setq type-break-interval (* 60 50)) +(setq type-break-keystroke-threshold '(nil . nil)) +(setq uniquify-buffer-name-style 'post-forward) +(setq use-dialog-box nil) +(setq user-full-name "Tom Willemsen") +(setq user-mail-address "tom@ryuslash.org") +(setq w3m-fill-column 72) +(setq window-combination-resize t) +(setq yas-fallback-behavior nil) +(setq yas-prompt-functions '(yas-ido-prompt)) + +(add-hook 'after-change-major-mode-hook 'set-current-mode-icon) +(add-hook 'after-save-hook 'oni:after-save-func t) +(add-hook 'before-save-hook 'oni:before-save-func) +(add-hook 'c-mode-hook 'oni:c-mode-func) +(add-hook 'css-mode-hook 'oni:css-mode-func) +(add-hook 'diary-display-hook 'oni:diary-display-func) +(add-hook 'emacs-startup-hook 'oni:emacs-startup-func) +(add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-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 'html-mode-hook 'oni:html-mode-func) +(add-hook 'jabber-alert-message-hooks 'oni:jabber-alert-message-func) +(add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func) +(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func) +(add-hook 'java-mode-hook 'oni:java-mode-func) +(add-hook 'js-mode-hook 'oni:js-mode-func) +(add-hook 'js2-mode-hook 'oni:js2-mode-func) +(add-hook 'lua-mode-hook 'oni:lua-mode-func) +(add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func) +(add-hook 'markdown-mode-hook 'oni:markdown-mode-func) +(add-hook 'message-mode-hook 'oni:message-mode-func) +(add-hook 'org-mode-hook 'oni:org-mode-func) +(add-hook 'php-mode-hook 'oni:php-mode-func) +(add-hook 'prog-mode-hook 'oni:prog-mode-func) +(add-hook 'python-mode-hook 'oni:python-mode-func) +(add-hook 'rst-mode-hook 'oni:rst-mode-func) +(add-hook 'term-mode-hook 'oni:term-mode-func) +(add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func) +(add-hook 'write-file-hooks 'oni:write-file-func) +(add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func) + +(define-key key-translation-map (kbd "C-j") (kbd "C-l")) +(define-key key-translation-map (kbd "C-l") (kbd "C-j")) + +(global-set-key (kbd "'") 'oni:self-insert-dwim) +(global-set-key (kbd "") 'oni:raise-scratch) +(global-set-key (kbd "") 'oni:view-mail) +(global-set-key (kbd "") 'git-project-show-files) +(global-set-key (kbd "") 'ext:reload-buffer) +(global-set-key (kbd "") 'jabber-switch-to-roster-buffer) +(global-set-key (kbd "") 'magit-status) +(global-set-key (kbd "") 'oni:show-org-index) +(global-set-key (kbd "C-<") 'oni:indent-shift-left) +(global-set-key (kbd "C->") 'oni:indent-shift-right) +(global-set-key (kbd "C-M-4") 'split-window-vertically) +(global-set-key (kbd "C-M-SPC") 'er/expand-region) +(global-set-key (kbd "C-M-d") 'kill-word) +(global-set-key (kbd "C-M-w") 'backward-kill-word) +(global-set-key (kbd "C-S-k") 'kill-whole-line) +(global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim) +(global-set-key (kbd "C-c a") 'org-agenda) +(global-set-key (kbd "C-c c") 'org-capture) +(global-set-key (kbd "C-c i p") 'identica-update-status-interactive) +(global-set-key (kbd "C-c p") 'oni:show-buffer-position) +(global-set-key (kbd "C-c t") 'oni:raise-ansi-term) +(global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char) +(global-set-key (kbd "C-e") 'oni:move-end-of-dwim) +(global-set-key (kbd "C-k") 'oni:kill-region-or-line) +(global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char) +(global-set-key (kbd "M-0") 'delete-window) +(global-set-key (kbd "M-1") 'delete-other-windows) +(global-set-key (kbd "M-2") 'split-window-below) +(global-set-key (kbd "M-3") 'split-window-right) +(global-set-key (kbd "M-4") 'split-window-horizontally) +(global-set-key (kbd "M-n") 'idomenu) +(global-set-key (kbd "M-o") 'other-window) +(global-set-key (kbd "\"") 'oni:self-insert-dwim) + +(if (daemonp) + (global-set-key "\C-x\C-c" 'oni:close-client-window)) + +(when (or window-system (daemonp)) + (global-unset-key "\C-z")) + +(add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode)) +(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode)) +(add-to-list 'auto-mode-alist + '("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode)) +(add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode)) +(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) +(add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode)) +(add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode)) +(add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode)) + +(add-to-list 'debug-ignored-errors "^Can't shift all lines enough") + +(add-to-list + 'display-buffer-alist + '("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil)))) +(add-to-list + 'display-buffer-alist + '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) +(add-to-list + 'display-buffer-alist + '("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil)))) + +(add-to-list 'compilation-finish-functions 'ext:comp-finish-function) + +(blink-cursor-mode -1) +(column-number-mode -1) +(line-number-mode -1) +(tooltip-mode -1) + +(package-initialize) + +(auto-insert-mode) +(cua-selection-mode t) +(electric-indent-mode) +(electric-pair-mode) +(ido-mode) +(ido-ubiquitous-mode) +(savehist-mode) +(show-paren-mode) +(winner-mode) + +(smex-initialize) +(help-at-pt-set-timer) +(windmove-default-keybindings) +(global-diff-hl-mode) + +(load custom-file) +;; (load "rudel-loaddefs.el") +(load (expand-file-name "~/quicklisp/slime-helper.el")) + +(unless (server-running-p) + (server-start)) + +(diminish 'auto-fill-function "_") + +(provide 'init) + +;;; init.el ends here diff --git a/emacs/init.org b/emacs/init.org new file mode 100644 index 0000000..2687290 --- /dev/null +++ b/emacs/init.org @@ -0,0 +1,400 @@ +#+TITLE: Emacs init +#+STYLE: +#+OPTIONS: author:nil +#+STARTUP: showall +#+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html + +* gui + + Remove the ~menu-bar~, ~tool-bar~ and ~scroll-bar~ from the UI since I + don't use them at all. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (menu-bar-mode -1) + (scroll-bar-mode -1) + (tool-bar-mode -1) + #+END_SRC + +* load-path + + Before doing anything else I should make sure that both the + directories ~/usr/local/emacs/share/emacs/site-lisp~ and + ~/usr/share/emacs/site-list~ are included in =load-path=, along with + their subdirectories, but only if they haven't already been added + and exist. Place them at the end of =load-path= so they don't mess up + package precedence. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (eval-and-compile + (defun oni:path-init (dir) + "Add DIR to `load-path' and all its subdirectories, unless + DIR is already in `load-path'." + (unless (or (member dir load-path) (not (file-exists-p dir))) + (let ((default-directory dir)) + (add-to-list 'load-path dir t) + (normal-top-level-add-subdirs-to-load-path)))) + (oni:path-init "/usr/share/emacs/site-lisp") + (oni:path-init "/usr/local/emacs/share/emacs/site-lisp")) + #+END_SRC + + Add my project [[yoshi-theme]] to =custom-theme-load-path= and load it. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (add-to-list 'custom-theme-load-path "~/projects/emacs/yoshi-theme/") + (load-theme 'yoshi t) + #+END_SRC + + Add any other interesting paths to =load-path= and, if it exists, + load the ~loaddefs.el~ file from these directories. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (mapc #'(lambda (dir) + (add-to-list 'load-path dir) + (let ((loaddefs (concat dir "/loaddefs.el"))) + (when (file-exists-p loaddefs) + (load loaddefs)))) + '("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp" + "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode")) + #+END_SRC + +* y-or-n-p + + Don't ask ~yes~ or ~no~, ask ~y~ or ~n~, I've never had an accidental ~y~ so + far. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defalias 'yes-or-no-p 'y-or-n-p) + #+END_SRC + +* ibuffer + + Use =ibuffer= instead of the default =list-buffers= because it has many + more features. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defalias 'list-buffers 'ibuffer) + #+END_SRC + +* hippie-expand + + Do the same with =hippie-expand= and =dabbrev-expand=. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defalias 'dabbrev-expand 'hippie-expand) + #+END_SRC + +* eldoc + + Don't show it when ~eldoc~ is running, I almost assume that it is + whenever I'm working in a mode that supports it anyway. This should + only execute once ~eldoc~ has been loaded. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (eval-after-load "eldoc" '(diminish 'eldoc-mode)) + #+END_SRC + +* emms + + Use the standard EMMS configuration and add some MPD settings. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:emms-init () + "Initialization function for EMMS." + (require 'emms-setup) + (require 'emms-player-mpd) + + (emms-standard) + + (add-to-list 'emms-info-functions 'emms-info-mpd) + (add-to-list 'emms-player-list 'emms-player-mpd) + + (setq emms-player-mpd-server-name "localhost") + (setq emms-player-mpd-server-port "6600") + (setq emms-player-mpd-music-directory "/mnt/music/mp3")) + + (eval-after-load "emms-source-file" '(oni:emms-init)) + (setq emms-source-file-default-directory "/mnt/music/") + #+END_SRC + + Add some keybindings for EMMS. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:emms-toggle-playing () + "Toggle between playing/paused states." + (interactive) + (if (eq emms-player-playing-p nil) + (emms-start) + (emms-pause))) + + (defun oni:start-emms () + "Check to see if the function `emms' exists, if not call + `emms-player-mpd-connect' and assume that will have loaded it." + (interactive) + (unless (fboundp 'emms) + (emms-player-mpd-connect)) + (emms)) + + (global-set-key (kbd "") 'emms-next) + (global-set-key (kbd "") 'oni:emms-toggle-playing) + (global-set-key (kbd "") 'emms-previous) + (global-set-key (kbd "") 'emms-stop) + (global-set-key (kbd "") 'oni:start-emms) + #+END_SRC + +* flymake + + Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to + "allowed" files and add go error output to error patterns. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:flymake-init () + "Initialization function for flymake." + (require 'flymake-cursor) + + (add-to-list ; Make sure pyflakes is loaded + 'flymake-allowed-file-name-masks ; for python files. + '("\\.py\\'" ext:flymake-pyflakes-init)) + + (add-to-list ; Error line repexp for go + 'flymake-err-line-patterns ; compilation. + '("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$" + 1 2 nil 3)) + + (add-to-list ; Go uses makefiles, makes + 'flymake-allowed-file-name-masks ; flymaking 'easy'. + '("\\.go$" flymake-simple-make-init))) + + (eval-after-load "flymake" '(oni:flymake-init)) + #+END_SRC + + Disable the GUI for flymake errors, add a bunch of pep8, flymake + and pyflakes messages to warning and info patterns, set the log + file to somewhere in my home directory and set logging level to 0. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq flymake-gui-warnings-enabled nil) + (setq flymake-info-line-regexp + (eval-when-compile + (regexp-opt + '("Invalid name" + "String statement has no effect" + "Missing docstring" + "Empty docstring" + "multiple imports on one line" + "expected 2 blank lines, found 1" + "expected 2 blank lines, found 0" + "TODO:" + "whitespace after '{'" + "whitespace before '}'" + "whitespace before ':'" + "whitespace after '('" + "whitespace before ')'" + "whitespace after '['" + "whitespace before ']'" + "the backslash is redundant between brackets" + "continuation line over-indented for visual indent" + "continuation line under-indented for visual indent" + "Too many statements" + "comparison to None should be" + "missing whitespace around operator" + "missing whitespace after ','" + "line too long" + "at least two spaces before inline comment" + "trailing whitespace" + "imported but unused" + "Unused import" + "too many blank lines")))) + (setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log")) + (setq flymake-log-level 0) + (setq flymake-warn-line-regexp + (eval-when-compile + (regexp-opt '("warning" + "Warning" + "redefinition of unused" + "Redefining built-in" + "Redefining name" + "Unused argument" + "Unused variable" + "Dangerous default value {} as argument" + "no newline at end of file" + "Access to a protected member")))) + #+END_SRC + +* flycheck + + After loading ~flycheck~ Remove the default python checkers and + replace them with my own, which tries both ~flake8~ and ~pylint~. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (eval-after-load "flycheck" + '(progn + (mapc (lambda (c) (delete c flycheck-checkers)) + '(python-pylint python-pyflakes)))) + #+END_SRC + +* pretty-control-l-mode + + Make the ~C-l~ look like a line of ~-~ up to =fill-column= or + =fci-rule-column= and remove the string displayed before the ~C-l~. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:pretty-control-l-function (win) + "Just make a string of either `fci-rule-column' or + `fill-column' length -1. Use the `-' character. WIN is ignored." + (make-string + (1- (if (boundp 'fci-rule-column) + fci-rule-column fill-column)) ?-)) + + (setq pp^L-^L-string-function 'oni:pretty-control-l-function) + #+END_SRC + + Remove the string displayed before the ~C-l~. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq pp^L-^L-string-pre nil) + #+END_SRC + + Enable =pretty-control-l-mode= at startup and whenever a new frame is + created. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (add-hook 'emacs-startup-hook 'pretty-control-l-mode) + (add-hook 'after-make-frame-functions + '(lambda (arg) (pretty-control-l-mode))) + #+END_SRC + +* erc + + Automatically join some channels when connecting to freenode.net. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq erc-autojoin-channels-alist + '(("freenode.net" "#ninthfloor" "#emacs"))) + #+END_SRC + + Don't show ~PART~ messages. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq erc-hide-list '("PART")) + #+END_SRC + + Insert a timestamp every time a message comes in, print it on the + left and print the hour and minute parts of the time. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) + (setq erc-timestamp-format "[%H:%M] ") + (setq erc-timestamp-only-if-changed-flag nil) + #+END_SRC + + Set my nickname. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq erc-nick "ryuslash") + #+END_SRC + + When starting ERC disable truncating lines, don't let ERC fill each + line and enable =visual-line-mode=. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:erc-mode-func () + "Function for `erc-mode-hook'." + (erc-fill-mode -1) + (visual-line-mode) + (setq truncate-lines nil)) + + (add-hook 'erc-mode-hook 'oni:erc-mode-func) + #+END_SRC + +* eshell + + Add ~unison~ to the list of =eshell-visual-commands= because it + expects unbuffered input and eshell just doesn't give that. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (eval-after-load "em-term" + '(add-to-list 'eshell-visual-commands "unison")) + #+END_SRC + + Don't let eshell highlight it's prompt, this way I can decide the + colors for it myself. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (setq eshell-highlight-prompt nil) + #+END_SRC + + In the prompt: + + - Show the exit status of the last program/command run represented + by a green ~+~ and a red ~-~ sign. + - Show the current hostname with the =mode-line-buffer-id= face. + - Show an abbreviation of the current directory (as seen in ~fish~) + using the =font-lock-string-face= face. + - If we're in a git repository, show the current branch with the + =font-lock-function-name-face= face. + - Show the status of priviledges in blue. + + And set the =eshell-prompt-regexp= to + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:eshell-prompt-function () + "Show a pretty shell prompt." + (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) + (hostname (shell-command-to-string "hostname")) + (dir (abbreviate-file-name (eshell/pwd))) + (branch + (shell-command-to-string + "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) + (userstatus (if (zerop (user-uid)) ?# ?$))) + (concat + (propertize (char-to-string status) + 'face `(:foreground ,(if (= status ?+) + "green" + "red"))) + " " + (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) + " " + (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) + " " + (when (not (string= branch "")) + (propertize + ;; Cut off "* " and "\n" + (substring branch 2 -1) + 'face 'font-lock-function-name-face)) + " \n" + (propertize (char-to-string userstatus) + 'face `(:foreground "blue")) + "> "))) + + (setq eshell-prompt-function 'oni:eshell-prompt-function + eshell-prompt-regexp "^[#$]> ") + #+END_SRC + + Don't truncate lines in eshell, wrap them. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:eshell-mode-func () + "Function for `eshell-mode-hook'." + (setq truncate-lines nil)) + + (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) + #+END_SRC + + Bind the ~f8~ key to easily show eshell. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:raise-eshell () + "Start or switch back to `eshell'. + Also change directories to current working directory." + (interactive) + (let ((dir (file-name-directory + (or (buffer-file-name) "~/"))) + (hasfile (not (eq (buffer-file-name) nil)))) + (eshell) + (if (and hasfile (eq eshell-process-list nil)) + (progn + (eshell/cd dir) + (eshell-reset))))) + + (global-set-key (kbd "") 'oni:raise-eshell) + #+END_SRC diff --git a/emacs/site-lisp/Makefile b/emacs/site-lisp/Makefile new file mode 100644 index 0000000..bbccbb7 --- /dev/null +++ b/emacs/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/site-lisp/dzen.el b/emacs/site-lisp/dzen.el new file mode 100644 index 0000000..6cc3eae --- /dev/null +++ b/emacs/site-lisp/dzen.el @@ -0,0 +1,86 @@ +;;; dzen.el --- Control DZEN2 from emacs + +;; Copyright (C) 2012 Tom Willemsen + +;; Author: Tom Willemsen +;; 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/site-lisp/eltuki.el b/emacs/site-lisp/eltuki.el new file mode 100644 index 0000000..224e9ab --- /dev/null +++ b/emacs/site-lisp/eltuki.el @@ -0,0 +1,232 @@ +;;; eltuki.el --- Tekuti functions + +;; Copyright (C) 2012 Tom Willemsen + +;; Author: Tom Willemsen +;; 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) + (filename (concat dir "/content"))) + (with-current-buffer (org-export-region-as-html + (point-min) (point-max) t "*eltuki-html*") + (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))) + +(provide 'eltuki) +;;; eltuki.el ends here diff --git a/emacs/site-lisp/ext.el b/emacs/site-lisp/ext.el new file mode 100644 index 0000000..d6abaa6 --- /dev/null +++ b/emacs/site-lisp/ext.el @@ -0,0 +1,56 @@ +;;; ext.el --- More emacs functions + +;; Copyright (C) 2012 Tom Willemsen + +;; Author: Tom Willemsen +;; Keywords: local + +;; 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: + +(defadvice org-agenda-redo (after ext:org-agenda-redo-add-appts) + "Pressing `r' on the agenda will also add appointments." + (progn + (setq appt-time-msg-list nil) + (org-agenda-to-appt))) + +(defun ext:flymake-pyflakes-init () + "Initialize function for flymake with pyflakes." + (let* ((temp-file (flymake-init-create-temp-buffer-copy + 'flymake-create-temp-inplace)) + (local-file (file-relative-name temp-file (file-name-directory + buffer-file-name)))) + (list "pycheck.sh" (list local-file)))) + +(defun ext:comp-finish-function (buf str) + "Don't show compilation window if everything went ok" + (if (string-match "exited abnormally" str) + ;; there were errors + (message "compilation errors, press C-x ` to visit") + ;; no errors, make the compilation window go away in 0.5 seconds + (run-at-time 0.5 nil 'delete-windows-on buf) + (message "No compilation errors!"))) + +(defun ext:reload-buffer () + "Reload current buffer." + (interactive) + (revert-buffer nil t nil)) + +(provide 'ext) +;;; ext.el ends here diff --git a/emacs/site-lisp/metalexpress.el b/emacs/site-lisp/metalexpress.el new file mode 100644 index 0000000..0c4539a --- /dev/null +++ b/emacs/site-lisp/metalexpress.el @@ -0,0 +1,80 @@ +;;; metalexpress.el --- Listen to Metal Express Radio + +;; Copyright (C) 2012 Tom Willemsen + +;; Author: Tom Willemsen +;; 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)) + (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) + (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/site-lisp/mu4e-init.el b/emacs/site-lisp/mu4e-init.el new file mode 100644 index 0000000..258a6ef --- /dev/null +++ b/emacs/site-lisp/mu4e-init.el @@ -0,0 +1,54 @@ +;;; mu4e-init.el --- mu4e initialization + +;; Copyright (C) 2012 Tom Willemsen + +;; Author: Tom Willemsen +;; 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/site-lisp/newsticker-init.el b/emacs/site-lisp/newsticker-init.el new file mode 100644 index 0000000..c393df1 --- /dev/null +++ b/emacs/site-lisp/newsticker-init.el @@ -0,0 +1,6 @@ +(setq newsticker-automatically-mark-items-as-old nil) +(setq newsticker-html-renderer 'w3m-region) +(setq newsticker-obsolete-item-max-age 604800) +(setq newsticker-use-full-width nil) + +(provide 'newsticker-init) diff --git a/emacs/site-lisp/oni.el b/emacs/site-lisp/oni.el new file mode 100644 index 0000000..80d1b01 --- /dev/null +++ b/emacs/site-lisp/oni.el @@ -0,0 +1,574 @@ +;;; oni.el --- Functions for emacs + +;; Copyright (C) 2012 Tom Willemsen + +;; Author: Tom Willemsen +;; Keywords: local + +;; 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: + +(autoload 'notifications-notify "notifications") +(autoload 'jabber-send-message "jabber-chat") + +(defmacro oni:email (user at host dot com) + "Turn arguments into an email address. +The resulting email address will look like: USER@HOST.COM, AT and +DOT are intentionally being skipped." + (concat (symbol-name user) "@" (symbol-name host) "." + (symbol-name com))) + +(defun oni:after-save-func () + "Function for `after-save-hook'." + (oni:compile-el) + (executable-make-buffer-file-executable-if-script-p) + (let* ((dom-dir (locate-dominating-file (buffer-file-name) "Makefile")) + (TAGSp (not (string= "" (shell-command-to-string + (concat "grep \"^TAGS:\" " dom-dir "Makefile")))))) + (when (and dom-dir TAGSp) + (shell-command + (concat "make -C " dom-dir " TAGS >/dev/null 2>&1"))))) + +(defun oni:appt-display-window-and-jabber (min-to-app new-time appt-msg) + "Send a message to my phone jabber account." + (jabber-send-message (car jabber-connections) "phone@ryuslash.org" + nil (format "%s%s (in %s minutes)" + new-time appt-msg min-to-app) nil) + (appt-disp-window min-to-app new-time appt-msg)) +;; (jabber-send-message (car jabber-connections) +;; "aethon@muc.ryuslash.org" nil "Hi, I'm a programmatic message; this +;; upens up possibilities :)" "groupchat") +(defun oni:before-save-func () + "Function for `before-save-hook'." + (if (eq major-mode 'html-mode) + (oni:replace-html-special-chars)) + (if (not (eq major-mode 'markdown-mode)) + (delete-trailing-whitespace))) + +(defun oni:c-mode-func () + "Function for `c-mode-hook'." + (local-set-key [f9] 'compile) + (local-set-key "\C-j" 'oni:newline-and-indent)) + +(defun oni:close-client-window () + "Close a client's frames." + (interactive) + (server-save-buffers-kill-terminal nil)) + +(defun oni:color-for (object) + "Generate a hex color by taking the first 6 characters of OBJECT's MD5 sum." + (format "#%s" (substring (md5 object) 0 6))) + +(defun oni:compile-el () + "Compile the current buffer file if it is an .el file." + (let* ((full-file-name (buffer-file-name)) + (file-name (file-name-nondirectory full-file-name)) + (suffix (file-name-extension file-name))) + (if (and (not (string-equal file-name ".dir-locals.el")) + (string-equal suffix "el")) + (byte-compile-file full-file-name)))) + +(defun oni:css-mode-func () + "Function for `css-mode-hook'." + (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)) + +(defun oni:emacs-lisp-mode-func () + "Function for `emacs-lisp-mode-hook'." + (eldoc-mode)) + +(defun oni:emacs-startup-func () + "Function for `emacs-init-hook'." + (require 'auto-complete-config) + (ac-config-default)) + +(defun oni:go-mode-func () + "Function for `go-mode-hook'." + (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)) + +(defun oni:html-mode-func () + "Function for `html-mode-hook'." + (yas-minor-mode) + (fci-mode) + (flycheck-mode)) + +(defun oni:ido-init () + "Initialization functionn for ido." + (setq ido-ignore-buffers + (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" + (eval-when-compile + (regexp-opt + '("*-jabber-roster-*" + "*Messages*" + "*fsm-debug*" + "*magit-process*" + "*magit-edit-log*" + "*Backtrace*")))))) + +(defun oni:indent-shift-left (start end &optional count) + "Rigidly indent region. +Region is from START to END. Move +COUNT number of spaces if it is non-nil otherwise use +`tab-width'." + (interactive + (if mark-active + (list (region-beginning) (region-end) current-prefix-arg) + (list (line-beginning-position) + (line-end-position) + current-prefix-arg))) + (if count + (setq count (prefix-numeric-value count)) + (setq count tab-width)) + (when (> count 0) + (let ((deactivate-mark nil)) + (save-excursion + (goto-char start) + (while (< (point) end) + (if (and (< (current-indentation) count) + (not (looking-at "[ \t]*$"))) + (error "Can't shift all lines enough")) + (forward-line)) + (indent-rigidly start end (- count)))))) + +(defun oni:indent-shift-right (start end &optional count) + "Indent region between START and END rigidly to the right. +If COUNT has been specified indent by that much, otherwise look at +`tab-width'." + (interactive + (if mark-active + (list (region-beginning) (region-end) current-prefix-arg) + (list (line-beginning-position) + (line-end-position) + current-prefix-arg))) + (let ((deactivate-mark nil)) + (if count + (setq count (prefix-numeric-value count)) + (setq count tab-width)) + (indent-rigidly start end count))) + +(defun oni:jabber-alert-message-func (from buffer text title) + (notifications-notify :title title + :body text)) + +(defun oni:jabber-chat-mode-func () + "Function for `jabber-chat-mode-hook'." + (visual-line-mode) + (setq mode-line-format (append (cddr jabber-chat-header-line-format) + '(global-mode-string)) + header-line-format nil)) + +(defun oni:jabber-init () + "Initialization function for jabber." + (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) + +(defun oni:jabber-roster-mode-func () + "Function for `jabber-roster-mode-hook'." + (setq mode-line-format + (list (propertize " %m" 'face 'mode-line-buffer-id)))) + +(defun oni:java-mode-func () + "Function for `java-mode-hook'." + (local-set-key "\C-j" 'oni:newline-and-indent)) + +(defun oni:js-mode-func () + "Function for `js-mode-hook'." + (rainbow-delimiters-mode) + (local-set-key "\C-j" 'oni:newline-and-indent)) + +(defun oni:js2-mode-func () + "Function for `js2-mode-hook'." + (oni:prog-mode-func) + (oni:js-mode-func) + (local-set-key (kbd "") #'slime-js-reload) + (slime-js-minor-mode)) + +(defun oni:kill-region-or-backward-char () + "Either `kill-region' or `backward-delete-char-untabify'." + (interactive) + (if (region-active-p) + (kill-region (region-beginning) (region-end)) + (backward-delete-char-untabify 1))) + +(defun oni:kill-region-or-forward-char () + "Either `kill-region' or `delete-forward-char'." + (interactive) + (if (region-active-p) + (kill-region (region-beginning) (region-end)) + (delete-forward-char 1))) + +(defun oni:kill-region-or-line () + "Either `kill-region' or `kill-line'." + (interactive) + (if (region-active-p) + (kill-region (region-beginning) (region-end)) + (kill-line))) + +(defun oni:lua-mode-func() + "Function for `lua-mode-hook'." + (local-unset-key (kbd ")")) + (local-unset-key (kbd "]")) + (local-unset-key (kbd "}")) + (flycheck-mode)) + +(defun oni:magit-log-edit-mode-func () + "Function for `magit-log-edit-mode-hook'." + (auto-fill-mode) + (font-lock-add-keywords + nil + '(("\\`\\(.\\{,50\\}\\)\\(.*\\)\n?\\(.*\\)$" + (1 'git-commit-summary-face) + (2 'git-commit-overlong-summary-face) + (3 'git-commit-nonempty-second-line-face)) + ("`\\([^']+\\)'" 1 font-lock-constant-face)) + t)) + +(defun oni:markdown-mode-func () + "Function for `markdown-mode-hook'." + (setq-local comment-auto-fill-only-comments nil) + (setq-local whitespace-style '(face trailing)) + (auto-fill-mode) + (whitespace-mode)) + +(defun oni:message-mode-func () + "Function for `message-mode-hook'." + (setq-local comment-auto-fill-only-comments nil) + (auto-fill-mode) + (flyspell-mode)) + +(defun oni:mini-fix-timestamp-string (date-string) + "A minimal version of Xah Lee's `fix-timestamp-string'. +Turn DATE-STRING into something else that can be worked with in +code. Found at http://xahlee.org/emacs/elisp_parse_time.html" + (setq date-string (replace-regexp-in-string "Jan" "01" date-string) + date-string (replace-regexp-in-string "Feb" "02" date-string) + date-string (replace-regexp-in-string "Mar" "03" date-string) + date-string (replace-regexp-in-string "Apr" "04" date-string) + date-string (replace-regexp-in-string "May" "05" date-string) + date-string (replace-regexp-in-string "Jun" "06" date-string) + date-string (replace-regexp-in-string "Jul" "07" date-string) + date-string (replace-regexp-in-string "Aug" "08" date-string) + date-string (replace-regexp-in-string "Sep" "09" date-string) + date-string (replace-regexp-in-string "Oct" "10" date-string) + date-string (replace-regexp-in-string "Nov" "11" date-string) + date-string (replace-regexp-in-string "Dec" "12" date-string)) + (string-match + "^\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{4\\}\\)$" + date-string) + (format "%s-%s-%s" + (match-string 3 date-string) + (match-string 2 date-string) + (match-string 1 date-string))) + +(defun oni:move-beginning-of-dwim () + "Move to beginning of line either after indentation or before." + (interactive) + (let ((start (point))) + (back-to-indentation) + (if (= start (point)) + (beginning-of-line)))) + +(defun oni:move-end-of-dwim () + "Move to end of line, either before any comments or after." + (interactive) + (let ((start (point)) + (eolpos (line-end-position))) + (beginning-of-line) + (if (and comment-start + (comment-search-forward eolpos t)) + (progn + (search-backward-regexp (concat "[^ \t" comment-start "]")) + (forward-char) + + (when (or (bolp) + (= start (point))) + (end-of-line))) + (end-of-line)))) + +(defun oni:myepisodes-formatter (plist) + "Format RSS items from MyEpisodes as org tasks. +PLIST contains all the pertinent information." + (let ((str (plist-get plist :title))) + (string-match + "^\\[ \\([^\]]+\\) \\]\\[ \\([^\]]+\\) \\]\\[ \\([^\]]+\\) \\]\\[ \\([^\]]+\\) \\]$" + str) + (let* ((title (match-string 1 str)) + (episode (match-string 2 str)) + (name (match-string 3 str)) + (date (oni:mini-fix-timestamp-string (match-string 4 str)))) + (format "* ACQUIRE %s %s - %s \n SCHEDULED: <%s>" + title episode name date)))) + +(defun oni:newline-and-indent () + "`newline-and-indent', but with a twist. +When dealing with braces, add another line and indent that too." + (interactive) + (if (and (not (or (= (point) (point-max)) + (= (point) (point-min)))) + (or (and (char-equal (char-before) ?{) + (char-equal (char-after) ?})) + (and (char-equal (char-before) ?\() + (char-equal (char-after) ?\))))) + (save-excursion (newline-and-indent))) + (newline-and-indent)) + +(defun oni:org-mode-func () + "Function for `org-mode-hook'." + (auto-fill-mode) + (yas-minor-mode) + (setq-local comment-auto-fill-only-comments nil)) + +(defun oni:php-mode-func () + "Function for `php-mode-hook'." + (local-set-key "\C-j" 'oni:newline-and-indent) + (c-set-offset 'arglist-intro '+) + (c-set-offset 'arglist-close '0) + (rainbow-delimiters-mode) + (setq-local fci-rule-column 80) + (flycheck-mode)) + +(defun oni:prog-mode-func () + "Function for `prog-mode-hook'." + (rainbow-delimiters-mode) + (fci-mode) + (yas-minor-mode) + (auto-fill-mode)) + +(defun oni:python-mode-func () + "Function for `python-mode-hook'." + (flycheck-mode) + (local-set-key (kbd "C->") 'python-indent-shift-right) + (local-set-key (kbd "C-<") 'python-indent-shift-left) + (set (make-local-variable 'electric-indent-chars) nil) + (rainbow-delimiters-mode) + (setq fci-rule-column 79 + fill-column 72) + (setq-local whitespace-style '(tab-mark)) + (fci-mode) + (whitespace-mode)) + +(defun oni:rainbow-mode-init () + "Initialization function for rainbow-mode." + (diminish 'rainbow-mode)) + +(defun oni:raise-ansi-term (arg) + "Create or show an `ansi-term' buffer." + (interactive "P") + (let ((buffer (get-buffer "*ansi-term*"))) + (if (and buffer (not arg)) + (switch-to-buffer buffer) + (call-interactively 'ansi-term)))) + +(defun oni:raise-scratch (&optional mode) + "Show the *scratch* buffer. +If called with a universal argument, ask the user which mode to +use. If MODE is not nil, open a new buffer with the name +*MODE-scratch* and load MODE as its major mode." + (interactive (list (if current-prefix-arg + (read-string "Mode: ") + nil))) + (let* ((bname (if mode + (concat "*" mode "-scratch*") + "*scratch*")) + (buffer (get-buffer bname)) + (mode-sym (intern (concat mode "-mode")))) + + (unless buffer + (setq buffer (generate-new-buffer bname)) + (with-current-buffer buffer + (when (fboundp mode-sym) + (funcall mode-sym)))) + + (select-window (display-buffer buffer)))) + +(defun oni:replace-html-special-chars () + "Replace special characters with HTML escaped entities." + (oni:replace-occurrences "é" "é")) + +(defun oni:replace-occurrences (from to) + "Replace all occurrences of FROM with TO in the current buffer." + (save-excursion + (goto-char (point-min)) + (while (search-forward from nil t) + (replace-match to)))) + +(defun oni:request-pull () + "Start a mail to request pulling from a git repository." + (interactive) + (let* ((default-directory + (expand-file-name + (or (locate-dominating-file default-directory ".git") + (magit-read-top-dir nil)))) + (refs (magit-list-interesting-refs magit-uninteresting-refs)) + (from (cdr (assoc (completing-read "From: " refs) refs))) + (url (read-from-minibuffer "Pull URL: ")) + (to (symbol-name (read-from-minibuffer "Up to (HEAD): " + nil nil t nil "HEAD"))) + (patchp (and current-prefix-arg (listp current-prefix-arg)))) + (message "Requesting pull for %s from %s to %s at %s with%s patch" + default-directory from to url (if patchp "" "out")) + + (compose-mail + nil (concat + "Requesting pull for " + (file-name-base (directory-file-name default-directory)))) + + (save-excursion + (goto-char (point-max)) + (insert + (shell-command-to-string + (concat "git --git-dir='" default-directory ".git' --work-tree='" + default-directory "' request-pull " (when patchp "-p ") + from " " url " " to)))))) + +(defun oni:rst-mode-func () + "Function for `rst-mode-hook'." + (auto-fill-mode)) + +(defun oni:self-insert-dwim () + "Execute self insert, but when the region is active call self +insert at the end of the region and at the beginning." + (interactive) + (if (region-active-p) + (let ((electric-pair-mode nil) + (beginning (region-beginning)) + (end (region-end))) + (goto-char end) + (self-insert-command 1) + (save-excursion + (goto-char beginning) + (self-insert-command 1))) + (self-insert-command 1))) + +(defun oni:shorten-dir (dir) + "Shorten a directory, (almost) like fish does it." + (while (string-match "\\(/\\.?[^./]\\)[^/]+/" dir) + (setq dir (replace-match "\\1/" nil nil dir))) + dir) + +(defun oni:show-buffer-position () + "Show the position in the current buffer." + (interactive) + (message (format "%d:%d" (line-number-at-pos) (current-column)))) + +(defun oni:show-org-index () + "Show the index of my org files." + (interactive) + (find-file "~/documents/org/index.org")) + +(defun oni:smex-init () + "Initialization function for smex." + (global-set-key (kbd "M-x") 'smex) + (global-set-key (kbd "C-M-x") 'smex-major-mode-commands)) + +(defun oni:split-window-interactive (dir) + "Split windows in direction DIR. + +Can also delete or switch to another window." + (interactive + (list (read-char "Direction (h,v,q,d,o): "))) + (case dir + ((?v) (split-window-vertically)) + ((?h) (split-window-horizontally)) + ((?q) (delete-other-windows)) + ((?d) (delete-window)) + ((?o) (other-window 1)))) + +(defun oni:split-window-interactively (window) + "Ask for a direction and split WINDOW that way. + +If no direction is given, don't split." + (let ((dir (read-char "Direction (h,v): "))) + (case dir + ((?v) (split-window-vertically)) + ((?h) (split-window-horizontally)) + (t window)))) + +(defun oni:start-python-test-mail-server () + "Run the python test mailserver." + (interactive) + (start-process "python-test-mail-server" "*py-mail-server*" "python" "-m" + "smtpd" "-n" "-c" "DebuggingServer" "localhost:1025")) + +(defun oni:stop-python-test-mail-server () + "Stop the python test mailserver." + (interactive) + (kill-process "python-test-mail-server")) + +(defun oni:term-mode-func () + "Function for `term-mode-hook'." + (setq truncate-lines nil)) + +(defun oni:texinfo-mode-func () + "Function for `texinfo-mode-hook'." + (setq-local comment-auto-fill-only-comments nil) + (auto-fill-mode)) + +(defun oni:write-file-func () + "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-key yas-minor-mode-map (kbd "C-\\") 'yas-expand)) + +(defun oni:yasnippet-init () + "Initialization function for yasnippet." + (diminish 'yas-minor-mode)) + +(defvar oni:auto-save-name-transforms + `((".*" ,temporary-file-directory t)) + "Place all auto-save files in `temporary-file-directory'.") + +(defvar oni:backup-directory-alist + `((".*" . ,temporary-file-directory)) + "Palce all backup files in `temporary-file-directory'.") + +(defvar oni:mailbox-map + '("top" ("menu" + ("ryulash.org" . "ryuslash") + ("ninthfloor" . "ninthfloor") + ("gmail" . "gmail") + ("aethon" . "aethon"))) + "A mailbox map for use with `tmm-prompt'.") + +(provide 'oni) +;;; oni.el ends here diff --git a/emacs/site-lisp/org-init.el b/emacs/site-lisp/org-init.el new file mode 100644 index 0000000..4033c30 --- /dev/null +++ b/emacs/site-lisp/org-init.el @@ -0,0 +1,164 @@ +;;; org-init.el --- Org initialization + +;; Copyright (C) 2012 Tom Willemsen + +;; Author: Tom Willemsen +;; 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 'oni) +(require 'org-contacts) +(require 'org-habit) +(require 'org-protocol) + +(autoload 'org-clocking-p "org-clock") + +(eval-after-load "org-crypt" + '(org-crypt-use-before-save-magic)) + +(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)) + +(defun oni:set-org-agenda-files () + "Set `org-agenda-files` according to the current time." + (interactive) + (let* ((current-time (decode-time)) + (current-hour (nth 2 current-time)) + (current-dow (nth 6 current-time))) + (if (or (= current-dow 6) (= current-dow 0) ; Saturday or Sunday + (< current-hour 9) (>= current-hour 17)) + (setq org-agenda-files + (append oni:personal-agenda-files oni:common-agenda-files)) + (setq org-agenda-files + (append oni:work-agenda-files oni:common-agenda-files))))) + +(defvar oni:personal-agenda-files + (list (expand-file-name "~/documents/org/tasks")) + "My personal agenda, should only show up at times I don't have + to work.") + +(defvar oni:work-agenda-files + (list (expand-file-name "~/documents/org/work")) + "My work agenda, should only show up at times I work.") + +(defvar oni:common-agenda-files + (list (expand-file-name "~/documents/org/dailies") + (expand-file-name "~/documents/org/misc/contacts.org") + (expand-file-name "~/documents/org/misc/bookmarks.org")) + "Agenda files that are work-agnostic, should always show up.") + +(setq org-agenda-custom-commands + '(("P" . "Personal only") + ("Pa" "Personal agenda" agenda "" + ((org-agenda-files (append oni:personal-agenda-files + oni:common-agenda-files)))) + ("Pt" "Personal todo" todo "" + ((org-agenda-files (append oni:personal-agenda-files + oni:common-agenda-files)))) + ("W" . "Work only") + ("Wa" "Work agenda" agenda "" + ((org-agenda-files (append oni:work-agenda-files + oni:common-agenda-files)))) + ("Wt" "Work todo" todo "" + ((org-agenda-files (append oni:work-agenda-files + oni:common-agenda-files)))))) +(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 category-keep) + (tags priority-down category-keep) + (search category-keep))) +(setq org-agenda-tags-column -101) +(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 %?") + ("T" "Linked task" entry (file "~/documents/org/tasks") + "* TODO %?\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-targets '((nil . (:maxlevel . 6)))) +(setq org-refile-use-outline-path 'file) +(setq org-return-follows-link t) +(setq org-src-fontify-natively t) +(setq org-tags-column -101) +(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")))) +(setq org-use-fast-todo-selection t) +(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) + +(oni:set-org-agenda-files) +(run-at-time "09:01" (* 60 60 24) 'oni:set-org-agenda-files) +(run-at-time "17:01" (* 60 60 24) 'oni:set-org-agenda-files) + +(provide 'org-init) +;;; org-init.el ends here diff --git a/emacs/site-lisp/quick-edit-mode.el b/emacs/site-lisp/quick-edit-mode.el new file mode 100644 index 0000000..821c738 --- /dev/null +++ b/emacs/site-lisp/quick-edit-mode.el @@ -0,0 +1,74 @@ +;;; quick-edit-mode.el --- Quickly edit stuff + +;; Copyright (C) 2012 Tom Willemsen + +;; Author: Tom Willemsen +;; 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/site-lisp/wm-init.el b/emacs/site-lisp/wm-init.el new file mode 100644 index 0000000..694acab --- /dev/null +++ b/emacs/site-lisp/wm-init.el @@ -0,0 +1,3 @@ +(async-shell-command "herbstluftwm" " herbstluftwm") +(async-shell-command "dunst" " dunst") +(async-shell-command "xbindkeys" " xbindkeys") diff --git a/emacs/snippets/Makefile b/emacs/snippets/Makefile new file mode 100644 index 0000000..12ff544 --- /dev/null +++ b/emacs/snippets/Makefile @@ -0,0 +1,4 @@ +DESTDIR:=$(DESTDIR)/snippets +modules=html-mode org-mode python-mode + +include ../../dotfiles.mk diff --git a/emacs/snippets/html-mode/Makefile b/emacs/snippets/html-mode/Makefile new file mode 100644 index 0000000..b2dff78 --- /dev/null +++ b/emacs/snippets/html-mode/Makefile @@ -0,0 +1,4 @@ +DESTDIR:=$(DESTDIR)/html-mode +objects=for generic-block + +include ../../../dotfiles.mk diff --git a/emacs/snippets/html-mode/for b/emacs/snippets/html-mode/for new file mode 100644 index 0000000..01d9c44 --- /dev/null +++ b/emacs/snippets/html-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# condition: pony-tpl-minor-mode +# -- +{% for $1 in $2 %} + $0 +{% endfor %} \ No newline at end of file diff --git a/emacs/snippets/html-mode/generic-block b/emacs/snippets/html-mode/generic-block new file mode 100644 index 0000000..82d40c7 --- /dev/null +++ b/emacs/snippets/html-mode/generic-block @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Template Block +# key: % +# condition: pony-tpl-minor-mode +# -- +{% $1 %} + $0 +{% end$1 %} \ No newline at end of file diff --git a/emacs/snippets/org-mode/Makefile b/emacs/snippets/org-mode/Makefile new file mode 100644 index 0000000..34d4cd9 --- /dev/null +++ b/emacs/snippets/org-mode/Makefile @@ -0,0 +1,4 @@ +DESTDIR:=$(DESTDIR)/org-mode +objects=codeblock heading project snippet + +include ../../../dotfiles.mk diff --git a/emacs/snippets/org-mode/codeblock b/emacs/snippets/org-mode/codeblock new file mode 100644 index 0000000..a200b08 --- /dev/null +++ b/emacs/snippets/org-mode/codeblock @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: codeblock +# key: code +# -- +#+begin_src $1 + $0 +#+end_src \ No newline at end of file diff --git a/emacs/snippets/org-mode/heading b/emacs/snippets/org-mode/heading new file mode 100644 index 0000000..9d5451e --- /dev/null +++ b/emacs/snippets/org-mode/heading @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Heading +# key: * +# -- +${1:*} ${2:TODO} $3 +${1:$(make-string (length text) ?\ )} :PROPERTIES: +${1:$(make-string (length text) ?\ )} :CATEGORY: $4 +${1:$(make-string (length text) ?\ )} :END: +${1:$(make-string (length text) ?\ )} $0 \ No newline at end of file diff --git a/emacs/snippets/org-mode/project b/emacs/snippets/org-mode/project new file mode 100644 index 0000000..269d655 --- /dev/null +++ b/emacs/snippets/org-mode/project @@ -0,0 +1,51 @@ +# -*- mode: snippet -*- +# name: project +# key: project +# -- +#+TITLE: ${1:project_name} +#+LINK: src ${2:http://code.ryuslash.org/cgit.cgi/$3$1/} +#+LINK: tar_gz $2${4:snapshot/$1-master}.tar.gz +#+LINK: zip $2$4.zip +#+STARTUP: showall + +#+begin_html + + +#+end_html + +#+INCLUDE: "dlmenu.inc" + +* About + + ${5:A short description about $1} + + | $0Status | $6 | + | Language | $7 | + | License | ${8:GPLv3} | + +* Why? + + ${9:Why did you even think of writing $1?} + +* Features + + ${10:$1 does...} + +* Dependencies + + ${11:$1 needs to have...} + +* Download + + ${12:To download $1...} + +* Install + + ${13:To install $1...} + +* Usage + + ${14:Using $1...} \ No newline at end of file diff --git a/emacs/snippets/org-mode/snippet b/emacs/snippets/org-mode/snippet new file mode 100644 index 0000000..67f15d5 --- /dev/null +++ b/emacs/snippets/org-mode/snippet @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: snippet +# key: snippet +# -- +#+TITLE: ${1:snippet-name} +#+OPTIONS: toc:nil + +* $1 + + ${2:A short description abount $1} + + #+BEGIN_SRC $3 :tangle yes +$0 + #+END_SRC \ No newline at end of file diff --git a/emacs/snippets/python-mode/Makefile b/emacs/snippets/python-mode/Makefile new file mode 100644 index 0000000..192657b --- /dev/null +++ b/emacs/snippets/python-mode/Makefile @@ -0,0 +1,4 @@ +DESTDIR:=$(DESTDIR)/python-mode +objects=defm_empty form form_valid import_from permission_guard url + +include ../../../dotfiles.mk diff --git a/emacs/snippets/python-mode/defm_empty b/emacs/snippets/python-mode/defm_empty new file mode 100644 index 0000000..baa976e --- /dev/null +++ b/emacs/snippets/python-mode/defm_empty @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# name: Empty Defmethod +# key: defm +# -- +def ${1:name}(self, *args, **kwargs): + '''$2''' + return super(${3:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).$1(*args, **kwargs) \ No newline at end of file diff --git a/emacs/snippets/python-mode/form b/emacs/snippets/python-mode/form new file mode 100644 index 0000000..225d5e4 --- /dev/null +++ b/emacs/snippets/python-mode/form @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Model Form +# key: form +# -- +class ${1:Model}Form(forms.ModelForm): + '''Form for the $1 model.''' + + class Meta: + model = $1 \ No newline at end of file diff --git a/emacs/snippets/python-mode/form_valid b/emacs/snippets/python-mode/form_valid new file mode 100644 index 0000000..c5a7e58 --- /dev/null +++ b/emacs/snippets/python-mode/form_valid @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Record form +# key: defm +# -- +@record_activity(model=${1:`(progn (re-search-backward "^[ \t]*model = \\([a-zA-Z_].*\\)$") (match-string 1))`}) +def form_valid(self, form): + '''Make sure any changes to the $1 model get logged.''' + return super(${2:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).form_valid(form) \ No newline at end of file diff --git a/emacs/snippets/python-mode/import_from b/emacs/snippets/python-mode/import_from new file mode 100644 index 0000000..5c23b8e --- /dev/null +++ b/emacs/snippets/python-mode/import_from @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# name: from ... import ... +# contributor: Tom Willemsen +# key: from +# -- +from ${1:module} import ${2:class_or_module} \ No newline at end of file diff --git a/emacs/snippets/python-mode/permission_guard b/emacs/snippets/python-mode/permission_guard new file mode 100644 index 0000000..ab53895 --- /dev/null +++ b/emacs/snippets/python-mode/permission_guard @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Permission guard +# key: defm +# -- +@method_decorator(permission_required('$1', + raise_exception=True)) +def dispatch(self, *args, **kwargs): + '''Make sure the user has the $1 permission.''' + return super(${3:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).dispatch(*args, **kwargs) \ No newline at end of file diff --git a/emacs/snippets/python-mode/url b/emacs/snippets/python-mode/url new file mode 100644 index 0000000..00ade72 --- /dev/null +++ b/emacs/snippets/python-mode/url @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: url +# key: url +# -- +url(r'^$1', $2, name='$3'), \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 091a42d916e2ef5901bf42de236d4cb9b9cfda23 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 17 Feb 2013 23:09:46 +0100 Subject: emacs: Change some stuff --- emacs/init.org | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 2687290..14f16f7 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -1,19 +1,38 @@ #+TITLE: Emacs init -#+STYLE: -#+OPTIONS: author:nil +#+OPTIONS: author:nil num:nil #+STARTUP: showall #+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html -* gui +* GUI - Remove the ~menu-bar~, ~tool-bar~ and ~scroll-bar~ from the UI since I - don't use them at all. + These things should happen early, so that Emacs will look the way I + want it to as quickly as is possible. - #+BEGIN_SRC emacs-lisp :tangle init2.el - (menu-bar-mode -1) - (scroll-bar-mode -1) - (tool-bar-mode -1) - #+END_SRC +** menu-bar-mode + + Disable =menu-bar-mode= since I haven't used the menu bar much ever, + even when I first started using Emacs. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (menu-bar-mode -1) + #+END_SRC + +** scroll-bar-mode + + Since Emacs gives a pretty good indication of where in the buffer + I'm working I really don't need to have the scroll bar visible. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (scroll-bar-mode -1) + #+END_SRC + +** tool-bar-mode + + I've never used the tool bar much, so remove it. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (tool-bar-mode -1) + #+END_SRC * load-path @@ -167,12 +186,18 @@ (eval-after-load "flymake" '(oni:flymake-init)) #+END_SRC - Disable the GUI for flymake errors, add a bunch of pep8, flymake - and pyflakes messages to warning and info patterns, set the log - file to somewhere in my home directory and set logging level to 0. + Disable the GUI for flymake errors. This causes the flymake errors + to be shown in the minibuffer. #+BEGIN_SRC emacs-lisp :tangle init2.el (setq flymake-gui-warnings-enabled nil) + #+END_SRC + + Add a bunch of pep8, flymake and pyflakes messages to warning and + info patterns, set the log file to somewhere in my home directory + and set logging level to 0. + + #+BEGIN_SRC emacs-lisp :tangle init2.el (setq flymake-info-line-regexp (eval-when-compile (regexp-opt -- cgit v1.2.3-54-g00ecf From 48d11cb7c1dead4eaeeae79b0482320ed7ea7b3e Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 17 Feb 2013 23:41:54 +0100 Subject: emacs: Specify the tangle for the entire file --- emacs/init.org | 59 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 14f16f7..f5db6c9 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -2,6 +2,7 @@ #+OPTIONS: author:nil num:nil #+STARTUP: showall #+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html +#+PROPERTY: tangle init2.el * GUI @@ -13,7 +14,7 @@ Disable =menu-bar-mode= since I haven't used the menu bar much ever, even when I first started using Emacs. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (menu-bar-mode -1) #+END_SRC @@ -22,7 +23,7 @@ Since Emacs gives a pretty good indication of where in the buffer I'm working I really don't need to have the scroll bar visible. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (scroll-bar-mode -1) #+END_SRC @@ -30,7 +31,7 @@ I've never used the tool bar much, so remove it. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (tool-bar-mode -1) #+END_SRC @@ -43,7 +44,7 @@ and exist. Place them at the end of =load-path= so they don't mess up package precedence. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (eval-and-compile (defun oni:path-init (dir) "Add DIR to `load-path' and all its subdirectories, unless @@ -58,7 +59,7 @@ Add my project [[yoshi-theme]] to =custom-theme-load-path= and load it. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (add-to-list 'custom-theme-load-path "~/projects/emacs/yoshi-theme/") (load-theme 'yoshi t) #+END_SRC @@ -66,7 +67,7 @@ Add any other interesting paths to =load-path= and, if it exists, load the ~loaddefs.el~ file from these directories. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (mapc #'(lambda (dir) (add-to-list 'load-path dir) (let ((loaddefs (concat dir "/loaddefs.el"))) @@ -81,7 +82,7 @@ Don't ask ~yes~ or ~no~, ask ~y~ or ~n~, I've never had an accidental ~y~ so far. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defalias 'yes-or-no-p 'y-or-n-p) #+END_SRC @@ -90,7 +91,7 @@ Use =ibuffer= instead of the default =list-buffers= because it has many more features. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defalias 'list-buffers 'ibuffer) #+END_SRC @@ -98,7 +99,7 @@ Do the same with =hippie-expand= and =dabbrev-expand=. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defalias 'dabbrev-expand 'hippie-expand) #+END_SRC @@ -108,7 +109,7 @@ whenever I'm working in a mode that supports it anyway. This should only execute once ~eldoc~ has been loaded. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (eval-after-load "eldoc" '(diminish 'eldoc-mode)) #+END_SRC @@ -116,7 +117,7 @@ Use the standard EMMS configuration and add some MPD settings. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:emms-init () "Initialization function for EMMS." (require 'emms-setup) @@ -137,7 +138,7 @@ Add some keybindings for EMMS. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:emms-toggle-playing () "Toggle between playing/paused states." (interactive) @@ -165,7 +166,7 @@ Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to "allowed" files and add go error output to error patterns. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:flymake-init () "Initialization function for flymake." (require 'flymake-cursor) @@ -189,7 +190,7 @@ Disable the GUI for flymake errors. This causes the flymake errors to be shown in the minibuffer. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq flymake-gui-warnings-enabled nil) #+END_SRC @@ -197,7 +198,7 @@ info patterns, set the log file to somewhere in my home directory and set logging level to 0. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq flymake-info-line-regexp (eval-when-compile (regexp-opt @@ -250,7 +251,7 @@ After loading ~flycheck~ Remove the default python checkers and replace them with my own, which tries both ~flake8~ and ~pylint~. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (eval-after-load "flycheck" '(progn (mapc (lambda (c) (delete c flycheck-checkers)) @@ -262,7 +263,7 @@ Make the ~C-l~ look like a line of ~-~ up to =fill-column= or =fci-rule-column= and remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:pretty-control-l-function (win) "Just make a string of either `fci-rule-column' or `fill-column' length -1. Use the `-' character. WIN is ignored." @@ -275,14 +276,14 @@ Remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq pp^L-^L-string-pre nil) #+END_SRC Enable =pretty-control-l-mode= at startup and whenever a new frame is created. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (add-hook 'emacs-startup-hook 'pretty-control-l-mode) (add-hook 'after-make-frame-functions '(lambda (arg) (pretty-control-l-mode))) @@ -292,21 +293,21 @@ Automatically join some channels when connecting to freenode.net. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq erc-autojoin-channels-alist '(("freenode.net" "#ninthfloor" "#emacs"))) #+END_SRC Don't show ~PART~ messages. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq erc-hide-list '("PART")) #+END_SRC Insert a timestamp every time a message comes in, print it on the left and print the hour and minute parts of the time. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) (setq erc-timestamp-format "[%H:%M] ") (setq erc-timestamp-only-if-changed-flag nil) @@ -314,14 +315,14 @@ Set my nickname. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq erc-nick "ryuslash") #+END_SRC When starting ERC disable truncating lines, don't let ERC fill each line and enable =visual-line-mode=. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:erc-mode-func () "Function for `erc-mode-hook'." (erc-fill-mode -1) @@ -336,7 +337,7 @@ Add ~unison~ to the list of =eshell-visual-commands= because it expects unbuffered input and eshell just doesn't give that. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (eval-after-load "em-term" '(add-to-list 'eshell-visual-commands "unison")) #+END_SRC @@ -344,7 +345,7 @@ Don't let eshell highlight it's prompt, this way I can decide the colors for it myself. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (setq eshell-highlight-prompt nil) #+END_SRC @@ -361,7 +362,7 @@ And set the =eshell-prompt-regexp= to - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:eshell-prompt-function () "Show a pretty shell prompt." (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) @@ -397,7 +398,7 @@ Don't truncate lines in eshell, wrap them. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:eshell-mode-func () "Function for `eshell-mode-hook'." (setq truncate-lines nil)) @@ -407,7 +408,7 @@ Bind the ~f8~ key to easily show eshell. - #+BEGIN_SRC emacs-lisp :tangle init2.el + #+BEGIN_SRC emacs-lisp (defun oni:raise-eshell () "Start or switch back to `eshell'. Also change directories to current working directory." -- cgit v1.2.3-54-g00ecf From e8a16eb5356555ae3320c245f67cb09cc2b0c198 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 19 Feb 2013 00:52:31 +0100 Subject: conkeror: set the b key to markam-add --- .conkerorrc/init.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index 157f125..e399202 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -159,6 +159,7 @@ define_key(content_buffer_normal_keymap, "C-y", "paste-url-new-buffer"); define_key(content_buffer_normal_keymap, "H", "find-url-from-history"); define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer"); define_key(default_base_keymap, "C-x f", "follow-new-buffer"); +define_key(content_buffer_normal_keymap, "b", "markam-add"); add_hook("before_quit_hook", oni_before_quit_func); add_hook("content_policy_hook", content_policy_bytype); -- cgit v1.2.3-54-g00ecf From 9262554c269a58bb7a77baf2b7d7cb88792ca545 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 19 Feb 2013 00:52:53 +0100 Subject: emacs: add custom org to load path --- emacs/init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index f5db6c9..9ac0ef7 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -74,7 +74,8 @@ (when (file-exists-p loaddefs) (load loaddefs)))) '("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp" - "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode")) + "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode" + "/usr/local/org-mode/share/emacs/site-lisp/org")) #+END_SRC * y-or-n-p -- cgit v1.2.3-54-g00ecf From 2e1315b829f0285cce05f305fc97993ac2890cf1 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 19 Feb 2013 00:53:13 +0100 Subject: xmonad: show mplayer in full opacity --- xmonad/xmonad.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs index 9a80be4..56a404a 100644 --- a/xmonad/xmonad.hs +++ b/xmonad/xmonad.hs @@ -19,9 +19,11 @@ fadeRules = do fullscreen <- isFullscreen conkeror <- className =? "Conkeror" chromium <- className =? "Chromium" + mplayer <- className =? "MPlayer" return $ case () of _ | fullscreen -> 1 | conkeror -> 0.95 | chromium -> 1 + | mplayer -> 1 | otherwise -> 0.9 main = xmonad $ defaultConfig -- cgit v1.2.3-54-g00ecf From 0fb047ba987a259a2cbb0bd327cea0c9b7cab63e Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 19 Feb 2013 23:43:39 +0100 Subject: emacs: Don't use avatars with jabber --- emacs/init.el | 3 +++ emacs/site-lisp/oni.el | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index 816c03d..a3eff7b 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -119,6 +119,7 @@ (setq jabber-account-list '(("ryuslash@jabber.org") ("tom@ryuslash.org/Emacs" (:connection-type . ssl)))) +(setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") (setq jabber-chat-buffer-format "*jab:%n*") (setq jabber-chat-buffer-show-avatar nil) (setq jabber-chat-fill-long-lines nil) @@ -128,6 +129,8 @@ (setq jabber-history-dir "~/.emacs.d/jabber") (setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) (setq jabber-roster-show-bindings nil) +(setq jabber-vcard-avatars-publish nil) +(setq jabber-vcard-avatars-retrieve nil) (setq jit-lock-defer-time 0.2) (setq magit-repo-dirs '("~/projects/" "~/var/src/")) (setq message-log-max 1000) diff --git a/emacs/site-lisp/oni.el b/emacs/site-lisp/oni.el index 80d1b01..9b2df64 100644 --- a/emacs/site-lisp/oni.el +++ b/emacs/site-lisp/oni.el @@ -189,10 +189,7 @@ If COUNT has been specified indent by that much, otherwise look at (defun oni:jabber-chat-mode-func () "Function for `jabber-chat-mode-hook'." - (visual-line-mode) - (setq mode-line-format (append (cddr jabber-chat-header-line-format) - '(global-mode-string)) - header-line-format nil)) + (visual-line-mode)) (defun oni:jabber-init () "Initialization function for jabber." -- cgit v1.2.3-54-g00ecf From df7fa2f1c4a9beedd41d321c32712f508b2ee934 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 20 Feb 2013 00:06:06 +0100 Subject: emacs: do some stuff --- emacs/init.el | 6 ------ emacs/init.org | 41 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index a3eff7b..fa7188d 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -49,12 +49,6 @@ (require 'ext) (require 'oni) -(put 'upcase-region 'disabled nil) -(put 'downcase-region 'disabled nil) -(put 'narrow-to-region 'disabled nil) -(put 'scroll-left 'disabled nil) - -(setq-default bidi-paragraph-direction 'left-to-right) (setq-default c-basic-offset 4) (setq-default fci-rule-column 73) (setq-default indent-tabs-mode nil) diff --git a/emacs/init.org b/emacs/init.org index 9ac0ef7..d8eb2e7 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -1,8 +1,8 @@ #+TITLE: Emacs init -#+OPTIONS: author:nil num:nil -#+STARTUP: showall #+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html +#+OPTIONS: author:nil num:nil #+PROPERTY: tangle init2.el +#+STARTUP: showall * GUI @@ -425,3 +425,40 @@ (global-set-key (kbd "") 'oni:raise-eshell) #+END_SRC + +* svg-mode-line-themes + + After Emacs has initialized, enable =svg-mode-line-themes= and select + a theme. + + #+BEGIN_SRC emacs-lisp + (defun oni:enable-svg-mode-line-theme () + "Enable `svg-mode-line-theme' and select a theme." + (smt/enable) + (smt/set-theme 'black-crystal)) + + (add-hook 'emacs-startup-hook 'oni:enable-svg-mode-line-theme) + #+END_SRC + +* bidi + + Disable bi-directional text, since I don't write right-to-left + myself and I don't know anyone who does. I have read that it is a + bad idea to disable it completely, but forcing left-to-right should + help. + + #+BEGIN_SRC emacs-lisp + (setq-default bidi-paragraph-direction 'left-to-right) + #+END_SRC + +* disabled + + There are some functions which get disabled by default because they + "confuse new users", but these I like using. + + #+BEGIN_SRC emacs-lisp + (put 'upcase-region 'disabled nil) + (put 'downcase-region 'disabled nil) + (put 'narrow-to-region 'disabled nil) + (put 'scroll-left 'disabled nil) + #+END_SRC -- cgit v1.2.3-54-g00ecf From bfcd2d8f3b350e955bc3e26b8ac43022276ba607 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 21 Feb 2013 15:09:08 +0100 Subject: emacs: Use local hostname as jabber resource --- emacs/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/init.el b/emacs/init.el index fa7188d..85f3b4b 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -111,7 +111,7 @@ (setq initial-major-mode 'emacs-lisp-mode) (setq initial-scratch-message nil) (setq jabber-account-list '(("ryuslash@jabber.org") - ("tom@ryuslash.org/Emacs" + ("tom@ryuslash.org/drd" (:connection-type . ssl)))) (setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") (setq jabber-chat-buffer-format "*jab:%n*") -- cgit v1.2.3-54-g00ecf From f20965bd7543b8a3bb1bc2e7b0e0eb1d6c600017 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 21 Feb 2013 15:10:03 +0100 Subject: offlineimap: Update mowedline after sync --- .offlineimaprc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.offlineimaprc b/.offlineimaprc index 443e83e..aec7367 100644 --- a/.offlineimaprc +++ b/.offlineimaprc @@ -8,7 +8,7 @@ pythonfile = ~/.offlineimap.py [Account ryuslash.org] localrepository = ryuslash.org-local remoterepository = ryuslash.org-remote -postsynchook = mu index --muhome=~/.mu/ryuslash --maildir=~/documents/mail/ryuslash.org; ~/usr/bin/emacs-send-mail ryuslash.org +postsynchook = /home/slash/usr/bin/emacs-send-mail ryuslash.org; /home/slash/usr/bin/mode-line-mail ryuslash.org ryu [Repository ryuslash.org-local] type = Maildir @@ -25,7 +25,7 @@ nametrans = lambda folder: folder.lower() [Account aethon] localrepository = aethon-local remoterepository = aethon-remote -postsynchook = mu index --muhome=~/.mu/aethon --maildir=~/documents/mail/aethon; ~/usr/bin/emacs-send-mail aethon +postsynchook = /home/slash/usr/bin/emacs-send-mail aethon; /home/slash/usr/bin/mode-line-mail aethon ae [Repository aethon-local] type = Maildir @@ -44,7 +44,7 @@ nametrans = lambda folder: re.sub('^INBOX$', 'inbox', re.sub('^\[Gmail\]/ [Account gmail] localrepository = gmail-local remoterepository = gmail-remote -postsynchook = mu index --muhome=~/.mu/gmail --maildir=~/documents/mail/gmail; ~/usr/bin/emacs-send-mail gmail +postsynchook = /home/slash/usr/bin/emacs-send-mail gmail; /home/slash/usr/bin/mode-line-mail gmail g [Repository gmail-local] type = Maildir @@ -63,7 +63,7 @@ nametrans = lambda folder: re.sub('^INBOX$', 'inbox', re.sub('^\[Gmail\]/ [Account ninthfloor] localrepository = ninthfloor-local remoterepository = ninthfloor-remote -postsynchook = mu index --muhome=~/.mu/ninthfloor --maildir=~/documents/mail/ninthfloor; ~/usr/bin/emacs-send-mail ninthfloor +postsynchook = /home/slash/usr/bin/emacs-send-mail ninthfloor; /home/slash/usr/bin/mode-line-mail ninthfloor 9f [Repository ninthfloor-local] type = Maildir -- cgit v1.2.3-54-g00ecf From f3c60acddbaeac0fc81d3eed8cd8407b24f3c988 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 3 Mar 2013 00:16:14 +0100 Subject: Replace xflux with redshift --- .xinitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xinitrc b/.xinitrc index 66b10f0..cf85c60 100755 --- a/.xinitrc +++ b/.xinitrc @@ -9,7 +9,7 @@ if [ -d /etc/X11/xinit/xinitrc.d ]; then unset f fi -xflux -l 51.1180 -g 4.0012 +redshift -l 51.1180:4.0012 & unclutter & mowedline & xcompmgr -n -r 0 & -- cgit v1.2.3-54-g00ecf From 5b0715954765f1688e87db0caacc3a7f36972663 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 3 Mar 2013 14:45:22 +0100 Subject: zathura: Always show input bar Makes it look more like emacs --- .config/zathura/zathurarc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc index 5ac9983..5066895 100644 --- a/.config/zathura/zathurarc +++ b/.config/zathura/zathurarc @@ -3,3 +3,5 @@ map scroll down map scroll up map scroll right map scroll left + +set guioptions cs -- cgit v1.2.3-54-g00ecf From 404cbbeaf121aa9429a4e27293843210199e6bb7 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 3 Mar 2013 14:45:41 +0100 Subject: emacs: Use topic-mode with gnus --- emacs/gnus.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/gnus.el b/emacs/gnus.el index 7301231..aac7c6e 100644 --- a/emacs/gnus.el +++ b/emacs/gnus.el @@ -49,7 +49,7 @@ (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) -- cgit v1.2.3-54-g00ecf From fea99289b63e1824be7cf7dc0524ebc7dfddf42f Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 3 Mar 2013 14:46:31 +0100 Subject: emacs: Have the mail button open gnus --- emacs/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/init.el b/emacs/init.el index 85f3b4b..2856abf 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -200,7 +200,7 @@ (global-set-key (kbd "'") 'oni:self-insert-dwim) (global-set-key (kbd "") 'oni:raise-scratch) -(global-set-key (kbd "") 'oni:view-mail) +(global-set-key (kbd "") 'gnus) (global-set-key (kbd "") 'git-project-show-files) (global-set-key (kbd "") 'ext:reload-buffer) (global-set-key (kbd "") 'jabber-switch-to-roster-buffer) -- cgit v1.2.3-54-g00ecf From 7856c942888afd7aafdbde09646c59d90cd5fe39 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 3 Mar 2013 14:47:01 +0100 Subject: emacs: Move (some) jabber config to org --- emacs/init.el | 2 -- emacs/init.org | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index 2856abf..3104840 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -120,7 +120,6 @@ (setq jabber-chat-foreign-prompt-format "%t %u/%r <\n") (setq jabber-chat-local-prompt-format "%t %u/%r >\n") (setq jabber-chatstates-confirm nil) -(setq jabber-history-dir "~/.emacs.d/jabber") (setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) (setq jabber-roster-show-bindings nil) (setq jabber-vcard-avatars-publish nil) @@ -175,7 +174,6 @@ (add-hook 'gtags-mode-hook 'oni:gtags-mode-func) (add-hook 'haskell-mode-hook 'oni:haskell-mode-func) (add-hook 'html-mode-hook 'oni:html-mode-func) -(add-hook 'jabber-alert-message-hooks 'oni:jabber-alert-message-func) (add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func) (add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func) (add-hook 'java-mode-hook 'oni:java-mode-func) diff --git a/emacs/init.org b/emacs/init.org index d8eb2e7..aeb16ca 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -462,3 +462,35 @@ (put 'narrow-to-region 'disabled nil) (put 'scroll-left 'disabled nil) #+END_SRC + +* jabber + + Require ~jabber-libnotify~ so we can use its alert functions. + + #+BEGIN_SRC emacs-lisp + (require 'jabber-libnotify) + #+END_SRC + + Enable libnotify alerts for regular and mutli-user chats, this is + preferable to seeing them in the echo area. + + #+BEGIN_SRC emacs-lisp + (add-hook 'jabber-alert-message-hooks 'jabber-message-libnotify) + (add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify) + #+END_SRC + + Keep track of what was said to and by my contacts, both for + "personal" chats and muc chats. + + #+BEGIN_SRC emacs-lisp + (setq jabber-history-enabled t + jabber-history-muc-enabled t) + #+END_SRC + + Store history on a per-contact basis and keep these files in + ~$HOME/.emacs.d/jabber-hist~. + + #+BEGIN_SRC emacs-lisp + (setq jabber-use-global-history nil + jabber-history-dir "~/.emacs.d/jabber-hist") + #+END_SRC -- cgit v1.2.3-54-g00ecf From b7c89d708df5ce6d5776ba21f75da51fa918b1b7 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 3 Mar 2013 14:47:18 +0100 Subject: emacs: Use naquadah theme --- emacs/init.org | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index aeb16ca..6589644 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -57,11 +57,10 @@ (oni:path-init "/usr/local/emacs/share/emacs/site-lisp")) #+END_SRC - Add my project [[yoshi-theme]] to =custom-theme-load-path= and load it. + Load naquadah-theme and set my own preferred background color. #+BEGIN_SRC emacs-lisp - (add-to-list 'custom-theme-load-path "~/projects/emacs/yoshi-theme/") - (load-theme 'yoshi t) + (add-hook 'emacs-startup-hook (lambda () (load-theme 'naquadah t))) #+END_SRC Add any other interesting paths to =load-path= and, if it exists, -- cgit v1.2.3-54-g00ecf From 8593af7f3e60c57db6a91783a248b3e1deef7fcd Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 3 Mar 2013 14:47:37 +0100 Subject: xmonad: Add some extended key bindings --- xmonad/xmonad.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs index 56a404a..617ab53 100644 --- a/xmonad/xmonad.hs +++ b/xmonad/xmonad.hs @@ -46,7 +46,14 @@ main = xmonad $ defaultConfig ("M-S-1", spawn "dmenu_run"), ("M-n", windows W.focusDown), ("M-p", windows W.focusUp), - ("M1-C-l", spawn "i3lock -c 000000") + ("M1-C-l", spawn "i3lock -c 000000"), + ("", spawn "mpc toggle"), + ("", spawn "mcp stop"), + ("", spawn "amixer sset Master toggle"), + ("", spawn "mpc volume -5"), + ("", spawn "mpc volume +5"), + ("", spawn "mpc prev"), + ("", spawn "mpc next") ] `removeKeysP` [ ("M-j"), ("M-k") ] -- cgit v1.2.3-54-g00ecf From b13108a00538601c46f3ed79038acd163cea8513 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 3 Mar 2013 16:28:29 +0100 Subject: conkeror: add style for Pro Git, use less --- .conkerorrc/init.js | 1 + .conkerorrc/styles/.gitignore | 1 + .conkerorrc/styles/Makefile | 5 +- .conkerorrc/styles/base.less | 4 + .conkerorrc/styles/git-scm.less | 18 +++++ .conkerorrc/styles/github.css | 161 --------------------------------------- .conkerorrc/styles/github.less | 162 ++++++++++++++++++++++++++++++++++++++++ .conkerorrc/styles/help.css | 19 ----- .conkerorrc/styles/help.less | 21 ++++++ .conkerorrc/styles/tango.less | 27 +++++++ 10 files changed, 238 insertions(+), 181 deletions(-) create mode 100644 .conkerorrc/styles/.gitignore create mode 100644 .conkerorrc/styles/base.less create mode 100644 .conkerorrc/styles/git-scm.less delete mode 100644 .conkerorrc/styles/github.css create mode 100644 .conkerorrc/styles/github.less delete mode 100644 .conkerorrc/styles/help.css create mode 100644 .conkerorrc/styles/help.less create mode 100644 .conkerorrc/styles/tango.less diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index e399202..5775492 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -306,3 +306,4 @@ register_user_stylesheet( oni_add_sheet("github.css"); oni_add_sheet("help.css"); +oni_add_sheet("git-scm.css"); diff --git a/.conkerorrc/styles/.gitignore b/.conkerorrc/styles/.gitignore new file mode 100644 index 0000000..b3a5267 --- /dev/null +++ b/.conkerorrc/styles/.gitignore @@ -0,0 +1 @@ +*.css diff --git a/.conkerorrc/styles/Makefile b/.conkerorrc/styles/Makefile index fb44500..c75377b 100644 --- a/.conkerorrc/styles/Makefile +++ b/.conkerorrc/styles/Makefile @@ -1,4 +1,7 @@ DESTDIR:=$(DESTDIR)/styles -objects=github.css help.css +objects=github.css help.css git-scm.css include ../../dotfiles.mk + +$(objects): %.css: %.less + lessc -x $^ > $@ diff --git a/.conkerorrc/styles/base.less b/.conkerorrc/styles/base.less new file mode 100644 index 0000000..dcb5a5e --- /dev/null +++ b/.conkerorrc/styles/base.less @@ -0,0 +1,4 @@ +@import "tango"; + +@monospace-font: "Envy Code R"; +@background: #111113; diff --git a/.conkerorrc/styles/git-scm.less b/.conkerorrc/styles/git-scm.less new file mode 100644 index 0000000..d69a97d --- /dev/null +++ b/.conkerorrc/styles/git-scm.less @@ -0,0 +1,18 @@ +@import "base"; + +@-moz-document domain(git-scm.com) { + .book#main { + background: @background !important; + color: @aluminium-1 !important; + + code, pre { + background: @aluminium-6 !important; + color: @aluminium-2 !important; + font-family: @monospace-font !important; + } + + &, code, pre { + border: none !important; + } + } +} diff --git a/.conkerorrc/styles/github.css b/.conkerorrc/styles/github.css deleted file mode 100644 index ff3a643..0000000 --- a/.conkerorrc/styles/github.css +++ /dev/null @@ -1,161 +0,0 @@ -@-moz-document url(https://github.com/), url(https://github.com/dashboard) { - #dashboard .filter-bar { - background: #222224 !important; - border-bottom: none !important; - } - - #dashboard .filter-bar li a.filter_selected { - color: #eeeeec !important; - } - - #dashboard .repos { - border: none !important; - background-color: #171719 !important; - } - - #dashboard .repos .bottom-bar { - background-color: #222224 !important; - } - - #dashboard .repos .top-bar { - background: #222224 !important; - border-bottom: none !important; - } - - #dashboard .repos h2 { - color: inherit !important; - } - - #dashboard ul.repo_list li.private { - background: #222224 !important; - } - - #dashboard ul.repo_list li a { - border-width: 0 !important; - } - - #footer { - text-shadow: none !important; - } - - .button .minibutton { - background: #171719 !important; - } - - .header { - background: #222224 !important; - color: #eeeeec !important; - border-bottom: none !important; - text-shadow: none !important; - } - - .header .divider-vertical { - background: #222224 !important; - border-right: none !important; - } - - .header .top-nav a { - color: #eeeeec !important; - } - - .header .topsearch a#advanced_search { - color: #eeeeec !important; - } - - .header #user-links a { - color: #eeeeec !important; - } - - .markdown-body code, - .markdown-body tt { - background-color: #222224 !important; - border: none !important; - color: #eeeeec !important; - font-family: "Envy Code R" !important; - } - - .minibutton.dark-grey { - background: #171719 !important;o - } - - .news .alert { - border-top: none !important; - } - - .news .alert .branch-link, - .news .alert .pull-info { - background: #222224 !important; - color: #eeeeec !important; - } - - .news .alert .gravatar { - background: none !important; - } - - .news .alert .simple .title { - color: #eeeeec !important; - } - - .news .commits li img { - background: none !important; - } - - .news blockquote { - color: #eeeeec !important; - } - - .pagehead .container > ul.tabs { - background: #171719 !important; - border: none !important; - } - - .pagehead .container > ul.tabs li a { - text-shadow: none !important; - border: none !important; - } - - .pagehead .container > ul.tabs li a:hover { - background: #222224 !important; - } - - .pagehead .container > ul.tabs li a.selected { - background: #222224 !important; - } - - .pagehead-actions a.feed { - background: #222224 !important; - border: none !important; - } - - .pagination { - background: #171719 !important; - border: none !important; - } - - .pagination a { - text-shadow: none !important; - border-bottom: none !important; - } - - .pagination a:hover { - background: #222224 !important; - } - - a { - color: #ffbb56 !important; - } - - a:visited { - color: #ee82ee !important; - } - - a.header-logo-blacktocat, - a.header-logo-blacktocat:visited { - color: #eeeeec !important; - } - - body { - background-color: #111113 !important; - color: #eeeeec !important; - } -} diff --git a/.conkerorrc/styles/github.less b/.conkerorrc/styles/github.less new file mode 100644 index 0000000..e4d3ed0 --- /dev/null +++ b/.conkerorrc/styles/github.less @@ -0,0 +1,162 @@ +@import "base"; + +@-moz-document url("https://github.com/"), url("https://github.com/dashboard") { + #dashboard { + .filter-bar { + background: @aluminium-5 !important; + border-bottom: none !important; + + li a.filter_selected { + color: @aluminium-1 !important; + } + } + + .repos { + border: none !important; + background-color: @aluminium-6 !important; + + .bottom-bar { + background-color: @aluminium-5 !important; + } + + .top-bar { + background: @aluminium-5 !important; + border-bottom: none !important; + } + + h2 { + color: inherit !important; + } + } + + ul.repo_list li { + &.private { + background: @aluminium-5 !important; + } + + a { + border-width: 0 !important; + } + } + } + + #footer { + text-shadow: none !important; + } + + .button .minibutton { + background: @aluminium-6 !important; + } + + .header { + background: @aluminium-5 !important; + color: @aluminium-1 !important; + border-bottom: none !important; + text-shadow: none !important; + + .divider-vertical { + background: @aluminium-5 !important; + border-right: none !important; + } + + .top-nav a, + .topsearch a#advanced_search, + #user-links a { + color: @aluminium-1 !important; + } + } + + .markdown-body { + code, tt { + background-color: @aluminium-5 !important; + border: none !important; + color: @aluminium-1 !important; + font-family: @monospace-font !important; + } + } + + .minibutton.dark-grey { + backgrond: @aluminium-6 !important; + } + + .news { + .alert { + border-top: none !important; + + .branch-info, + .pull-info { + background: @aluminium-5 !important; + color: @aluminium-1 !important; + } + + .gravatar { + background: none !important; + } + + .simple .title { + color: @aluminium-1 !important; + } + } + + .commits li img { + background: none !important; + } + + blockquote { + color: @aluminium-1 !important; + } + } + + .pagehead .container > ul.tabs { + background: @aluminium-6 !important; + border: none !important; + + li a { + text-shadow: none !important; + border: none !important; + + &:hover, + &.selected { + background: @aluminium-5 !important; + } + } + } + + .pagehead-actions a.feed { + background: @aluminium-5 !important; + border: none !important; + } + + .pagination { + background: @aluminium-6 !important; + border: none !important; + + a { + text-shadow: none !important; + border-bottom: none !important; + + &:hover { + background: @aluminium-5 !important; + } + } + } + + a { + color: @orange-1 !important; + + &:visited { + color: @plum-1 !important; + } + + &.header-logo-blacktocat { + &, &:visited { + color: @aluminium-1 !important; + } + } + } + + body { + background-color: @background !important; + color: @aluminium-1 !important; + } +} diff --git a/.conkerorrc/styles/help.css b/.conkerorrc/styles/help.css deleted file mode 100644 index 03888b6..0000000 --- a/.conkerorrc/styles/help.css +++ /dev/null @@ -1,19 +0,0 @@ -@-moz-document url(chrome://conkeror-help/content/help.html) { - body { - background: #111113 !important; - color: #eeeeec !important; - } - - a { - color: #ffbb56 !important; - } - - a:visited { - color: #ee82ee !important; - } - - pre, .key { - background: #222224 !important; - font-family: "Envy Code R" !important; - } -} diff --git a/.conkerorrc/styles/help.less b/.conkerorrc/styles/help.less new file mode 100644 index 0000000..339d7fa --- /dev/null +++ b/.conkerorrc/styles/help.less @@ -0,0 +1,21 @@ +@import "base"; + +@-moz-document url("chrome://conkeror-help/content/help.html") { + body { + background: @background !important; + color: @aluminium-1 !important; + } + + a { + color: @orange-1 !important; + + &:visited { + color: @plum-1 !important; + } + } + + pre, .key { + background: @aluminium-5 !important; + font-family: @monospace-font !important; + } +} diff --git a/.conkerorrc/styles/tango.less b/.conkerorrc/styles/tango.less new file mode 100644 index 0000000..ed6858b --- /dev/null +++ b/.conkerorrc/styles/tango.less @@ -0,0 +1,27 @@ +@butter-1: #fce94f; +@butter-2: #edd400; +@butter-3: #c4a000; +@orange-1: #fcaf3e; +@orange-2: #f57900; +@orange-3: #ce5c00; +@chocolate-1: #e9b96e; +@chocolate-2: #c17d11; +@chocolate-3: #8f5902; +@chameleon-1: #8ae234; +@chameleon-2: #73d216; +@chameleon-3: #4e9a06; +@sky-blue-1: #729fcf; +@sky-blue-2: #3465a4; +@sky-blue-3: #204a87; +@plum-1: #ad7fa8; +@plum-2: #75507b; +@plum-3: #5c3566; +@scarlet-red-1: #ef2929; +@scarlet-red-2: #cc0000; +@scarlet-red-3: #a40000; +@aluminium-1: #eeeeec; +@aluminium-2: #d3d7cf; +@aluminium-3: #babdb6; +@aluminium-4: #888a85; +@aluminium-5: #555753; +@aluminium-6: #2e3436; -- cgit v1.2.3-54-g00ecf From 8aad7173c48e848d582cf755082e1605a10bf6cb Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 4 Mar 2013 11:12:45 +0100 Subject: xinit: Start MPD updater --- .xinitrc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.xinitrc b/.xinitrc index cf85c60..ab65755 100755 --- a/.xinitrc +++ b/.xinitrc @@ -1,4 +1,26 @@ #!/bin/bash + +function update_mowedline_mpd () +{ + while read action; do + if [ "$action" == "player" ]; then + IFS='' read -ra INFO <<< "`mpc status | tr '\n' `" + + if [ "${INFO[1]}" == "" ]; then + mowedline-client -update mpd "" + else + TXT=" ${INFO[0]}" + ST="`echo ${INFO[1]} | sed 's/\[\(.*\)\] .*/\1/'`" + if [ "$ST" == "paused" ]; then + TXT="$TXT (paused)" + fi + + mowedline-client -update mpd " $TXT" + fi + fi + done +} + xmodmap ~/.Xmodmap # Source scripts in /etc/X11/xinit/xinitrc.d/ @@ -15,5 +37,9 @@ mowedline & xcompmgr -n -r 0 & feh --bg-tile ~/pictures/wallpapers/wallpaper-864137.jpg +{ + mpc idleloop | update_mowedline_mpd +} & + test -n "$1" && wm=$1 || wm="xmonad" exec $wm -- cgit v1.2.3-54-g00ecf From 354fc517436a793685600f6087d19ab3c92b2154 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 10 Mar 2013 13:33:11 +0100 Subject: Emacs: Use yoshi-theme --- emacs/init.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 6589644..7ba2dc0 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -57,10 +57,12 @@ (oni:path-init "/usr/local/emacs/share/emacs/site-lisp")) #+END_SRC - Load naquadah-theme and set my own preferred background color. + Load my preferred theme after emacs has finished starting up. Use + the ~emacs-startup-hook~ to wait until we're sure all ELPA packages + have been loaded. #+BEGIN_SRC emacs-lisp - (add-hook 'emacs-startup-hook (lambda () (load-theme 'naquadah t))) + (add-hook 'emacs-startup-hook (lambda () (load-theme 'yoshi t))) #+END_SRC Add any other interesting paths to =load-path= and, if it exists, -- cgit v1.2.3-54-g00ecf From ed9106f857e974b970adf0340c93c89278c153f8 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 10 Mar 2013 13:36:55 +0100 Subject: Emacs: Reverse-sort org tasks --- emacs/site-lisp/org-init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/site-lisp/org-init.el b/emacs/site-lisp/org-init.el index 4033c30..789b1bb 100644 --- a/emacs/site-lisp/org-init.el +++ b/emacs/site-lisp/org-init.el @@ -77,6 +77,7 @@ (expand-file-name "~/documents/org/misc/bookmarks.org")) "Agenda files that are work-agnostic, should always show up.") +(setq org-agenda-cmp-user-defined (lambda (a b) 1)) (setq org-agenda-custom-commands '(("P" . "Personal only") ("Pa" "Personal agenda" agenda "" @@ -100,7 +101,7 @@ (search . " %i %-12:c"))) (setq org-agenda-sorting-strategy '((agenda habit-down time-up priority-down category-keep) - (todo priority-down category-keep) + (todo user-defined-down) (tags priority-down category-keep) (search category-keep))) (setq org-agenda-tags-column -101) -- cgit v1.2.3-54-g00ecf From 937e2732924ef40dd7f0361f232b3fcca45dd72f Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 11 Mar 2013 00:32:53 +0100 Subject: Emacs: remove org ELPA repo --- emacs/init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index 3104840..064af83 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -130,8 +130,7 @@ (setq message-send-mail-function 'message-send-mail-with-sendmail) (setq message-sendmail-extra-arguments '("-a" "ryuslash")) (setq package-archives - '(("org" . "http://orgmode.org/elpa/") - ("melpa" . "http://melpa.milkbox.net/packages/") + '(("melpa" . "http://melpa.milkbox.net/packages/") ("marmalade" . "http://marmalade-repo.org/packages/") ("gnu" . "http://elpa.gnu.org/packages/"))) (setq package-load-list '((htmlize "1.39") -- cgit v1.2.3-54-g00ecf From 07586eb43b8a5b1f3b92f5095a0077056b49428c Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 11 Mar 2013 00:33:42 +0100 Subject: Emacs: customize my svg-mode-line-theme --- emacs/init.org | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 7ba2dc0..003d229 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -433,10 +433,31 @@ a theme. #+BEGIN_SRC emacs-lisp + (defun oni:smt/minor-mode-indicator-text (widget) + (let ((text (concat + (when (bound-and-true-p auto-complete-mode) "C") + (when (bound-and-true-p auto-fill-mode) "F") + (when (bound-and-true-p eldoc-mode) "D")))) + (if (plusp (length text)) + (concat " " text) + ""))) + + (smt/deftheme yoshi + :prototype 'black-crystal + :local-widgets + (lambda (theme) + (let ((parent-local-widgets + (smt/t-local-widgets (smt/t-prototype theme)))) + (append (list (cons 'minor-modes + (smt/make-widget + :prototye 'minor-modes + :text 'oni:smt/minor-mode-indicator-text))) + parent-local-widgets)))) + (defun oni:enable-svg-mode-line-theme () "Enable `svg-mode-line-theme' and select a theme." (smt/enable) - (smt/set-theme 'black-crystal)) + (smt/set-theme 'yoshi)) (add-hook 'emacs-startup-hook 'oni:enable-svg-mode-line-theme) #+END_SRC -- cgit v1.2.3-54-g00ecf From 47989707515b462b952886acdae24b9a6e119b7a Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 11 Mar 2013 00:40:57 +0100 Subject: Emacs: move ido settings to org --- emacs/init.el | 10 ------- emacs/init.org | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++ emacs/site-lisp/oni.el | 13 --------- 3 files changed, 78 insertions(+), 23 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index 064af83..ca0b82b 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -23,7 +23,6 @@ "Face for the supposedly empty line in commit messages." :group 'local) -(eval-after-load "ido" '(oni:ido-init)) (eval-after-load "jabber" '(oni:jabber-init)) (eval-after-load "newst-treeview" '(require 'newsticker-init)) (eval-after-load "org" '(require 'org-init)) @@ -98,12 +97,6 @@ (setq help-at-pt-display-when-idle t) (setq highlight-80+-columns 72) (setq identica-enable-striping t) -(setq ido-auto-merge-delay-time 1000000) -(setq ido-default-buffer-method 'selected-window) -(setq ido-max-window-height 1) -(setq ido-save-directory-list-file nil) -(setq ido-ubiquitous-command-exceptions - '(org-refile org-capture-refile)) (setq inferior-lisp-program "sbcl") (setq inhibit-default-init t) (setq inhibit-local-menu-bar-menus t) @@ -225,7 +218,6 @@ (global-set-key (kbd "M-2") 'split-window-below) (global-set-key (kbd "M-3") 'split-window-right) (global-set-key (kbd "M-4") 'split-window-horizontally) -(global-set-key (kbd "M-n") 'idomenu) (global-set-key (kbd "M-o") 'other-window) (global-set-key (kbd "\"") 'oni:self-insert-dwim) @@ -270,8 +262,6 @@ (cua-selection-mode t) (electric-indent-mode) (electric-pair-mode) -(ido-mode) -(ido-ubiquitous-mode) (savehist-mode) (show-paren-mode) (winner-mode) diff --git a/emacs/init.org b/emacs/init.org index 003d229..5394f5e 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -516,3 +516,81 @@ (setq jabber-use-global-history nil jabber-history-dir "~/.emacs.d/jabber-hist") #+END_SRC + +* ido + + Keep some buffers from showing up when using ido-mode. Either these + get used very rarely or they don't have any really useful + information in them. + + #+BEGIN_SRC emacs-lisp + (defun oni:ido-init () + "Initialization functionn for ido." + (setq ido-ignore-buffers + (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" + (eval-when-compile + (regexp-opt + '("*-jabber-roster-*" + "*Messages*" + "*fsm-debug*" + "*magit-process*" + "*magit-edit-log*" + "*Backtrace*")))))) + + (eval-after-load "ido" '(oni:ido-init)) + #+END_SRC + + Ido tries to be smart and find files in other directories, I don't + like that, stop doing that (or at least wait a long time). + + #+BEGIN_SRC emacs-lisp + (setq ido-auto-merge-delay-time 1000000) + #+END_SRC + + Open files in the selected window when switching between buffers. + + #+BEGIN_SRC emacs-lisp + (setq ido-default-buffer-method 'selected-window) + #+END_SRC + + Only ever show one line of possibilities when using ido. I hate it + when the minibuffer grows. + + #+BEGIN_SRC emacs-lisp + (setq ido-max-window-height 1) + #+END_SRC + + Don't save ido state between invocations. + + #+BEGIN_SRC emacs-lisp + (setq ido-save-directory-list-file nil) + #+END_SRC + + Enable =ido-mode=. + + #+BEGIN_SRC emacs-lisp + (ido-mode) + #+END_SRC + +** ido-ubiquitous + + Don't use ido when calling =org-refile= or =org-capture-refile=. + + #+BEGIN_SRC emacs-lisp + (setq ido-ubiquitous-command-exceptions + '(org-refile org-capture-refile)) + #+END_SRC + + Enable =ido-ubiquitous=. + + #+BEGIN_SRC emacs-lisp + (ido-ubiquitous-mode) + #+END_SRC + +** idomenu + + Call =idomenu= with ~M-n~. + + #+BEGIN_SRC emacs-lisp + (global-set-key (kbd "M-n") 'idomenu) + #+END_SRC diff --git a/emacs/site-lisp/oni.el b/emacs/site-lisp/oni.el index 9b2df64..37f818d 100644 --- a/emacs/site-lisp/oni.el +++ b/emacs/site-lisp/oni.el @@ -129,19 +129,6 @@ DOT are intentionally being skipped." (fci-mode) (flycheck-mode)) -(defun oni:ido-init () - "Initialization functionn for ido." - (setq ido-ignore-buffers - (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" - (eval-when-compile - (regexp-opt - '("*-jabber-roster-*" - "*Messages*" - "*fsm-debug*" - "*magit-process*" - "*magit-edit-log*" - "*Backtrace*")))))) - (defun oni:indent-shift-left (start end &optional count) "Rigidly indent region. Region is from START to END. Move -- cgit v1.2.3-54-g00ecf From 664df88e9820cff08a2ddf0f1964e5833f2298a9 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:22:12 +0100 Subject: herbstluftwm: Make autostart executable when installing --- .config/herbstluftwm/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/herbstluftwm/Makefile b/.config/herbstluftwm/Makefile index f875c23..62151ad 100644 --- a/.config/herbstluftwm/Makefile +++ b/.config/herbstluftwm/Makefile @@ -2,3 +2,5 @@ DESTDIR:=$(DESTDIR)/herbstluftwm objects=autostart panel.sh include ../../dotfiles.mk + +install-autostart: MODE=744 -- cgit v1.2.3-54-g00ecf From 3a3286c83a5efd337a6ca11f46b484349b78c075 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:22:36 +0100 Subject: herbstluftwm: Replace old config with fresh one --- .config/herbstluftwm/autostart | 183 +++++++++++++++++++++++++---------------- 1 file changed, 114 insertions(+), 69 deletions(-) diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart index cf9b852..a74f1aa 100755 --- a/.config/herbstluftwm/autostart +++ b/.config/herbstluftwm/autostart @@ -1,77 +1,122 @@ -#!/bin/zsh +#!/bin/bash -function hc () { - herbstclient $@ +# this is a simple config for herbstluftwm + +function hc() { + herbstclient "$@" } -modkey="Mod4" - -hc keybind $modkey+Ctrl+b resize left +0.05 -hc keybind $modkey+Ctrl+f resize right +0.05 -hc keybind $modkey+Ctrl+n resize down +0.05 -hc keybind $modkey+Ctrl+p resize up +0.05 -hc keybind $modkey+Ctrl+q quit -hc keybind $modkey+Ctrl+r reload -hc keybind $modkey+Shift+1 spawn dmenu_run -p 'Run:' -b -nb '#111113' -nf '#eeeeec' -sb '#171719' -hc keybind $modkey+Shift+b shift left -hc keybind $modkey+Shift+f shift right -hc keybind $modkey+Shift+n shift down -hc keybind $modkey+Shift+p shift up -hc keybind $modkey+Shift+s split horizontal 0.5 -hc keybind $modkey+b focus -i left -hc keybind $modkey+c spawn urxvt -hc keybind $modkey+comma cycle_monitor -1 -hc keybind $modkey+e spawn emacsclient -ca emacs -hc keybind $modkey+f focus -i right -hc keybind $modkey+k close -hc keybind $modkey+n focus -i down -hc keybind $modkey+o cycle_all -hc keybind $modkey+p focus -i up -hc keybind $modkey+period cycle_monitor 1 -hc keybind $modkey+q remove -hc keybind $modkey+s split vertical 0.5 -hc keybind $modkey+space cycle_layout 1 -hc keybind $modkey+w spawn conkeror -hc keybind Ctrl+Mod1+l spawn i3lock -c 000000 -hc keybind XF86AudioNext spawn mpc next -hc keybind XF86AudioPlay spawn mpc toggle -hc keybind XF86AudioPrev spawn mpc prev -hc keybind XF86AudioStop spawn mpc stop - -hc set default_frame_layout 2 -hc set focus_stealing_prevention 0 -hc set frame_bg_transparent 1 -hc set frame_border_width 0 -hc set raise_on_focus 1 -hc set window_border_active_color "#999999" -hc set window_border_normal_color "#222224" -hc set window_border_width 1 - -hc set_layout max - -hc add default2 -hc remove_monitor 1 -hc move_monitor 0 1920x1080+0+0 -hc add_monitor 1680x1050+1920+0 default2 - -hc pad 0 20 -5 -5 -5 -hc pad 1 -5 -5 -5 -5 - -hc mousebind $modkey-Button1 move -hc mousebind $modkey-Button2 resize -hc mousebind $modkey-Button3 zoom +hc emit_hook reload + +# remove all existing keybindings +hc keyunbind --all + +# keybindings +Mod=Mod4 +hc keybind $Mod-Shift-q quit +hc keybind $Mod-Shift-r reload +hc keybind $Mod-Shift-c close + +hc keybind $Mod-c spawn urxvt +hc keybind $Mod-e spawn emacsclient -ca emacs +hc keybind $Mod-w spawn conkeror + +# tags +TAG_NAMES=( {1..9} ) +TAG_KEYS=( {1..9} 0 ) + +hc rename default "${TAG_NAMES[0]}" || true +for i in ${!TAG_NAMES[@]} ; do + hc add "${TAG_NAMES[$i]}" + key="${TAG_KEYS[$i]}" + if ! [ -z "$key" ] ; then + hc keybind "$Mod-$key" use_index "$i" + hc keybind "$Mod-Shift-$key" move_index "$i" + fi +done + +# cycle through tags +hc keybind $Mod-period use_index +1 --skip-visible +hc keybind $Mod-comma use_index -1 --skip-visible +hc keybind $Mod-Right use_index +1 --skip-visible +hc keybind $Mod-Left use_index -1 --skip-visible +# layouting +hc keybind $Mod-r remove +hc keybind $Mod-space cycle_layout 1 +hc keybind $Mod-u split vertical 0.5 +hc keybind $Mod-o split horizontal 0.5 +hc keybind $Mod-s floating toggle +# hc keybind $Mod-f fullscreen toggle +# hc keybind $Mod-p pseudotile toggle + +# resizing +RESIZESTEP=0.05 +hc keybind $Mod-Control-h resize left +$RESIZESTEP +hc keybind $Mod-Control-j resize down +$RESIZESTEP +hc keybind $Mod-Control-k resize up +$RESIZESTEP +hc keybind $Mod-Control-l resize right +$RESIZESTEP + +# mouse +hc mouseunbind --all +hc mousebind $Mod-Button1 move +hc mousebind $Mod-Button2 resize +hc mousebind $Mod-Button3 zoom + +# focus +hc keybind $Mod-BackSpace cycle_monitor +hc keybind $Mod-Tab cycle_all +1 +hc keybind $Mod-Shift-Tab cycle_all -1 +# hc keybind $Mod-c cycle +hc keybind $Mod-b focus left +hc keybind $Mod-n focus down +hc keybind $Mod-p focus up +hc keybind $Mod-f focus right +hc keybind $Mod-i jumpto urgent +hc keybind $Mod-Shift-h shift left +hc keybind $Mod-Shift-j shift down +hc keybind $Mod-Shift-k shift up +hc keybind $Mod-Shift-l shift right + +# colors +hc set frame_border_active_color '#222222' +hc set frame_border_normal_color '#101010' +hc set frame_bg_normal_color '#565656' +hc set frame_bg_active_color '#345F0C' +hc set frame_border_width 1 +hc set window_border_width 3 +hc set window_border_inner_width 1 +hc set window_border_normal_color '#454545' +hc set window_border_active_color '#9fbc00' +hc set always_show_frame 1 +hc set frame_gap 4 +# add overlapping window borders +hc set window_gap -2 +hc set frame_padding 2 +hc set smart_window_surroundings 0 +hc set smart_frame_surroundings 1 +hc set mouse_recenter_gap 0 + + +# rules hc unrule -F -hc rule focus=on -hc rule windowtype=_NET_WM_WINDOW_TYPE_DIALOG focus=on pseudotile=on -hc rule class=Xephyr pseudotile=on -hc rule instance=Xine\ Window pseudotile=on -hc rule class=Pinentry pseudotile=on -hc rule class=Dispass pseudotile=on -hc rule title="GIMP Startup" pseudotile=on +#hc rule class=XTerm tag=3 # move all xterms to tag 3 +hc rule focus=off # normally do not focus new clients +# give focus to most common terminals +hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on +hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on +hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on +hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off + +# unlock, just to be sure +hc unlock -# xbindkeys +herbstclient set tree_style '╾│ ├└╼─┐' -# ~/.config/herbstluftwm/panel.sh & +# do multi monitor setup here, e.g.: +# hc set_monitors 1280x1024+0+0 1280x1024+1280+0 +# or simply: +# hc detect_monitors -# hc load default "(split horizontal:0.550000:0 (split vertical:0.850000:0 (split horizontal:0.180000:1 (clients max:0) (clients max:0 0x140001a)) (clients max:0)) (clients max:0 0xc00077))" +hc set_monitors 1920x1080+0+0 1680x1050+1920+0 +hc pad 0 21 -- cgit v1.2.3-54-g00ecf From 806ec425bcd66d4d0cdf4da0db50efce6fd61110 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:32:42 +0100 Subject: xinit: Don't use xbindkeys for now --- .xinitrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.xinitrc b/.xinitrc index ab65755..0b85371 100755 --- a/.xinitrc +++ b/.xinitrc @@ -36,6 +36,7 @@ unclutter & mowedline & xcompmgr -n -r 0 & feh --bg-tile ~/pictures/wallpapers/wallpaper-864137.jpg +# xbindkeys { mpc idleloop | update_mowedline_mpd -- cgit v1.2.3-54-g00ecf From 628558a40c6a502e5181cc0b2cb7160c9f0f0dd1 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:32:49 +0100 Subject: xinit: use stumpwm --- .xinitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xinitrc b/.xinitrc index 0b85371..752a432 100755 --- a/.xinitrc +++ b/.xinitrc @@ -42,5 +42,5 @@ feh --bg-tile ~/pictures/wallpapers/wallpaper-864137.jpg mpc idleloop | update_mowedline_mpd } & -test -n "$1" && wm=$1 || wm="xmonad" +test -n "$1" && wm=$1 || wm="stumpwm" exec $wm -- cgit v1.2.3-54-g00ecf From e28ba29d84492ff065c70fe003f517cbc326dc25 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:33:08 +0100 Subject: Emacs: Remove transparency --- emacs/init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index ca0b82b..66e37d4 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -86,8 +86,7 @@ (vertical-scroll-bars . nil) (menu-bar-lines . nil) (tool-bar-lines . nil) - (font . "Envy Code R:pixelsize=18") - (alpha 90 90))) + (font . "Envy Code R:pixelsize=18"))) (setq elnode-do-init nil) (setq fci-rule-color "darkred") (setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) -- cgit v1.2.3-54-g00ecf From a5c9f6c9c3338a90d0bd11a6d13ee8724503d4fd Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:33:59 +0100 Subject: Emacs: Move some more jabber settings to org --- emacs/init.el | 4 ---- emacs/init.org | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index 66e37d4..fa5a93b 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -23,7 +23,6 @@ "Face for the supposedly empty line in commit messages." :group 'local) -(eval-after-load "jabber" '(oni:jabber-init)) (eval-after-load "newst-treeview" '(require 'newsticker-init)) (eval-after-load "org" '(require 'org-init)) (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) @@ -102,9 +101,6 @@ (setq inhibit-startup-message t) (setq initial-major-mode 'emacs-lisp-mode) (setq initial-scratch-message nil) -(setq jabber-account-list '(("ryuslash@jabber.org") - ("tom@ryuslash.org/drd" - (:connection-type . ssl)))) (setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") (setq jabber-chat-buffer-format "*jab:%n*") (setq jabber-chat-buffer-show-avatar nil) diff --git a/emacs/init.org b/emacs/init.org index 5394f5e..7fc6a8d 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -487,6 +487,16 @@ * jabber + Don't echo presence updates in the message area. + + #+BEGIN_SRC emacs-lisp + (defun oni:jabber-init () + "Initialization function for jabber." + (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) + + (eval-after-load "jabber" '(oni:jabber-init)) + #+END_SRC + Require ~jabber-libnotify~ so we can use its alert functions. #+BEGIN_SRC emacs-lisp @@ -517,6 +527,14 @@ jabber-history-dir "~/.emacs.d/jabber-hist") #+END_SRC + Add some accounts. + + #+BEGIN_SRC emacs-lisp + (setq jabber-account-list '(("ryuslash@jabber.org") + ("tom@ryuslash.org/drd" + (:connection-type . ssl)))) + #+END_SRC + * ido Keep some buffers from showing up when using ido-mode. Either these -- cgit v1.2.3-54-g00ecf From 9da019d7e8394076c9c5e19b2842fb7fd1123c6b Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:34:32 +0100 Subject: Emacs: Rewrite part of index.org --- emacs/init.org | 238 +++++++++++++++++++-------------------------------------- 1 file changed, 80 insertions(+), 158 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 7fc6a8d..62656f2 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -4,164 +4,86 @@ #+PROPERTY: tangle init2.el #+STARTUP: showall -* GUI - - These things should happen early, so that Emacs will look the way I - want it to as quickly as is possible. - -** menu-bar-mode - - Disable =menu-bar-mode= since I haven't used the menu bar much ever, - even when I first started using Emacs. - - #+BEGIN_SRC emacs-lisp - (menu-bar-mode -1) - #+END_SRC - -** scroll-bar-mode - - Since Emacs gives a pretty good indication of where in the buffer - I'm working I really don't need to have the scroll bar visible. - - #+BEGIN_SRC emacs-lisp - (scroll-bar-mode -1) - #+END_SRC - -** tool-bar-mode - - I've never used the tool bar much, so remove it. - - #+BEGIN_SRC emacs-lisp - (tool-bar-mode -1) - #+END_SRC - -* load-path - - Before doing anything else I should make sure that both the - directories ~/usr/local/emacs/share/emacs/site-lisp~ and - ~/usr/share/emacs/site-list~ are included in =load-path=, along with - their subdirectories, but only if they haven't already been added - and exist. Place them at the end of =load-path= so they don't mess up - package precedence. - - #+BEGIN_SRC emacs-lisp - (eval-and-compile - (defun oni:path-init (dir) - "Add DIR to `load-path' and all its subdirectories, unless - DIR is already in `load-path'." - (unless (or (member dir load-path) (not (file-exists-p dir))) - (let ((default-directory dir)) - (add-to-list 'load-path dir t) - (normal-top-level-add-subdirs-to-load-path)))) - (oni:path-init "/usr/share/emacs/site-lisp") - (oni:path-init "/usr/local/emacs/share/emacs/site-lisp")) - #+END_SRC - - Load my preferred theme after emacs has finished starting up. Use - the ~emacs-startup-hook~ to wait until we're sure all ELPA packages - have been loaded. - - #+BEGIN_SRC emacs-lisp - (add-hook 'emacs-startup-hook (lambda () (load-theme 'yoshi t))) - #+END_SRC - - Add any other interesting paths to =load-path= and, if it exists, - load the ~loaddefs.el~ file from these directories. - - #+BEGIN_SRC emacs-lisp - (mapc #'(lambda (dir) - (add-to-list 'load-path dir) - (let ((loaddefs (concat dir "/loaddefs.el"))) - (when (file-exists-p loaddefs) - (load loaddefs)))) - '("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp" - "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode" - "/usr/local/org-mode/share/emacs/site-lisp/org")) - #+END_SRC - -* y-or-n-p - - Don't ask ~yes~ or ~no~, ask ~y~ or ~n~, I've never had an accidental ~y~ so - far. - - #+BEGIN_SRC emacs-lisp - (defalias 'yes-or-no-p 'y-or-n-p) - #+END_SRC - -* ibuffer - - Use =ibuffer= instead of the default =list-buffers= because it has many - more features. - - #+BEGIN_SRC emacs-lisp - (defalias 'list-buffers 'ibuffer) - #+END_SRC - -* hippie-expand - - Do the same with =hippie-expand= and =dabbrev-expand=. - - #+BEGIN_SRC emacs-lisp - (defalias 'dabbrev-expand 'hippie-expand) - #+END_SRC - -* eldoc - - Don't show it when ~eldoc~ is running, I almost assume that it is - whenever I'm working in a mode that supports it anyway. This should - only execute once ~eldoc~ has been loaded. - - #+BEGIN_SRC emacs-lisp - (eval-after-load "eldoc" '(diminish 'eldoc-mode)) - #+END_SRC - -* emms - - Use the standard EMMS configuration and add some MPD settings. - - #+BEGIN_SRC emacs-lisp - (defun oni:emms-init () - "Initialization function for EMMS." - (require 'emms-setup) - (require 'emms-player-mpd) - - (emms-standard) - - (add-to-list 'emms-info-functions 'emms-info-mpd) - (add-to-list 'emms-player-list 'emms-player-mpd) - - (setq emms-player-mpd-server-name "localhost") - (setq emms-player-mpd-server-port "6600") - (setq emms-player-mpd-music-directory "/mnt/music/mp3")) - - (eval-after-load "emms-source-file" '(oni:emms-init)) - (setq emms-source-file-default-directory "/mnt/music/") - #+END_SRC - - Add some keybindings for EMMS. - - #+BEGIN_SRC emacs-lisp - (defun oni:emms-toggle-playing () - "Toggle between playing/paused states." - (interactive) - (if (eq emms-player-playing-p nil) - (emms-start) - (emms-pause))) - - (defun oni:start-emms () - "Check to see if the function `emms' exists, if not call - `emms-player-mpd-connect' and assume that will have loaded it." - (interactive) - (unless (fboundp 'emms) - (emms-player-mpd-connect)) - (emms)) - - (global-set-key (kbd "") 'emms-next) - (global-set-key (kbd "") 'oni:emms-toggle-playing) - (global-set-key (kbd "") 'emms-previous) - (global-set-key (kbd "") 'emms-stop) - (global-set-key (kbd "") 'oni:start-emms) - #+END_SRC +Disable the ~menu-bar-mode~, ~tool-bar-mode~ and ~scroll-bar-mode~ early on +so the disappear quickly after emacs starts up. + +#+BEGIN_SRC emacs-lisp + (menu-bar-mode -1) + (scroll-bar-mode -1) + (tool-bar-mode -1) +#+END_SRC + +Define a macro for deferring code until after emacs has started up. + +#+BEGIN_SRC emacs-lisp + (defmacro eval-after-init (&rest body) + "Defer execution of BODY until after Emacs init." + `(add-hook 'emacs-startup-hook #'(lambda () ,@body))) +#+END_SRC + +Add ~/usr/share/emacs/site-lisp~ and +~/usr/local/emacs/share/emacs/site-lisp~ and all their sub-directories +to the ~load-path~ so I can use modules from both Emacs from the +official repository *and* the self-compiled one. + +This should be done both when compiling the elisp file and when +loading it so it doesn't complain about missing modules and such. + +#+BEGIN_SRC emacs-lisp + (eval-and-compile + (defun oni:path-init (dir) + "Add DIR to `load-path' and all its subdirectories, unless + DIR is already in `load-path'." + (unless (or (member dir load-path) (not (file-exists-p dir))) + (let ((default-directory dir)) + (add-to-list 'load-path dir t) + (normal-top-level-add-subdirs-to-load-path)))) + (oni:path-init "/usr/share/emacs/site-lisp") + (oni:path-init "/usr/local/emacs/share/emacs/site-lisp")) +#+END_SRC + +Defer loading my theme until after emacs initialization. This is +because it has been installed with ~package.el~, and the packages aren't +added to the ~load-path~ until _after_ ~init.el~ has been run through. + +#+BEGIN_SRC emacs-lisp + (eval-after-init (load-theme 'yoshi t)) +#+END_SRC + +Add some of my project directories and other important directories +into ~load-path~ so I can easily load libraries in them. Also, if it +exists, load ~loaddefs.el~ in each directory for autoloads. + +#+BEGIN_SRC emacs-lisp + (mapc #'(lambda (dir) + (add-to-list 'load-path dir) + (let ((loaddefs (concat dir "/loaddefs.el"))) + (when (file-exists-p loaddefs) + (load loaddefs)))) + '("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp" + "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode" + "/usr/local/org-mode/share/emacs/site-lisp/org")) +#+END_SRC + +Replace the question of ~yes~ or ~no~ with just ~y~ or ~n~, I have never (yet) +accidentally typed a ~y~ or ~n~ when asked and typing ~yes~ or ~no~ is just +too much work. + +#+BEGIN_SRC emacs-lisp + (defalias 'yes-or-no-p 'y-or-n-p) +#+END_SRC + +Replace these functions with better alternatives. They offer the same +functionality, plus more. + +#+BEGIN_SRC emacs-lisp + (defalias 'list-buffers 'ibuffer) + (defalias 'dabbrev-expand 'hippie-expand) +#+END_SRC + +#+BEGIN_SRC emacs-lisp + (setq compilation-scroll-output t) +#+END_SRC * flymake -- cgit v1.2.3-54-g00ecf From 7db1567d040140e6fc8c589e8cbc7a48f44b960c Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:34:56 +0100 Subject: Emacs: Add jabber-activity widget to mode-line --- emacs/init.org | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 62656f2..235b730 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -364,17 +364,34 @@ functionality, plus more. (concat " " text) ""))) - (smt/deftheme yoshi - :prototype 'black-crystal - :local-widgets - (lambda (theme) - (let ((parent-local-widgets - (smt/t-local-widgets (smt/t-prototype theme)))) - (append (list (cons 'minor-modes - (smt/make-widget - :prototye 'minor-modes - :text 'oni:smt/minor-mode-indicator-text))) - parent-local-widgets)))) + (defun oni:jabber-activity (widget) + (when (boundp 'jabber-activity-mode-string) + (concat jabber-activity-mode-string " "))) + + (eval-after-load "svg-mode-line-themes" + '(progn + (smt/defwidget oni:jabber-activity-widget + :text 'oni:jabber-activity) + + (smt/defrow oni:default-right + :widgets '(oni:jabber-activity-widget major-mode version-control + minor-modes) + :align "right" + :margin 14) + + (smt/deftheme yoshi + :prototype 'black-crystal + :local-widgets + (lambda (theme) + (let ((parent-local-widgets + (smt/t-local-widgets (smt/t-prototype theme)))) + (append + (list (cons 'minor-modes + (smt/make-widget + :prototye 'minor-modes + :text 'oni:smt/minor-mode-indicator-text))) + parent-local-widgets))) + :rows '(default-left default-position oni:default-right)))) (defun oni:enable-svg-mode-line-theme () "Enable `svg-mode-line-theme' and select a theme." -- cgit v1.2.3-54-g00ecf From d000ec7a4ca50c51590978b812d2ca711c966148 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:35:15 +0100 Subject: Emacs: Ignore the ibuffer buffer in ido --- emacs/init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 235b730..f1393be 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -492,7 +492,8 @@ functionality, plus more. "*fsm-debug*" "*magit-process*" "*magit-edit-log*" - "*Backtrace*")))))) + "*Backtrace*" + "*Ibuffer*")))))) (eval-after-load "ido" '(oni:ido-init)) #+END_SRC -- cgit v1.2.3-54-g00ecf From b7fd0e603bfd6a080baf06fe5e10ad14e408d16f Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:35:31 +0100 Subject: Emacs: Start ido-ubiquitous after init --- emacs/init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index f1393be..544de26 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -542,7 +542,7 @@ functionality, plus more. Enable =ido-ubiquitous=. #+BEGIN_SRC emacs-lisp - (ido-ubiquitous-mode) + (add-hook 'emacs-startup-hook 'ido-ubiquitous-mode) #+END_SRC ** idomenu -- cgit v1.2.3-54-g00ecf From 161924268f1eea8d468f7aafe4a72e12a4dda752 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:36:15 +0100 Subject: Emacs: Add some mode-line, minibuffer and jedi settings --- emacs/init.org | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index 544de26..2ab5eb5 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -552,3 +552,42 @@ functionality, plus more. #+BEGIN_SRC emacs-lisp (global-set-key (kbd "M-n") 'idomenu) #+END_SRC + +* minibuffer + + A new feature in Emacs 24.3 can shorten ~(default ...)~ to ~[...]~ when + prompting for something. The =minibuffer-eldef-shorten-default= should + be set before enabling the =minibuffer-electric-default-mode=. + + #+BEGIN_SRC emacs-lisp + (setq minibuffer-eldef-shorten-default t) + (minibuffer-electric-default-mode) + #+END_SRC + +* mode-line + + Don't show any default help messages, if no help message was + specified, just leave the echo area empty. + + #+BEGIN_SRC emacs-lisp + (setq mode-line-default-help-echo "") + #+END_SRC + +* jedi + + Start jedi when =python-mode= is started. + + #+BEGIN_SRC emacs-lisp + (eval-after-load "jedi" '(setcar jedi:server-command "python2")) + (add-hook 'python-mode-hook 'jedi:setup) + #+END_SRC + + Show argument lists and such in the echo area. + + #+BEGIN_SRC emacs-lisp + (setq jedi:tooltip-method nil) + #+END_SRC + +# Local Variables: +# eval: (flyspell-mode 1) +# End: -- cgit v1.2.3-54-g00ecf From afba3f97aee13d6d52b577dc28089d9fd9596bf0 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:37:00 +0100 Subject: Emacs: Hide compilation window more consistently --- emacs/site-lisp/ext.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/emacs/site-lisp/ext.el b/emacs/site-lisp/ext.el index d6abaa6..d9e1973 100644 --- a/emacs/site-lisp/ext.el +++ b/emacs/site-lisp/ext.el @@ -44,8 +44,9 @@ ;; there were errors (message "compilation errors, press C-x ` to visit") ;; no errors, make the compilation window go away in 0.5 seconds - (run-at-time 0.5 nil 'delete-windows-on buf) - (message "No compilation errors!"))) + (when (member (buffer-name) '("*Compilation*" "*compilation*")) + (run-at-time 0.5 nil 'delete-windows-on buf) + (message "No compilation errors!")))) (defun ext:reload-buffer () "Reload current buffer." -- cgit v1.2.3-54-g00ecf From d9fec92e0babba26580f2bac4e91408bda227a24 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:38:21 +0100 Subject: Emacs: Remove jabber-init from oni.el It was moved to init.org some commits ago --- emacs/site-lisp/oni.el | 4 ---- 1 file changed, 4 deletions(-) diff --git a/emacs/site-lisp/oni.el b/emacs/site-lisp/oni.el index 37f818d..9ff1ee4 100644 --- a/emacs/site-lisp/oni.el +++ b/emacs/site-lisp/oni.el @@ -178,10 +178,6 @@ If COUNT has been specified indent by that much, otherwise look at "Function for `jabber-chat-mode-hook'." (visual-line-mode)) -(defun oni:jabber-init () - "Initialization function for jabber." - (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) - (defun oni:jabber-roster-mode-func () "Function for `jabber-roster-mode-hook'." (setq mode-line-format -- cgit v1.2.3-54-g00ecf From 534a2e1ab752030869778ea34eadd086bacc83f3 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 23 Mar 2013 14:02:16 +0100 Subject: Emacs: Enable paredit for lisp-like languages --- emacs/init.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index 2ab5eb5..70b134c 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -85,6 +85,13 @@ functionality, plus more. (setq compilation-scroll-output t) #+END_SRC +#+BEGIN_SRC emacs-lisp + (add-hook 'clojure-mode-hook 'paredit-mode) + (add-hook 'emacs-lisp-mode-hook 'paredit-mode) + (add-hook 'lisp-mode-hook 'paredit-mode) + (add-hook 'scheme-mode-hook 'paredit-mode) +#+END_SRC + * flymake Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to -- cgit v1.2.3-54-g00ecf From d215db6c7b8d8091a51d78c869c2486595ad265d Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 23 Mar 2013 14:02:56 +0100 Subject: Emacs: Fix minor modes widget --- emacs/init.org | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 70b134c..531e6d5 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -363,10 +363,17 @@ functionality, plus more. #+BEGIN_SRC emacs-lisp (defun oni:smt/minor-mode-indicator-text (widget) - (let ((text (concat - (when (bound-and-true-p auto-complete-mode) "C") - (when (bound-and-true-p auto-fill-mode) "F") - (when (bound-and-true-p eldoc-mode) "D")))) + (let* ((mm-alist '((auto-complete-mode . "AC ") + (auto-fill-mode . "AF ") + (eldoc-mode . "LD ") + (paredit-mode . "()"))) + (text (apply 'concat + (mapcar + (lambda (pair) + (when (and (boundp (car pair)) + (symbol-value (car pair))) + (cdr pair))) + mm-alist)))) (if (plusp (length text)) (concat " " text) ""))) -- cgit v1.2.3-54-g00ecf From 19f2259f1a8706159121ad5157c4dfd496eecdfc Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 23 Mar 2013 14:03:17 +0100 Subject: zsh: Add /usr/local/clark to PATH and INFOPATH --- .zprofile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.zprofile b/.zprofile index 631e8a0..b6ee4f7 100644 --- a/.zprofile +++ b/.zprofile @@ -1,10 +1,16 @@ export BROWSER=conkeror export EDITOR="emacsclient -c -a emacs" -export INFOPATH="${HOME}/documents/info:/usr/local/emacs/share/info:/usr/share/info:/usr/local/stumpwm/share/info" + +INFOPATH="$HOME/documents/info" +INFOPATH="$INFOPATH:/usr/local/emacs/share/info" +INFOPATH="$INFOPATH:/usr/share/info" +INFOPATH="$INFOPATH:/usr/local/clark/share/info" +export INFOPATH="$INFOPATH:/usr/local/stumpwm/share/info" PATH="${HOME}/usr/bin:${PATH}:/usr/local/bin:/usr/local/stumpwm/bin" PATH="/usr/local/scwm/bin:$PATH" PATH="/usr/local/clfswm/bin:$PATH" +PATH="/usr/local/clark/bin:$PATH" export PATH="/usr/local/emacs/bin:$PATH" if [ -z "$SSH_AGENT_PID" ]; then -- cgit v1.2.3-54-g00ecf From 8c69461ebf9480001213e9c0cd2b78003d7c3fb6 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 23 Mar 2013 14:05:00 +0100 Subject: xinit: Start emacs daemon --- .xinitrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.xinitrc b/.xinitrc index 752a432..eea0991 100755 --- a/.xinitrc +++ b/.xinitrc @@ -31,6 +31,7 @@ if [ -d /etc/X11/xinit/xinitrc.d ]; then unset f fi +emacs --daemon & redshift -l 51.1180:4.0012 & unclutter & mowedline & -- cgit v1.2.3-54-g00ecf From 8f8d6879490a9829b55972f08c39c5c887e25830 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 23 Mar 2013 14:05:17 +0100 Subject: Conkeror: Replace markam with CLark --- .conkerorrc/init.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index 5775492..9db702c 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -1,10 +1,10 @@ require("content-policy.js"); require("favicon"); -load_paths.push("file:///home/slash/projects/markam/conkeror/"); +load_paths.push("file:///usr/local/clark/share/conkeror/modules/"); theme_load_paths.push("/home/slash/.conkerorrc/themes/"); -require("markam"); +require("clark"); define_browser_object_class( "history-url", null, @@ -159,7 +159,7 @@ define_key(content_buffer_normal_keymap, "C-y", "paste-url-new-buffer"); define_key(content_buffer_normal_keymap, "H", "find-url-from-history"); define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer"); define_key(default_base_keymap, "C-x f", "follow-new-buffer"); -define_key(content_buffer_normal_keymap, "b", "markam-add"); +define_key(content_buffer_normal_keymap, "b", "clark-add"); add_hook("before_quit_hook", oni_before_quit_func); add_hook("content_policy_hook", content_policy_bytype); -- cgit v1.2.3-54-g00ecf From 4d406485882e3680c187f0e1400fb301df94a995 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 24 Mar 2013 22:00:45 +0100 Subject: conkeror: Change keybinding and mode-line widgets --- .conkerorrc/init.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index 9db702c..f816f42 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -159,12 +159,13 @@ define_key(content_buffer_normal_keymap, "C-y", "paste-url-new-buffer"); define_key(content_buffer_normal_keymap, "H", "find-url-from-history"); define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer"); define_key(default_base_keymap, "C-x f", "follow-new-buffer"); -define_key(content_buffer_normal_keymap, "b", "clark-add"); +define_key(content_buffer_normal_keymap, "b", clark_keymap); add_hook("before_quit_hook", oni_before_quit_func); add_hook("content_policy_hook", content_policy_bytype); -add_hook("mode_line_hook", mode_line_adder(buffer_count_widget, true)); -add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget, true)); +add_hook("mode_line_hook", mode_line_adder(buffer_count_widget)); +add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget), true); +add_hook("mode_line_hook", mode_line_adder(clark_bookmarked_widget), true); add_hook("mode_line_hook", mode_line_adder(downloads_status_widget)); remove_hook("download_added_hook", open_download_buffer_automatically); -- cgit v1.2.3-54-g00ecf From 6a6410492e90857cc21487d139a79b841b81f4dc Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 24 Mar 2013 23:59:23 +0100 Subject: conkeror: Add yoshi theme --- .conkerorrc/init.js | 2 +- .conkerorrc/themes/Makefile | 2 +- .conkerorrc/themes/yoshi/Makefile | 5 +++ .conkerorrc/themes/yoshi/conkeror--scrollbars.css | 36 +++++++++++++++ .conkerorrc/themes/yoshi/hints--url-panel.css | 17 +++++++ .conkerorrc/themes/yoshi/minibuffer.css | 49 ++++++++++++++++++++ .conkerorrc/themes/yoshi/mode-line.css | 11 +++++ .conkerorrc/themes/yoshi/new-tabs.css | 54 +++++++++++++++++++++++ .conkerorrc/themes/yoshi/tab-bar.css | 41 +++++++++++++++++ .conkerorrc/themes/yoshi/theme.json | 9 ++++ 10 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 .conkerorrc/themes/yoshi/Makefile create mode 100644 .conkerorrc/themes/yoshi/conkeror--scrollbars.css create mode 100644 .conkerorrc/themes/yoshi/hints--url-panel.css create mode 100644 .conkerorrc/themes/yoshi/minibuffer.css create mode 100644 .conkerorrc/themes/yoshi/mode-line.css create mode 100644 .conkerorrc/themes/yoshi/new-tabs.css create mode 100644 .conkerorrc/themes/yoshi/tab-bar.css create mode 100644 .conkerorrc/themes/yoshi/theme.json diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index f816f42..1fc2ebd 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -171,7 +171,7 @@ add_hook("mode_line_hook", mode_line_adder(downloads_status_widget)); remove_hook("download_added_hook", open_download_buffer_automatically); hints_minibuffer_annotation_mode(true); -theme_load("naquadah"); +theme_load("yoshi"); external_content_handlers.set("application/pdf", "xpdf"); diff --git a/.conkerorrc/themes/Makefile b/.conkerorrc/themes/Makefile index a88d833..adb917a 100644 --- a/.conkerorrc/themes/Makefile +++ b/.conkerorrc/themes/Makefile @@ -1,4 +1,4 @@ DESTDIR:=$(DESTDIR)/themes -modules=naquadah +modules=naquadah yoshi include ../../dotfiles.mk diff --git a/.conkerorrc/themes/yoshi/Makefile b/.conkerorrc/themes/yoshi/Makefile new file mode 100644 index 0000000..158dade --- /dev/null +++ b/.conkerorrc/themes/yoshi/Makefile @@ -0,0 +1,5 @@ +DESTDIR:=$(DESTDIR)/yoshi +objects=conkeror--scrollbars.css hints--url-panel.css minibuffer.css \ + mode-line.css new-tabs.css tab-bar.css theme.json + +include ../../../dotfiles.mk diff --git a/.conkerorrc/themes/yoshi/conkeror--scrollbars.css b/.conkerorrc/themes/yoshi/conkeror--scrollbars.css new file mode 100644 index 0000000..0f70e96 --- /dev/null +++ b/.conkerorrc/themes/yoshi/conkeror--scrollbars.css @@ -0,0 +1,36 @@ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* The "background" behind the scrolling part of the scrollbar. */ +scrollbar { + background-color: #222; +} + +/* corner between horizontal and vertical scrollbars */ +scrollcorner { + background-color: black; +} + +/* The scroll up/down buttons. */ +scrollbarbutton { + background-color: #666; +} + +/* The actual scrolling part of the scrollbar. */ +thumb { + background-color: #666; +} + +thumb, scrollbarbutton { + -moz-border-bottom-colors: #000 #333; + -moz-border-left-colors: #aaa #888; + -moz-border-right-colors: #000 #333; + -moz-border-top-colors: #aaa #888; +} + +scrollbarbutton:hover:active, scrollbarbutton[active="true"] { + -moz-border-bottom-colors: #aaa #888; + -moz-border-left-colors: #000 #333; + -moz-border-right-colors: #aaa #888; + -moz-border-top-colors: #000 #333; +} diff --git a/.conkerorrc/themes/yoshi/hints--url-panel.css b/.conkerorrc/themes/yoshi/hints--url-panel.css new file mode 100644 index 0000000..143f3c1 --- /dev/null +++ b/.conkerorrc/themes/yoshi/hints--url-panel.css @@ -0,0 +1,17 @@ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +.panel { + border-top: 4px double #333333; + color: white; + background-color: black; +} + +.panel .panel-row-label { + font-weight: bold; +} + +.panel .url-panel-label { + font-weight: bold; +} + diff --git a/.conkerorrc/themes/yoshi/minibuffer.css b/.conkerorrc/themes/yoshi/minibuffer.css new file mode 100644 index 0000000..12ca4e8 --- /dev/null +++ b/.conkerorrc/themes/yoshi/minibuffer.css @@ -0,0 +1,49 @@ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +#minibuffer { + background-color: #111113; + border: none; + color: #EEEEEC; + font: 16px "Envy Code R"; +} + +#minibuffer-input, #minibuffer-input * { + color: #EEEEEC; +} + +#minibuffer-prompt { + color: #EEEEEC; +} + +/* Completions display */ + +tree.completions treechildren { border: none !important; } + +tree.completions treecol { -moz-binding: none !important; } +tree.completions { + -moz-appearance: none !important; + border: 0px none !important; + background-color: #111113 !important; + -moz-border-top-colors: -moz-initial !important; + color: #EEEEEC !important; + font: 18px "Envy Code R"; +} + +tree.completions treechildren::-moz-tree-row { + background-color: #111113 !important; + border: none; +} + +tree.completions treechildren::-moz-tree-row(current) { + background-color: #536580 !important; + color: #EEEEEC; +} + +tree.completions treechildren::-moz-tree-cell-text(completion-description) { + color: #b8ffa6 !important; +} + +tree.completions treechildren::-moz-tree-cell-text(current) { + color: #EEEEEC !important; +} diff --git a/.conkerorrc/themes/yoshi/mode-line.css b/.conkerorrc/themes/yoshi/mode-line.css new file mode 100644 index 0000000..31aabd7 --- /dev/null +++ b/.conkerorrc/themes/yoshi/mode-line.css @@ -0,0 +1,11 @@ +.mode-line { + font: 16px "Envy Code R"; + padding: 0px; + border: none; + color: #EEEEEC; + background-color: #222224; +} + +.mode-line label { + color: #EEEEEC; +} diff --git a/.conkerorrc/themes/yoshi/new-tabs.css b/.conkerorrc/themes/yoshi/new-tabs.css new file mode 100644 index 0000000..f5d30c0 --- /dev/null +++ b/.conkerorrc/themes/yoshi/new-tabs.css @@ -0,0 +1,54 @@ +#tab2-bar { + background: #222; +} + +.tab2 { + margin: 2px 0px 0px 2px; + padding: 0px; + height: 22px; + border-width: 2px; + border-bottom-width: 0; + border-style: solid; + -moz-border-radius: 3px 3px 0 0; + -moz-border-left-colors: #888 #555; + -moz-border-right-colors: #000 #171717; + -moz-border-top-colors: #888 #555; + background: #333; + min-width: 200px; + max-width: 200px; + overflow: hidden; /* Chops end of label */ +} + +.tab2[selected=true] { + -moz-border-left-colors: #aaa #888; + -moz-border-right-colors: #000 #333; + -moz-border-top-colors: #aaa #888; + background: #666; +} + +.tab2:hover { + -moz-border-left-colors: #eee #bbb; + -moz-border-right-colors: #333 #666; + -moz-border-top-colors: #eee #bbb; + background: #999; +} + +.tab2-label { + margin-left: 4px; + padding-top: 1px; + color: #fff; + font: 11px Tahoma; +} + +.tab2-icon { + margin: 1px !important; + padding: 1px; + width: 20px; + height: 15px; + max-height: 15px; + -moz-border-radius: 1px; + background: black; + color: white; + font: 900 11px Tahoma; + text-align: center; +} diff --git a/.conkerorrc/themes/yoshi/tab-bar.css b/.conkerorrc/themes/yoshi/tab-bar.css new file mode 100644 index 0000000..c451778 --- /dev/null +++ b/.conkerorrc/themes/yoshi/tab-bar.css @@ -0,0 +1,41 @@ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* TABS */ +#tab2-bar { + background: #000; +} + +#tab2-bar .tab2 { + margin: 0; + padding: 0; + border: none; + /*height: 19px; + border: 1px solid #666; + min-width: 200px; + max-width: 200px;*/ + background: #333; + overflow: hidden; +} + +#tab2-bar .tab2-label { + margin: 0; + color: white; + font: 11px Tahoma; +} + +#tab2-bar .tab2-icon { + height: 16px; + width: 16px; + background: #222; + color: white; + border: 1px solid #999; + font: 900 11px Tahoma; + text-align: center; +} + +#tab2-bar .tab2[selected=true] { + border: 1px solid white; + background: #666; + border: 1px solid #999; +} diff --git a/.conkerorrc/themes/yoshi/theme.json b/.conkerorrc/themes/yoshi/theme.json new file mode 100644 index 0000000..bb74ee1 --- /dev/null +++ b/.conkerorrc/themes/yoshi/theme.json @@ -0,0 +1,9 @@ +{ "sheets" : [ + "conkeror--scrollbars.css", + "new-tabs.css", + "minibuffer.css", + "mode-line.css", + "hints--url-panel.css", + "tab-bar.css" + ] +} -- cgit v1.2.3-54-g00ecf From 1847e330d6ac0b21893435743ce98516898eb216 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 27 Mar 2013 00:42:43 +0100 Subject: stumpwm: Add hooks for (un)locking the screen When locked, these hooks set my jabber presence to "away" and pause MPD if it's playing. When unlocked they set my jabber presence to "online" and resume MPD if it was playing before. --- .stumpwmrc | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/.stumpwmrc b/.stumpwmrc index bdc7395..e7c4af6 100644 --- a/.stumpwmrc +++ b/.stumpwmrc @@ -3,6 +3,16 @@ (in-package :stumpwm) +(require 'cl-ppcre) + +(defmacro elisp (&body body) + "Run BODY through emacsclient." + `(sb-ext:run-program + "/usr/bin/emacsclient" + '("-e" + ,(string-downcase (format nil "~S" (cons 'progn body)))) + :wait nil)) + ;; Naquadah (defun colour (key) (let ((colours (list :aluminium-1 #xeeeeec @@ -47,6 +57,12 @@ "The executable to run to start i3lock.") (defvar *urxvt-program* "urxvt" "The executable to run to start URxvt.") +(defvar *lock-screen-hook* nil + "Hook run right before the screen gets locked.") +(defvar *screen-unlocked-hook* nil + "Hook run right after the screen is unlocked.") +(defvar *mpd-was-playing-p* nil + "Indicator of whether or not MPD was playing when it was paused.") (defun get-mail-count (mailbox &optional (inbox "inbox")) "Check how many new messages there are in MAILBOX." @@ -55,6 +71,38 @@ (format nil "/home/slash/documents/mail/~A/~A/new/*.*" mailbox inbox)))) +(defun mpd-playing-p () + "Check if MPD is currently in the playing state." + (and (cl-ppcre:scan + "\\n\\[playing\\]" + (with-output-to-string (status) + (sb-ext:run-program "/usr/bin/mpc" '() :output status))) + t)) + +(defun set-jabber-away () + "Tell emacs to set jabber to away presence." + (elisp + (when (and (fboundp 'jabber-send-away-presence) + *jabber-connected*) + (jabber-send-away-presence)))) + +(defun set-jabber-online () + "Tel emacs to set jabber to online presence." + (elisp + (when (and (fboundp 'jabber-send-default-presence) + *jabber-connected*) + (jabber-send-default-presence)))) + +(defun mpd-pause () + "Pause MPD playback." + (when (setf *mpd-was-playing-p* (mpd-playing-p)) + (sb-ext:run-program "/usr/bin/mpc" '("pause") :wait nil))) + +(defun mpd-play () + "Resume MPD playback." + (when *mpd-was-playing-p* + (sb-ext:run-program "/usr/bin/mpc" '("play") :wait nil))) + (defcommand run-emacs () () "Open Emacs" (run-shell-command *emacs-program*)) @@ -87,9 +135,15 @@ "Open URxvt" (run-or-raise *urxvt-program* '(:class "URxvt"))) -(defcommand run-i3lock () () - "Lock screen" - (run-shell-command *i3lock-program*)) +(defcommand lock-screen () () + "Lock the screen using i3lock. Run *lock-screen-hook* before locking +it and run *screen-unlocked-hook* after it has been unlocked." + (run-hook *lock-screen-hook*) + (sb-ext:run-program + "/usr/bin/i3lock" '("-n" "-c" "000000") :wait nil + :status-hook (lambda (p) + (when (eq (sb-ext:process-status p) :exited) + (run-hook *screen-unlocked-hook*))))) (set-bg-color (colour :background)) (set-border-color (colour :aluminium-6)) @@ -123,11 +177,16 @@ (get-mail-count "ninthfloor"))) '(:eval (format-expand *window-formatters* *window-format* - (current-window))))) + (current-window))))) + +(add-hook *lock-screen-hook* 'set-jabber-away) +(add-hook *lock-screen-hook* 'mpd-pause) +(add-hook *screen-unlocked-hook* 'set-jabber-online) +(add-hook *screen-unlocked-hook* 'mpd-play) (set-prefix-key (kbd "C-z")) -(define-key *top-map* (kbd "C-M-l") "run-i3lock") +(define-key *top-map* (kbd "C-M-l") "lock-screen") (define-key *root-map* (kbd "c") "raise-urxvt") (define-key *root-map* (kbd "C") "run-urxvt") -- cgit v1.2.3-54-g00ecf From 12ce6e7f75be7db6f1a4c0b26619c96b765dec09 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 27 Mar 2013 00:49:54 +0100 Subject: Xdefaults: Use colors from yoshi-theme --- .Xdefaults | 52 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/.Xdefaults b/.Xdefaults index ebe9d51..cce9f2f 100644 --- a/.Xdefaults +++ b/.Xdefaults @@ -25,32 +25,32 @@ urxvt.boldFont: xft:Envy Code R:weight=bold:pixelsize=18 urxvt.italicFont: xft:Envy Code R:slant=italic:pixelsize=18 urxvt.depth: 32 -urxvt.background: [90]#111113 +urxvt.background: #111113 urxvt.foreground: #eeeeec -urxvt.color0: #171719 -urxvt.color8: #999999 +urxvt.color0: #111113 +urxvt.color8: #eeeeec -urxvt.color1: #973732 -urxvt.color9: #ff756e +urxvt.color1: #734a4a +urxvt.color9: #bf7d7d -urxvt.color2: #405c2e -urxvt.color10: #9ad870 +urxvt.color2: #52734a +urxvt.color10: #8abf6d -urxvt.color3: #835c0e -urxvt.color11: #ffbb56 +urxvt.color3: #6b734a +urxvt.color11: #b2bf6d -urxvt.color4: #2729b6 -urxvt.color12: #78a2c1 +urxvt.color4: #4a5b73 +urxvt.color12: #6d97bf -urxvt.color5: #5c325d -urxvt.color13: #c39cc3 +urxvt.color5: #6b4a73 +urxvt.color13: #b27dbf -urxvt.color6: #208181 -urxvt.color14: #93d8d8 +urxvt.color6: #4a7373 +urxvt.color14: #7dbfbf urxvt.color7: #222224 -urxvt.color15: #a9a9a9 +urxvt.color15: #a5a5a4 Xft.antialias: true Xft.rgba: rgb @@ -61,7 +61,25 @@ Xft.hintstyle: hintslight Emacs.menuBar: off Emacs.toolbar: off Emacs.useXIM: off -! Emacs.background: #252a2b +Emacs.background: #111113 +Emacs.borderWidth: 0 +Emacs.font: Envy Code R-13 +Emacs.foreground: #eeeeec +Emacs.internalBorder: 0 +Emacs.paneFont: Envy Code R-13 +Emacs.pointerColor: #eeeeec +Emacs*menu*font: Envy Code R-13 +Emacs*menu*foreground: #eeeeec +Emacs*menu*background: #222224 +Emacs*menu*buttonForeground: #a5a5a4 +Emacs*menu*verticalSpacing: 0 +Emacs*menu*shadowThickness: 1 +Emacs*menu*margin: 0 +Emacs.pane.menubar.translations: #override\ + Ctrl n: down()\n\ + Ctrl p: up()\n\ + Ctrl f: right()\n\ + Ctrl b: left()\n\ xfontsel.sampleText: \ static void print_sample_message(XWindow *win) {\n\ -- cgit v1.2.3-54-g00ecf From 01d77b518f4cd4df3179dea5bc88acd89f451e88 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:15:03 +0100 Subject: Emacs: Move everything from init.el to init.org I'll write stuff about it later, as long as it's in the org file for now. --- emacs/init.el | 267 -------------- emacs/init.org | 1092 +++++++++++++++++++++++++++++++++----------------------- 2 files changed, 637 insertions(+), 722 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index fa5a93b..d9dc98c 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -8,273 +8,6 @@ (load (concat user-emacs-directory "init2")) -(defface git-commit-summary-face - '((t (:inherit org-level-1))) - "Face for the git title line." - :group 'local) - -(defface git-commit-overlong-summary-face - '((t (:background "#873732"))) - "Face for commit titles that are too long." - :group 'local) - -(defface git-commit-nonempty-second-line-face - '((t (:inherit git-commit-overlong-summary-face))) - "Face for the supposedly empty line in commit messages." - :group 'local) - -(eval-after-load "newst-treeview" '(require 'newsticker-init)) -(eval-after-load "org" '(require 'org-init)) -(eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) -(eval-after-load "smex" '(oni:smex-init)) -(eval-after-load "yasnippet" '(oni:yasnippet-init)) - -(autoload 'define-slime-contrib "slime") -(autoload 'gtags-mode "gtags" nil t) -(autoload 'jabber-connect "jabber" nil t) -(autoload 'php-mode "php-mode" nil t) -(autoload 'po-mode "po-mode" nil t) -(autoload 'pony-mode "pony-mode" nil t) -(autoload 'sawfish-mode "sawfish" nil t) -(autoload 'server-running-p "server") -(autoload 'slime-js-minor-mode "slime-js" nil t) -(autoload 'xmodmap-mode "xmodmap-mode" nil t) -(autoload 'w3m-bookmark-view "w3m" nil t) -(autoload 'w3m-goto-url "w3m" nil t) - -(require 'geiser-install) -(require 'uniquify) -(require 'ext) -(require 'oni) - -(setq-default c-basic-offset 4) -(setq-default fci-rule-column 73) -(setq-default indent-tabs-mode nil) -(setq-default php-mode-warn-if-mumamo-off nil) -(setq-default require-final-newline t) -(setq-default tab-width 4) -(setq-default truncate-lines t) - -(setq appt-disp-window-function #'oni:appt-display-window-and-jabber) -(setq appt-display-diary nil) -(setq auto-mode-case-fold nil) -(setq auto-save-file-name-transforms oni:auto-save-name-transforms) -(setq avandu-article-render-function #'avandu-view-w3m) -(setq backup-directory-alist oni:backup-directory-alist) -(setq browse-url-browser-function 'browse-url-generic) -(setq browse-url-generic-program (getenv "BROWSER")) -(setq c-offsets-alist '((statement-block-intro . +) - (knr-argdecl-intro . 5) - (substatement-open . +) - (substatement-label . 0) - (label . 0) - (statement-case-open . +) - (statement-cont . +) - (arglist-intro . +) - (arglist-close . 0) - (inline-open . 0) - (brace-list-open . +) - (topmost-intro-cont first c-lineup-topmost-intro-cont - c-lineup-gnu-DEFUN-intro-cont))) -(setq comment-auto-fill-only-comments t) -(setq custom-file "~/.emacs.d/custom.el") -(setq custom-theme-directory "~/.emacs.d/themes") -(setq default-frame-alist - `((border-width . 0) - (internal-border-width . 0) - (vertical-scroll-bars . nil) - (menu-bar-lines . nil) - (tool-bar-lines . nil) - (font . "Envy Code R:pixelsize=18"))) -(setq elnode-do-init nil) -(setq fci-rule-color "darkred") -(setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) -(setq geiser-repl-history-filename "~/.emacs.d/geiser-history") -(setq gnus-init-file "~/.emacs.d/gnus") -(setq gtags-auto-update t) -(setq help-at-pt-display-when-idle t) -(setq highlight-80+-columns 72) -(setq identica-enable-striping t) -(setq inferior-lisp-program "sbcl") -(setq inhibit-default-init t) -(setq inhibit-local-menu-bar-menus t) -(setq inhibit-startup-message t) -(setq initial-major-mode 'emacs-lisp-mode) -(setq initial-scratch-message nil) -(setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") -(setq jabber-chat-buffer-format "*jab:%n*") -(setq jabber-chat-buffer-show-avatar nil) -(setq jabber-chat-fill-long-lines nil) -(setq jabber-chat-foreign-prompt-format "%t %u/%r <\n") -(setq jabber-chat-local-prompt-format "%t %u/%r >\n") -(setq jabber-chatstates-confirm nil) -(setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) -(setq jabber-roster-show-bindings nil) -(setq jabber-vcard-avatars-publish nil) -(setq jabber-vcard-avatars-retrieve nil) -(setq jit-lock-defer-time 0.2) -(setq magit-repo-dirs '("~/projects/" "~/var/src/")) -(setq message-log-max 1000) -(setq message-send-mail-function 'message-send-mail-with-sendmail) -(setq message-sendmail-extra-arguments '("-a" "ryuslash")) -(setq package-archives - '(("melpa" . "http://melpa.milkbox.net/packages/") - ("marmalade" . "http://marmalade-repo.org/packages/") - ("gnu" . "http://elpa.gnu.org/packages/"))) -(setq package-load-list '((htmlize "1.39") - (lua-mode "20111107") - all)) -(setq php-function-call-face 'font-lock-function-name-face) -(setq php-mode-force-pear t) -(setq pony-tpl-indent-moves t) -(setq rainbow-delimiters-max-face-count 12) -(setq redisplay-dont-pause t) -(setq send-mail-function 'smtpmail-send-it) -(setq sendmail-program "/usr/bin/msmtp") -(setq sentence-end-double-space nil) -(setq smex-key-advice-ignore-menu-bar t) -(setq smex-save-file "~/.emacs.d/smex-items") -(setq split-height-threshold 40) -(setq time-stamp-active t) -(setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") -(setq type-break-good-rest-interval (* 60 10)) -(setq type-break-interval (* 60 50)) -(setq type-break-keystroke-threshold '(nil . nil)) -(setq uniquify-buffer-name-style 'post-forward) -(setq use-dialog-box nil) -(setq user-full-name "Tom Willemsen") -(setq user-mail-address "tom@ryuslash.org") -(setq w3m-fill-column 72) -(setq window-combination-resize t) -(setq yas-fallback-behavior nil) -(setq yas-prompt-functions '(yas-ido-prompt)) - -(add-hook 'after-change-major-mode-hook 'set-current-mode-icon) -(add-hook 'after-save-hook 'oni:after-save-func t) -(add-hook 'before-save-hook 'oni:before-save-func) -(add-hook 'c-mode-hook 'oni:c-mode-func) -(add-hook 'css-mode-hook 'oni:css-mode-func) -(add-hook 'diary-display-hook 'oni:diary-display-func) -(add-hook 'emacs-startup-hook 'oni:emacs-startup-func) -(add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-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 'html-mode-hook 'oni:html-mode-func) -(add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func) -(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func) -(add-hook 'java-mode-hook 'oni:java-mode-func) -(add-hook 'js-mode-hook 'oni:js-mode-func) -(add-hook 'js2-mode-hook 'oni:js2-mode-func) -(add-hook 'lua-mode-hook 'oni:lua-mode-func) -(add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func) -(add-hook 'markdown-mode-hook 'oni:markdown-mode-func) -(add-hook 'message-mode-hook 'oni:message-mode-func) -(add-hook 'org-mode-hook 'oni:org-mode-func) -(add-hook 'php-mode-hook 'oni:php-mode-func) -(add-hook 'prog-mode-hook 'oni:prog-mode-func) -(add-hook 'python-mode-hook 'oni:python-mode-func) -(add-hook 'rst-mode-hook 'oni:rst-mode-func) -(add-hook 'term-mode-hook 'oni:term-mode-func) -(add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func) -(add-hook 'write-file-hooks 'oni:write-file-func) -(add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func) - -(define-key key-translation-map (kbd "C-j") (kbd "C-l")) -(define-key key-translation-map (kbd "C-l") (kbd "C-j")) - -(global-set-key (kbd "'") 'oni:self-insert-dwim) -(global-set-key (kbd "") 'oni:raise-scratch) -(global-set-key (kbd "") 'gnus) -(global-set-key (kbd "") 'git-project-show-files) -(global-set-key (kbd "") 'ext:reload-buffer) -(global-set-key (kbd "") 'jabber-switch-to-roster-buffer) -(global-set-key (kbd "") 'magit-status) -(global-set-key (kbd "") 'oni:show-org-index) -(global-set-key (kbd "C-<") 'oni:indent-shift-left) -(global-set-key (kbd "C->") 'oni:indent-shift-right) -(global-set-key (kbd "C-M-4") 'split-window-vertically) -(global-set-key (kbd "C-M-SPC") 'er/expand-region) -(global-set-key (kbd "C-M-d") 'kill-word) -(global-set-key (kbd "C-M-w") 'backward-kill-word) -(global-set-key (kbd "C-S-k") 'kill-whole-line) -(global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim) -(global-set-key (kbd "C-c a") 'org-agenda) -(global-set-key (kbd "C-c c") 'org-capture) -(global-set-key (kbd "C-c i p") 'identica-update-status-interactive) -(global-set-key (kbd "C-c p") 'oni:show-buffer-position) -(global-set-key (kbd "C-c t") 'oni:raise-ansi-term) -(global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char) -(global-set-key (kbd "C-e") 'oni:move-end-of-dwim) -(global-set-key (kbd "C-k") 'oni:kill-region-or-line) -(global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char) -(global-set-key (kbd "M-0") 'delete-window) -(global-set-key (kbd "M-1") 'delete-other-windows) -(global-set-key (kbd "M-2") 'split-window-below) -(global-set-key (kbd "M-3") 'split-window-right) -(global-set-key (kbd "M-4") 'split-window-horizontally) -(global-set-key (kbd "M-o") 'other-window) -(global-set-key (kbd "\"") 'oni:self-insert-dwim) - -(if (daemonp) - (global-set-key "\C-x\C-c" 'oni:close-client-window)) - -(when (or window-system (daemonp)) - (global-unset-key "\C-z")) - -(add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode)) -(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode)) -(add-to-list 'auto-mode-alist - '("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode)) -(add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode)) -(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) -(add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode)) -(add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode)) -(add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode)) - -(add-to-list 'debug-ignored-errors "^Can't shift all lines enough") - -(add-to-list - 'display-buffer-alist - '("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil)))) -(add-to-list - 'display-buffer-alist - '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) -(add-to-list - 'display-buffer-alist - '("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil)))) - -(add-to-list 'compilation-finish-functions 'ext:comp-finish-function) - -(blink-cursor-mode -1) -(column-number-mode -1) -(line-number-mode -1) -(tooltip-mode -1) - -(package-initialize) - -(auto-insert-mode) -(cua-selection-mode t) -(electric-indent-mode) -(electric-pair-mode) -(savehist-mode) -(show-paren-mode) -(winner-mode) - -(smex-initialize) -(help-at-pt-set-timer) -(windmove-default-keybindings) -(global-diff-hl-mode) - -(load custom-file) -;; (load "rudel-loaddefs.el") -(load (expand-file-name "~/quicklisp/slime-helper.el")) - -(unless (server-running-p) - (server-start)) - -(diminish 'auto-fill-function "_") - (provide 'init) ;;; init.el ends here diff --git a/emacs/init.org b/emacs/init.org index 531e6d5..95536a7 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -92,195 +92,185 @@ functionality, plus more. (add-hook 'scheme-mode-hook 'paredit-mode) #+END_SRC -* flymake - - Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to - "allowed" files and add go error output to error patterns. - - #+BEGIN_SRC emacs-lisp - (defun oni:flymake-init () - "Initialization function for flymake." - (require 'flymake-cursor) - - (add-to-list ; Make sure pyflakes is loaded - 'flymake-allowed-file-name-masks ; for python files. - '("\\.py\\'" ext:flymake-pyflakes-init)) - - (add-to-list ; Error line repexp for go - 'flymake-err-line-patterns ; compilation. - '("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$" - 1 2 nil 3)) - - (add-to-list ; Go uses makefiles, makes - 'flymake-allowed-file-name-masks ; flymaking 'easy'. - '("\\.go$" flymake-simple-make-init))) - - (eval-after-load "flymake" '(oni:flymake-init)) - #+END_SRC - - Disable the GUI for flymake errors. This causes the flymake errors - to be shown in the minibuffer. - - #+BEGIN_SRC emacs-lisp - (setq flymake-gui-warnings-enabled nil) - #+END_SRC - - Add a bunch of pep8, flymake and pyflakes messages to warning and - info patterns, set the log file to somewhere in my home directory - and set logging level to 0. - - #+BEGIN_SRC emacs-lisp - (setq flymake-info-line-regexp - (eval-when-compile - (regexp-opt - '("Invalid name" - "String statement has no effect" - "Missing docstring" - "Empty docstring" - "multiple imports on one line" - "expected 2 blank lines, found 1" - "expected 2 blank lines, found 0" - "TODO:" - "whitespace after '{'" - "whitespace before '}'" - "whitespace before ':'" - "whitespace after '('" - "whitespace before ')'" - "whitespace after '['" - "whitespace before ']'" - "the backslash is redundant between brackets" - "continuation line over-indented for visual indent" - "continuation line under-indented for visual indent" - "Too many statements" - "comparison to None should be" - "missing whitespace around operator" - "missing whitespace after ','" - "line too long" - "at least two spaces before inline comment" - "trailing whitespace" - "imported but unused" - "Unused import" - "too many blank lines")))) - (setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log")) - (setq flymake-log-level 0) - (setq flymake-warn-line-regexp - (eval-when-compile - (regexp-opt '("warning" - "Warning" - "redefinition of unused" - "Redefining built-in" - "Redefining name" - "Unused argument" - "Unused variable" - "Dangerous default value {} as argument" - "no newline at end of file" - "Access to a protected member")))) - #+END_SRC - -* flycheck - - After loading ~flycheck~ Remove the default python checkers and - replace them with my own, which tries both ~flake8~ and ~pylint~. - - #+BEGIN_SRC emacs-lisp - (eval-after-load "flycheck" - '(progn - (mapc (lambda (c) (delete c flycheck-checkers)) - '(python-pylint python-pyflakes)))) - #+END_SRC - -* pretty-control-l-mode - - Make the ~C-l~ look like a line of ~-~ up to =fill-column= or - =fci-rule-column= and remove the string displayed before the ~C-l~. - - #+BEGIN_SRC emacs-lisp - (defun oni:pretty-control-l-function (win) - "Just make a string of either `fci-rule-column' or - `fill-column' length -1. Use the `-' character. WIN is ignored." - (make-string - (1- (if (boundp 'fci-rule-column) - fci-rule-column fill-column)) ?-)) - - (setq pp^L-^L-string-function 'oni:pretty-control-l-function) - #+END_SRC - - Remove the string displayed before the ~C-l~. - - #+BEGIN_SRC emacs-lisp - (setq pp^L-^L-string-pre nil) - #+END_SRC - - Enable =pretty-control-l-mode= at startup and whenever a new frame is - created. - - #+BEGIN_SRC emacs-lisp - (add-hook 'emacs-startup-hook 'pretty-control-l-mode) - (add-hook 'after-make-frame-functions - '(lambda (arg) (pretty-control-l-mode))) - #+END_SRC - -* erc - - Automatically join some channels when connecting to freenode.net. - - #+BEGIN_SRC emacs-lisp - (setq erc-autojoin-channels-alist - '(("freenode.net" "#ninthfloor" "#emacs"))) - #+END_SRC - - Don't show ~PART~ messages. - - #+BEGIN_SRC emacs-lisp - (setq erc-hide-list '("PART")) - #+END_SRC - - Insert a timestamp every time a message comes in, print it on the - left and print the hour and minute parts of the time. - - #+BEGIN_SRC emacs-lisp - (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) - (setq erc-timestamp-format "[%H:%M] ") - (setq erc-timestamp-only-if-changed-flag nil) - #+END_SRC - - Set my nickname. - - #+BEGIN_SRC emacs-lisp - (setq erc-nick "ryuslash") - #+END_SRC - - When starting ERC disable truncating lines, don't let ERC fill each - line and enable =visual-line-mode=. - - #+BEGIN_SRC emacs-lisp - (defun oni:erc-mode-func () - "Function for `erc-mode-hook'." - (erc-fill-mode -1) - (visual-line-mode) - (setq truncate-lines nil)) +Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to +"allowed" files and add go error output to error patterns. - (add-hook 'erc-mode-hook 'oni:erc-mode-func) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (defun oni:flymake-init () + "Initialization function for flymake." + (require 'flymake-cursor) + + (add-to-list ; Make sure pyflakes is loaded + 'flymake-allowed-file-name-masks ; for python files. + '("\\.py\\'" ext:flymake-pyflakes-init)) + + (add-to-list ; Error line repexp for go + 'flymake-err-line-patterns ; compilation. + '("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$" + 1 2 nil 3)) + + (add-to-list ; Go uses makefiles, makes + 'flymake-allowed-file-name-masks ; flymaking 'easy'. + '("\\.go$" flymake-simple-make-init))) + + (eval-after-load "flymake" '(oni:flymake-init)) +#+END_SRC + +Disable the GUI for flymake errors. This causes the flymake errors +to be shown in the minibuffer. + +#+BEGIN_SRC emacs-lisp + (setq flymake-gui-warnings-enabled nil) +#+END_SRC + +Add a bunch of pep8, flymake and pyflakes messages to warning and +info patterns, set the log file to somewhere in my home directory +and set logging level to 0. + +#+BEGIN_SRC emacs-lisp + (setq flymake-info-line-regexp + (eval-when-compile + (regexp-opt + '("Invalid name" + "String statement has no effect" + "Missing docstring" + "Empty docstring" + "multiple imports on one line" + "expected 2 blank lines, found 1" + "expected 2 blank lines, found 0" + "TODO:" + "whitespace after '{'" + "whitespace before '}'" + "whitespace before ':'" + "whitespace after '('" + "whitespace before ')'" + "whitespace after '['" + "whitespace before ']'" + "the backslash is redundant between brackets" + "continuation line over-indented for visual indent" + "continuation line under-indented for visual indent" + "Too many statements" + "comparison to None should be" + "missing whitespace around operator" + "missing whitespace after ','" + "line too long" + "at least two spaces before inline comment" + "trailing whitespace" + "imported but unused" + "Unused import" + "too many blank lines")))) + (setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log")) + (setq flymake-log-level 0) + (setq flymake-warn-line-regexp + (eval-when-compile + (regexp-opt '("warning" + "Warning" + "redefinition of unused" + "Redefining built-in" + "Redefining name" + "Unused argument" + "Unused variable" + "Dangerous default value {} as argument" + "no newline at end of file" + "Access to a protected member")))) +#+END_SRC + +After loading ~flycheck~ Remove the default python checkers and +replace them with my own, which tries both ~flake8~ and ~pylint~. -* eshell +#+BEGIN_SRC emacs-lisp + (eval-after-load "flycheck" + '(progn + (mapc (lambda (c) (delete c flycheck-checkers)) + '(python-pylint python-pyflakes)))) +#+END_SRC - Add ~unison~ to the list of =eshell-visual-commands= because it - expects unbuffered input and eshell just doesn't give that. +Make the ~C-l~ look like a line of ~-~ up to =fill-column= or +=fci-rule-column= and remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp - (eval-after-load "em-term" - '(add-to-list 'eshell-visual-commands "unison")) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (defun oni:pretty-control-l-function (win) + "Just make a string of either `fci-rule-column' or + `fill-column' length -1. Use the `-' character. WIN is ignored." + (make-string + (1- (if (boundp 'fci-rule-column) + fci-rule-column fill-column)) ?-)) + + (setq pp^L-^L-string-function 'oni:pretty-control-l-function) +#+END_SRC - Don't let eshell highlight it's prompt, this way I can decide the - colors for it myself. +Remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp - (setq eshell-highlight-prompt nil) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq pp^L-^L-string-pre nil) +#+END_SRC - In the prompt: +Enable =pretty-control-l-mode= at startup and whenever a new frame is +created. + +#+BEGIN_SRC emacs-lisp + (add-hook 'emacs-startup-hook 'pretty-control-l-mode) + (add-hook 'after-make-frame-functions + '(lambda (arg) (pretty-control-l-mode))) +#+END_SRC + +Automatically join some channels when connecting to freenode.net. + +#+BEGIN_SRC emacs-lisp + (setq erc-autojoin-channels-alist + '(("freenode.net" "#ninthfloor" "#emacs"))) +#+END_SRC + +Don't show ~PART~ messages. + +#+BEGIN_SRC emacs-lisp + (setq erc-hide-list '("PART")) +#+END_SRC + +Insert a timestamp every time a message comes in, print it on the +left and print the hour and minute parts of the time. + +#+BEGIN_SRC emacs-lisp + (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) + (setq erc-timestamp-format "[%H:%M] ") + (setq erc-timestamp-only-if-changed-flag nil) +#+END_SRC + +Set my nickname. + +#+BEGIN_SRC emacs-lisp + (setq erc-nick "ryuslash") +#+END_SRC + +When starting ERC disable truncating lines, don't let ERC fill each +line and enable =visual-line-mode=. + +#+BEGIN_SRC emacs-lisp + (defun oni:erc-mode-func () + "Function for `erc-mode-hook'." + (erc-fill-mode -1) + (visual-line-mode) + (setq truncate-lines nil)) + + (add-hook 'erc-mode-hook 'oni:erc-mode-func) +#+END_SRC + +Add ~unison~ to the list of =eshell-visual-commands= because it +expects unbuffered input and eshell just doesn't give that. + +#+BEGIN_SRC emacs-lisp + (eval-after-load "em-term" + '(add-to-list 'eshell-visual-commands "unison")) +#+END_SRC + +Don't let eshell highlight it's prompt, this way I can decide the +colors for it myself. + +#+BEGIN_SRC emacs-lisp + (setq eshell-highlight-prompt nil) +#+END_SRC + +In the prompt: - Show the exit status of the last program/command run represented by a green ~+~ and a red ~-~ sign. @@ -291,316 +281,508 @@ functionality, plus more. =font-lock-function-name-face= face. - Show the status of priviledges in blue. - And set the =eshell-prompt-regexp= to - - #+BEGIN_SRC emacs-lisp - (defun oni:eshell-prompt-function () - "Show a pretty shell prompt." - (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) - (hostname (shell-command-to-string "hostname")) - (dir (abbreviate-file-name (eshell/pwd))) - (branch - (shell-command-to-string - "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) - (userstatus (if (zerop (user-uid)) ?# ?$))) - (concat - (propertize (char-to-string status) - 'face `(:foreground ,(if (= status ?+) - "green" - "red"))) - " " - (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) - " " - (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) - " " - (when (not (string= branch "")) - (propertize - ;; Cut off "* " and "\n" - (substring branch 2 -1) - 'face 'font-lock-function-name-face)) - " \n" - (propertize (char-to-string userstatus) - 'face `(:foreground "blue")) - "> "))) - - (setq eshell-prompt-function 'oni:eshell-prompt-function - eshell-prompt-regexp "^[#$]> ") - #+END_SRC - - Don't truncate lines in eshell, wrap them. - - #+BEGIN_SRC emacs-lisp - (defun oni:eshell-mode-func () - "Function for `eshell-mode-hook'." - (setq truncate-lines nil)) - - (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) - #+END_SRC - - Bind the ~f8~ key to easily show eshell. - - #+BEGIN_SRC emacs-lisp - (defun oni:raise-eshell () - "Start or switch back to `eshell'. - Also change directories to current working directory." - (interactive) - (let ((dir (file-name-directory - (or (buffer-file-name) "~/"))) - (hasfile (not (eq (buffer-file-name) nil)))) - (eshell) - (if (and hasfile (eq eshell-process-list nil)) - (progn - (eshell/cd dir) - (eshell-reset))))) - - (global-set-key (kbd "") 'oni:raise-eshell) - #+END_SRC - -* svg-mode-line-themes - - After Emacs has initialized, enable =svg-mode-line-themes= and select - a theme. - - #+BEGIN_SRC emacs-lisp - (defun oni:smt/minor-mode-indicator-text (widget) - (let* ((mm-alist '((auto-complete-mode . "AC ") - (auto-fill-mode . "AF ") - (eldoc-mode . "LD ") - (paredit-mode . "()"))) - (text (apply 'concat - (mapcar - (lambda (pair) - (when (and (boundp (car pair)) - (symbol-value (car pair))) - (cdr pair))) - mm-alist)))) - (if (plusp (length text)) - (concat " " text) - ""))) - - (defun oni:jabber-activity (widget) - (when (boundp 'jabber-activity-mode-string) - (concat jabber-activity-mode-string " "))) - - (eval-after-load "svg-mode-line-themes" - '(progn - (smt/defwidget oni:jabber-activity-widget - :text 'oni:jabber-activity) - - (smt/defrow oni:default-right - :widgets '(oni:jabber-activity-widget major-mode version-control - minor-modes) - :align "right" - :margin 14) - - (smt/deftheme yoshi - :prototype 'black-crystal - :local-widgets - (lambda (theme) - (let ((parent-local-widgets - (smt/t-local-widgets (smt/t-prototype theme)))) - (append - (list (cons 'minor-modes - (smt/make-widget - :prototye 'minor-modes - :text 'oni:smt/minor-mode-indicator-text))) - parent-local-widgets))) - :rows '(default-left default-position oni:default-right)))) - - (defun oni:enable-svg-mode-line-theme () - "Enable `svg-mode-line-theme' and select a theme." - (smt/enable) - (smt/set-theme 'yoshi)) - - (add-hook 'emacs-startup-hook 'oni:enable-svg-mode-line-theme) - #+END_SRC - -* bidi - - Disable bi-directional text, since I don't write right-to-left - myself and I don't know anyone who does. I have read that it is a - bad idea to disable it completely, but forcing left-to-right should - help. - - #+BEGIN_SRC emacs-lisp - (setq-default bidi-paragraph-direction 'left-to-right) - #+END_SRC - -* disabled - - There are some functions which get disabled by default because they - "confuse new users", but these I like using. - - #+BEGIN_SRC emacs-lisp - (put 'upcase-region 'disabled nil) - (put 'downcase-region 'disabled nil) - (put 'narrow-to-region 'disabled nil) - (put 'scroll-left 'disabled nil) - #+END_SRC - -* jabber - - Don't echo presence updates in the message area. - - #+BEGIN_SRC emacs-lisp - (defun oni:jabber-init () - "Initialization function for jabber." - (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) - - (eval-after-load "jabber" '(oni:jabber-init)) - #+END_SRC - - Require ~jabber-libnotify~ so we can use its alert functions. - - #+BEGIN_SRC emacs-lisp - (require 'jabber-libnotify) - #+END_SRC - - Enable libnotify alerts for regular and mutli-user chats, this is - preferable to seeing them in the echo area. - - #+BEGIN_SRC emacs-lisp - (add-hook 'jabber-alert-message-hooks 'jabber-message-libnotify) - (add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify) - #+END_SRC - - Keep track of what was said to and by my contacts, both for - "personal" chats and muc chats. - - #+BEGIN_SRC emacs-lisp - (setq jabber-history-enabled t - jabber-history-muc-enabled t) - #+END_SRC +And set the =eshell-prompt-regexp= to - Store history on a per-contact basis and keep these files in - ~$HOME/.emacs.d/jabber-hist~. +#+BEGIN_SRC emacs-lisp + (defun oni:eshell-prompt-function () + "Show a pretty shell prompt." + (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) + (hostname (shell-command-to-string "hostname")) + (dir (abbreviate-file-name (eshell/pwd))) + (branch + (shell-command-to-string + "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) + (userstatus (if (zerop (user-uid)) ?# ?$))) + (concat + (propertize (char-to-string status) + 'face `(:foreground ,(if (= status ?+) + "green" + "red"))) + " " + (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) + " " + (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) + " " + (when (not (string= branch "")) + (propertize + ;; Cut off "* " and "\n" + (substring branch 2 -1) + 'face 'font-lock-function-name-face)) + " \n" + (propertize (char-to-string userstatus) + 'face `(:foreground "blue")) + "> "))) + + (setq eshell-prompt-function 'oni:eshell-prompt-function + eshell-prompt-regexp "^[#$]> ") +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq jabber-use-global-history nil - jabber-history-dir "~/.emacs.d/jabber-hist") - #+END_SRC +Don't truncate lines in eshell, wrap them. - Add some accounts. +#+BEGIN_SRC emacs-lisp + (defun oni:eshell-mode-func () + "Function for `eshell-mode-hook'." + (setq truncate-lines nil)) - #+BEGIN_SRC emacs-lisp - (setq jabber-account-list '(("ryuslash@jabber.org") - ("tom@ryuslash.org/drd" - (:connection-type . ssl)))) - #+END_SRC + (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) +#+END_SRC -* ido +Bind the ~f8~ key to easily show eshell. - Keep some buffers from showing up when using ido-mode. Either these - get used very rarely or they don't have any really useful - information in them. +#+BEGIN_SRC emacs-lisp + (defun oni:raise-eshell () + "Start or switch back to `eshell'. + Also change directories to current working directory." + (interactive) + (let ((dir (file-name-directory + (or (buffer-file-name) "~/"))) + (hasfile (not (eq (buffer-file-name) nil)))) + (eshell) + (if (and hasfile (eq eshell-process-list nil)) + (progn + (eshell/cd dir) + (eshell-reset))))) + + (global-set-key (kbd "") 'oni:raise-eshell) +#+END_SRC + +Disable bi-directional text, since I don't write right-to-left +myself and I don't know anyone who does. I have read that it is a +bad idea to disable it completely, but forcing left-to-right should +help. + +#+BEGIN_SRC emacs-lisp + (setq-default bidi-paragraph-direction 'left-to-right) +#+END_SRC + +There are some functions which get disabled by default because they +"confuse new users", but these I like using. - #+BEGIN_SRC emacs-lisp - (defun oni:ido-init () - "Initialization functionn for ido." - (setq ido-ignore-buffers - (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" - (eval-when-compile - (regexp-opt - '("*-jabber-roster-*" - "*Messages*" - "*fsm-debug*" - "*magit-process*" - "*magit-edit-log*" - "*Backtrace*" - "*Ibuffer*")))))) +#+BEGIN_SRC emacs-lisp + (put 'upcase-region 'disabled nil) + (put 'downcase-region 'disabled nil) + (put 'narrow-to-region 'disabled nil) + (put 'scroll-left 'disabled nil) +#+END_SRC - (eval-after-load "ido" '(oni:ido-init)) - #+END_SRC +Don't echo presence updates in the message area. - Ido tries to be smart and find files in other directories, I don't - like that, stop doing that (or at least wait a long time). +#+BEGIN_SRC emacs-lisp + (defun oni:jabber-init () + "Initialization function for jabber." + (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) + + (eval-after-load "jabber" '(oni:jabber-init)) +#+END_SRC + +Require ~jabber-libnotify~ so we can use its alert functions. + +#+BEGIN_SRC emacs-lisp + (require 'jabber-libnotify) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq ido-auto-merge-delay-time 1000000) - #+END_SRC +Enable libnotify alerts for regular and mutli-user chats, this is +preferable to seeing them in the echo area. + +#+BEGIN_SRC emacs-lisp + (add-hook 'jabber-alert-message-hooks 'jabber-message-libnotify) + (add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify) +#+END_SRC + +Keep track of what was said to and by my contacts, both for +"personal" chats and muc chats. + +#+BEGIN_SRC emacs-lisp + (setq jabber-history-enabled t + jabber-history-muc-enabled t) +#+END_SRC + +Store history on a per-contact basis and keep these files in +~$HOME/.emacs.d/jabber-hist~. + +#+BEGIN_SRC emacs-lisp + (setq jabber-use-global-history nil + jabber-history-dir "~/.emacs.d/jabber-hist") +#+END_SRC + +Add some accounts. + +#+BEGIN_SRC emacs-lisp + (setq jabber-account-list '(("ryuslash@jabber.org") + ("tom@ryuslash.org/drd" + (:connection-type . ssl)))) +#+END_SRC - Open files in the selected window when switching between buffers. +Keep some buffers from showing up when using ido-mode. Either these +get used very rarely or they don't have any really useful +information in them. - #+BEGIN_SRC emacs-lisp - (setq ido-default-buffer-method 'selected-window) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (defun oni:ido-init () + "Initialization functionn for ido." + (setq ido-ignore-buffers + (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" + (eval-when-compile + (regexp-opt + '("*-jabber-roster-*" + "*Messages*" + "*fsm-debug*" + "*magit-process*" + "*magit-edit-log*" + "*Backtrace*" + "*Ibuffer*")))))) + + (eval-after-load "ido" '(oni:ido-init)) +#+END_SRC - Only ever show one line of possibilities when using ido. I hate it - when the minibuffer grows. +Ido tries to be smart and find files in other directories, I don't +like that, stop doing that (or at least wait a long time). - #+BEGIN_SRC emacs-lisp - (setq ido-max-window-height 1) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq ido-auto-merge-delay-time 1000000) +#+END_SRC - Don't save ido state between invocations. +Open files in the selected window when switching between buffers. - #+BEGIN_SRC emacs-lisp - (setq ido-save-directory-list-file nil) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq ido-default-buffer-method 'selected-window) +#+END_SRC - Enable =ido-mode=. +Only ever show one line of possibilities when using ido. I hate it +when the minibuffer grows. - #+BEGIN_SRC emacs-lisp - (ido-mode) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq ido-max-window-height 1) +#+END_SRC -** ido-ubiquitous +Don't save ido state between invocations. - Don't use ido when calling =org-refile= or =org-capture-refile=. +#+BEGIN_SRC emacs-lisp + (setq ido-save-directory-list-file nil) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq ido-ubiquitous-command-exceptions - '(org-refile org-capture-refile)) - #+END_SRC +Enable =ido-mode=. - Enable =ido-ubiquitous=. +#+BEGIN_SRC emacs-lisp + (ido-mode) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (add-hook 'emacs-startup-hook 'ido-ubiquitous-mode) - #+END_SRC +Don't use ido when calling =org-refile= or =org-capture-refile=. -** idomenu +#+BEGIN_SRC emacs-lisp + (setq ido-ubiquitous-command-exceptions + '(org-refile org-capture-refile)) +#+END_SRC - Call =idomenu= with ~M-n~. +Enable =ido-ubiquitous=. - #+BEGIN_SRC emacs-lisp - (global-set-key (kbd "M-n") 'idomenu) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (add-hook 'emacs-startup-hook 'ido-ubiquitous-mode) +#+END_SRC -* minibuffer +Call =idomenu= with ~M-n~. - A new feature in Emacs 24.3 can shorten ~(default ...)~ to ~[...]~ when - prompting for something. The =minibuffer-eldef-shorten-default= should - be set before enabling the =minibuffer-electric-default-mode=. +#+BEGIN_SRC emacs-lisp + (global-set-key (kbd "M-n") 'idomenu) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq minibuffer-eldef-shorten-default t) - (minibuffer-electric-default-mode) - #+END_SRC +A new feature in Emacs 24.3 can shorten ~(default ...)~ to ~[...]~ when +prompting for something. The =minibuffer-eldef-shorten-default= should +be set before enabling the =minibuffer-electric-default-mode=. -* mode-line +#+BEGIN_SRC emacs-lisp + (setq minibuffer-eldef-shorten-default t) + (minibuffer-electric-default-mode) +#+END_SRC - Don't show any default help messages, if no help message was - specified, just leave the echo area empty. +Don't show any default help messages, if no help message was +specified, just leave the echo area empty. - #+BEGIN_SRC emacs-lisp - (setq mode-line-default-help-echo "") - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq mode-line-default-help-echo "") +#+END_SRC -* jedi +Start jedi when =python-mode= is started. - Start jedi when =python-mode= is started. +#+BEGIN_SRC emacs-lisp + (eval-after-load "jedi" '(setcar jedi:server-command "python2")) + (add-hook 'python-mode-hook 'jedi:setup) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (eval-after-load "jedi" '(setcar jedi:server-command "python2")) - (add-hook 'python-mode-hook 'jedi:setup) - #+END_SRC +Show argument lists and such in the echo area. - Show argument lists and such in the echo area. +#+BEGIN_SRC emacs-lisp + (setq jedi:tooltip-method nil) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq jedi:tooltip-method nil) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (defface git-commit-summary-face + '((t (:inherit org-level-1))) + "Face for the git title line." + :group 'local) + + (defface git-commit-overlong-summary-face + '((t (:background "#873732"))) + "Face for commit titles that are too long." + :group 'local) + + (defface git-commit-nonempty-second-line-face + '((t (:inherit git-commit-overlong-summary-face))) + "Face for the supposedly empty line in commit messages." + :group 'local) + + (eval-after-load "newst-treeview" '(require 'newsticker-init)) + (eval-after-load "org" '(require 'org-init)) + (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) + (eval-after-load "smex" '(oni:smex-init)) + (eval-after-load "yasnippet" '(oni:yasnippet-init)) + + (autoload 'define-slime-contrib "slime") + (autoload 'gtags-mode "gtags" nil t) + (autoload 'jabber-connect "jabber" nil t) + (autoload 'php-mode "php-mode" nil t) + (autoload 'po-mode "po-mode" nil t) + (autoload 'pony-mode "pony-mode" nil t) + (autoload 'sawfish-mode "sawfish" nil t) + (autoload 'server-running-p "server") + (autoload 'slime-js-minor-mode "slime-js" nil t) + (autoload 'xmodmap-mode "xmodmap-mode" nil t) + (autoload 'w3m-bookmark-view "w3m" nil t) + (autoload 'w3m-goto-url "w3m" nil t) + + (require 'geiser-install) + (require 'uniquify) + (require 'ext) + (require 'oni) + + (setq-default c-basic-offset 4) + (setq-default fci-rule-column 73) + (setq-default indent-tabs-mode nil) + (setq-default php-mode-warn-if-mumamo-off nil) + (setq-default require-final-newline t) + (setq-default tab-width 4) + (setq-default truncate-lines t) + + (setq appt-disp-window-function #'oni:appt-display-window-and-jabber) + (setq appt-display-diary nil) + (setq auto-mode-case-fold nil) + (setq auto-save-file-name-transforms oni:auto-save-name-transforms) + (setq avandu-article-render-function #'avandu-view-w3m) + (setq backup-directory-alist oni:backup-directory-alist) + (setq browse-url-browser-function 'browse-url-generic) + (setq browse-url-generic-program (getenv "BROWSER")) + (setq c-offsets-alist '((statement-block-intro . +) + (knr-argdecl-intro . 5) + (substatement-open . +) + (substatement-label . 0) + (label . 0) + (statement-case-open . +) + (statement-cont . +) + (arglist-intro . +) + (arglist-close . 0) + (inline-open . 0) + (brace-list-open . +) + (topmost-intro-cont first c-lineup-topmost-intro-cont + c-lineup-gnu-DEFUN-intro-cont))) + (setq comment-auto-fill-only-comments t) + (setq custom-file "~/.emacs.d/custom.el") + (setq custom-theme-directory "~/.emacs.d/themes") + (setq default-frame-alist + `((border-width . 0) + (internal-border-width . 0) + (vertical-scroll-bars . nil) + (menu-bar-lines . nil) + (tool-bar-lines . nil) + (font . "Envy Code R:pixelsize=18"))) + (setq elnode-do-init nil) + (setq fci-rule-color "darkred") + (setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) + (setq geiser-repl-history-filename "~/.emacs.d/geiser-history") + (setq gnus-init-file "~/.emacs.d/gnus") + (setq gtags-auto-update t) + (setq help-at-pt-display-when-idle t) + (setq highlight-80+-columns 72) + (setq identica-enable-striping t) + (setq inferior-lisp-program "sbcl") + (setq inhibit-default-init t) + (setq inhibit-local-menu-bar-menus t) + (setq inhibit-startup-message t) + (setq initial-major-mode 'emacs-lisp-mode) + (setq initial-scratch-message nil) + (setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") + (setq jabber-chat-buffer-format "*jab:%n*") + (setq jabber-chat-buffer-show-avatar nil) + (setq jabber-chat-fill-long-lines nil) + (setq jabber-chat-foreign-prompt-format "%t %u/%r <\n") + (setq jabber-chat-local-prompt-format "%t %u/%r >\n") + (setq jabber-chatstates-confirm nil) + (setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) + (setq jabber-roster-show-bindings nil) + (setq jabber-vcard-avatars-publish nil) + (setq jabber-vcard-avatars-retrieve nil) + (setq jit-lock-defer-time 0.2) + (setq magit-repo-dirs '("~/projects/" "~/var/src/")) + (setq message-log-max 1000) + (setq message-send-mail-function 'message-send-mail-with-sendmail) + (setq message-sendmail-extra-arguments '("-a" "ryuslash")) + (setq package-archives + '(("melpa" . "http://melpa.milkbox.net/packages/") + ("marmalade" . "http://marmalade-repo.org/packages/") + ("gnu" . "http://elpa.gnu.org/packages/"))) + (setq package-load-list '((htmlize "1.39") + (lua-mode "20111107") + all)) + (setq php-function-call-face 'font-lock-function-name-face) + (setq php-mode-force-pear t) + (setq pony-tpl-indent-moves t) + (setq rainbow-delimiters-max-face-count 12) + (setq redisplay-dont-pause t) + (setq send-mail-function 'smtpmail-send-it) + (setq sendmail-program "/usr/bin/msmtp") + (setq sentence-end-double-space nil) + (setq smex-key-advice-ignore-menu-bar t) + (setq smex-save-file "~/.emacs.d/smex-items") + (setq split-height-threshold 40) + (setq time-stamp-active t) + (setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") + (setq type-break-good-rest-interval (* 60 10)) + (setq type-break-interval (* 60 50)) + (setq type-break-keystroke-threshold '(nil . nil)) + (setq uniquify-buffer-name-style 'post-forward) + (setq use-dialog-box nil) + (setq user-full-name "Tom Willemsen") + (setq user-mail-address "tom@ryuslash.org") + (setq w3m-fill-column 72) + (setq window-combination-resize t) + (setq yas-fallback-behavior nil) + (setq yas-prompt-functions '(yas-ido-prompt)) + + (add-hook 'after-change-major-mode-hook 'set-current-mode-icon) + (add-hook 'after-save-hook 'oni:after-save-func t) + (add-hook 'before-save-hook 'oni:before-save-func) + (add-hook 'c-mode-hook 'oni:c-mode-func) + (add-hook 'css-mode-hook 'oni:css-mode-func) + (add-hook 'diary-display-hook 'oni:diary-display-func) + (add-hook 'emacs-startup-hook 'oni:emacs-startup-func) + (add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-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 'html-mode-hook 'oni:html-mode-func) + (add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func) + (add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func) + (add-hook 'java-mode-hook 'oni:java-mode-func) + (add-hook 'js-mode-hook 'oni:js-mode-func) + (add-hook 'js2-mode-hook 'oni:js2-mode-func) + (add-hook 'lua-mode-hook 'oni:lua-mode-func) + (add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func) + (add-hook 'markdown-mode-hook 'oni:markdown-mode-func) + (add-hook 'message-mode-hook 'oni:message-mode-func) + (add-hook 'org-mode-hook 'oni:org-mode-func) + (add-hook 'php-mode-hook 'oni:php-mode-func) + (add-hook 'prog-mode-hook 'oni:prog-mode-func) + (add-hook 'python-mode-hook 'oni:python-mode-func) + (add-hook 'rst-mode-hook 'oni:rst-mode-func) + (add-hook 'term-mode-hook 'oni:term-mode-func) + (add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func) + (add-hook 'write-file-hooks 'oni:write-file-func) + (add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func) + + (define-key key-translation-map (kbd "C-j") (kbd "C-l")) + (define-key key-translation-map (kbd "C-l") (kbd "C-j")) + + (global-set-key (kbd "'") 'oni:self-insert-dwim) + (global-set-key (kbd "") 'oni:raise-scratch) + (global-set-key (kbd "") 'gnus) + (global-set-key (kbd "") 'git-project-show-files) + (global-set-key (kbd "") 'ext:reload-buffer) + (global-set-key (kbd "") 'jabber-switch-to-roster-buffer) + (global-set-key (kbd "") 'magit-status) + (global-set-key (kbd "") 'oni:show-org-index) + (global-set-key (kbd "C-<") 'oni:indent-shift-left) + (global-set-key (kbd "C->") 'oni:indent-shift-right) + (global-set-key (kbd "C-M-4") 'split-window-vertically) + (global-set-key (kbd "C-M-SPC") 'er/expand-region) + (global-set-key (kbd "C-M-d") 'kill-word) + (global-set-key (kbd "C-M-w") 'backward-kill-word) + (global-set-key (kbd "C-S-k") 'kill-whole-line) + (global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim) + (global-set-key (kbd "C-c a") 'org-agenda) + (global-set-key (kbd "C-c c") 'org-capture) + (global-set-key (kbd "C-c i p") 'identica-update-status-interactive) + (global-set-key (kbd "C-c p") 'oni:show-buffer-position) + (global-set-key (kbd "C-c t") 'oni:raise-ansi-term) + (global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char) + (global-set-key (kbd "C-e") 'oni:move-end-of-dwim) + (global-set-key (kbd "C-k") 'oni:kill-region-or-line) + (global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char) + (global-set-key (kbd "M-0") 'delete-window) + (global-set-key (kbd "M-1") 'delete-other-windows) + (global-set-key (kbd "M-2") 'split-window-below) + (global-set-key (kbd "M-3") 'split-window-right) + (global-set-key (kbd "M-4") 'split-window-horizontally) + (global-set-key (kbd "M-o") 'other-window) + (global-set-key (kbd "\"") 'oni:self-insert-dwim) + + (if (daemonp) + (global-set-key "\C-x\C-c" 'oni:close-client-window)) + + (when (or window-system (daemonp)) + (global-unset-key "\C-z")) + + (add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode)) + (add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode)) + (add-to-list 'auto-mode-alist + '("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode)) + (add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode)) + (add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) + (add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode)) + (add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode)) + (add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode)) + + (add-to-list 'debug-ignored-errors "^Can't shift all lines enough") + + (add-to-list + 'display-buffer-alist + '("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil)))) + (add-to-list + 'display-buffer-alist + '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) + (add-to-list + 'display-buffer-alist + '("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil)))) + + (add-to-list 'compilation-finish-functions 'ext:comp-finish-function) + + (blink-cursor-mode -1) + (column-number-mode -1) + (line-number-mode -1) + (tooltip-mode -1) + + (package-initialize) + + (auto-insert-mode) + (cua-selection-mode t) + (electric-indent-mode) + (electric-pair-mode) + (savehist-mode) + (show-paren-mode) + (winner-mode) + + (smex-initialize) + (help-at-pt-set-timer) + (windmove-default-keybindings) + (global-diff-hl-mode) + + (load custom-file) + ;; (load "rudel-loaddefs.el") + (load (expand-file-name "~/quicklisp/slime-helper.el")) + + (unless (server-running-p) + (server-start)) + + (diminish 'auto-fill-function "_") +#+END_SRC # Local Variables: # eval: (flyspell-mode 1) -- cgit v1.2.3-54-g00ecf From 7a477eb80367af11c6ac2c2223a38d5ed9d3778f Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:18:13 +0100 Subject: Emacs: Don't generate init2.el, make init.el instead --- emacs/.gitignore | 2 +- emacs/Makefile | 4 ++-- emacs/init.el | 13 ------------- emacs/init.org | 2 +- 4 files changed, 4 insertions(+), 17 deletions(-) delete mode 100644 emacs/init.el diff --git a/emacs/.gitignore b/emacs/.gitignore index 0b490df..66209de 100644 --- a/emacs/.gitignore +++ b/emacs/.gitignore @@ -13,5 +13,5 @@ templates/ rinit.* !rinit.org history -init2.el +init.el *.html diff --git a/emacs/Makefile b/emacs/Makefile index fc17095..db6203e 100644 --- a/emacs/Makefile +++ b/emacs/Makefile @@ -1,11 +1,11 @@ DESTDIR:=$(DESTDIR)/.emacs.d -objects=init.elc init.el gnus.elc gnus.el init2.elc init2.el +objects=init.elc init.el gnus.elc gnus.el modules=eshell site-lisp snippets EMACS=emacs include ../dotfiles.mk -init2.el: init.org +init.el: init.org $(EMACS) -Q -batch \ -eval "(progn (require 'org) (require 'ob-tangle) (org-babel-tangle-file \"$^\"))" diff --git a/emacs/init.el b/emacs/init.el deleted file mode 100644 index d9dc98c..0000000 --- a/emacs/init.el +++ /dev/null @@ -1,13 +0,0 @@ -;;; init.el --- ryuslash's emacs init - -;;; Commentary: -;; Does so much and changes so often - - -;;; Code: - -(load (concat user-emacs-directory "init2")) - -(provide 'init) - -;;; init.el ends here diff --git a/emacs/init.org b/emacs/init.org index 95536a7..d9b8530 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -1,7 +1,7 @@ #+TITLE: Emacs init #+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html #+OPTIONS: author:nil num:nil -#+PROPERTY: tangle init2.el +#+PROPERTY: tangle init.el #+STARTUP: showall Disable the ~menu-bar-mode~, ~tool-bar-mode~ and ~scroll-bar-mode~ early on -- cgit v1.2.3-54-g00ecf From bd575ffdcf12b6364c7d261fcd7559c7b99c56f0 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:21:05 +0100 Subject: Emacs: Update text about deferring execution macro --- emacs/init.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index d9b8530..3ec9a00 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -14,6 +14,9 @@ so the disappear quickly after emacs starts up. #+END_SRC Define a macro for deferring code until after emacs has started up. +This gets used by certain functions that rely on packages installed +from ELPA. These packages don't get loaded until /after/ the init file +has completed loading. #+BEGIN_SRC emacs-lisp (defmacro eval-after-init (&rest body) -- cgit v1.2.3-54-g00ecf From eface3a29f54cb4d0802264333188e444a1f65f7 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:22:20 +0100 Subject: Emacs: Remove extraneous loadpath additions I've stopped installing Emacs from the bzr sources and instead use a package again. --- emacs/init.org | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 3ec9a00..0add126 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -24,27 +24,6 @@ has completed loading. `(add-hook 'emacs-startup-hook #'(lambda () ,@body))) #+END_SRC -Add ~/usr/share/emacs/site-lisp~ and -~/usr/local/emacs/share/emacs/site-lisp~ and all their sub-directories -to the ~load-path~ so I can use modules from both Emacs from the -official repository *and* the self-compiled one. - -This should be done both when compiling the elisp file and when -loading it so it doesn't complain about missing modules and such. - -#+BEGIN_SRC emacs-lisp - (eval-and-compile - (defun oni:path-init (dir) - "Add DIR to `load-path' and all its subdirectories, unless - DIR is already in `load-path'." - (unless (or (member dir load-path) (not (file-exists-p dir))) - (let ((default-directory dir)) - (add-to-list 'load-path dir t) - (normal-top-level-add-subdirs-to-load-path)))) - (oni:path-init "/usr/share/emacs/site-lisp") - (oni:path-init "/usr/local/emacs/share/emacs/site-lisp")) -#+END_SRC - Defer loading my theme until after emacs initialization. This is because it has been installed with ~package.el~, and the packages aren't added to the ~load-path~ until _after_ ~init.el~ has been run through. -- cgit v1.2.3-54-g00ecf From 8a5ee046a7eeecaf979cd0b2bde08854e2f0ed65 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:23:36 +0100 Subject: Emacs: Remove old org-mode location I don't build org-mode from git sources anymore. --- emacs/init.org | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 0add126..2d76347 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -43,8 +43,7 @@ exists, load ~loaddefs.el~ in each directory for autoloads. (when (file-exists-p loaddefs) (load loaddefs)))) '("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp" - "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode" - "/usr/local/org-mode/share/emacs/site-lisp/org")) + "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode")) #+END_SRC Replace the question of ~yes~ or ~no~ with just ~y~ or ~n~, I have never (yet) -- cgit v1.2.3-54-g00ecf From 9defc70b3f7483525f5b9c1a4d430236546eba2d Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:39:51 +0100 Subject: Emacs: Add text about git-commit faces --- emacs/init.org | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 2d76347..b9db462 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -490,12 +490,14 @@ Start jedi when =python-mode= is started. (add-hook 'python-mode-hook 'jedi:setup) #+END_SRC -Show argument lists and such in the echo area. +Show argument lists and such from jedi in the echo area. #+BEGIN_SRC emacs-lisp (setq jedi:tooltip-method nil) #+END_SRC +Define some faces to make editing magit logs nicer. + #+BEGIN_SRC emacs-lisp (defface git-commit-summary-face '((t (:inherit org-level-1))) @@ -511,7 +513,9 @@ Show argument lists and such in the echo area. '((t (:inherit git-commit-overlong-summary-face))) "Face for the supposedly empty line in commit messages." :group 'local) +#+END_SRC +#+BEGIN_SRC emacs-lisp (eval-after-load "newst-treeview" '(require 'newsticker-init)) (eval-after-load "org" '(require 'org-init)) (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) -- cgit v1.2.3-54-g00ecf From 3104ad4735d0f8e09e68ecd3b2f3c3db741ece57 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:41:09 +0100 Subject: Emacs: Remove emacs/site-lisp/newsticker-init.el I haven't used newsticker in quite a while... --- emacs/init.org | 1 - emacs/site-lisp/newsticker-init.el | 6 ------ 2 files changed, 7 deletions(-) delete mode 100644 emacs/site-lisp/newsticker-init.el diff --git a/emacs/init.org b/emacs/init.org index b9db462..adc31d2 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -516,7 +516,6 @@ Define some faces to make editing magit logs nicer. #+END_SRC #+BEGIN_SRC emacs-lisp - (eval-after-load "newst-treeview" '(require 'newsticker-init)) (eval-after-load "org" '(require 'org-init)) (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) (eval-after-load "smex" '(oni:smex-init)) diff --git a/emacs/site-lisp/newsticker-init.el b/emacs/site-lisp/newsticker-init.el deleted file mode 100644 index c393df1..0000000 --- a/emacs/site-lisp/newsticker-init.el +++ /dev/null @@ -1,6 +0,0 @@ -(setq newsticker-automatically-mark-items-as-old nil) -(setq newsticker-html-renderer 'w3m-region) -(setq newsticker-obsolete-item-max-age 604800) -(setq newsticker-use-full-width nil) - -(provide 'newsticker-init) -- cgit v1.2.3-54-g00ecf From 9b3b6503b8c1a01023bbdc993422bfc6038b85fd Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:43:02 +0100 Subject: Emacs: Add text about org-init --- emacs/init.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index adc31d2..3129e07 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -515,8 +515,14 @@ Define some faces to make editing magit logs nicer. :group 'local) #+END_SRC +I have quite a few modifications to my org-mode setup, so don't load +them immediately, they take a little time to load. + #+BEGIN_SRC emacs-lisp (eval-after-load "org" '(require 'org-init)) +#+END_SRC + +#+BEGIN_SRC emacs-lisp (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) (eval-after-load "smex" '(oni:smex-init)) (eval-after-load "yasnippet" '(oni:yasnippet-init)) -- cgit v1.2.3-54-g00ecf From 547450d83f53d73cc38fa44143f96ce535bff4b4 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:44:08 +0100 Subject: Emacs: Remove newsticker-init.el from Makefile --- emacs/site-lisp/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/site-lisp/Makefile b/emacs/site-lisp/Makefile index bbccbb7..bf452e9 100644 --- a/emacs/site-lisp/Makefile +++ b/emacs/site-lisp/Makefile @@ -1,7 +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 + oni.elc oni.el org-init.elc org-init.el quick-edit-mode.elc \ + quick-edit-mode.el include ../../dotfiles.mk -- cgit v1.2.3-54-g00ecf From ba42d20b902d228a0b57af3420dbd281a5929762 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:52:26 +0100 Subject: Emacs: Autoload some jabber functions and don't require geiser-install These have just been installed through elpa. --- emacs/init.org | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 3129e07..739c038 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -356,10 +356,12 @@ Don't echo presence updates in the message area. (eval-after-load "jabber" '(oni:jabber-init)) #+END_SRC -Require ~jabber-libnotify~ so we can use its alert functions. +Autoload functions from =jabber-libnotify= so we can use them in some +hooks. #+BEGIN_SRC emacs-lisp - (require 'jabber-libnotify) + (autoload 'jabber-message-libnotify "jabber-libnotify") + (autoload 'jabber-muc-libnotify "jabber-libnotify") #+END_SRC Enable libnotify alerts for regular and mutli-user chats, this is @@ -540,7 +542,6 @@ them immediately, they take a little time to load. (autoload 'w3m-bookmark-view "w3m" nil t) (autoload 'w3m-goto-url "w3m" nil t) - (require 'geiser-install) (require 'uniquify) (require 'ext) (require 'oni) -- cgit v1.2.3-54-g00ecf From 85100905e4842b5f3ba779e308b36d1e2abc806d Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:55:12 +0100 Subject: Emacs: Remove ~/var/src from magit-repo-dirs Only old projects live there, if I still want to work on any of them they should be moved to ~/projects/. --- emacs/init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 739c038..a41452b 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -612,7 +612,7 @@ them immediately, they take a little time to load. (setq jabber-vcard-avatars-publish nil) (setq jabber-vcard-avatars-retrieve nil) (setq jit-lock-defer-time 0.2) - (setq magit-repo-dirs '("~/projects/" "~/var/src/")) + (setq magit-repo-dirs '("~/projects/")) (setq message-log-max 1000) (setq message-send-mail-function 'message-send-mail-with-sendmail) (setq message-sendmail-extra-arguments '("-a" "ryuslash")) -- cgit v1.2.3-54-g00ecf From 56822a900cb3e8d3d80cf97a4e9c87bdc4b9596e Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 12:20:42 +0100 Subject: Emacs: Add indent-defun Found at: http://emacsredux.com/blog/2013/03/28/indent-defun/ --- emacs/init.org | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index a41452b..0a72b5c 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -524,6 +524,22 @@ them immediately, they take a little time to load. (eval-after-load "org" '(require 'org-init)) #+END_SRC +Found on [[http://emacsredux.com/blog/2013/03/28/indent-defun/][Indent defun - Emacs Redux]], indents a function. Should be +just a tiny bit easier than going to the beginning of a function and +then calling =indent-sexp=, which only works in lisp-like languages +anyway. + +#+BEGIN_SRC emacs-lisp + (defun indent-defun () + "Indent the current defun." + (interactive) + (save-excursion + (mark-defun) + (indent-region (region-beginning) (region-end)))) + + (global-set-key (kbd "C-M-z") 'indent-defun) +#+END_SRC + #+BEGIN_SRC emacs-lisp (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) (eval-after-load "smex" '(oni:smex-init)) -- cgit v1.2.3-54-g00ecf From 752c0436b1b6017baedd752a4d676973a6f2ab87 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 29 Mar 2013 15:46:50 +0100 Subject: Emacs: speedup calling of ansi-term --- emacs/site-lisp/oni.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/site-lisp/oni.el b/emacs/site-lisp/oni.el index 9ff1ee4..027463b 100644 --- a/emacs/site-lisp/oni.el +++ b/emacs/site-lisp/oni.el @@ -373,7 +373,7 @@ When dealing with braces, add another line and indent that too." (let ((buffer (get-buffer "*ansi-term*"))) (if (and buffer (not arg)) (switch-to-buffer buffer) - (call-interactively 'ansi-term)))) + (ansi-term (getenv "SHELL"))))) (defun oni:raise-scratch (&optional mode) "Show the *scratch* buffer. -- cgit v1.2.3-54-g00ecf From 51d121158687a5965ed28ecb4043f85c066a502a Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 31 Mar 2013 01:52:19 +0100 Subject: Don't show status for equals If the installed and local file are the same, don't show that it's not being installed, only show not installing older files during install. --- dotfiles.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dotfiles.mk b/dotfiles.mk index 0d1e70b..892c5b5 100644 --- a/dotfiles.mk +++ b/dotfiles.mk @@ -55,7 +55,8 @@ $(install-objects): install-%: % @$(if $(call newer,$*), \ echo -e "$(FG_GRE)+ $(FG_YEL)$(MKDPREFIX)$* $(CLR_RE)to $(DESTDIR) as $(MODE)"; \ install -pDm $(MODE) "$*" "$(DESTDIR)/$*", \ - echo -e "$(FG_RED)- $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)") + $(if $(call older,$*) ,\ + echo -e "$(FG_RED)- $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)")) $(install-modules): install-%: @$(MAKE) -s -C $* install MKDPREFIX=$(MKDPREFIX)$*/ -- cgit v1.2.3-54-g00ecf From a416fe4650b0d38f0e37e0d2489c91415a7f966a Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 31 Mar 2013 01:53:06 +0100 Subject: Emacs: Automatically close ansi-term buffer --- emacs/init.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index 0a72b5c..db69785 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -540,6 +540,18 @@ anyway. (global-set-key (kbd "C-M-z") 'indent-defun) #+END_SRC +Kill the ~*ansi-term*~ buffer (or any term buffer) after the underlying +shell process has finished. When I quit a shell I don't want the +buffer hanging around. + +#+BEGIN_SRC emacs-lisp + (defadvice term-handle-exit (after oni:kill-buffer-after-exit activate) + "Kill the term buffer if the process finished." + (let ((msg (ad-get-arg 1))) + (when (string-equal msg "finished\n") + (kill-buffer (current-buffer))))) +#+END_SRC + #+BEGIN_SRC emacs-lisp (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) (eval-after-load "smex" '(oni:smex-init)) -- cgit v1.2.3-54-g00ecf From cce4cd35eac3ea26fbe8c0f04f5d15f74a93b8dd Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 31 Mar 2013 01:54:30 +0100 Subject: Don't install Xmonad, I don't use it anymore --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 911aaf0..8b7f397 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ export DESTDIR:=$(HOME) modules=emacs .config .conkerorrc .local .moc .mutt .ncmpcpp \ - .pentadactyl .sawfish .ssh .w3m .weechat .zsh xmonad + .pentadactyl .sawfish .ssh .w3m .weechat .zsh objects=.bash_profile .beetsconfig .conky_box.lua .conkyrc .gitconfig \ .guile .hgrc .offlineimap.py .offlineimaprc .screenrc .scwmrc \ .slrnrc .stumpwmrc .tmux.conf .urlview .xbindkeysrc.scm .Xdefaults \ -- cgit v1.2.3-54-g00ecf From 9786d89c93a1657c715fca0c8e10f09f19b4469d Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 3 Apr 2013 01:54:52 +0200 Subject: Emacs: Add case functions, vala-mode change Add some functions that may help me managing case for enums and such. For some reason vala-mode really likes having indent-tabs-mode turned on, but I prefer it off anyway. --- emacs/init.org | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index db69785..a127d78 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -552,6 +552,42 @@ buffer hanging around. (kill-buffer (current-buffer))))) #+END_SRC +I don't have a capslock key on my keyboard, and sometimes it's +annoying to have to hold my shift key for long enums and such. The +idea is to type everything except regular caps in lower case and then +use these functions to fix them. + +#+BEGIN_SRC emacs-lisp + (defun oni:change-prev-case (num dir) + (let ((regfunc (if (eq dir 'up) 'upcase-region 'downcase-region)) + (wordfunc (if (eq dir 'up) 'upcase-word 'downcase-word))) + (if (> num 1) + (funcall regfunc (point) (- (point) num)) + (funcall wordfunc -1)))) + + (defun oni:upcase-prev (num) + (interactive "p") + (oni:change-prev-case num 'up)) + + (defun oni:downcase-prev (num) + (interactive "p") + (oni:change-prev-case num 'down)) + + (global-set-key (kbd "C-c u") 'oni:upcase-prev) + (global-set-key (kbd "C-c d") 'oni:downcase-prev) +#+END_SRC + +For some reason, =vala-mode= turns on =indent-tabs-mode=, I don't like +that. + +#+BEGIN_SRC emacs-lisp + (defun oni:vala-mode-func () + "Function for `vala-mode-hook'." + (setq indent-tabs-mode nil)) + + (add-hook 'vala-mode-hook 'oni:vala-mode-func) +#+END_SRC + #+BEGIN_SRC emacs-lisp (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) (eval-after-load "smex" '(oni:smex-init)) -- cgit v1.2.3-54-g00ecf From 541dcb98c9d81525530b29df67eac939a6614fd6 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 3 Apr 2013 01:55:21 +0200 Subject: zsh: Add xls suffix alias --- .zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.zshrc b/.zshrc index 1d167ee..fcda0bd 100644 --- a/.zshrc +++ b/.zshrc @@ -33,6 +33,7 @@ alias mysql="mysql --pager" # Suffix aliases alias -s pdf="zathura" +alias -s xls="libreoffice" setopt notify setopt PROMPT_SUBST # Allow for functions in the prompt -- cgit v1.2.3-54-g00ecf From 784f238fc1c3325332b693db99978a782ecde01f Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 3 Apr 2013 01:55:55 +0200 Subject: Stumpwm: Change the colors --- .stumpwmrc | 69 +++++++++++++++++++++++--------------------------------------- 1 file changed, 25 insertions(+), 44 deletions(-) diff --git a/.stumpwmrc b/.stumpwmrc index e7c4af6..79767c9 100644 --- a/.stumpwmrc +++ b/.stumpwmrc @@ -15,36 +15,18 @@ ;; Naquadah (defun colour (key) - (let ((colours (list :aluminium-1 #xeeeeec - :aluminium-2 #xd3d7cf - :aluminium-3 #xbabdb6 - :aluminium-4 #x888a85 - :aluminium-5 #x555753 - :aluminium-6 #x2e3436 - :butter-1 #xfce94f - :butter-2 #xedd400 - :butter-3 #xc4a000 - :orange-1 #xfcaf3e - :orange-2 #xf57900 - :orange-3 #xce5c00 - :chocolate-1 #xe9b96e - :chocolate-2 #xc17d11 - :chocolate-3 #x9f5902 - :chameleon-1 #x8ae234 - :chameleon-2 #x73d216 - :chameleon-3 #x4e9a06 - :sky-blue-1 #x729fcf - :sky-blue-2 #x3465a4 - :sky-blue-3 #x204a87 - :plum-1 #xad7fa8 - :plum-2 #x75507b - :plum-3 #x5c3566 - :scarlet-red-1 #xef2929 - :scarlet-red-2 #xcc0000 - :scarlet-red-3 #xa40000 - :background #x252a2b - :black #x0c191c - :cyan "cyan3"))) + (let ((colours (list :lblack #xeeeeec :dblack #x111113 + :lwhite #xa5a5a4 :dwhite #x222224 + :lred #xbf6d6d :dred #x744a4a + :lorange #xbfa47d :dorange #x73634a + :lyellow #xb2bf6d :dyellow #x6b734a + :lgreen #x8abf6d :dgreen #x52734a + :lturquoise #x7dbf97 :dturquoise #x4a735b + :lcyan #x7dbfbf :dcyan #x4a7373 + :lblue #x6d97bf :dblue #x4a5b73 + :lpurple #x8a7dbf :dpurple #x524a73 + :lmagenta #xb27dbf :dmagenta #x6b4a73 + :lpink #xbf6da4 :dpink #x734a63))) (getf colours key))) (defvar *conkeror-program* "conkeror" @@ -145,24 +127,23 @@ it and run *screen-unlocked-hook* after it has been unlocked." (when (eq (sb-ext:process-status p) :exited) (run-hook *screen-unlocked-hook*))))) -(set-bg-color (colour :background)) -(set-border-color (colour :aluminium-6)) -(set-fg-color (colour :aluminium-1)) -(set-float-focus-color (colour :black)) -(set-float-unfocus-color (colour :aluminium-6)) -(set-focus-color (colour :black)) +(set-bg-color (colour :dwhite)) +(set-border-color (colour :lwhite)) +(set-fg-color (colour :lblack)) +(set-float-focus-color (colour :dblack)) +(set-float-unfocus-color (colour :dwhite)) +(set-focus-color (colour :dblack)) (set-font "-*-tamsyn-medium-r-normal-*-17-*-*-*-*-0-iso8859-1") -(set-unfocus-color (colour :aluminium-6)) -(set-win-bg-color (colour :background)) +(set-unfocus-color (colour :dwhite)) +(set-win-bg-color (colour :dwhite)) -(setf *colors* (mapcar #'colour '(:black :scarlet-red-1 :chameleon-1 - :butter-1 :sky-blue-1 :plum-1 :cyan - :aluminium-1))) +(setf *colors* (mapcar #'colour '(:lwhite :lred :lgreen :lyellow :lblue + :lmagenta :lcyan :lblack))) (setf *input-window-gravity* :bottom-left) (setf *message-window-gravity* :top-right) -(setf *mode-line-background-color* (colour :background)) -(setf *mode-line-border-color* (colour :aluminium-6)) -(setf *mode-line-foreground-color* (colour :aluminium-1)) +(setf *mode-line-background-color* (colour :dwhite)) +(setf *mode-line-border-color* (colour :dwhite)) +(setf *mode-line-foreground-color* (colour :lblack)) (setf *shell-program* (getenv "SHELL")) (setf *transient-border-width* 1) (setf *window-format* "%m%50t") -- cgit v1.2.3-54-g00ecf From 1687986cdcd77fd154922df7de2e03d715db868c Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 3 Apr 2013 09:59:07 +0200 Subject: Conkeror: MozRepl doesn't work in FF 20 --- .conkerorrc/init.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index 1fc2ebd..8a932d3 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -285,12 +285,12 @@ let (mozrepl_init = get_home_directory()) { session_pref('extensions.mozrepl.initUrl', make_uri(mozrepl_init).spec); }; -if ('@hyperstruct.net/mozlab/mozrepl;1' in Cc) { - let mozrepl = Cc['@hyperstruct.net/mozlab/mozrepl;1'] - .getService(Ci.nsIMozRepl); - if (!mozrepl.isActive()) - mozrepl.start(4242); -} +// if ('@hyperstruct.net/mozlab/mozrepl;1' in Cc) { +// let mozrepl = Cc['@hyperstruct.net/mozlab/mozrepl;1'] +// .getService(Ci.nsIMozRepl); +// if (!mozrepl.isActive()) +// mozrepl.start(4242); +// } register_user_stylesheet( "data:text/css," + -- cgit v1.2.3-54-g00ecf From 13b625585a471f50f3aae5825e40795245b91aa3 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 9 Apr 2013 16:50:58 +0200 Subject: Conkeror: set programs for pdf, xls To zathura and libreoffice respectively --- .conkerorrc/init.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index 8a932d3..1d1387c 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -173,7 +173,8 @@ remove_hook("download_added_hook", open_download_buffer_automatically); hints_minibuffer_annotation_mode(true); theme_load("yoshi"); -external_content_handlers.set("application/pdf", "xpdf"); +external_content_handlers.set("application/pdf", "zathura"); +external_content_handlers.set("application/vnd.ms-excel", "libreoffice"); var gh_url = "http://github.com/"; function read_url_github_ad_command_handler(input) -- cgit v1.2.3-54-g00ecf From d90fe264ea5809996eb6993bb651b687c259cf04 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 9 Apr 2013 16:51:39 +0200 Subject: Stumpwm: Use function instead of lambda --- .stumpwmrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.stumpwmrc b/.stumpwmrc index 79767c9..3583e68 100644 --- a/.stumpwmrc +++ b/.stumpwmrc @@ -117,15 +117,18 @@ "Open URxvt" (run-or-raise *urxvt-program* '(:class "URxvt"))) +(defun run-stumpwm-hook-on-exit (process) + "Run `*screen-unlocked-hook*' if PROCESS' status is `:exited'." + (when (eq (sb-ext:process-status process) :exited) + (run-hook *screen-unlocked-hook*))) + (defcommand lock-screen () () "Lock the screen using i3lock. Run *lock-screen-hook* before locking it and run *screen-unlocked-hook* after it has been unlocked." (run-hook *lock-screen-hook*) (sb-ext:run-program "/usr/bin/i3lock" '("-n" "-c" "000000") :wait nil - :status-hook (lambda (p) - (when (eq (sb-ext:process-status p) :exited) - (run-hook *screen-unlocked-hook*))))) + :status-hook #'run-stumpwm-hook-on-exit)) (set-bg-color (colour :dwhite)) (set-border-color (colour :lwhite)) -- cgit v1.2.3-54-g00ecf From bab8601a498e6bd18c612b849c21235dd4bf65f6 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 9 Apr 2013 16:53:19 +0200 Subject: Emacs: Stop using org I like literal programming, but I'm nog good at writing stories for each change. --- emacs/.gitignore | 1 - emacs/Makefile | 4 - emacs/init.el | 607 +++++++++++++++++++++++++++++++++++ emacs/init.org | 844 ------------------------------------------------- emacs/site-lisp/ext.el | 10 - 5 files changed, 607 insertions(+), 859 deletions(-) create mode 100644 emacs/init.el delete mode 100644 emacs/init.org diff --git a/emacs/.gitignore b/emacs/.gitignore index 66209de..771231f 100644 --- a/emacs/.gitignore +++ b/emacs/.gitignore @@ -13,5 +13,4 @@ templates/ rinit.* !rinit.org history -init.el *.html diff --git a/emacs/Makefile b/emacs/Makefile index db6203e..43ee5ec 100644 --- a/emacs/Makefile +++ b/emacs/Makefile @@ -5,7 +5,3 @@ modules=eshell site-lisp snippets EMACS=emacs include ../dotfiles.mk - -init.el: init.org - $(EMACS) -Q -batch \ - -eval "(progn (require 'org) (require 'ob-tangle) (org-babel-tangle-file \"$^\"))" diff --git a/emacs/init.el b/emacs/init.el new file mode 100644 index 0000000..60ba521 --- /dev/null +++ b/emacs/init.el @@ -0,0 +1,607 @@ +;;; Turn the menu, scroll-bar and tool-bar off quickly, so they don't +;;; jump around as much. +(menu-bar-mode -1) +(scroll-bar-mode -1) +(tool-bar-mode -1) + +(defmacro eval-after-init (&rest body) + "Defer execution of BODY until after Emacs init. + +Some functionality is dependent on code loaded by package.el. +Instead of requiring package.el to load very early on, have some +functionality deferred to a point after Emacs has initialized and +package.el is loaded anyway." + `(add-hook 'emacs-startup-hook #'(lambda () ,@body))) + +;;; Load my very own theme. +(eval-after-init (load-theme 'yoshi t)) + +;;; Add some project directories and my site-lisp directory to the +;;; load path to make it easy to (auto)load them. +(mapc #'(lambda (dir) + (add-to-list 'load-path dir) + (let ((loaddefs (concat dir "/loaddefs.el"))) + (when (file-exists-p loaddefs) + (load loaddefs)))) + '("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp" + "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode")) + +;;; I have never, yet, accidentally said `y' or `n' when asked. +(defalias 'yes-or-no-p 'y-or-n-p) + +;;; These are much more feature-rich. +(defalias 'list-buffers 'ibuffer) +(defalias 'dabbrev-expand 'hippie-expand) + +(defun ext:comp-finish-function (buf str) + "Close the compilation buffer quickly if everything went OK." + (if (string-match "exited abnormally" str) + ;; there were errors + (message "compilation errors, press C-x ` to visit") + ;; no errors, make the compilation window go away in 0.5 seconds + (when (member (buffer-name) '("*Compilation*" "*compilation*")) + (run-at-time 0.5 nil 'delete-windows-on buf) + (message "No compilation errors!")))) + +(add-to-list 'compilation-finish-functions 'ext:comp-finish-function) + +;;; I close the compilation window if there are no errors. Seeing it +;;; scroll past lets me see if there were any warnings I might want to +;;; look at. +(setq compilation-scroll-output t) + +;;; Enable the excellent `paredit-mode' for any lisp-like languages. +(add-hook 'clojure-mode-hook 'paredit-mode) +(add-hook 'emacs-lisp-mode-hook 'paredit-mode) +(add-hook 'lisp-mode-hook 'paredit-mode) +(add-hook 'sawfish-mode-hook 'paredit-mode) +(add-hook 'scheme-mode-hook 'paredit-mode) + +;;; Remove the pylint and pyflakes checkers from the flycheck +;;; configuration so the flake8 checker remains. +(eval-after-load "flycheck" + '(progn + (mapc (lambda (c) (delq c flycheck-checkers)) + '(python-pylint python-pyflakes)))) + +(defun oni:pretty-control-l-function (win) + "Just make a string 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)) ?-)) + +;;; Use `oni:pretty-control-l-function' to create a nice horizontal +;;; line. +(setq pp^L-^L-string-function 'oni:pretty-control-l-function) + +;;; Don't put anything before the pp^L string. +(setq pp^L-^L-string-pre nil) + +;;; Enable pp^L at startup and again for each frame created. +(add-hook 'emacs-startup-hook 'pretty-control-l-mode) +(add-hook 'after-make-frame-functions + '(lambda (arg) (pretty-control-l-mode))) + +(setq erc-autojoin-channels-alist + '(("freenode.net" "#ninthfloor" "#emacs"))) +(setq erc-hide-list '("PART")) +(setq erc-insert-timestamp-function 'erc-insert-timestamp-left) +(setq erc-timestamp-format "[%H:%M] ") +(setq erc-timestamp-only-if-changed-flag nil) +(setq erc-nick "ryuslash") + +(defun oni:erc-mode-func () + "Function for `erc-mode-hook'." + (erc-fill-mode -1) + (visual-line-mode) + (setq truncate-lines nil)) + +(add-hook 'erc-mode-hook 'oni:erc-mode-func) + +;;; Since unison requires unbuffered input it should not show up in +;;; eshell, but a real term shell. +(eval-after-load "em-term" + '(add-to-list 'eshell-visual-commands "unison")) + +;;; To be able to highlight the eshell prompt just as I want it with +;;; regular text properties the standard highlighting should be turned +;;; off, otherwise it always overwrites whatever text properties it +;;; finds. +(setq eshell-highlight-prompt nil) + +(defun oni:eshell-prompt-function () + "Show a pretty shell prompt." + (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) + (hostname (shell-command-to-string "hostname")) + (dir (abbreviate-file-name (eshell/pwd))) + (branch + (shell-command-to-string + "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) + (userstatus (if (zerop (user-uid)) ?# ?$))) + (concat + (propertize (char-to-string status) + 'face `(:foreground ,(if (= status ?+) + "green" + "red"))) + " " + (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) + " " + (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) + " " + (when (not (string= branch "")) + (propertize + ;; Cut off "* " and "\n" + (substring branch 2 -1) + 'face 'font-lock-function-name-face)) + " \n" + (propertize (char-to-string userstatus) + 'face `(:foreground "blue")) + "> "))) + +(setq eshell-prompt-function 'oni:eshell-prompt-function + eshell-prompt-regexp "^[#$]> ") + +(defun oni:eshell-mode-func () + "Function for `eshell-mode-hook'." + (setq truncate-lines nil)) + +(add-hook 'eshell-mode-hook 'oni:eshell-mode-func) + +(defun oni:raise-eshell () + "Start or switch back to `eshell'. +Also change directories to current working directory." + (interactive) + (let ((dir (file-name-directory + (or (buffer-file-name) "~/"))) + (hasfile (not (eq (buffer-file-name) nil)))) + (eshell) + (if (and hasfile (eq eshell-process-list nil)) + (progn + (eshell/cd dir) + (eshell-reset))))) + +(global-set-key (kbd "") 'oni:raise-eshell) + +;;; Since I don't ever get any mail from people that use right-to-left +;;; text, and even if I did I wouldn't be able to read it, I don't +;;; need bidirectional text support. You shouldn't actually disable it +;;; (if that's even still possible) since, supposedly, it is an +;;; integral part of the display engine now, but telling it to always +;;; use left-to-right should keep it from slowing your emacs down. +(setq-default bidi-paragraph-direction 'left-to-right) + +;;; Enable the following commands because they're useful sometimes and +;;; I'm not an Emacs beginner anymore, they don't confuse me. +(put 'upcase-region 'disabled nil) +(put 'downcase-region 'disabled nil) +(put 'narrow-to-region 'disabled nil) +(put 'scroll-left 'disabled nil) + +(defun oni:jabber-init () + "Initialization function for jabber." + (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) + +(eval-after-load "jabber" '(oni:jabber-init)) + +(autoload 'jabber-message-libnotify "jabber-libnotify") +(autoload 'jabber-muc-libnotify "jabber-libnotify") + +(add-hook 'jabber-alert-message-hooks 'jabber-message-libnotify) +(add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify) + +(setq jabber-history-enabled t + jabber-history-muc-enabled t) + +(setq jabber-use-global-history nil + jabber-history-dir "~/.emacs.d/jabber-hist") + +(setq jabber-account-list '(("ryuslash@jabber.org") + ("tom@ryuslash.org/drd" + (:connection-type . ssl)))) + +(defun oni:ido-init () + "Initialization functionn for ido." + (setq ido-ignore-buffers + (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" + (eval-when-compile + (regexp-opt + '("*-jabber-roster-*" + "*Messages*" + "*fsm-debug*" + "*magit-process*" + "*magit-edit-log*" + "*Backtrace*" + "*Ibuffer*")))))) + +(eval-after-load "ido" '(oni:ido-init)) + +(setq ido-auto-merge-delay-time 1000000) + +(setq ido-default-buffer-method 'selected-window) + +(setq ido-max-window-height 1) + +(setq ido-save-directory-list-file nil) + +(ido-mode) + +(setq ido-ubiquitous-command-exceptions + '(org-refile org-capture-refile)) + +(add-hook 'emacs-startup-hook 'ido-ubiquitous-mode) + +(global-set-key (kbd "M-n") 'idomenu) + +(setq minibuffer-eldef-shorten-default t) +(minibuffer-electric-default-mode) + +(setq mode-line-default-help-echo "") + +(eval-after-load "jedi" '(setcar jedi:server-command "python2")) +(add-hook 'python-mode-hook 'jedi:setup) + +(setq jedi:tooltip-method nil) + +(defface git-commit-summary-face + '((t (:inherit org-level-1))) + "Face for the git title line." + :group 'local) + +(defface git-commit-overlong-summary-face + '((t (:background "#873732"))) + "Face for commit titles that are too long." + :group 'local) + +(defface git-commit-nonempty-second-line-face + '((t (:inherit git-commit-overlong-summary-face))) + "Face for the supposedly empty line in commit messages." + :group 'local) + +(eval-after-load "org" '(require 'org-init)) + +(defun indent-defun () + "Indent the current defun." + (interactive) + (save-excursion + (mark-defun) + (indent-region (region-beginning) (region-end)))) + +(global-set-key (kbd "C-M-z") 'indent-defun) + +(defadvice term-handle-exit (after oni:kill-buffer-after-exit activate) + "Kill the term buffer if the process finished." + (let ((msg (ad-get-arg 1))) + (when (string-equal msg "finished\n") + (kill-buffer (current-buffer))))) + +(defun oni:change-prev-case (num dir) + (let ((regfunc (if (eq dir 'up) 'upcase-region 'downcase-region)) + (wordfunc (if (eq dir 'up) 'upcase-word 'downcase-word))) + (if (> num 1) + (funcall regfunc (point) (- (point) num)) + (funcall wordfunc -1)))) + +(defun oni:upcase-prev (num) + (interactive "p") + (oni:change-prev-case num 'up)) + +(defun oni:downcase-prev (num) + (interactive "p") + (oni:change-prev-case num 'down)) + +(global-set-key (kbd "C-c u") 'oni:upcase-prev) +(global-set-key (kbd "C-c d") 'oni:downcase-prev) + +(defun oni:vala-mode-func () + "Function for `vala-mode-hook'." + (setq indent-tabs-mode nil)) + +(add-hook 'vala-mode-hook 'oni:vala-mode-func) + +(eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) +(eval-after-load "smex" '(oni:smex-init)) +(eval-after-load "yasnippet" '(oni:yasnippet-init)) + +(autoload 'define-slime-contrib "slime") +(autoload 'gtags-mode "gtags" nil t) +(autoload 'jabber-connect "jabber" nil t) +(autoload 'php-mode "php-mode" nil t) +(autoload 'po-mode "po-mode" nil t) +(autoload 'pony-mode "pony-mode" nil t) +(autoload 'sawfish-mode "sawfish" nil t) +(autoload 'server-running-p "server") +(autoload 'slime-js-minor-mode "slime-js" nil t) +(autoload 'xmodmap-mode "xmodmap-mode" nil t) +(autoload 'w3m-bookmark-view "w3m" nil t) +(autoload 'w3m-goto-url "w3m" nil t) + +(require 'uniquify) +(require 'ext) +(require 'oni) + +(setq-default c-basic-offset 4) +(setq-default fci-rule-column 73) +(setq-default indent-tabs-mode nil) +(setq-default php-mode-warn-if-mumamo-off nil) +(setq-default require-final-newline t) +(setq-default tab-width 4) +(setq-default truncate-lines t) + +(setq appt-disp-window-function #'oni:appt-display-window-and-jabber) +(setq appt-display-diary nil) +(setq auto-mode-case-fold nil) +(setq auto-save-file-name-transforms oni:auto-save-name-transforms) +(setq avandu-article-render-function #'avandu-view-w3m) +(setq backup-directory-alist oni:backup-directory-alist) +(setq browse-url-browser-function 'browse-url-generic) +(setq browse-url-generic-program (getenv "BROWSER")) +(setq c-offsets-alist '((statement-block-intro . +) + (knr-argdecl-intro . 5) + (substatement-open . +) + (substatement-label . 0) + (label . 0) + (statement-case-open . +) + (statement-cont . +) + (arglist-intro . +) + (arglist-close . 0) + (inline-open . 0) + (brace-list-open . +) + (topmost-intro-cont first c-lineup-topmost-intro-cont + c-lineup-gnu-DEFUN-intro-cont))) +(setq comment-auto-fill-only-comments t) +(setq custom-file "~/.emacs.d/custom.el") +(setq custom-theme-directory "~/.emacs.d/themes") +(setq default-frame-alist + `((border-width . 0) + (internal-border-width . 0) + (vertical-scroll-bars . nil) + (menu-bar-lines . nil) + (tool-bar-lines . nil) + (font . "Envy Code R:pixelsize=18"))) +(setq elnode-do-init nil) +(setq fci-rule-color "darkred") +(setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) +(setq geiser-repl-history-filename "~/.emacs.d/geiser-history") +(setq gnus-init-file "~/.emacs.d/gnus") +(setq gtags-auto-update t) +(setq help-at-pt-display-when-idle t) +(setq highlight-80+-columns 72) +(setq identica-enable-striping t) +(setq inferior-lisp-program "sbcl") +(setq inhibit-default-init t) +(setq inhibit-local-menu-bar-menus t) +(setq inhibit-startup-message t) +(setq initial-major-mode 'emacs-lisp-mode) +(setq initial-scratch-message nil) +(setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") +(setq jabber-chat-buffer-format "*jab:%n*") +(setq jabber-chat-buffer-show-avatar nil) +(setq jabber-chat-fill-long-lines nil) +(setq jabber-chat-foreign-prompt-format "%t %u/%r <\n") +(setq jabber-chat-local-prompt-format "%t %u/%r >\n") +(setq jabber-chatstates-confirm nil) +(setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) +(setq jabber-roster-show-bindings nil) +(setq jabber-vcard-avatars-publish nil) +(setq jabber-vcard-avatars-retrieve nil) +(setq jit-lock-defer-time 0.2) +(setq magit-repo-dirs '("~/projects/")) +(setq message-log-max 1000) +(setq message-send-mail-function 'message-send-mail-with-sendmail) +(setq message-sendmail-extra-arguments '("-a" "ryuslash")) +(setq package-archives + '(("melpa" . "http://melpa.milkbox.net/packages/") + ("marmalade" . "http://marmalade-repo.org/packages/") + ("gnu" . "http://elpa.gnu.org/packages/"))) +(setq package-load-list '((htmlize "1.39") + (lua-mode "20111107") + all)) +(setq php-function-call-face 'font-lock-function-name-face) +(setq php-mode-force-pear t) +(setq pony-tpl-indent-moves t) +(setq rainbow-delimiters-max-face-count 12) +(setq redisplay-dont-pause t) +(setq send-mail-function 'smtpmail-send-it) +(setq sendmail-program "/usr/bin/msmtp") +(setq sentence-end-double-space nil) +(setq smex-key-advice-ignore-menu-bar t) +(setq smex-save-file "~/.emacs.d/smex-items") +(setq split-height-threshold 40) +(setq time-stamp-active t) +(setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") +(setq type-break-good-rest-interval (* 60 10)) +(setq type-break-interval (* 60 50)) +(setq type-break-keystroke-threshold '(nil . nil)) +(setq uniquify-buffer-name-style 'post-forward) +(setq use-dialog-box nil) +(setq user-full-name "Tom Willemsen") +(setq user-mail-address "tom@ryuslash.org") +(setq w3m-fill-column 72) +(setq window-combination-resize t) +(setq yas-fallback-behavior nil) +(setq yas-prompt-functions '(yas-ido-prompt)) + +(add-hook 'after-change-major-mode-hook 'set-current-mode-icon) +(add-hook 'after-save-hook 'oni:after-save-func t) +(add-hook 'before-save-hook 'oni:before-save-func) +(add-hook 'c-mode-hook 'oni:c-mode-func) +(add-hook 'css-mode-hook 'oni:css-mode-func) +(add-hook 'diary-display-hook 'oni:diary-display-func) +(add-hook 'emacs-startup-hook 'oni:emacs-startup-func) +(add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-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 'html-mode-hook 'oni:html-mode-func) +(add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func) +(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func) +(add-hook 'java-mode-hook 'oni:java-mode-func) +(add-hook 'js-mode-hook 'oni:js-mode-func) +(add-hook 'js2-mode-hook 'oni:js2-mode-func) +(add-hook 'lua-mode-hook 'oni:lua-mode-func) +(add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func) +(add-hook 'markdown-mode-hook 'oni:markdown-mode-func) +(add-hook 'message-mode-hook 'oni:message-mode-func) +(add-hook 'org-mode-hook 'oni:org-mode-func) +(add-hook 'php-mode-hook 'oni:php-mode-func) +(add-hook 'prog-mode-hook 'oni:prog-mode-func) +(add-hook 'python-mode-hook 'oni:python-mode-func) +(add-hook 'rst-mode-hook 'oni:rst-mode-func) +(add-hook 'term-mode-hook 'oni:term-mode-func) +(add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func) +(add-hook 'write-file-hooks 'oni:write-file-func) +(add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func) + +(define-key key-translation-map (kbd "C-j") (kbd "C-l")) +(define-key key-translation-map (kbd "C-l") (kbd "C-j")) + +(global-set-key (kbd "'") 'oni:self-insert-dwim) +(global-set-key (kbd "") 'oni:raise-scratch) +(global-set-key (kbd "") 'gnus) +(global-set-key (kbd "") 'git-project-show-files) +(global-set-key (kbd "") 'ext:reload-buffer) +(global-set-key (kbd "") 'jabber-switch-to-roster-buffer) +(global-set-key (kbd "") 'magit-status) +(global-set-key (kbd "") 'oni:show-org-index) +(global-set-key (kbd "C-<") 'oni:indent-shift-left) +(global-set-key (kbd "C->") 'oni:indent-shift-right) +(global-set-key (kbd "C-M-4") 'split-window-vertically) +(global-set-key (kbd "C-M-SPC") 'er/expand-region) +(global-set-key (kbd "C-M-d") 'kill-word) +(global-set-key (kbd "C-M-w") 'backward-kill-word) +(global-set-key (kbd "C-S-k") 'kill-whole-line) +(global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim) +(global-set-key (kbd "C-c a") 'org-agenda) +(global-set-key (kbd "C-c c") 'org-capture) +(global-set-key (kbd "C-c i p") 'identica-update-status-interactive) +(global-set-key (kbd "C-c p") 'oni:show-buffer-position) +(global-set-key (kbd "C-c t") 'oni:raise-ansi-term) +(global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char) +(global-set-key (kbd "C-e") 'oni:move-end-of-dwim) +(global-set-key (kbd "C-k") 'oni:kill-region-or-line) +(global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char) +(global-set-key (kbd "M-0") 'delete-window) +(global-set-key (kbd "M-1") 'delete-other-windows) +(global-set-key (kbd "M-2") 'split-window-below) +(global-set-key (kbd "M-3") 'split-window-right) +(global-set-key (kbd "M-4") 'split-window-horizontally) +(global-set-key (kbd "M-o") 'other-window) +(global-set-key (kbd "\"") 'oni:self-insert-dwim) + +(if (daemonp) + (global-set-key "\C-x\C-c" 'oni:close-client-window)) + +(when (or window-system (daemonp)) + (global-unset-key "\C-z")) + +(add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode)) +(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode)) +(add-to-list 'auto-mode-alist + '("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode)) +(add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode)) +(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) +(add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode)) +(add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode)) +(add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode)) + +(add-to-list 'debug-ignored-errors "^Can't shift all lines enough") + +(add-to-list + 'display-buffer-alist + '("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil)))) +(add-to-list + 'display-buffer-alist + '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) +(add-to-list + 'display-buffer-alist + '("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil)))) + +(blink-cursor-mode -1) +(column-number-mode -1) +(line-number-mode -1) +(tooltip-mode -1) + +(package-initialize) + +(auto-insert-mode) +(electric-indent-mode) +(savehist-mode) +(show-paren-mode) +(winner-mode) + +(smex-initialize) +(help-at-pt-set-timer) +(windmove-default-keybindings) +(global-diff-hl-mode) + +;;; Diminish lighter for a bunch of minor modes that should be on in +;;; certain modes and usually just clogg up the mode line. +(diminish 'auto-fill-function) +(eval-after-load "eldoc" '(diminish 'eldoc-mode)) +(eval-after-load "paredit" '(diminish 'paredit-mode)) +(eval-after-load "auto-complete" '(diminish 'auto-complete-mode)) +(eval-after-load "flycheck" '(diminish 'flycheck-mode)) +(eval-after-load "smartparens" '(diminish 'smartparens-mode)) + +;;; Popping up multiple frames out of the blue does not usually play +;;; well with (manual) tiling window managers. +(setq ediff-window-setup-function 'ediff-setup-windows-plain) + +;;; Not being able to find newly written functions in imenu is a pain. +(setq imenu-auto-rescan t) + +;;; Yanking at click makes not sense to me. I normally have my cursor +;;; where it needs to point and if I *have* to use the mouse I prefer +;;; just clicking it wherever it lands, without having to drag it all +;;; the way to the proper place. +(setq mouse-yank-at-point t) + +;;; Always having to move the cursor around so much after scrolling +;;; gets annoying. +(setq scroll-preserve-screen-position t) + +;;; I store my blog posts in `~/documents/blog', not the default +;;; `~/Blog'. +(setq eltuki-blog-dir "~/documents/blog") + +(setq sp-cancel-autoskip-on-backward-movement nil) + +(add-hook 'python-mode-hook 'smartparens-mode) +(add-hook 'html-mode-hook 'smartparens-mode) + +(defun oni:scroll-down-or-prev-page (arg) + "Either scroll down or go to the previous page. + +Depending on the value of `buffer-narrowed-p'." + (interactive "P") + (if (buffer-narrowed-p) + (progn + (narrow-to-page (or arg -1)) + (goto-char (point-min))) + (scroll-down-command arg))) + +(defun oni:scroll-up-or-next-page (arg) + "Either scroll up or go to the next page. + +Depending on the value of `buffer-narrowed-p'." + (interactive "P") + (if (buffer-narrowed-p) + (progn + (narrow-to-page (or arg 1)) + (goto-char (point-min))) + (scroll-up-command arg))) + +(global-set-key (kbd "") 'oni:scroll-down-or-prev-page) +(global-set-key (kbd "") 'oni:scroll-up-or-next-page) + +;;; Emacs Alsa Player +(add-to-list 'load-path "~/.emacs.d/site-lisp/eap") +(load "eap-autoloads") + +(setq eap-music-library "/mnt/music") +(setq eap-playlist-library "~/music/playlists") + +;;; Finally, load any `customize' settings and slime. +(load custom-file) +(load (expand-file-name "~/quicklisp/slime-helper.el")) diff --git a/emacs/init.org b/emacs/init.org deleted file mode 100644 index a127d78..0000000 --- a/emacs/init.org +++ /dev/null @@ -1,844 +0,0 @@ -#+TITLE: Emacs init -#+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html -#+OPTIONS: author:nil num:nil -#+PROPERTY: tangle init.el -#+STARTUP: showall - -Disable the ~menu-bar-mode~, ~tool-bar-mode~ and ~scroll-bar-mode~ early on -so the disappear quickly after emacs starts up. - -#+BEGIN_SRC emacs-lisp - (menu-bar-mode -1) - (scroll-bar-mode -1) - (tool-bar-mode -1) -#+END_SRC - -Define a macro for deferring code until after emacs has started up. -This gets used by certain functions that rely on packages installed -from ELPA. These packages don't get loaded until /after/ the init file -has completed loading. - -#+BEGIN_SRC emacs-lisp - (defmacro eval-after-init (&rest body) - "Defer execution of BODY until after Emacs init." - `(add-hook 'emacs-startup-hook #'(lambda () ,@body))) -#+END_SRC - -Defer loading my theme until after emacs initialization. This is -because it has been installed with ~package.el~, and the packages aren't -added to the ~load-path~ until _after_ ~init.el~ has been run through. - -#+BEGIN_SRC emacs-lisp - (eval-after-init (load-theme 'yoshi t)) -#+END_SRC - -Add some of my project directories and other important directories -into ~load-path~ so I can easily load libraries in them. Also, if it -exists, load ~loaddefs.el~ in each directory for autoloads. - -#+BEGIN_SRC emacs-lisp - (mapc #'(lambda (dir) - (add-to-list 'load-path dir) - (let ((loaddefs (concat dir "/loaddefs.el"))) - (when (file-exists-p loaddefs) - (load loaddefs)))) - '("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp" - "~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode")) -#+END_SRC - -Replace the question of ~yes~ or ~no~ with just ~y~ or ~n~, I have never (yet) -accidentally typed a ~y~ or ~n~ when asked and typing ~yes~ or ~no~ is just -too much work. - -#+BEGIN_SRC emacs-lisp - (defalias 'yes-or-no-p 'y-or-n-p) -#+END_SRC - -Replace these functions with better alternatives. They offer the same -functionality, plus more. - -#+BEGIN_SRC emacs-lisp - (defalias 'list-buffers 'ibuffer) - (defalias 'dabbrev-expand 'hippie-expand) -#+END_SRC - -#+BEGIN_SRC emacs-lisp - (setq compilation-scroll-output t) -#+END_SRC - -#+BEGIN_SRC emacs-lisp - (add-hook 'clojure-mode-hook 'paredit-mode) - (add-hook 'emacs-lisp-mode-hook 'paredit-mode) - (add-hook 'lisp-mode-hook 'paredit-mode) - (add-hook 'scheme-mode-hook 'paredit-mode) -#+END_SRC - -Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to -"allowed" files and add go error output to error patterns. - -#+BEGIN_SRC emacs-lisp - (defun oni:flymake-init () - "Initialization function for flymake." - (require 'flymake-cursor) - - (add-to-list ; Make sure pyflakes is loaded - 'flymake-allowed-file-name-masks ; for python files. - '("\\.py\\'" ext:flymake-pyflakes-init)) - - (add-to-list ; Error line repexp for go - 'flymake-err-line-patterns ; compilation. - '("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$" - 1 2 nil 3)) - - (add-to-list ; Go uses makefiles, makes - 'flymake-allowed-file-name-masks ; flymaking 'easy'. - '("\\.go$" flymake-simple-make-init))) - - (eval-after-load "flymake" '(oni:flymake-init)) -#+END_SRC - -Disable the GUI for flymake errors. This causes the flymake errors -to be shown in the minibuffer. - -#+BEGIN_SRC emacs-lisp - (setq flymake-gui-warnings-enabled nil) -#+END_SRC - -Add a bunch of pep8, flymake and pyflakes messages to warning and -info patterns, set the log file to somewhere in my home directory -and set logging level to 0. - -#+BEGIN_SRC emacs-lisp - (setq flymake-info-line-regexp - (eval-when-compile - (regexp-opt - '("Invalid name" - "String statement has no effect" - "Missing docstring" - "Empty docstring" - "multiple imports on one line" - "expected 2 blank lines, found 1" - "expected 2 blank lines, found 0" - "TODO:" - "whitespace after '{'" - "whitespace before '}'" - "whitespace before ':'" - "whitespace after '('" - "whitespace before ')'" - "whitespace after '['" - "whitespace before ']'" - "the backslash is redundant between brackets" - "continuation line over-indented for visual indent" - "continuation line under-indented for visual indent" - "Too many statements" - "comparison to None should be" - "missing whitespace around operator" - "missing whitespace after ','" - "line too long" - "at least two spaces before inline comment" - "trailing whitespace" - "imported but unused" - "Unused import" - "too many blank lines")))) - (setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log")) - (setq flymake-log-level 0) - (setq flymake-warn-line-regexp - (eval-when-compile - (regexp-opt '("warning" - "Warning" - "redefinition of unused" - "Redefining built-in" - "Redefining name" - "Unused argument" - "Unused variable" - "Dangerous default value {} as argument" - "no newline at end of file" - "Access to a protected member")))) -#+END_SRC - -After loading ~flycheck~ Remove the default python checkers and -replace them with my own, which tries both ~flake8~ and ~pylint~. - -#+BEGIN_SRC emacs-lisp - (eval-after-load "flycheck" - '(progn - (mapc (lambda (c) (delete c flycheck-checkers)) - '(python-pylint python-pyflakes)))) -#+END_SRC - -Make the ~C-l~ look like a line of ~-~ up to =fill-column= or -=fci-rule-column= and remove the string displayed before the ~C-l~. - -#+BEGIN_SRC emacs-lisp - (defun oni:pretty-control-l-function (win) - "Just make a string of either `fci-rule-column' or - `fill-column' length -1. Use the `-' character. WIN is ignored." - (make-string - (1- (if (boundp 'fci-rule-column) - fci-rule-column fill-column)) ?-)) - - (setq pp^L-^L-string-function 'oni:pretty-control-l-function) -#+END_SRC - -Remove the string displayed before the ~C-l~. - -#+BEGIN_SRC emacs-lisp - (setq pp^L-^L-string-pre nil) -#+END_SRC - -Enable =pretty-control-l-mode= at startup and whenever a new frame is -created. - -#+BEGIN_SRC emacs-lisp - (add-hook 'emacs-startup-hook 'pretty-control-l-mode) - (add-hook 'after-make-frame-functions - '(lambda (arg) (pretty-control-l-mode))) -#+END_SRC - -Automatically join some channels when connecting to freenode.net. - -#+BEGIN_SRC emacs-lisp - (setq erc-autojoin-channels-alist - '(("freenode.net" "#ninthfloor" "#emacs"))) -#+END_SRC - -Don't show ~PART~ messages. - -#+BEGIN_SRC emacs-lisp - (setq erc-hide-list '("PART")) -#+END_SRC - -Insert a timestamp every time a message comes in, print it on the -left and print the hour and minute parts of the time. - -#+BEGIN_SRC emacs-lisp - (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) - (setq erc-timestamp-format "[%H:%M] ") - (setq erc-timestamp-only-if-changed-flag nil) -#+END_SRC - -Set my nickname. - -#+BEGIN_SRC emacs-lisp - (setq erc-nick "ryuslash") -#+END_SRC - -When starting ERC disable truncating lines, don't let ERC fill each -line and enable =visual-line-mode=. - -#+BEGIN_SRC emacs-lisp - (defun oni:erc-mode-func () - "Function for `erc-mode-hook'." - (erc-fill-mode -1) - (visual-line-mode) - (setq truncate-lines nil)) - - (add-hook 'erc-mode-hook 'oni:erc-mode-func) -#+END_SRC - -Add ~unison~ to the list of =eshell-visual-commands= because it -expects unbuffered input and eshell just doesn't give that. - -#+BEGIN_SRC emacs-lisp - (eval-after-load "em-term" - '(add-to-list 'eshell-visual-commands "unison")) -#+END_SRC - -Don't let eshell highlight it's prompt, this way I can decide the -colors for it myself. - -#+BEGIN_SRC emacs-lisp - (setq eshell-highlight-prompt nil) -#+END_SRC - -In the prompt: - - - Show the exit status of the last program/command run represented - by a green ~+~ and a red ~-~ sign. - - Show the current hostname with the =mode-line-buffer-id= face. - - Show an abbreviation of the current directory (as seen in ~fish~) - using the =font-lock-string-face= face. - - If we're in a git repository, show the current branch with the - =font-lock-function-name-face= face. - - Show the status of priviledges in blue. - -And set the =eshell-prompt-regexp= to - -#+BEGIN_SRC emacs-lisp - (defun oni:eshell-prompt-function () - "Show a pretty shell prompt." - (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) - (hostname (shell-command-to-string "hostname")) - (dir (abbreviate-file-name (eshell/pwd))) - (branch - (shell-command-to-string - "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) - (userstatus (if (zerop (user-uid)) ?# ?$))) - (concat - (propertize (char-to-string status) - 'face `(:foreground ,(if (= status ?+) - "green" - "red"))) - " " - (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) - " " - (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) - " " - (when (not (string= branch "")) - (propertize - ;; Cut off "* " and "\n" - (substring branch 2 -1) - 'face 'font-lock-function-name-face)) - " \n" - (propertize (char-to-string userstatus) - 'face `(:foreground "blue")) - "> "))) - - (setq eshell-prompt-function 'oni:eshell-prompt-function - eshell-prompt-regexp "^[#$]> ") -#+END_SRC - -Don't truncate lines in eshell, wrap them. - -#+BEGIN_SRC emacs-lisp - (defun oni:eshell-mode-func () - "Function for `eshell-mode-hook'." - (setq truncate-lines nil)) - - (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) -#+END_SRC - -Bind the ~f8~ key to easily show eshell. - -#+BEGIN_SRC emacs-lisp - (defun oni:raise-eshell () - "Start or switch back to `eshell'. - Also change directories to current working directory." - (interactive) - (let ((dir (file-name-directory - (or (buffer-file-name) "~/"))) - (hasfile (not (eq (buffer-file-name) nil)))) - (eshell) - (if (and hasfile (eq eshell-process-list nil)) - (progn - (eshell/cd dir) - (eshell-reset))))) - - (global-set-key (kbd "") 'oni:raise-eshell) -#+END_SRC - -Disable bi-directional text, since I don't write right-to-left -myself and I don't know anyone who does. I have read that it is a -bad idea to disable it completely, but forcing left-to-right should -help. - -#+BEGIN_SRC emacs-lisp - (setq-default bidi-paragraph-direction 'left-to-right) -#+END_SRC - -There are some functions which get disabled by default because they -"confuse new users", but these I like using. - -#+BEGIN_SRC emacs-lisp - (put 'upcase-region 'disabled nil) - (put 'downcase-region 'disabled nil) - (put 'narrow-to-region 'disabled nil) - (put 'scroll-left 'disabled nil) -#+END_SRC - -Don't echo presence updates in the message area. - -#+BEGIN_SRC emacs-lisp - (defun oni:jabber-init () - "Initialization function for jabber." - (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) - - (eval-after-load "jabber" '(oni:jabber-init)) -#+END_SRC - -Autoload functions from =jabber-libnotify= so we can use them in some -hooks. - -#+BEGIN_SRC emacs-lisp - (autoload 'jabber-message-libnotify "jabber-libnotify") - (autoload 'jabber-muc-libnotify "jabber-libnotify") -#+END_SRC - -Enable libnotify alerts for regular and mutli-user chats, this is -preferable to seeing them in the echo area. - -#+BEGIN_SRC emacs-lisp - (add-hook 'jabber-alert-message-hooks 'jabber-message-libnotify) - (add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify) -#+END_SRC - -Keep track of what was said to and by my contacts, both for -"personal" chats and muc chats. - -#+BEGIN_SRC emacs-lisp - (setq jabber-history-enabled t - jabber-history-muc-enabled t) -#+END_SRC - -Store history on a per-contact basis and keep these files in -~$HOME/.emacs.d/jabber-hist~. - -#+BEGIN_SRC emacs-lisp - (setq jabber-use-global-history nil - jabber-history-dir "~/.emacs.d/jabber-hist") -#+END_SRC - -Add some accounts. - -#+BEGIN_SRC emacs-lisp - (setq jabber-account-list '(("ryuslash@jabber.org") - ("tom@ryuslash.org/drd" - (:connection-type . ssl)))) -#+END_SRC - -Keep some buffers from showing up when using ido-mode. Either these -get used very rarely or they don't have any really useful -information in them. - -#+BEGIN_SRC emacs-lisp - (defun oni:ido-init () - "Initialization functionn for ido." - (setq ido-ignore-buffers - (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" - (eval-when-compile - (regexp-opt - '("*-jabber-roster-*" - "*Messages*" - "*fsm-debug*" - "*magit-process*" - "*magit-edit-log*" - "*Backtrace*" - "*Ibuffer*")))))) - - (eval-after-load "ido" '(oni:ido-init)) -#+END_SRC - -Ido tries to be smart and find files in other directories, I don't -like that, stop doing that (or at least wait a long time). - -#+BEGIN_SRC emacs-lisp - (setq ido-auto-merge-delay-time 1000000) -#+END_SRC - -Open files in the selected window when switching between buffers. - -#+BEGIN_SRC emacs-lisp - (setq ido-default-buffer-method 'selected-window) -#+END_SRC - -Only ever show one line of possibilities when using ido. I hate it -when the minibuffer grows. - -#+BEGIN_SRC emacs-lisp - (setq ido-max-window-height 1) -#+END_SRC - -Don't save ido state between invocations. - -#+BEGIN_SRC emacs-lisp - (setq ido-save-directory-list-file nil) -#+END_SRC - -Enable =ido-mode=. - -#+BEGIN_SRC emacs-lisp - (ido-mode) -#+END_SRC - -Don't use ido when calling =org-refile= or =org-capture-refile=. - -#+BEGIN_SRC emacs-lisp - (setq ido-ubiquitous-command-exceptions - '(org-refile org-capture-refile)) -#+END_SRC - -Enable =ido-ubiquitous=. - -#+BEGIN_SRC emacs-lisp - (add-hook 'emacs-startup-hook 'ido-ubiquitous-mode) -#+END_SRC - -Call =idomenu= with ~M-n~. - -#+BEGIN_SRC emacs-lisp - (global-set-key (kbd "M-n") 'idomenu) -#+END_SRC - -A new feature in Emacs 24.3 can shorten ~(default ...)~ to ~[...]~ when -prompting for something. The =minibuffer-eldef-shorten-default= should -be set before enabling the =minibuffer-electric-default-mode=. - -#+BEGIN_SRC emacs-lisp - (setq minibuffer-eldef-shorten-default t) - (minibuffer-electric-default-mode) -#+END_SRC - -Don't show any default help messages, if no help message was -specified, just leave the echo area empty. - -#+BEGIN_SRC emacs-lisp - (setq mode-line-default-help-echo "") -#+END_SRC - -Start jedi when =python-mode= is started. - -#+BEGIN_SRC emacs-lisp - (eval-after-load "jedi" '(setcar jedi:server-command "python2")) - (add-hook 'python-mode-hook 'jedi:setup) -#+END_SRC - -Show argument lists and such from jedi in the echo area. - -#+BEGIN_SRC emacs-lisp - (setq jedi:tooltip-method nil) -#+END_SRC - -Define some faces to make editing magit logs nicer. - -#+BEGIN_SRC emacs-lisp - (defface git-commit-summary-face - '((t (:inherit org-level-1))) - "Face for the git title line." - :group 'local) - - (defface git-commit-overlong-summary-face - '((t (:background "#873732"))) - "Face for commit titles that are too long." - :group 'local) - - (defface git-commit-nonempty-second-line-face - '((t (:inherit git-commit-overlong-summary-face))) - "Face for the supposedly empty line in commit messages." - :group 'local) -#+END_SRC - -I have quite a few modifications to my org-mode setup, so don't load -them immediately, they take a little time to load. - -#+BEGIN_SRC emacs-lisp - (eval-after-load "org" '(require 'org-init)) -#+END_SRC - -Found on [[http://emacsredux.com/blog/2013/03/28/indent-defun/][Indent defun - Emacs Redux]], indents a function. Should be -just a tiny bit easier than going to the beginning of a function and -then calling =indent-sexp=, which only works in lisp-like languages -anyway. - -#+BEGIN_SRC emacs-lisp - (defun indent-defun () - "Indent the current defun." - (interactive) - (save-excursion - (mark-defun) - (indent-region (region-beginning) (region-end)))) - - (global-set-key (kbd "C-M-z") 'indent-defun) -#+END_SRC - -Kill the ~*ansi-term*~ buffer (or any term buffer) after the underlying -shell process has finished. When I quit a shell I don't want the -buffer hanging around. - -#+BEGIN_SRC emacs-lisp - (defadvice term-handle-exit (after oni:kill-buffer-after-exit activate) - "Kill the term buffer if the process finished." - (let ((msg (ad-get-arg 1))) - (when (string-equal msg "finished\n") - (kill-buffer (current-buffer))))) -#+END_SRC - -I don't have a capslock key on my keyboard, and sometimes it's -annoying to have to hold my shift key for long enums and such. The -idea is to type everything except regular caps in lower case and then -use these functions to fix them. - -#+BEGIN_SRC emacs-lisp - (defun oni:change-prev-case (num dir) - (let ((regfunc (if (eq dir 'up) 'upcase-region 'downcase-region)) - (wordfunc (if (eq dir 'up) 'upcase-word 'downcase-word))) - (if (> num 1) - (funcall regfunc (point) (- (point) num)) - (funcall wordfunc -1)))) - - (defun oni:upcase-prev (num) - (interactive "p") - (oni:change-prev-case num 'up)) - - (defun oni:downcase-prev (num) - (interactive "p") - (oni:change-prev-case num 'down)) - - (global-set-key (kbd "C-c u") 'oni:upcase-prev) - (global-set-key (kbd "C-c d") 'oni:downcase-prev) -#+END_SRC - -For some reason, =vala-mode= turns on =indent-tabs-mode=, I don't like -that. - -#+BEGIN_SRC emacs-lisp - (defun oni:vala-mode-func () - "Function for `vala-mode-hook'." - (setq indent-tabs-mode nil)) - - (add-hook 'vala-mode-hook 'oni:vala-mode-func) -#+END_SRC - -#+BEGIN_SRC emacs-lisp - (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) - (eval-after-load "smex" '(oni:smex-init)) - (eval-after-load "yasnippet" '(oni:yasnippet-init)) - - (autoload 'define-slime-contrib "slime") - (autoload 'gtags-mode "gtags" nil t) - (autoload 'jabber-connect "jabber" nil t) - (autoload 'php-mode "php-mode" nil t) - (autoload 'po-mode "po-mode" nil t) - (autoload 'pony-mode "pony-mode" nil t) - (autoload 'sawfish-mode "sawfish" nil t) - (autoload 'server-running-p "server") - (autoload 'slime-js-minor-mode "slime-js" nil t) - (autoload 'xmodmap-mode "xmodmap-mode" nil t) - (autoload 'w3m-bookmark-view "w3m" nil t) - (autoload 'w3m-goto-url "w3m" nil t) - - (require 'uniquify) - (require 'ext) - (require 'oni) - - (setq-default c-basic-offset 4) - (setq-default fci-rule-column 73) - (setq-default indent-tabs-mode nil) - (setq-default php-mode-warn-if-mumamo-off nil) - (setq-default require-final-newline t) - (setq-default tab-width 4) - (setq-default truncate-lines t) - - (setq appt-disp-window-function #'oni:appt-display-window-and-jabber) - (setq appt-display-diary nil) - (setq auto-mode-case-fold nil) - (setq auto-save-file-name-transforms oni:auto-save-name-transforms) - (setq avandu-article-render-function #'avandu-view-w3m) - (setq backup-directory-alist oni:backup-directory-alist) - (setq browse-url-browser-function 'browse-url-generic) - (setq browse-url-generic-program (getenv "BROWSER")) - (setq c-offsets-alist '((statement-block-intro . +) - (knr-argdecl-intro . 5) - (substatement-open . +) - (substatement-label . 0) - (label . 0) - (statement-case-open . +) - (statement-cont . +) - (arglist-intro . +) - (arglist-close . 0) - (inline-open . 0) - (brace-list-open . +) - (topmost-intro-cont first c-lineup-topmost-intro-cont - c-lineup-gnu-DEFUN-intro-cont))) - (setq comment-auto-fill-only-comments t) - (setq custom-file "~/.emacs.d/custom.el") - (setq custom-theme-directory "~/.emacs.d/themes") - (setq default-frame-alist - `((border-width . 0) - (internal-border-width . 0) - (vertical-scroll-bars . nil) - (menu-bar-lines . nil) - (tool-bar-lines . nil) - (font . "Envy Code R:pixelsize=18"))) - (setq elnode-do-init nil) - (setq fci-rule-color "darkred") - (setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) - (setq geiser-repl-history-filename "~/.emacs.d/geiser-history") - (setq gnus-init-file "~/.emacs.d/gnus") - (setq gtags-auto-update t) - (setq help-at-pt-display-when-idle t) - (setq highlight-80+-columns 72) - (setq identica-enable-striping t) - (setq inferior-lisp-program "sbcl") - (setq inhibit-default-init t) - (setq inhibit-local-menu-bar-menus t) - (setq inhibit-startup-message t) - (setq initial-major-mode 'emacs-lisp-mode) - (setq initial-scratch-message nil) - (setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") - (setq jabber-chat-buffer-format "*jab:%n*") - (setq jabber-chat-buffer-show-avatar nil) - (setq jabber-chat-fill-long-lines nil) - (setq jabber-chat-foreign-prompt-format "%t %u/%r <\n") - (setq jabber-chat-local-prompt-format "%t %u/%r >\n") - (setq jabber-chatstates-confirm nil) - (setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) - (setq jabber-roster-show-bindings nil) - (setq jabber-vcard-avatars-publish nil) - (setq jabber-vcard-avatars-retrieve nil) - (setq jit-lock-defer-time 0.2) - (setq magit-repo-dirs '("~/projects/")) - (setq message-log-max 1000) - (setq message-send-mail-function 'message-send-mail-with-sendmail) - (setq message-sendmail-extra-arguments '("-a" "ryuslash")) - (setq package-archives - '(("melpa" . "http://melpa.milkbox.net/packages/") - ("marmalade" . "http://marmalade-repo.org/packages/") - ("gnu" . "http://elpa.gnu.org/packages/"))) - (setq package-load-list '((htmlize "1.39") - (lua-mode "20111107") - all)) - (setq php-function-call-face 'font-lock-function-name-face) - (setq php-mode-force-pear t) - (setq pony-tpl-indent-moves t) - (setq rainbow-delimiters-max-face-count 12) - (setq redisplay-dont-pause t) - (setq send-mail-function 'smtpmail-send-it) - (setq sendmail-program "/usr/bin/msmtp") - (setq sentence-end-double-space nil) - (setq smex-key-advice-ignore-menu-bar t) - (setq smex-save-file "~/.emacs.d/smex-items") - (setq split-height-threshold 40) - (setq time-stamp-active t) - (setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") - (setq type-break-good-rest-interval (* 60 10)) - (setq type-break-interval (* 60 50)) - (setq type-break-keystroke-threshold '(nil . nil)) - (setq uniquify-buffer-name-style 'post-forward) - (setq use-dialog-box nil) - (setq user-full-name "Tom Willemsen") - (setq user-mail-address "tom@ryuslash.org") - (setq w3m-fill-column 72) - (setq window-combination-resize t) - (setq yas-fallback-behavior nil) - (setq yas-prompt-functions '(yas-ido-prompt)) - - (add-hook 'after-change-major-mode-hook 'set-current-mode-icon) - (add-hook 'after-save-hook 'oni:after-save-func t) - (add-hook 'before-save-hook 'oni:before-save-func) - (add-hook 'c-mode-hook 'oni:c-mode-func) - (add-hook 'css-mode-hook 'oni:css-mode-func) - (add-hook 'diary-display-hook 'oni:diary-display-func) - (add-hook 'emacs-startup-hook 'oni:emacs-startup-func) - (add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-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 'html-mode-hook 'oni:html-mode-func) - (add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func) - (add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func) - (add-hook 'java-mode-hook 'oni:java-mode-func) - (add-hook 'js-mode-hook 'oni:js-mode-func) - (add-hook 'js2-mode-hook 'oni:js2-mode-func) - (add-hook 'lua-mode-hook 'oni:lua-mode-func) - (add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func) - (add-hook 'markdown-mode-hook 'oni:markdown-mode-func) - (add-hook 'message-mode-hook 'oni:message-mode-func) - (add-hook 'org-mode-hook 'oni:org-mode-func) - (add-hook 'php-mode-hook 'oni:php-mode-func) - (add-hook 'prog-mode-hook 'oni:prog-mode-func) - (add-hook 'python-mode-hook 'oni:python-mode-func) - (add-hook 'rst-mode-hook 'oni:rst-mode-func) - (add-hook 'term-mode-hook 'oni:term-mode-func) - (add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func) - (add-hook 'write-file-hooks 'oni:write-file-func) - (add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func) - - (define-key key-translation-map (kbd "C-j") (kbd "C-l")) - (define-key key-translation-map (kbd "C-l") (kbd "C-j")) - - (global-set-key (kbd "'") 'oni:self-insert-dwim) - (global-set-key (kbd "") 'oni:raise-scratch) - (global-set-key (kbd "") 'gnus) - (global-set-key (kbd "") 'git-project-show-files) - (global-set-key (kbd "") 'ext:reload-buffer) - (global-set-key (kbd "") 'jabber-switch-to-roster-buffer) - (global-set-key (kbd "") 'magit-status) - (global-set-key (kbd "") 'oni:show-org-index) - (global-set-key (kbd "C-<") 'oni:indent-shift-left) - (global-set-key (kbd "C->") 'oni:indent-shift-right) - (global-set-key (kbd "C-M-4") 'split-window-vertically) - (global-set-key (kbd "C-M-SPC") 'er/expand-region) - (global-set-key (kbd "C-M-d") 'kill-word) - (global-set-key (kbd "C-M-w") 'backward-kill-word) - (global-set-key (kbd "C-S-k") 'kill-whole-line) - (global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim) - (global-set-key (kbd "C-c a") 'org-agenda) - (global-set-key (kbd "C-c c") 'org-capture) - (global-set-key (kbd "C-c i p") 'identica-update-status-interactive) - (global-set-key (kbd "C-c p") 'oni:show-buffer-position) - (global-set-key (kbd "C-c t") 'oni:raise-ansi-term) - (global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char) - (global-set-key (kbd "C-e") 'oni:move-end-of-dwim) - (global-set-key (kbd "C-k") 'oni:kill-region-or-line) - (global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char) - (global-set-key (kbd "M-0") 'delete-window) - (global-set-key (kbd "M-1") 'delete-other-windows) - (global-set-key (kbd "M-2") 'split-window-below) - (global-set-key (kbd "M-3") 'split-window-right) - (global-set-key (kbd "M-4") 'split-window-horizontally) - (global-set-key (kbd "M-o") 'other-window) - (global-set-key (kbd "\"") 'oni:self-insert-dwim) - - (if (daemonp) - (global-set-key "\C-x\C-c" 'oni:close-client-window)) - - (when (or window-system (daemonp)) - (global-unset-key "\C-z")) - - (add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode)) - (add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode)) - (add-to-list 'auto-mode-alist - '("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode)) - (add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode)) - (add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) - (add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode)) - (add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode)) - (add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode)) - - (add-to-list 'debug-ignored-errors "^Can't shift all lines enough") - - (add-to-list - 'display-buffer-alist - '("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil)))) - (add-to-list - 'display-buffer-alist - '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) - (add-to-list - 'display-buffer-alist - '("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil)))) - - (add-to-list 'compilation-finish-functions 'ext:comp-finish-function) - - (blink-cursor-mode -1) - (column-number-mode -1) - (line-number-mode -1) - (tooltip-mode -1) - - (package-initialize) - - (auto-insert-mode) - (cua-selection-mode t) - (electric-indent-mode) - (electric-pair-mode) - (savehist-mode) - (show-paren-mode) - (winner-mode) - - (smex-initialize) - (help-at-pt-set-timer) - (windmove-default-keybindings) - (global-diff-hl-mode) - - (load custom-file) - ;; (load "rudel-loaddefs.el") - (load (expand-file-name "~/quicklisp/slime-helper.el")) - - (unless (server-running-p) - (server-start)) - - (diminish 'auto-fill-function "_") -#+END_SRC - -# Local Variables: -# eval: (flyspell-mode 1) -# End: diff --git a/emacs/site-lisp/ext.el b/emacs/site-lisp/ext.el index d9e1973..2ed65d4 100644 --- a/emacs/site-lisp/ext.el +++ b/emacs/site-lisp/ext.el @@ -38,16 +38,6 @@ buffer-file-name)))) (list "pycheck.sh" (list local-file)))) -(defun ext:comp-finish-function (buf str) - "Don't show compilation window if everything went ok" - (if (string-match "exited abnormally" str) - ;; there were errors - (message "compilation errors, press C-x ` to visit") - ;; no errors, make the compilation window go away in 0.5 seconds - (when (member (buffer-name) '("*Compilation*" "*compilation*")) - (run-at-time 0.5 nil 'delete-windows-on buf) - (message "No compilation errors!")))) - (defun ext:reload-buffer () "Reload current buffer." (interactive) -- cgit v1.2.3-54-g00ecf From 5a41774f82ef4f86f46c808d44a65b156561de4a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 10 Apr 2013 21:30:58 +0200 Subject: Following in footsteps --- .gitconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitconfig b/.gitconfig index 2d49656..d55f3be 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,5 +1,5 @@ [user] - name = Tom Willemsen + name = Tom Willemse email = tom@ryuslash.org [core] editor = emacs -nw -- cgit v1.2.3-54-g00ecf From fb31196138f86a5deda32dae2a7059a5da64b0d6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 10 Apr 2013 21:38:19 +0200 Subject: .mutt/muttrc --- .mutt/muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mutt/muttrc b/.mutt/muttrc index 69250ef..86736ba 100644 --- a/.mutt/muttrc +++ b/.mutt/muttrc @@ -57,7 +57,7 @@ set index_format = "%3C %Z %D [%-12.12L] %s" set alias_format = "%4n %t %-20a %r" # composing mail -set realname = "Tom Willemsen" # who am I? +set realname = "Tom Willemse" # who am I? set envelope_from # which from? set sig_dashes # dashes before my sig... sweet set edit_headers # show headers when composing -- cgit v1.2.3-54-g00ecf From 35b47c5092c9f1db746152c7c3da6fb1b759a5a4 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 10 Apr 2013 21:38:20 +0200 Subject: .mutt/muttrc --- .mutt/muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mutt/muttrc b/.mutt/muttrc index 86736ba..0704996 100644 --- a/.mutt/muttrc +++ b/.mutt/muttrc @@ -57,7 +57,7 @@ set index_format = "%3C %Z %D [%-12.12L] %s" set alias_format = "%4n %t %-20a %r" # composing mail -set realname = "Tom Willemse" # who am I? +set realname = "Tom Willemse" # who am I? set envelope_from # which from? set sig_dashes # dashes before my sig... sweet set edit_headers # show headers when composing -- cgit v1.2.3-54-g00ecf From d07f2eb138231656b671ff8b0bd2e26d046d415f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 10 Apr 2013 22:05:48 +0200 Subject: More --- .hgrc | 2 +- emacs/gnus.el | 1 + emacs/init.el | 2 +- emacs/site-lisp/dzen.el | 4 ++-- emacs/site-lisp/eltuki.el | 4 ++-- emacs/site-lisp/ext.el | 4 ++-- emacs/site-lisp/metalexpress.el | 4 ++-- emacs/site-lisp/mu4e-init.el | 4 ++-- emacs/site-lisp/oni.el | 4 ++-- emacs/site-lisp/org-init.el | 4 ++-- emacs/site-lisp/quick-edit-mode.el | 4 ++-- emacs/snippets/python-mode/import_from | 4 ++-- 12 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.hgrc b/.hgrc index 4fa66ab..adef43b 100644 --- a/.hgrc +++ b/.hgrc @@ -1,4 +1,4 @@ [ui] -username = Tom Willemsen +username = Tom Willemse [extensions] hgext.bookmarks = diff --git a/emacs/gnus.el b/emacs/gnus.el index aac7c6e..49b3931 100644 --- a/emacs/gnus.el +++ b/emacs/gnus.el @@ -45,6 +45,7 @@ (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") diff --git a/emacs/init.el b/emacs/init.el index 60ba521..176d904 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -415,7 +415,7 @@ Also change directories to current working directory." (setq type-break-keystroke-threshold '(nil . nil)) (setq uniquify-buffer-name-style 'post-forward) (setq use-dialog-box nil) -(setq user-full-name "Tom Willemsen") +(setq user-full-name "Tom Willemse") (setq user-mail-address "tom@ryuslash.org") (setq w3m-fill-column 72) (setq window-combination-resize t) diff --git a/emacs/site-lisp/dzen.el b/emacs/site-lisp/dzen.el index 6cc3eae..da83099 100644 --- a/emacs/site-lisp/dzen.el +++ b/emacs/site-lisp/dzen.el @@ -1,8 +1,8 @@ ;;; dzen.el --- Control DZEN2 from emacs -;; Copyright (C) 2012 Tom Willemsen +;; Copyright (C) 2012 Tom Willemse -;; Author: Tom Willemsen +;; Author: Tom Willemse ;; Keywords: convenience ;; This program is free software; you can redistribute it and/or modify diff --git a/emacs/site-lisp/eltuki.el b/emacs/site-lisp/eltuki.el index 224e9ab..d457a0f 100644 --- a/emacs/site-lisp/eltuki.el +++ b/emacs/site-lisp/eltuki.el @@ -1,8 +1,8 @@ ;;; eltuki.el --- Tekuti functions -;; Copyright (C) 2012 Tom Willemsen +;; Copyright (C) 2012 Tom Willemse -;; Author: Tom Willemsen +;; Author: Tom Willemse ;; Keywords: convenience ;; This program is free software; you can redistribute it and/or modify diff --git a/emacs/site-lisp/ext.el b/emacs/site-lisp/ext.el index 2ed65d4..eb84a3f 100644 --- a/emacs/site-lisp/ext.el +++ b/emacs/site-lisp/ext.el @@ -1,8 +1,8 @@ ;;; ext.el --- More emacs functions -;; Copyright (C) 2012 Tom Willemsen +;; Copyright (C) 2012 Tom Willemse -;; Author: Tom Willemsen +;; Author: Tom Willemse ;; Keywords: local ;; This program is free software; you can redistribute it and/or modify diff --git a/emacs/site-lisp/metalexpress.el b/emacs/site-lisp/metalexpress.el index 0c4539a..d4a92d7 100644 --- a/emacs/site-lisp/metalexpress.el +++ b/emacs/site-lisp/metalexpress.el @@ -1,8 +1,8 @@ ;;; metalexpress.el --- Listen to Metal Express Radio -;; Copyright (C) 2012 Tom Willemsen +;; Copyright (C) 2012 Tom Willemse -;; Author: Tom Willemsen +;; Author: Tom Willemse ;; Keywords: multimedia ;; This program is free software; you can redistribute it and/or modify diff --git a/emacs/site-lisp/mu4e-init.el b/emacs/site-lisp/mu4e-init.el index 258a6ef..e11baf5 100644 --- a/emacs/site-lisp/mu4e-init.el +++ b/emacs/site-lisp/mu4e-init.el @@ -1,8 +1,8 @@ ;;; mu4e-init.el --- mu4e initialization -;; Copyright (C) 2012 Tom Willemsen +;; Copyright (C) 2012 Tom Willemse -;; Author: Tom Willemsen +;; Author: Tom Willemse ;; Keywords: ;; This program is free software; you can redistribute it and/or modify diff --git a/emacs/site-lisp/oni.el b/emacs/site-lisp/oni.el index 027463b..2076093 100644 --- a/emacs/site-lisp/oni.el +++ b/emacs/site-lisp/oni.el @@ -1,8 +1,8 @@ ;;; oni.el --- Functions for emacs -;; Copyright (C) 2012 Tom Willemsen +;; Copyright (C) 2012 Tom Willemse -;; Author: Tom Willemsen +;; Author: Tom Willemse ;; Keywords: local ;; This program is free software; you can redistribute it and/or modify diff --git a/emacs/site-lisp/org-init.el b/emacs/site-lisp/org-init.el index 789b1bb..3c698d2 100644 --- a/emacs/site-lisp/org-init.el +++ b/emacs/site-lisp/org-init.el @@ -1,8 +1,8 @@ ;;; org-init.el --- Org initialization -;; Copyright (C) 2012 Tom Willemsen +;; Copyright (C) 2012 Tom Willemse -;; Author: Tom Willemsen +;; Author: Tom Willemse ;; Keywords: ;; This program is free software; you can redistribute it and/or modify diff --git a/emacs/site-lisp/quick-edit-mode.el b/emacs/site-lisp/quick-edit-mode.el index 821c738..898d7c2 100644 --- a/emacs/site-lisp/quick-edit-mode.el +++ b/emacs/site-lisp/quick-edit-mode.el @@ -1,8 +1,8 @@ ;;; quick-edit-mode.el --- Quickly edit stuff -;; Copyright (C) 2012 Tom Willemsen +;; Copyright (C) 2012 Tom Willemse -;; Author: Tom Willemsen +;; Author: Tom Willemse ;; Keywords: convenience ;; This program is free software; you can redistribute it and/or modify diff --git a/emacs/snippets/python-mode/import_from b/emacs/snippets/python-mode/import_from index 5c23b8e..d9cc4e2 100644 --- a/emacs/snippets/python-mode/import_from +++ b/emacs/snippets/python-mode/import_from @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # name: from ... import ... -# contributor: Tom Willemsen +# contributor: Tom Willemse # key: from # -- -from ${1:module} import ${2:class_or_module} \ No newline at end of file +from ${1:module} import ${2:class_or_module} -- cgit v1.2.3-54-g00ecf From 0a4dc20800feaed48b8d44b50fe0c4c4097fd2d9 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 10 Apr 2013 22:06:28 +0200 Subject: Mutt --- .mutt/muttrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.mutt/muttrc b/.mutt/muttrc index 0704996..2af358d 100644 --- a/.mutt/muttrc +++ b/.mutt/muttrc @@ -1,4 +1,3 @@ -### -*- eval: (git-auto-commit-mode 1) -*- # ~/.muttrc ### -- cgit v1.2.3-54-g00ecf From f94bccb95bca9801cccacb8cf566f57a377549c0 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 11 Apr 2013 15:29:59 +0200 Subject: Stumpwm: Remove window title from mode-line It makes stumpmw crash with certain window titles from conkeror --- .stumpwmrc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.stumpwmrc b/.stumpwmrc index 3583e68..386da9c 100644 --- a/.stumpwmrc +++ b/.stumpwmrc @@ -9,8 +9,7 @@ "Run BODY through emacsclient." `(sb-ext:run-program "/usr/bin/emacsclient" - '("-e" - ,(string-downcase (format nil "~S" (cons 'progn body)))) + '("-e" ,(string-downcase (format nil "~S" (cons 'progn body)))) :wait nil)) ;; Naquadah @@ -149,7 +148,6 @@ it and run *screen-unlocked-hook* after it has been unlocked." (setf *mode-line-foreground-color* (colour :lblack)) (setf *shell-program* (getenv "SHELL")) (setf *transient-border-width* 1) -(setf *window-format* "%m%50t") (setf *window-border-style* :thin) (setf *screen-mode-line-format* (list "[%n]" @@ -158,10 +156,7 @@ it and run *screen-unlocked-hook* after it has been unlocked." (get-mail-count "ryuslash.org") (get-mail-count "gmail") (get-mail-count "aethon") - (get-mail-count "ninthfloor"))) - '(:eval - (format-expand *window-formatters* *window-format* - (current-window))))) + (get-mail-count "ninthfloor"))))) (add-hook *lock-screen-hook* 'set-jabber-away) (add-hook *lock-screen-hook* 'mpd-pause) -- cgit v1.2.3-54-g00ecf From a55c5dc5800c8cf40e84b129bb7985a64a5b4d21 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 11 Apr 2013 15:30:31 +0200 Subject: zsh: Simplify prompt --- .zshrc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.zshrc b/.zshrc index fcda0bd..735e5bc 100644 --- a/.zshrc +++ b/.zshrc @@ -53,17 +53,14 @@ add-zsh-hook precmd precmd_maybe_festival add-zsh-hook precmd vcs_info add-zsh-hook chpwd chpwd_update_git_vars -zstyle ':vcs_info:*' actionformats '%F{2}(%f%s %r %b%F{2})%f %a - %S' +zstyle ':vcs_info:*' actionformats '%B%F{5}%a%f%%b %s:%r-%b %S' zstyle ':vcs_info:*' enable bzr git hg svn -zstyle ':vcs_info:*' formats '%F{2}(%f%s %r %b%F{2})%f - %S' -zstyle ':vcs_info:*' nvcsformats ' - %~' +zstyle ':vcs_info:*' formats '%s:%r-%b %S' +zstyle ':vcs_info:*' nvcsformats '%~' zstyle ':vcs_info:bzr:*' branchformat '%b' # Set the prompt. -PROMPT='%F{1}(%F{2}(%f%m %l%F{2})%f ${vcs_info_msg_0_}%F{1})%f %# ' +PROMPT='%B%(?.%F{2}+.%F{1}-) %F{6}%m%b%f ${vcs_info_msg_0_} %# ' # Set terminal name to current running application case $TERM in -- cgit v1.2.3-54-g00ecf From 9ab70194a65f1d7ab726aaacdb43a58a02a048b6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 11 Apr 2013 15:31:07 +0200 Subject: Emacs: Enable compilation-minor-mode for pony-mode comint buffers --- emacs/init.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emacs/init.el b/emacs/init.el index 176d904..8e7fd45 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -602,6 +602,16 @@ Depending on the value of `buffer-narrowed-p'." (setq eap-music-library "/mnt/music") (setq eap-playlist-library "~/music/playlists") +;;; Turn on `compilation-minor-mode' whenever `pony-minor-mode' starts +;;; in a `comint-mode' buffer. Since buffers like `*ponymanage*' and +;;; `*ponyserver*' don't have their own specialized modes, but use +;;; `comint-mode' and turn on `pony-minor-mode', and I don't want to +;;; enable `compilation-minor-mode' for *every* `comint-mode' buffer, +;;; we can add a hook that adds a local hook. +(defun turn-on-compilation-for-pony () + (add-hook 'pony-minor-mode-hook 'compilation-minor-mode nil t)) +(add-hook 'comint-mode-hook 'turn-on-compilation-for-pony) + ;;; Finally, load any `customize' settings and slime. (load custom-file) (load (expand-file-name "~/quicklisp/slime-helper.el")) -- cgit v1.2.3-54-g00ecf