Merge remote-tracking branch 'origin/master' into phoenix

Conflicts:
	.emacs.d/init.el
This commit is contained in:
Tom Willemsen 2013-01-04 00:06:15 +01:00
commit 12fbc83cc7
19 changed files with 466 additions and 188 deletions

View file

@ -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",

2
.emacs.d/.gitignore vendored
View file

@ -13,3 +13,5 @@ templates/
rinit.*
!rinit.org
history
init2.el
*.html

View file

@ -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 \"$^\"))"

View file

@ -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)

View file

@ -6,48 +6,10 @@
;;; Code:
(eval-and-compile
(package-initialize)
(load (concat user-emacs-directory "init2"))
(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"))
(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 'geiser-install)
(require 'iso-transl)
(require 'newcomment)
(require 'uniquify)
(require 'w3m-load)
(require 'ext)
(require 'oni)
(defalias 'dabbrev-expand 'hippie-expand)
(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)
(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)
(load (expand-file-name "~/.emacs.d/site-lisp/loaddefs.el"))
(define-key key-translation-map (kbd "C-j") (kbd "C-l"))
(define-key key-translation-map (kbd "C-l") (kbd "C-j"))
(defalias 'yes-or-no-p 'y-or-n-p)
(defalias 'list-buffers 'ibuffer)
@ -68,6 +30,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"))
@ -102,9 +67,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\\." "^\\#")))
@ -118,13 +80,19 @@
(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)
(global-set-key (kbd "C-M-x") 'smex-major-mode-commands)))
(eval-after-load "yasnippet"
'(oni:load-hippie-exp 'hippie-exp))
'(diminish 'yas-minor-mode))
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
@ -241,7 +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 '(oni:view-mail tmm-menubar))
(setq ido-ubiquitous-command-exceptions '(org-refile))
(setq inferior-lisp-program "sbcl")
(setq inhibit-default-init t)
(setq inhibit-local-menu-bar-menus t)
@ -264,7 +232,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/")
@ -296,6 +263,8 @@
(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)
@ -392,12 +361,13 @@
(add-to-list
'display-buffer-alist
'(".*" . ((display-buffer-same-window . nil))))
'("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil))))
(add-to-list
'display-buffer-alist
'("^\\*git-project-list\\*$" . ((git-project-show-window . nil))))
(delete " " mode-line-format)
(add-to-list
'display-buffer-alist
'("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil))))
(unless (oni:required-packages-installed-p)
(message "%s" "Refreshing package database...")
@ -409,12 +379,12 @@
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)
@ -423,6 +393,7 @@
(ido-ubiquitous-mode)
(savehist-mode)
(show-paren-mode)
(winner-mode)
(display-battery-mode)
(smex-initialize)
@ -431,11 +402,14 @@
(load-theme 'yoshi t)
(load custom-file)
(load "rudel-loaddefs.el")
;; (load "rudel-loaddefs.el")
(unless (server-running-p)
(server-start))
(diminish 'auto-fill-function "_")
(ac-config-default)
(provide 'init)
;;; init.el ends here

315
.emacs.d/init.org Normal file
View file

@ -0,0 +1,315 @@
#+TITLE: Emacs init
#+STYLE: <link href="http://ryuslash.ninth.su/test2.css" rel="stylesheet">
#+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
<<add-all>>
<<add-with-loaddefs>>
<<add-themes>>
<<package-initialize>>
<<load-site-lisps>>
<<load-projects>>
<<load-themes>>)
#+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.

View file

@ -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
@ -163,9 +173,13 @@
(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) (concat dir "/content"))))
(write-region (point-min) (point-max) filename)
(kill-buffer))
filename))
(defun eltuki-write-metadata (dir)
(let ((timestamp (eltuki-get-timestamp))
@ -173,7 +187,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 +196,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)
(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)

View file

@ -1,108 +1,6 @@
(defmacro reddit-feed (name)
"Return a reddit feed url"
(concat "http://www.reddit.com/r/" name "/new/.rss?sort=new"))
(setq newsticker-automatically-mark-items-as-old nil)
(setq newsticker-html-renderer 'w3m-region)
(setq newsticker-obsolete-item-max-age 604800)
(setq newsticker-url-list
`(("Irreal"
"http://irreal.org/blog/?feed=rss2" nil nil nil)
("Arch Linux - Keeping it Simple"
,(reddit-feed "archlinux") nil nil nil)
("The C programming language"
,(reddit-feed "c_language") nil nil nil)
("C"
,(reddit-feed "C_Programming") nil nil nil)
("coding"
,(reddit-feed "coding") nil nil nil)
("Command Line"
,(reddit-feed "commandline") nil nil nil)
("Django"
,(reddit-feed "django") nil nil nil)
("M-x emacs-reddit"
,(reddit-feed "emacs") nil nil nil)
("git"
,(reddit-feed "git") nil nil nil)
("JavaScript"
,(reddit-feed "javascript") nil nil nil)
("r/Linux"
,(reddit-feed "linux") nil nil nil)
("Linux Gaming on Reddit"
,(reddit-feed "linux_gaming") nil nil nil)
("Lisp"
,(reddit-feed "lisp") nil nil nil)
("Open Source on Reddit"
,(reddit-feed "opensource") nil nil nil)
("PHP: The latest news in the PHP world"
,(reddit-feed "PHP") nil nil nil)
("programming"
,(reddit-feed "programming") nil nil nil)
("Python"
,(reddit-feed "Python") nil nil nil)
("Scheme Programming Language articles"
,(reddit-feed "scheme") nil nil nil)
("The Wayland Display Server"
,(reddit-feed "wayland") nil nil nil)
("Identity at Mozilla"
"http://identity.mozilla.com/rss" nil nil nil)
("jd:/dev/blog"
"http://julien.danjou.info/blog/index.xml" nil nil nil)
("KaKaRoTo's Blog"
"http://kakaroto.homelinux.net/feed/" nil nil nil)
("Awhan Patnaik"
"http://awhan.wordpress.com/feed/" nil nil nil)
("The Gitorious Blog"
"http://blog.gitorious.org/feed/" nil nil nil)
;; ("Dieter on the web"
;; "http://dieter.plaetinck.be/index.rss" nil nil nil)
("Public Git Hosting - conkeror.git/atom log"
"http://repo.or.cz/w/conkeror.git/atom" nil nil nil)
("Stevey's Blog Rants"
"http://steve-yegge.blogspot.com/feeds/posts/default"
nil nil nil)
("Script Tutorials"
"http://www.script-tutorials.com/feed/rss/" nil nil nil)
("Hacker News"
"http://news.ycombinator.com/rss" nil nil nil)
("HowtoForge - Linux Howtos and Tutorials -"
"http://www.howtoforge.com/node/feed" nil nil nil)
("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)))
(setq newsticker-use-full-width nil)
(provide 'newsticker-init)

View file

@ -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")))))
@ -286,13 +288,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 ")"))
@ -601,6 +596,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)
@ -624,7 +620,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"

View file

@ -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)
@ -80,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"))

View file

@ -1,4 +1,4 @@
DESTDIR:=$(DESTDIR)/snippets
modules=html-mode org-mode
modules=html-mode org-mode python-mode
include ../../dotfiles.mk

View file

@ -0,0 +1,4 @@
DESTDIR:=$(DESTDIR)/python-mode
objects=defm_empty form form_valid import_from permission_guard url
include ../../../dotfiles.mk

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# name: from ... import ...
# contributor: Tom Willemsen
# key: from
# --
from ${1:module} import ${2:class_or_module}

View file

@ -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)

View file

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: url
# key: url
# --
url(r'^$1', $2, name='$3'),

View file

@ -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