From 36541fa5126a909ebb4517c514e8d7001ed21020 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 14 Dec 2012 15:23:36 +0100 Subject: RXVT: Turn off visual bell --- .Xdefaults | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Xdefaults b/.Xdefaults index 2ce94b9..ebbbd9c 100644 --- a/.Xdefaults +++ b/.Xdefaults @@ -9,7 +9,7 @@ urxvt.cursorBlink: false urxvt.cursorUnderline: true urxvt.urgentOnBell: true urxvt.termName: rxvt-256color -urxvt.visualBell: true +urxvt.visualBell: false urxvt.perl-lib: /usr/lib/urxvt/perl/ urxvt.perl-ext-common: default,url-select,keyboard-select -- cgit v1.2.3-54-g00ecf From c8b34bbdad15a4153f87d4b6df324fe34b1c8a37 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 17 Dec 2012 12:11:03 +0100 Subject: Remove oni:load-hippie-exp Placing `yas/hippie-try-expand' at the end of the `hippie-expand-try-functions-list' doesn't seem to work very well and putting it in the front might cause situations where I want to expand a variable name or something and yas might take over, so don't use yas with hippie-expand. Instead bind `yas-expand' to `C-\' and set `yas-fallback-behavior' to nil so it doesn't start acting crazy when there's no snippet to expand. --- .emacs.d/init.el | 7 +------ .emacs.d/site-lisp/oni.el | 10 ++-------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 61f14d7..3e74568 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -104,9 +104,6 @@ 'flymake-allowed-file-name-masks ; flymaking 'easy'. '("\\.go$" flymake-simple-make-init)))) -(eval-after-load "hippie-exp" - '(oni:load-hippie-exp 'yasnippet)) - (eval-after-load "ido" '(setq ido-ignore-buffers `(,@ido-ignore-buffers "^\\*.*\\*$" "^irc\\." "^\\#"))) @@ -125,9 +122,6 @@ (global-set-key (kbd "M-x") 'smex) (global-set-key (kbd "C-M-x") 'smex-major-mode-commands))) -(eval-after-load "yasnippet" - '(oni:load-hippie-exp 'hippie-exp)) - (put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil) (put 'narrow-to-region 'disabled nil) @@ -298,6 +292,7 @@ (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) diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index f636587..8930d6d 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -287,13 +287,6 @@ If COUNT has been specified indent by that much, otherwise look at (kill-region (region-beginning) (region-end)) (kill-line))) -(defun oni:load-hippie-exp (other) - "Make sure both hippie-expand and yasnippet are loaded in order - to add yasnippet's expand function to hippie-expand." - (require other) - (add-to-list 'hippie-expand-try-functions-list - 'yas/hippie-try-expand t)) - (defun oni:lua-mode-func() "Function for `lua-mode-hook'." (local-unset-key (kbd ")")) @@ -626,7 +619,8 @@ for easy selection." (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 [(tab)] nil) + (define-key yas-minor-mode-map (kbd "C-\\") 'yas-expand)) (define-skeleton html-tag "Testing creation of an html tag" -- cgit v1.2.3-54-g00ecf From 19cc94fc81a8b655c7104d1f058fa2ac1b0a52c4 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 19 Dec 2012 11:29:46 +0100 Subject: Only make TAGS when TAGS target available The "(Shell command failed with code 2 and no output)" was starting to drive me nuts. * .emacs.d/site-lisp/oni.el (oni:after-save-func): Check if there is a `TAGS:' target in the found makefile before trying to make. --- .emacs.d/site-lisp/oni.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index 8930d6d..46c87fb 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -68,8 +68,10 @@ DOT are intentionally being skipped." "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"))) - (when dom-dir + (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"))))) -- cgit v1.2.3-54-g00ecf From 25adcab0c33d332f5379b46fde5530f0b714a749 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 19 Dec 2012 11:43:00 +0100 Subject: Set the fci-rule-column to 101 for lisps --- .emacs.d/init.el | 3 +++ .emacs.d/site-lisp/oni.el | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 3e74568..6b78465 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -302,6 +302,7 @@ (add-hook 'css-mode-hook 'oni:css-mode-func) (add-hook 'diary-display-hook 'oni:diary-display-func) (add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-func) +(add-hook 'emacs-lisp-mode-hook 'oni:generic-lisp-mode-hook) (add-hook 'erc-mode-hook 'oni:erc-mode-func) (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) (add-hook 'flymake-mode-hook 'oni:flymake-mode-func) @@ -314,6 +315,7 @@ (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 'lisp-mode-hook 'oni:generic-lisp-mode-hook) (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) @@ -323,6 +325,7 @@ (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 'scheme-mode-hook 'oni:generic-lisp-mode-hook) (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) diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index 46c87fb..f652069 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -179,6 +179,11 @@ DOT are intentionally being skipped." (local-set-key [M-P] 'flymake-goto-prev-error) (local-set-key [M-N] 'flymake-goto-next-error)) +(defun oni:generic-lisp-mode-hook () + "Function for `emacs-lisp-mode-hook', `lisp-mode-hook' and +`scheme-mode-hook'." + (setq fci-column 101)) + (defun oni:go-mode-func () "Function for `go-mode-hook'." (setq indent-tabs-mode nil) -- cgit v1.2.3-54-g00ecf From adf44fafaeeb7b0347c02183ce3fca0b2025f222 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 19 Dec 2012 23:55:48 +0100 Subject: Add diminish --- .emacs.d/init.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 6b78465..43c49eb 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -70,6 +70,9 @@ "Face for the supposedly empty line in commit messages." :group 'local) +(eval-after-load "eldoc" + '(diminish 'eldoc-mode)) + (eval-after-load "em-term" '(add-to-list 'eshell-visual-commands "unison")) @@ -117,6 +120,12 @@ (eval-after-load "org" '(require 'org-init)) +(eval-after-load "pretty-symbols-mode" + '(diminish 'pretty-symbols-mode)) + +(eval-after-load "rainbow-mode" + '(diminish 'rainbmow-mode)) + (eval-after-load "smex" '(progn (global-set-key (kbd "M-x") 'smex) @@ -437,6 +446,8 @@ (unless (server-running-p) (server-start)) +(diminish 'auto-fill-function "_") + (provide 'init) ;;; init.el ends here -- cgit v1.2.3-54-g00ecf From 0dc07f528ff1545aa70bed57724da7279faec895 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 19 Dec 2012 23:56:25 +0100 Subject: Update eltuki to work better and do more --- .emacs.d/site-lisp/eltuki.el | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.emacs.d/site-lisp/eltuki.el b/.emacs.d/site-lisp/eltuki.el index 4815108..80400a9 100644 --- a/.emacs.d/site-lisp/eltuki.el +++ b/.emacs.d/site-lisp/eltuki.el @@ -163,9 +163,13 @@ (eltuki-slugify-string (eltuki-get-title)))) (defun eltuki-write-content (dir) - (with-current-buffer (org-export-region-as-html - (point-min) (point-max) t "*eltuki-html*") - (write-region (point-min) (point-max) (concat dir "/content")))) + (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)) @@ -173,7 +177,8 @@ (status (eltuki-get-status)) (title (eltuki-get-title)) (name (eltuki-slugify-string (eltuki-get-title))) - (commentstatus (eltuki-get-comment-status))) + (commentstatus (eltuki-get-comment-status)) + (filename (concat dir "/metadata"))) (with-temp-buffer (insert "timestamp: " timestamp "\n" "tags: " tags "\n" @@ -181,17 +186,36 @@ "title: " title "\n" "name: " name "\n" "comment_status: " commentstatus) - (write-region (point-min) (point-max) (concat dir "/metadata"))))) + (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 (get-buffer "*eltuki*")) + (let ((buffer (or (get-buffer "*eltuki*") + (current-buffer))) (dest (eltuki-get-directory))) (unless (file-exists-p dest) (mkdir dest)) - (eltuki-write-content dest) - (eltuki-write-metadata 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) -- cgit v1.2.3-54-g00ecf From 43382b4e453ce9ca37f04c29daa5284dab986b3b Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 20 Dec 2012 00:01:55 +0100 Subject: Emacs: diminish yasnippet --- .emacs.d/init.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 43c49eb..c3b4b59 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -131,6 +131,9 @@ (global-set-key (kbd "M-x") 'smex) (global-set-key (kbd "C-M-x") 'smex-major-mode-commands))) +(eval-after-load "yasnippet" + '(diminish 'yas-minor-mode)) + (put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil) (put 'narrow-to-region 'disabled nil) -- cgit v1.2.3-54-g00ecf From e6036a3382ce259681ff47bb8795d8c8421c64d0 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 20 Dec 2012 00:15:28 +0100 Subject: Show buffer position again --- .emacs.d/init.el | 1 - 1 file changed, 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index c3b4b59..1e3088f 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -272,7 +272,6 @@ (setq message-log-max 1000) (setq message-send-mail-function 'message-send-mail-with-sendmail) (setq message-sendmail-extra-arguments '("-a" "ryuslash")) -(setq mode-line-position nil) (setq package-archives '(("melpa" . "http://melpa.milkbox.net/packages/") ("ELPA" . "http://tromey.com/elpa/") -- cgit v1.2.3-54-g00ecf From 86c28de3740885ed872acfbc7024315f1df98c91 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 20 Dec 2012 00:15:52 +0100 Subject: Add feeds from Magnar Sveen --- .emacs.d/site-lisp/newsticker-init.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.emacs.d/site-lisp/newsticker-init.el b/.emacs.d/site-lisp/newsticker-init.el index 5d60850..aabb782 100644 --- a/.emacs.d/site-lisp/newsticker-init.el +++ b/.emacs.d/site-lisp/newsticker-init.el @@ -102,7 +102,11 @@ "http://feeds.feedburner.com/QjGameNewsOpinionsBlogsandMore" nil nil nil) ("Beej's Bit Bucket" - "http://beej.us/blog/rss.xml" nil nil nil))) + "http://beej.us/blog/rss.xml" nil nil nil) + ("What the .emacs.d!?" + "http://whattheemacsd.com/atom.xml" nil nil nil) + ("Emacs Rocks!" + "http://emacsrocks.com/atom.xml" nil nil nil))) (setq newsticker-use-full-width nil) (provide 'newsticker-init) -- cgit v1.2.3-54-g00ecf From 992da18f7adc67414c719f5b16041058b655c191 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 20 Dec 2012 12:07:16 +0100 Subject: Conkeror: Add monsterhunter webjump --- .conkerorrc/init.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index 939d3a6..6594523 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -98,6 +98,9 @@ define_webjump("github", define_webjump("mdn", "https://developer.mozilla.org/en-US/search?q=%s", $alternative="https://developer.mozilla.org/"); +define_webjump("monsterhunter", + "http://monsterhunter.wikia.com/wiki/index.php?search=%s&fulltext=Search", + $alternative="http://monsterhunter.wikia.com/"); // Archlinux define_webjump("arch/wiki", "https://wiki.archlinux.org/index.php?search=%s", -- cgit v1.2.3-54-g00ecf From abc27202062e6d6a0a9c7f790aecbda87b5152d8 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 23 Dec 2012 12:52:18 +0100 Subject: Use fci-rule-column, not fci-column --- .emacs.d/site-lisp/oni.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index f652069..fdaf01e 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -182,7 +182,7 @@ DOT are intentionally being skipped." (defun oni:generic-lisp-mode-hook () "Function for `emacs-lisp-mode-hook', `lisp-mode-hook' and `scheme-mode-hook'." - (setq fci-column 101)) + (setq fci-rule-column 101)) (defun oni:go-mode-func () "Function for `go-mode-hook'." -- cgit v1.2.3-54-g00ecf From 172fcfe9303b9e85d10721cac69aa31abaa0e515 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 27 Dec 2012 02:25:29 +0100 Subject: Emacs: Meh, stop messing around with the mode-line --- .emacs.d/init.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 1e3088f..ea12ee7 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -406,8 +406,6 @@ 'display-buffer-alist '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) -(delete " " mode-line-format) - (unless (oni:required-packages-installed-p) (message "%s" "Refreshing package database...") (package-refresh-contents) -- cgit v1.2.3-54-g00ecf From 5d781782167a2746c6a31a6e3a4c1f76396bea08 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 27 Dec 2012 02:26:02 +0100 Subject: Emacs: Throw away unneeded imports and sort --- .emacs.d/init.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index ea12ee7..061a29b 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -25,19 +25,16 @@ (add-to-list 'custom-theme-load-path dir)) '("~/var/src/emacs/yoshi-theme"))) +(require 'auto-complete-config) +(require 'ext) (require 'geiser-install) -(require 'iso-transl) -(require 'newcomment) +(require 'oni) (require 'uniquify) (require 'w3m-load) -(require 'ext) -(require 'oni) (autoload 'define-slime-contrib "slime") (autoload 'gtags-mode "gtags" nil t) -(autoload 'identica-mode "identica-mode" nil t) (autoload 'jabber-connect "jabber" nil t) -(autoload 'mu4e "mu4e" nil t) (autoload 'php-mode "php-mode" nil t) (autoload 'po-mode "po-mode" nil t) (autoload 'pony-mode "pony-mode" nil t) -- cgit v1.2.3-54-g00ecf From 08b6b2334926ac0cafff0a46aa90464735e58bd9 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 27 Dec 2012 02:26:32 +0100 Subject: Emacs: I've started using Gnus again for most feeds --- .emacs.d/site-lisp/newsticker-init.el | 99 +---------------------------------- 1 file changed, 2 insertions(+), 97 deletions(-) diff --git a/.emacs.d/site-lisp/newsticker-init.el b/.emacs.d/site-lisp/newsticker-init.el index aabb782..ad91632 100644 --- a/.emacs.d/site-lisp/newsticker-init.el +++ b/.emacs.d/site-lisp/newsticker-init.el @@ -1,112 +1,17 @@ -(defmacro reddit-feed (name) - "Return a reddit feed url" - (concat "http://www.reddit.com/r/" name "/new/.rss?sort=new")) - (setq newsticker-automatically-mark-items-as-old nil) (setq newsticker-html-renderer 'w3m-region) (setq newsticker-obsolete-item-max-age 604800) (setq newsticker-url-list - `(("Irreal" - "http://irreal.org/blog/?feed=rss2" nil nil nil) - ("Arch Linux - Keeping it Simple" - ,(reddit-feed "archlinux") nil nil nil) - ("The C programming language" - ,(reddit-feed "c_language") nil nil nil) - ("C" - ,(reddit-feed "C_Programming") nil nil nil) - ("coding" - ,(reddit-feed "coding") nil nil nil) - ("Command Line" - ,(reddit-feed "commandline") nil nil nil) - ("Django" - ,(reddit-feed "django") nil nil nil) - ("M-x emacs-reddit" - ,(reddit-feed "emacs") nil nil nil) - ("git" - ,(reddit-feed "git") nil nil nil) - ("JavaScript" - ,(reddit-feed "javascript") nil nil nil) - ("r/Linux" - ,(reddit-feed "linux") nil nil nil) - ("Linux Gaming on Reddit" - ,(reddit-feed "linux_gaming") nil nil nil) - ("Lisp" - ,(reddit-feed "lisp") nil nil nil) - ("Open Source on Reddit" - ,(reddit-feed "opensource") nil nil nil) - ("PHP: The latest news in the PHP world" - ,(reddit-feed "PHP") nil nil nil) - ("programming" - ,(reddit-feed "programming") nil nil nil) - ("Python" - ,(reddit-feed "Python") nil nil nil) - ("Scheme Programming Language articles" - ,(reddit-feed "scheme") nil nil nil) - ("The Wayland Display Server" - ,(reddit-feed "wayland") nil nil nil) - ("Identity at Mozilla" - "http://identity.mozilla.com/rss" nil nil nil) - ("jd:/dev/blog" - "http://julien.danjou.info/blog/index.xml" nil nil nil) - ("KaKaRoTo's Blog" - "http://kakaroto.homelinux.net/feed/" nil nil nil) - ("Awhan Patnaik" - "http://awhan.wordpress.com/feed/" nil nil nil) - ("The Gitorious Blog" - "http://blog.gitorious.org/feed/" nil nil nil) - ;; ("Dieter on the web" - ;; "http://dieter.plaetinck.be/index.rss" nil nil nil) - ("Public Git Hosting - conkeror.git/atom log" + `(("Public Git Hosting - conkeror.git/atom log" "http://repo.or.cz/w/conkeror.git/atom" nil nil nil) - ("Stevey's Blog Rants" - "http://steve-yegge.blogspot.com/feeds/posts/default" - nil nil nil) ("Script Tutorials" "http://www.script-tutorials.com/feed/rss/" nil nil nil) - ("Hacker News" - "http://news.ycombinator.com/rss" nil nil nil) - ("HowtoForge - Linux Howtos and Tutorials -" - "http://www.howtoforge.com/node/feed" nil nil nil) - ("Linuxtoday.com" - "http://linuxtoday.com/backend/biglt.rss" nil nil nil) - ("Linux.com - Content Feed" - "http://linux.com/rss/feeds.php" nil nil nil) - ("TuxRadar feed" - "http://www.tuxradar.com/rss" nil nil nil) - ("Planet Emacsen" - "http://planet.emacsen.org/atom.xml" nil nil nil) - ("M-x all-things-emacs" - "http://emacsblog.org/feed/" nil nil nil) - ;; ("Xah Emacs Blog" - ;; "http://feeds.feedburner.com/XahsEmacsBlog" nil nil nil) - ;; ("Mastering Emacs" - ;; "http://www.masteringemacs.org/feed/" nil nil nil) ("WikEmacs - Recent changes [en]" "http://wikemacs.org/w/index.php?title=Special:RecentChanges&feed=atom" nil nil nil) - ("newest questions tagged emacs - Stack Overflow" - "http://stackoverflow.com/feeds/tag?tagnames=emacs&sort=newest" - nil nil nil) - ("newest questions tagged elisp - Stack Overflow" - "http://stackoverflow.com/feeds/tag?tagnames=elisp&sort=newest" - nil nil nil) - ("Recent Commits to python-django.el:master" - "https://github.com/fgallina/python-django.el/commits/master.atom" - nil nil nil) ("git.tuxfamily.org Git - sawfish.main.git/atom log" "http://git.tuxfamily.org/sawfish/main.git?p=sawfish/main.git;a=atom" - nil nil nil) - ("BLABBERMOUTH.NET Latest News" - "http://feeds.feedburner.com/blabbermouth" nil nil nil) - ("QJ.NET" - "http://feeds.feedburner.com/QjGameNewsOpinionsBlogsandMore" - nil nil nil) - ("Beej's Bit Bucket" - "http://beej.us/blog/rss.xml" nil nil nil) - ("What the .emacs.d!?" - "http://whattheemacsd.com/atom.xml" nil nil nil) - ("Emacs Rocks!" - "http://emacsrocks.com/atom.xml" nil nil nil))) + nil nil nil))) (setq newsticker-use-full-width nil) (provide 'newsticker-init) -- cgit v1.2.3-54-g00ecf From e36594413834a5c59b317a022dadecc073fc1436 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 27 Dec 2012 02:26:58 +0100 Subject: Emacs: Use special face for "done" org tasks --- .emacs.d/site-lisp/org-init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/site-lisp/org-init.el b/.emacs.d/site-lisp/org-init.el index 793b453..9d61396 100644 --- a/.emacs.d/site-lisp/org-init.el +++ b/.emacs.d/site-lisp/org-init.el @@ -70,6 +70,7 @@ "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) -- cgit v1.2.3-54-g00ecf From e20a89885e57297d7772eb23b699f3ec10e0aece Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 27 Dec 2012 02:27:30 +0100 Subject: Make: Don't echo when not installing --- dotfiles.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dotfiles.mk b/dotfiles.mk index 82d1c31..77afcee 100644 --- a/dotfiles.mk +++ b/dotfiles.mk @@ -38,8 +38,7 @@ $(modules): %: $(install-objects): install-%: % $(if $(call newer,$*), \ - install -pDm $(MODE) "$*" "$(DESTDIR)/$*", \ - @echo -e "$(FG_YEL)$*$(CLR_RE) is $(FG_RED)not newer$(CLR_RE)") + install -pDm $(MODE) "$*" "$(DESTDIR)/$*") $(install-modules): install-%: @$(MAKE) -C $* install -- cgit v1.2.3-54-g00ecf From 62ea1086e9ec844c5357bcb86f09333a0ea5638a Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 28 Dec 2012 01:56:58 +0100 Subject: Emacs: Manually set-up w3m Only `w3m-goto-url' and `w3m-bookmark-view' are ever really used to start w3m, no need to load `w3m-load' for that. --- .emacs.d/init.el | 3 ++- .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 +++++ 8 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .emacs.d/snippets/python-mode/Makefile create mode 100644 .emacs.d/snippets/python-mode/defm_empty create mode 100644 .emacs.d/snippets/python-mode/form create mode 100644 .emacs.d/snippets/python-mode/form_valid create mode 100644 .emacs.d/snippets/python-mode/import_from create mode 100644 .emacs.d/snippets/python-mode/permission_guard create mode 100644 .emacs.d/snippets/python-mode/url diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 061a29b..dd679c9 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -30,7 +30,6 @@ (require 'geiser-install) (require 'oni) (require 'uniquify) -(require 'w3m-load) (autoload 'define-slime-contrib "slime") (autoload 'gtags-mode "gtags" nil t) @@ -42,6 +41,8 @@ (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) (load (expand-file-name "~/.emacs.d/site-lisp/loaddefs.el")) diff --git a/.emacs.d/snippets/python-mode/Makefile b/.emacs.d/snippets/python-mode/Makefile new file mode 100644 index 0000000..192657b --- /dev/null +++ b/.emacs.d/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.d/snippets/python-mode/defm_empty b/.emacs.d/snippets/python-mode/defm_empty new file mode 100644 index 0000000..baa976e --- /dev/null +++ b/.emacs.d/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.d/snippets/python-mode/form b/.emacs.d/snippets/python-mode/form new file mode 100644 index 0000000..225d5e4 --- /dev/null +++ b/.emacs.d/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.d/snippets/python-mode/form_valid b/.emacs.d/snippets/python-mode/form_valid new file mode 100644 index 0000000..c5a7e58 --- /dev/null +++ b/.emacs.d/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.d/snippets/python-mode/import_from b/.emacs.d/snippets/python-mode/import_from new file mode 100644 index 0000000..5c23b8e --- /dev/null +++ b/.emacs.d/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.d/snippets/python-mode/permission_guard b/.emacs.d/snippets/python-mode/permission_guard new file mode 100644 index 0000000..ab53895 --- /dev/null +++ b/.emacs.d/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.d/snippets/python-mode/url b/.emacs.d/snippets/python-mode/url new file mode 100644 index 0000000..00ade72 --- /dev/null +++ b/.emacs.d/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 71eaad34461d26c7f108096028c6ed86d9675518 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 28 Dec 2012 01:58:05 +0100 Subject: Emacs: Reset buffer display Having everything show up in the same buffer is unpleasant, the correct situation should be determined per-buffer. --- .emacs.d/init.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index dd679c9..9a60b81 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -397,9 +397,6 @@ (add-to-list 'debug-ignored-errors "^Can't shift all lines enough") -(add-to-list - 'display-buffer-alist - '(".*" . ((display-buffer-same-window . nil)))) (add-to-list 'display-buffer-alist '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) -- cgit v1.2.3-54-g00ecf From d29d60a99835ca3f705ac12d0bcfa40df530ddc2 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 28 Dec 2012 01:58:23 +0100 Subject: Emacs: set-up auto-complete default config --- .emacs.d/init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 9a60b81..1e5b60b 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -442,6 +442,7 @@ (server-start)) (diminish 'auto-fill-function "_") +(ac-config-default) (provide 'init) -- cgit v1.2.3-54-g00ecf From fea253be001c509dedfc027573f3dcc53dcf75e2 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 28 Dec 2012 01:59:21 +0100 Subject: Emacs: Remove last feeds from newsticker All feeds are being handled by Gnus again. --- .emacs.d/site-lisp/newsticker-init.el | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.emacs.d/site-lisp/newsticker-init.el b/.emacs.d/site-lisp/newsticker-init.el index ad91632..c393df1 100644 --- a/.emacs.d/site-lisp/newsticker-init.el +++ b/.emacs.d/site-lisp/newsticker-init.el @@ -1,17 +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-url-list - `(("Public Git Hosting - conkeror.git/atom log" - "http://repo.or.cz/w/conkeror.git/atom" nil nil nil) - ("Script Tutorials" - "http://www.script-tutorials.com/feed/rss/" nil nil nil) - ("WikEmacs - Recent changes [en]" - "http://wikemacs.org/w/index.php?title=Special:RecentChanges&feed=atom" - nil nil nil) - ("git.tuxfamily.org Git - sawfish.main.git/atom log" - "http://git.tuxfamily.org/sawfish/main.git?p=sawfish/main.git;a=atom" - nil nil nil))) (setq newsticker-use-full-width nil) (provide 'newsticker-init) -- cgit v1.2.3-54-g00ecf From e5a1d2ab36f3e38be79f3d4a8971bc5fa8ade1b4 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 28 Dec 2012 02:00:04 +0100 Subject: Emacs: Include python-mode snippets --- .emacs.d/snippets/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs.d/snippets/Makefile b/.emacs.d/snippets/Makefile index 20d79e0..12ff544 100644 --- a/.emacs.d/snippets/Makefile +++ b/.emacs.d/snippets/Makefile @@ -1,4 +1,4 @@ DESTDIR:=$(DESTDIR)/snippets -modules=html-mode org-mode +modules=html-mode org-mode python-mode include ../../dotfiles.mk -- cgit v1.2.3-54-g00ecf From eda4b0c1ef424a8929e287d717e9cd76496f56ad Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 28 Dec 2012 11:24:28 +0100 Subject: Emacs: Show magit main window in current window --- .emacs.d/init.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 1e5b60b..fb7e975 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -400,6 +400,9 @@ (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)))) (unless (oni:required-packages-installed-p) (message "%s" "Refreshing package database...") -- cgit v1.2.3-54-g00ecf From 0cceaba810bd354c46902f0b9a7da021a6c89e10 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 30 Dec 2012 02:29:08 +0100 Subject: Emacs: Stop using ido-ubiquitous It was starting to get in the way too much, try icomplete-mode instead. --- .emacs.d/init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index fb7e975..d1e8c50 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -247,7 +247,6 @@ (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 '(oni:view-mail tmm-menubar)) (setq inferior-lisp-program "sbcl") (setq inhibit-default-init t) (setq inhibit-local-menu-bar-menus t) @@ -425,9 +424,9 @@ (electric-indent-mode) (electric-pair-mode) (ido-mode) -(ido-ubiquitous-mode) (savehist-mode) (show-paren-mode) +(icomplete-mode) (smex-initialize) (help-at-pt-set-timer) -- cgit v1.2.3-54-g00ecf From 430729835bcd48744c736d5d90140723dc9e79e3 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 30 Dec 2012 02:31:16 +0100 Subject: Emacs: Autofill everything in Texinfo Not just comments --- .emacs.d/site-lisp/oni.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index fdaf01e..f461bab 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -603,6 +603,7 @@ If no direction is given, don't split." (defun oni:texinfo-mode-func () "Function for `texinfo-mode-hook'." + (setq-local comment-auto-fill-only-comments nil) (auto-fill-mode)) (defun oni:view-mail (inbox) -- cgit v1.2.3-54-g00ecf From 3fc11c073a8dc4bec85d32b0a7b642d6d0be0ab4 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 30 Dec 2012 02:33:34 +0100 Subject: Emacs: Change colors of org todo states Make them look better with yoshi-theme. --- .emacs.d/site-lisp/org-init.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.emacs.d/site-lisp/org-init.el b/.emacs.d/site-lisp/org-init.el index 9d61396..23ae6a5 100644 --- a/.emacs.d/site-lisp/org-init.el +++ b/.emacs.d/site-lisp/org-init.el @@ -81,16 +81,16 @@ (setq org-tags-column -101) (setq org-tags-exclude-from-inheritance '("crypt")) (setq org-todo-keyword-faces - '(("TODO" :background "red") - ("DONE" :background "forest green") - ("SUCCEEDED" :background "forest green") - ("WAITING" :background "orange" :foreground "black") - ("CANCELLED" :background "orange red") - ("FAILED" :background "orange red") - ("WIP" :background "#ff9800" :foreground "black") - ("HOLD" :background "orange" :foreground "black") - ("ACQUIRE" :background "red") - ("IGNORED" :background "#555555"))) + '(("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")) -- cgit v1.2.3-54-g00ecf From f4fdaef0eea5305433faa7f7e4cee1584385108e Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 30 Dec 2012 02:49:42 +0100 Subject: Emacs: Allow gnus to match score to To header --- .emacs.d/gnus.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/gnus.el b/.emacs.d/gnus.el index 03f1b41..7301231 100644 --- a/.emacs.d/gnus.el +++ b/.emacs.d/gnus.el @@ -10,6 +10,7 @@ (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) -- cgit v1.2.3-54-g00ecf From 5b4684f3356b0394925b2f783e5e98f0632012c1 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 3 Jan 2013 23:55:57 +0100 Subject: Emacs: Start with literate configuration again --- .emacs.d/init.el | 40 +------ .emacs.d/init.org | 315 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 316 insertions(+), 39 deletions(-) create mode 100644 .emacs.d/init.org diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d1e8c50..e0e73f1 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -6,45 +6,7 @@ ;;; Code: -(eval-and-compile - (package-initialize) - - (mapc #'(lambda (directory) - (add-to-list 'load-path directory) - (let ((default-directory directory)) - (normal-top-level-add-subdirs-to-load-path))) - '("/usr/share/emacs/site-lisp" "~/.emacs.d/site-lisp" - "/usr/local/emacs/share/emacs/site-lisp")) - (mapc #'(lambda (directory) - (add-to-list 'load-path directory) - (let ((loaddefs (concat directory "/loaddefs.el"))) - (when (file-exists-p loaddefs) - (load loaddefs)))) - '("~/var/src/emacs/dispass.el" "~/var/src/emacs/mode-icons")) - (mapc #'(lambda (dir) - (add-to-list 'custom-theme-load-path dir)) - '("~/var/src/emacs/yoshi-theme"))) - -(require 'auto-complete-config) -(require 'ext) -(require 'geiser-install) -(require 'oni) -(require 'uniquify) - -(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) - -(load (expand-file-name "~/.emacs.d/site-lisp/loaddefs.el")) +(load (concat user-emacs-directory "init2")) (define-key key-translation-map (kbd "C-j") (kbd "C-l")) (define-key key-translation-map (kbd "C-l") (kbd "C-j")) diff --git a/.emacs.d/init.org b/.emacs.d/init.org new file mode 100644 index 0000000..2041f5a --- /dev/null +++ b/.emacs.d/init.org @@ -0,0 +1,315 @@ +#+TITLE: Emacs init +#+STYLE: +#+OPTIONS: author:nil + +* Startup + + Startup requires a bit of customization to handle all my + customizations. + +** Load paths + + I have two versions of Emacs installed on my main computer. I have + a daily build of Emacs's ~trunk~ (or currently ~emacs-24~) branch from + bazaar and I have the official ~emacs~ package from archlinux + installed. I keep that second one around so that the occasional + emacs package that I install using ~pacman~ will recognize it as a + dependency and so that if there has been some horrible mistake in + the ~trunk~ branch I still have a stable version to fall back + on[fn:1]. + +*** Package initialization + + In order for packages installed through ELPA to be included + without having to mess with load paths and such, use: + + #+NAME: package-initialize + #+BEGIN_SRC emacs-lisp + (package-initialize) + #+END_SRC + +*** site-lisp + + Because of the setup I wrote about I need to have both the + self-built ~site-lisp~ directory in my load path *and* the "official" + one. + + #+NAME: load-site-lisps + #+BEGIN_SRC emacs-lisp + (mapc #'oni:add-all-to-load-path + '("/usr/share/emacs/site-lisp" + "/usr/local/emacs/share/emacs/site-lisp")) + #+END_SRC + + The =oni:add-all-to-load-path= function just binds =default-directory= + to the given directory and calls + =normal-top-level-add-subdirs-to-load-path= to add it and all its + subdirectories to the load path. + + #+NAME: add-all + #+BEGIN_SRC emacs-lisp + (defun oni:add-all-to-load-path (dir) + (add-to-list 'load-path dir) + (let ((default-directory dir)) + (normal-top-level-add-subdirs-to-load-path))) + #+END_SRC + +**** TODO Add load paths in different order depending on version + + The officially installed version should load + =/usr/share/emacs/site-lisp= before + =/usr/local/emacs/share/emacs/sit-lisp= and the bzr version should + do the reversed. + +*** Projects + + Then there are some projects I'm working on, which I use on a + daily basis, these should also be added so I don't have to + constantly remove and re-install them through ~package.el~ when + working on them. And there is the ~load-defs.el~ in my personal + ~site-lisp~ directory of course. + + #+NAME: load-projects + #+BEGIN_SRC emacs-lisp + (mapc #'oni:add-to-load-path-maybe-load-defs + '("~/projects/emacs/dispass.el" "~/var/src/emacs/mode-icons" + "~/.emacs.d/site-lisp")) + #+END_SRC + + The =oni:add-to-load-path-maybe-load-defs= function just adds the + given directory to the load path and then looks for a file named + ~loaddefs.el~ within that directory, if it exists it loads it. + + #+NAME: add-with-loaddefs + #+BEGIN_SRC emacs-lisp + (defun oni:add-to-load-path-maybe-load-defs (dir) + (add-to-list 'load-path dir) + (let ((loaddefs (concat dir "/loaddefs.el"))) + (when (file-exists-p loaddefs) + (load loaddefs)))) + #+END_SRC + +*** Themes + + And, finally, I'm also working on a color theme for emacs, this + should be added to ~custom-theme-load-path~. By using =mapc= here as + well I'm keeping in mind that this isn't the first theme I've + worked on and it might not be the last either. + + #+NAME: load-themes + #+BEGIN_SRC emacs-lisp + (mapc #'oni:add-to-custom-theme-load-path + '("~/projects/emacs/yoshi-theme")) + #+END_SRC + + The =oni:add-to-custom-theme-load-path= just adds the given + directory to the cutom theme load path. + + #+NAME: add-themes + #+BEGIN_SRC emacs-lisp + (defun oni:add-to-custom-theme-load-path (dir) + (add-to-list 'custom-theme-load-path dir)) + #+END_SRC + +*** Evaluation + + Because during byte-compilation certain parts loaded so far might + also be required I put it in an =eval-and-compile= form, so that all + components are loaded with ~emacs -Q~ as well. Without this + compilation might fail at certain points. + + #+BEGIN_SRC emacs-lisp :tangle init2.el :noweb yes + (eval-and-compile + <> + + <> + + <> + + <> + <> + <> + <>) + #+END_SRC + +** Modules + + While I try to use =eval-after-load= and =autoload= as much as + possible, some things require direct =require='ing to be of use. + +*** Require + + - ~auto-complete-config~ :: This sets up some default settings to + make ~auto-complete~ work for most[fn:2] of the modes it + supports. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (require 'auto-complete-config) + #+END_SRC + + - ~geiser-install~ :: Sets up geiser autoloads and such. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (require 'geiser-install) + #+END_SRC + + - ~uniquify~ :: Provides more helpful buffer name uniquification. + The default of using ~buffer-name<2>~ is boring and + uninformative, ~uniquify~ fixes this. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (require 'uniquify) + #+END_SRC + + - ~ext~ :: Functions from external sources. + - ~oni~ :: Functions written personally. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (require 'ext) + (require 'oni) + #+END_SRC + +*** Autoload + + These might not be used at all in a session, so they should only + be loaded when necessary. + + =define-slime-contrib= was used by some module that didn't autoload + or require it[fn:3]. But since I don't use whichever model it + was every day, it is of no use to load it every single time. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'define-slime-contrib "slime") + #+END_SRC + + I installed ~global~ with ~pacman~, but this doesn't add anything to + any =loaddefs.el=, so doesn't create any autoloads. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'gtags-mode "gtags" nil t) + #+END_SRC + + ~jabber.el~ does create ~jabber-autoloads.el~, but I only ever start + using it through ~jabber-connect~, so anything else isn't really + necessary. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'jabber-connect "jabber" nil t) + #+END_SRC + + I used to work a bit on ~php-mode~, but that was a while ago, so + it's still in my ~site-lisp~ directory. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'php-mode "php-mode" nil t) + #+END_SRC + + The same that goes for ~gtags.el~ also goes for ~po-mode.el~. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'po-mode "po-mode" nil t) + #+END_SRC + + And the same that went for ~php-mode~ also goes for ~pony-mode~, + except I'm still working on it and I was too lazy to put it with + my other projects. I should still do that. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'pony-mode "pony-mode" nil t) + #+END_SRC + + ~sawfish.el~ has the same problem that ~gtags.el~ and ~po-mode.el~ have. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'sawfish-mode "sawfish" nil t) + #+END_SRC + + I use =server-running-p= to check whether or not I should start a + new server, but this function isn't autoloaded by default. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'server-running-p "server") + #+END_SRC + + I was starting to try ~slime-js~ to make JavaScript programming + more interesting, but I haven't gotten around to trying it out + fully, yet. It shares issues with ~gtags.el~, ~po-mode.el~ and + ~sawfish.el~. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'slime-js-minor-mode "slime-js" nil t) + #+END_SRC + + I found ~xmodmap-mode~ on the [[http://emacswiki.org][EmacsWiki]] some time ago, it was + simple and a good example of how to use ~define-generic-mode~, but + since it's not really my project and it's really small it just + sits in my ~site-lisp~ directory. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'xmodmap-mode "xmodmap-mode" nil t) + #+END_SRC + + ~w3m~ also has a setup module like ~geiser-install~, but since I only + ever use these two functions to start it, there is no real need + for anything else. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (autoload 'w3m-bookmark-view "w3m" nil t) + (autoload 'w3m-goto-url "w3m" nil t) + #+END_SRC + +* Aliases + + There are some functions that are just better than others, no + matter how politically incorrect it might be to admit. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defalias 'yes-or-no-p 'y-or-n-p) + (defalias 'list-buffers 'ibuffer) + (defalias 'dabbrev-expand 'hippie-expand) + #+END_SRC + +* Faces + + Define faces for use with ~magit~ log edit mode. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (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 + +* Keys + + With the awesome power of Emacs comes the need for lots of + keybindings. + +** Translation + + Since the ~C-l~ combination is so much easier than ~C-j~ when using + the [[http://colemak.com][colemak]] keyboard layout and ~C-j~ is used so much more, switch + them. + + #+BEGIN_SRC emacs-lisp tangle init2.el + (define-key key-translation-map (kbd "C-j") (kbd "C-l")) + (define-key key-translation-map (kbd "C-l") (kbd "C-j")) + #+END_SRC +* Footnotes + +[fn:1] Though it doesn't happen often that ~trunk~ is so messed up that +I can't use it. + +[fn:2] Or perhaps all. + +[fn:3] I think it was ~slime-js-minor-mode~, but I'm not sure. -- cgit v1.2.3-54-g00ecf From 4e46ca2fd8d8a22c3b8bd1e5385772ce28d3e38b Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 3 Jan 2013 23:56:48 +0100 Subject: .emacs.d: Ignore some more generated files --- .emacs.d/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore index 2fa1670..0b490df 100644 --- a/.emacs.d/.gitignore +++ b/.emacs.d/.gitignore @@ -13,3 +13,5 @@ templates/ rinit.* !rinit.org history +init2.el +*.html -- cgit v1.2.3-54-g00ecf From d60dd0acee45f294e5cbd75611bc59ce8848c6bf Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 3 Jan 2013 23:57:41 +0100 Subject: Emacs: Tangle init2.el from init.org Eventually it might tangle to init.el, once I finish copying everything. --- .emacs.d/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.emacs.d/Makefile b/.emacs.d/Makefile index 0c716a8..fc17095 100644 --- a/.emacs.d/Makefile +++ b/.emacs.d/Makefile @@ -1,5 +1,11 @@ DESTDIR:=$(DESTDIR)/.emacs.d -objects=init.elc init.el gnus.elc gnus.el +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 \"$^\"))" -- cgit v1.2.3-54-g00ecf From 8e738db1faaa291b277e9cb84727ead4d51f3828 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 3 Jan 2013 23:59:26 +0100 Subject: Emacs: Some mode changes * .emacs.d/init.el: Reorder modes. Start using `winner-mode' again and once more prefer `ido-ubiquitous' over `icomplete-mode'. `icomplete-mode' tends to get messy. --- .emacs.d/init.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index e0e73f1..44731de 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -375,20 +375,21 @@ oni:required-packages)) (blink-cursor-mode -1) +(column-number-mode -1) +(line-number-mode -1) (menu-bar-mode -1) (scroll-bar-mode -1) (tool-bar-mode -1) (tooltip-mode -1) -(line-number-mode -1) -(column-number-mode -1) (auto-insert-mode) (electric-indent-mode) (electric-pair-mode) (ido-mode) +(ido-ubiquitous-mode) (savehist-mode) (show-paren-mode) -(icomplete-mode) +(winner-mode) (smex-initialize) (help-at-pt-set-timer) -- cgit v1.2.3-54-g00ecf From 241374103f698eaa75220647753cf48792adf7f3 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 4 Jan 2013 00:00:08 +0100 Subject: Emacs: don't use ido for `org-refile' It doesn't work... --- .emacs.d/init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 44731de..f8c32bb 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -209,6 +209,7 @@ (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)) (setq inferior-lisp-program "sbcl") (setq inhibit-default-init t) (setq inhibit-local-menu-bar-menus t) -- cgit v1.2.3-54-g00ecf From 4cf76b65c14060b60804ac119cbf91f779bc2e55 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 4 Jan 2013 00:00:37 +0100 Subject: Emacs: Stay true to 80 columns, even with lisp --- .emacs.d/init.el | 3 --- .emacs.d/site-lisp/oni.el | 5 ----- 2 files changed, 8 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index f8c32bb..2b32682 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -273,7 +273,6 @@ (add-hook 'css-mode-hook 'oni:css-mode-func) (add-hook 'diary-display-hook 'oni:diary-display-func) (add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-func) -(add-hook 'emacs-lisp-mode-hook 'oni:generic-lisp-mode-hook) (add-hook 'erc-mode-hook 'oni:erc-mode-func) (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) (add-hook 'flymake-mode-hook 'oni:flymake-mode-func) @@ -286,7 +285,6 @@ (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 'lisp-mode-hook 'oni:generic-lisp-mode-hook) (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) @@ -296,7 +294,6 @@ (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 'scheme-mode-hook 'oni:generic-lisp-mode-hook) (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) diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index f461bab..79b5f6e 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -179,11 +179,6 @@ DOT are intentionally being skipped." (local-set-key [M-P] 'flymake-goto-prev-error) (local-set-key [M-N] 'flymake-goto-next-error)) -(defun oni:generic-lisp-mode-hook () - "Function for `emacs-lisp-mode-hook', `lisp-mode-hook' and -`scheme-mode-hook'." - (setq fci-rule-column 101)) - (defun oni:go-mode-func () "Function for `go-mode-hook'." (setq indent-tabs-mode nil) -- cgit v1.2.3-54-g00ecf From 454f5cd77ebdd321e47af602a55828d5962986a2 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 4 Jan 2013 00:01:08 +0100 Subject: Emacs: Show any scratch buffers in current window --- .emacs.d/init.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 2b32682..f49748f 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -356,6 +356,9 @@ (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)))) -- cgit v1.2.3-54-g00ecf From a13dbcec8da7e9b06e0ca3a1d3ee6760686e38e6 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 4 Jan 2013 00:01:29 +0100 Subject: Emacs: Don't load rudel for now I haven't used it in a while anyway... --- .emacs.d/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index f49748f..cd9c9b5 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -398,7 +398,7 @@ (load-theme 'yoshi t) (load custom-file) -(load "rudel-loaddefs.el") +;; (load "rudel-loaddefs.el") (load (expand-file-name "~/quicklisp/slime-helper.el")) (load "quick-edit-mode") -- cgit v1.2.3-54-g00ecf From 1be69078ad8c1af62de79b80345a72d2b8490b04 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 4 Jan 2013 00:01:52 +0100 Subject: eltuki: Add post skeleton and use it for new posts --- .emacs.d/site-lisp/eltuki.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.emacs.d/site-lisp/eltuki.el b/.emacs.d/site-lisp/eltuki.el index 80400a9..224e9ab 100644 --- a/.emacs.d/site-lisp/eltuki.el +++ b/.emacs.d/site-lisp/eltuki.el @@ -46,10 +46,20 @@ :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)) + (org-mode) + (eltuki-post)) (defun eltuki-get-title () (save-excursion -- cgit v1.2.3-54-g00ecf