Commits

Anonymous committed b65bb3a

Update all stuff

Comments (0)

Files changed (13)

files/dired-defs.el

       (move-marker (process-mark proc) 1 (current-buffer)))
     (setq mode-line-process '(":%s"))))
 
+;;;_. avfs
+(defvar my-avfs-root "~/.avfs")
+(defvar my-avfs-archives '("zip" "rar" "tar"))
+(defvar my-hide-avfs-root t)
+
+(defun my-avfs-archive-filename (filename)
+  (concat my-avfs-root (file-truename filename) "#"))
+
+(defun my-avfs-archive-p (filename)
+  (let ((extensions (concat "\\." (regexp-opt my-avfs-archives) "\\'")))
+    (string-match-p extensions filename)))
+
+(defun my-open-avfs (filename)
+  (find-file (my-avfs-archive-filename filename)))
+
+(defun my-hide-avfs-root ()
+  (save-excursion
+    (when my-hide-avfs-root
+      (goto-char (point-min))
+      (when (search-forward (file-truename my-avfs-root) nil t)
+        (let ((inhibit-read-only t))
+          (put-text-property (match-beginning 0) (match-end 0) 'invisible t))))))
+
+(add-hook 'dired-after-readin-hook 'my-hide-avfs-root)
+
+(defun my-dired-open-avfs ()
+  (interactive)
+  (my-open-avfs (dired-file-name-at-point)))
+
+(defun my-dired-find-file ()
+  "In Dired, visit the file or directory named on this line.
+
+Like `dired-file-file' but handles archives via avfs."
+  (interactive)
+  (let ((file (dired-get-file-for-visit))
+        (find-file-run-dired t))
+    (if (my-avfs-archive-p file)
+        (my-open-avfs file)
+      (find-file file))))
+(define-key dired-mode-map [remap dired-find-file] 'my-dired-find-file)
+
+(defadvice find-file-noselect (before fix-avfs-arguments activate)
+  "If the target is archive that can be handled via avfs,
+automagically change the filename to the location of virtual
+directory representing this archive."
+  (when (my-avfs-archive-p (ad-get-arg 0))
+    (ad-set-arg 0 (my-avfs-archive-filename (ad-get-arg 0)))))
+
 ;;;_. Zip support
 
 (add-to-list 'dired-compress-file-suffixes '("\\.zip\\'" ".zip" "unzip"))

files/emacs-custom.el

  '(ac-quick-help-delay 0.5)
  '(ac-use-fuzzy t)
  '(ack-and-a-half-use-environment nil)
- '(ahk-bin "d:\\progs\\AutoHotkey\\AutoHotkey.exe")
- '(ahk-syntax-directory "d:/progs/AutoHotkey/Extras/Editors/Syntax/")
+ '(ag-highlight-search t)
  '(allout-prefixed-keybindings (quote (("[(control ?n)]" allout-next-visible-heading) ("[(control ?p)]" allout-previous-visible-heading) ("[(control ?u)]" allout-up-current-level) ("[(control ?f)]" allout-forward-current-level) ("[(control ?b)]" allout-backward-current-level) ("[(control ?a)]" allout-beginning-of-current-entry) ("[(control ?e)]" allout-end-of-entry) ("[(control ?i)]" allout-show-children) ("[(control ?s)]" allout-show-current-subtree) ("[(control ?t)]" allout-toggle-current-subtree-exposure) ("[?h]" allout-hide-current-subtree) ("[(control ?o)]" allout-show-current-entry) ("[?!]" allout-show-all) ("[?x]" allout-toggle-current-subtree-encryption) ("[? ]" allout-open-sibtopic) ("[?.]" allout-open-subtopic) ("[?,]" allout-open-supertopic) ("[?']" allout-shift-in) ("[?>]" allout-shift-in) ("[?<]" allout-shift-out) ("[(control ?m)]" allout-rebullet-topic) ("[?*]" allout-rebullet-current-heading) ("[?#]" allout-number-siblings) ("[(control ?k)]" allout-kill-topic) ("[(meta ?k)]" allout-copy-topic-as-kill) ("[?@]" allout-resolve-xref) ("[?=?c]" allout-copy-exposed-to-buffer) ("[?=?i]" allout-indented-exposed-to-buffer) ("[?=?t]" allout-latexify-exposed) ("[?=?p]" allout-flatten-exposed-to-buffer) ("[(control ?c)]" allout-hide-bodies))))
  '(ange-ftp-ftp-program-name "d:\\progs\\ftp.exe")
  '(ansi-color-names-vector ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#ad7fa8" "#8cc4ff" "#eeeeec"])
  '(desktop-save t)
  '(diary-file "~/org/diary")
  '(dired-dwim-target t)
+ '(dired-guess-shell-alist-user (quote (("\\.pdf\\'" "zathura --fork"))))
  '(dired-listing-switches "-alh")
  '(dired-omit-extensions (quote (".o" "~" ".bin" ".bak" ".obj" ".map" ".ico" ".pif" ".lnk" ".a" ".ln" ".blg" ".bbl" ".dll" ".drv" ".vxd" ".386" ".elc" ".lof" ".glo" ".idx" ".lot" ".svn/" ".hg/" ".git/" ".bzr/" "CVS/" "_darcs/" "_MTN/" ".fmt" ".tfm" ".class" ".fas" ".lib" ".mem" ".x86f" ".sparcf" ".dfsl" ".pfsl" ".d64fsl" ".p64fsl" ".lx64fsl" ".lx32fsl" ".dx64fsl" ".dx32fsl" ".fx64fsl" ".fx32fsl" ".sx64fsl" ".sx32fsl" ".wx64fsl" ".wx32fsl" ".fasl" ".ufsl" ".fsl" ".dxl" ".lo" ".la" ".gmo" ".mo" ".toc" ".aux" ".cp" ".fn" ".ky" ".pg" ".tp" ".vr" ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs" ".pyc" ".pyo" ".idx" ".lof" ".lot" ".glo" ".blg" ".bbl" ".cp" ".cps" ".fn" ".fns" ".ky" ".kys" ".pg" ".pgs" ".tp" ".tps" ".vr" ".vrs" ".log" ".ilg" ".out" ".ind" ".dsc")))
  '(display-time-24hr-format t)
  '(eldoc-in-minibuffer-mode t)
  '(emmet-indentation 2)
  '(emmet-preview-default nil)
+ '(emms-player-list nil)
  '(enable-recursive-minibuffers t)
  '(erc-autojoin-channels-alist (quote (("chat.freenode.org" "#emacs" "##latin"))))
  '(erc-away-timestamp-format "<%H:%M:%S>")
  '(erc-track-enable-keybindings t)
  '(erc-track-exclude-server-buffer t)
  '(erc-track-exclude-types (quote ("JOIN" "NICK" "PART" "QUIT" "333" "353")))
- '(erc-track-minor-mode t)
- '(erc-track-mode t)
  '(erc-track-position-in-mode-line t)
  '(erc-track-showcount t)
  '(erc-track-visibility nil)
  '(font-latex-math-environments (quote ("display" "displaymath" "equation" "eqnarray" "gather" "multline" "align" "alignat" "xalignat" "derivation")))
  '(font-latex-quotes (quote auto))
  '(foreground-color "#839496")
+ '(free-keys-modifiers (quote ("" "C" "M" "C-M" "H" "s")))
  '(gc-cons-threshold 20000000)
  '(global-flex-isearch-mode t)
- '(global-linum-mode nil)
  '(global-undo-tree-mode t)
  '(golden-ratio-exclude-buffer-names (quote ("*helm kill-ring*" "*Ediff Control Panel*" " *guide-key*")))
  '(golden-ratio-extra-commands (quote (windmove-left windmove-right windmove-down windmove-up)))
  '(golden-ratio-inhibit-functions (quote (my-golden-ratio-inhibit)))
  '(golden-ratio-mode t)
  '(guide-key-mode t)
- '(guide-key/guide-key-sequence (quote ("C-x r" "C-x 4" "C-x j" "C-x p" (calc-mode "V") (dired-mode "/" "*" "C-t") (ibuffer-mode "/" "*" "%"))))
+ '(guide-key/guide-key-sequence (quote ("C-x r" "C-x 4" "C-x j" "C-x p" (calc-mode "V" "k" "a") (dired-mode "/" "*" "C-t" "%") (ibuffer-mode "/" "*" "%"))))
  '(guide-key/idle-delay 0.6)
  '(guide-key/popup-window-position (quote bottom))
  '(guide-key/recursive-key-sequence-flag t)
  '(haskell-mode-hook (quote (turn-on-haskell-indentation turn-on-haskell-doc-mode)))
- '(haskell-program-name "d:\\progs\\HaskellPlatform\\bin\\ghci.exe")
+ '(helm-descbinds-mode t)
  '(ibuffer-fontification-alist (quote ((10 buffer-read-only font-lock-constant-face) (15 (and buffer-file-name (string-match ibuffer-compressed-file-name-regexp buffer-file-name)) font-lock-doc-face) (20 (string-match "^*" (buffer-name)) font-lock-keyword-face) (25 (and (string-match "^ " (buffer-name)) (null buffer-file-name)) italic) (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face) (35 (memq major-mode (quote (dired-mode sr-mode))) font-lock-function-name-face))))
  '(ibuffer-saved-filter-groups (quote (("default" ("Org" (mode . org-mode)) ("emacs-config" (or (predicate let ((bfn (buffer-file-name (current-buffer)))) (when bfn (and (string-match-p "\\.emacs\\.d" bfn) (eq major-mode (quote emacs-lisp-mode))))))) ("emacs" (or (mode . emacs-lisp-mode) (mode . lisp-interaction-mode) (mode . inferior-emacs-lisp-mode))) ("TeX" (or (mode . tex-mode) (mode . plain-tex-mode) (mode . latex-mode))) ("Markdown" (or (mode . markdown-mode) (mode . gfm-mode))) ("Web" (or (mode . html-mode) (mode . css-mode) (mode . php-mode) (mode . js-mode))) ("Dired" (mode . dired-mode)) ("Images" (or (mode . image-dired-display-image-mode) (mode . image-dired-thumbnail-mode) (mode . image-mode))) ("Tramp" (or (name . "tramp"))) ("Programming" (or (mode . c-mode) (mode . perl-mode) (mode . python-mode) (mode . cc-mode)))))))
  '(ibuffer-saved-filters (quote (("irc" ((mode . erc-mode))) ("dipl" ((filename . "_dipl"))) ("gnus" ((or (mode . message-mode) (mode . mail-mode) (mode . gnus-group-mode) (mode . gnus-summary-mode) (mode . gnus-article-mode)))) ("programming" ((or (mode . emacs-lisp-mode) (mode . cperl-mode) (mode . c-mode) (mode . java-mode) (mode . idl-mode) (mode . lisp-mode)))))))
  '(imenu-auto-rescan t)
  '(indicate-empty-lines nil)
  '(inhibit-startup-screen t)
+ '(initial-buffer-choice "~/.emacs.d/init.el")
  '(ispell-personal-dictionary "~/.emacs.d/.ispell")
  '(keyfreq-autosave-mode t)
  '(keyfreq-file "~/.emacs.d/.emacs.keyfreq")
  '(keyfreq-mode t)
- '(linum-format "%3s|")
  '(ls-lisp-dirs-first t)
  '(ls-lisp-use-insert-directory-program nil)
  '(ls-lisp-verbosity (quote (uid gid)))
  '(org-drill-add-random-noise-to-intervals-p t)
  '(org-drill-adjust-intervals-for-early-and-late-repetitions-p t)
  '(org-drill-card-type-alist (quote ((nil org-drill-present-simple-card) ("simple" org-drill-present-simple-card) ("twosided" org-drill-present-two-sided-card nil t) ("multisided" org-drill-present-multi-sided-card nil t) ("hide1cloze" org-drill-present-multicloze-hide1) ("hide2cloze" org-drill-present-multicloze-hide2) ("show1cloze" org-drill-present-multicloze-show1) ("show2cloze" org-drill-present-multicloze-show2) ("multicloze" org-drill-present-multicloze-hide1) ("hidefirst" org-drill-present-multicloze-hide-first) ("hidelast" org-drill-present-multicloze-hide-last) ("hide1_firstmore" org-drill-present-multicloze-hide1-firstmore) ("show1_lastmore" org-drill-present-multicloze-show1-lastmore) ("show1_firstless" org-drill-present-multicloze-show1-firstless) ("conjugate" org-drill-present-verb-conjugation org-drill-show-answer-verb-conjugation) ("decline_noun" org-drill-present-noun-declension org-drill-show-answer-noun-declension) ("spanish_verb" org-drill-present-spanish-verb) ("translate_number" org-drill-present-translate-number) ("twosidednocloze" org-drill-present-two-sided-card-no-cloze nil t))))
+ '(org-drill-learn-fraction 0.55)
  '(org-drill-maximum-duration nil)
- '(org-drill-maximum-items-per-session 35)
- '(org-drill-optimal-factor-matrix (quote ((2 (2.36 . 2.412)) (1 (2.6 . 4.14) (2.1799999999999997 . 3.72) (2.5 . 4.0) (2.36 . 3.86) (1.7000000000000002 . 3.44) (1.96 . 3.58)))))
+ '(org-drill-maximum-items-per-session 20)
+ '(org-drill-optimal-factor-matrix (quote ((4 (2.3200000000000003 . 2.305) (1.8 . 1.865) (1.76 . 1.92) (1.9400000000000002 . 2.0)) (3 (2.04 . 2.219) (1.6600000000000001 . 1.793) (1.48 . 1.721) (1.94 . 1.94) (1.6199999999999999 . 1.791) (1.8 . 1.865) (2.18 . 2.217) (2.7 . 2.688) (2.6 . 2.596) (2.56 . 2.593) (1.76 . 1.971) (2.5 . 2.5) (2.3200000000000003 . 2.305) (1.9400000000000002 . 2.053) (2.22 . 2.22) (2.36 . 2.404) (2.32 . 2.409) (2.46 . 2.497) (2.2199999999999998 . 2.311) (1.9000000000000001 . 2.049) (2.08 . 2.135)) (2 (1.52 . 1.596) (1.3399999999999999 . 1.532) (1.6600000000000001 . 1.793) (1.94 . 1.94) (2.2800000000000002 . 2.407) (2.3200000000000003 . 2.298) (1.48 . 1.721) (1.6199999999999999 . 1.791) (2.22 . 2.22) (1.8 . 1.865) (1.4 . 1.736) (2.18 . 2.217) (1.9400000000000002 . 2.053) (1.76 . 1.971) (2.08 . 2.135) (1.9000000000000001 . 2.049) (2.7 . 2.696) (2.1799999999999997 . 2.308) (2.5 . 2.5) (2.46 . 2.488) (2.2199999999999998 . 2.311) (2.04 . 2.219) (2.6 . 2.596) (2.36 . 2.404)) (1 (1.48 . 3.55) (1.52 . 3.846) (1.3399999999999999 . 3.692) (1.6600000000000001 . 3.698) (1.6199999999999999 . 3.692) (1.8 . 3.846) (1.76 . 3.55) (1.9400000000000002 . 3.698) (1.9000000000000001 . 3.692) (2.08 . 3.846) (2.04 . 3.55) (2.2199999999999998 . 3.698) (2.6 . 4.14) (2.1799999999999997 . 3.692) (2.5 . 4.0) (2.36 . 3.846) (1.7000000000000002 . 3.44) (1.96 . 3.58)))))
  '(org-drill-save-buffers-after-drill-sessions-p nil)
  '(org-emphasis-alist (quote (("*" my-org-bold "<b>" "</b>") ("/" my-org-italic "<i>" "</i>") ("_" underline "<span style=\"text-decoration:underline;\">" "</span>") ("=" my-org-code "<code>" "</code>" verbatim) ("~" my-org-code "<code>" "</code>" verbatim) ("+" (:strike-through t) "<del>" "</del>"))))
+ '(org-file-apps (quote ((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default) ("\\.pdf\\'" . "zathura %s"))))
  '(org-habit-following-days 1)
+ '(org-habit-preceding-days 60)
  '(org-log-into-drawer t)
  '(org-refile-use-outline-path (quote file))
  '(org-special-ctrl-a/e t)
  '(org-src-fontify-natively t)
+ '(org-tags-exclude-from-inheritance nil)
  '(org-time-clocksum-format (quote (:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t)))
+ '(pj-line-width 1100)
  '(predictive-add-to-dict-ask nil)
  '(predictive-auto-add-to-dict t)
  '(predictive-auto-learn t)
  '(projectile-global-mode t)
  '(projectile-globally-ignored-directories (quote (".idea" ".eunit" ".git" ".hg" ".fslckout" ".bzr" "_darcs" "elpa")))
  '(projectile-project-root-files (quote (".dir-locals.el" ".projectile" ".git" ".hg" ".fslckout" ".bzr" "_darcs" "rebar.config" "project.clj" "pom.xml" "build.sbt" "Gemfile" "Makefile")))
+ '(rcirc-fill-column (quote frame-width))
+ '(rcirc-server-alist (quote (("dasnet.cz" :port 7001 :password "polakmajstersveta" nil nil))))
  '(recentf-mode t)
  '(recentf-save-file "~/.emacs.d/.recentf")
  '(reftex-label-alist (quote (("lemma" 101 nil nil t nil))))
- '(safe-local-variable-values (quote ((my-org-drill-file . t) (my-org-drill-local-language . "Polish") (eval virtual-dired "d:/") (eval font-lock-add-keywords nil (\` (((\, (concat "(" (regexp-opt (quote ("wd-cond")) t) "\\_>")) 1 (quote font-lock-keyword-face))))) (eval push (file-name-directory (buffer-file-name)) load-path) (eval font-lock-add-keywords nil (\` (((\, (concat "(" (regexp-opt (quote ("sp-do-move-op" "sp-do-move-cl" "sp-do-put-op" "sp-do-put-cl" "sp-do-del-op" "sp-do-del-cl")) t) "\\_>")) 1 (quote font-lock-variable-name-face))))) (TeX-master . main) (eval font-lock-add-keywords nil (quote (("(\\(dm-defun\\)\\(?:\\s-\\)+\\(\\_<.*?\\_>\\)" (1 font-lock-keyword-face) (2 font-lock-function-name-face))))) (eval font-lock-add-keywords nil (quote (("defexamples\\| => " (0 (quote font-lock-keyword-face)))))) (reftex-default-bibliography "./bibliography") (eval allout-mode t))))
+ '(safe-local-variable-values (quote ((my-inhibit-buffer-cleanup . t) (eval progn (local-set-key (kbd "C-=") (quote my-org-add-drill-entry)) (local-set-key (kbd "C-<") (quote my-format-russian-verb)) (local-set-key (kbd "C->") (quote my-format-meaning))) (eval progn (local-set-key (kbd "C-=") (quote my-org-add-drill-entry)) (local-set-key (kbd "C->") (quote my-format-meaning))) (eval progn (local-set-key (kbd "C-=") (quote my-org-add-drill-entry)) (local-set-key (kbd "C->") (quote my-format-latin-meaning))) (eval progn (local-set-key (kbd "C-=") (quote my-org-add-drill-entry)) (local-set-key (kbd "C-<") (quote my-format-russian-verb)) (local-set-key (kbd "C->") (quote my-format-russian-meaning))) (eval progn (variable-pitch-mode 1) (text-scale-adjust 2)) (cursor-type . bar) (eval progn (variable-pitch-mode 1) (text-scale-adjust 3)) (my-org-drill-language . "Latin") (eval local-set-key (kbd "C-=") (quote my-org-add-drill-entry)) (eval set-input-method "cyrillic-translit") (my-org-drill-language . "Russian") (my-org-drill-file . t) (my-org-drill-local-language . "Polish") (eval virtual-dired "d:/") (eval font-lock-add-keywords nil (\` (((\, (concat "(" (regexp-opt (quote ("wd-cond")) t) "\\_>")) 1 (quote font-lock-keyword-face))))) (eval push (file-name-directory (buffer-file-name)) load-path) (eval font-lock-add-keywords nil (\` (((\, (concat "(" (regexp-opt (quote ("sp-do-move-op" "sp-do-move-cl" "sp-do-put-op" "sp-do-put-cl" "sp-do-del-op" "sp-do-del-cl")) t) "\\_>")) 1 (quote font-lock-variable-name-face))))) (TeX-master . main) (eval font-lock-add-keywords nil (quote (("(\\(dm-defun\\)\\(?:\\s-\\)+\\(\\_<.*?\\_>\\)" (1 font-lock-keyword-face) (2 font-lock-function-name-face))))) (eval font-lock-add-keywords nil (quote (("defexamples\\| => " (0 (quote font-lock-keyword-face)))))) (reftex-default-bibliography "./bibliography") (eval allout-mode t))))
  '(save-place t nil (saveplace))
  '(save-place-file "~/.emacs.d/.emacs-places")
  '(send-mail-function (quote mailclient-send-it))
  '(sp-comment-string (quote (((emacs-lisp-mode) . ";; "))))
  '(sp-hybrid-kill-entire-symbol (quote sp-point-in-string))
  '(sp-hybrid-kill-excessive-whitespace nil)
- '(sp-ignore-modes-list (quote (image-dired-display-image-mode image-dired-thumbnail-mode ediff-mode recentf-dialog-mode google-maps-static-mode)))
+ '(sp-ignore-modes-list (quote (image-dired-display-image-mode image-dired-thumbnail-mode ediff-mode recentf-dialog-mode google-maps-static-mode ibuffer-mode)))
  '(sp-navigate-close-if-unbalanced t)
  '(sp-navigate-comments-as-sexps t)
  '(sp-navigate-consider-sgml-tags (quote (html-mode markdown-mode gfm-mode rst-mode)))
  '(suggest-key-bindings nil)
  '(texmathp-tex-commands (quote (("derivation" env-on))))
  '(text-mode-hook (quote (text-mode-hook-identify)))
+ '(tramp-default-method "scpc")
  '(transient-mark-mode t)
  '(truncate-partial-width-windows nil)
  '(uniquify-buffer-name-style (quote forward) nil (uniquify))
  '(vc-make-backup-files t)
  '(visible-bell nil)
- '(w3m-command "c:\\cygwin\\bin\\w3m.exe")
+ '(w3m-command nil)
  '(w3m-imagick-convert-program "c:\\cygwin\\bin\\convert.exe")
  '(winner-mode t))
 
 (put 'downcase-region 'disabled nil)
 (put 'upcase-region 'disabled nil)
 (put 'dired-find-alternate-file 'disabled nil)
+
 (custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  '(eldoc-highlight-function-argument ((t (:inherit bold :foreground "#4e9a06"))))
  '(erc-nick-default-face ((t (:inherit erc-default))))
  '(eshell-prompt ((t (:foreground "#73d216" :weight normal))) t)
- '(font-latex-sedate-face ((t (:inherit font-lock-keyword-face))) t)
+ '(font-latex-sedate-face ((t (:inherit font-lock-keyword-face))))
  '(guide-key/key-face ((t (:inherit font-lock-keyword-face))))
  '(header-line ((t (:inherit mode-line))))
+ '(italic ((t (:slant italic))))
+ '(my-diredp-media-face ((t (:foreground "#ce5c00"))))
  '(my-diredp-sourcefile-face ((t (:foreground "#fcaf3e"))))
  '(my-hide-prefix ((t (:underline "#888a85"))) t)
  '(my-space-2 ((t (:inherit default :height 0.21))) t)
  '(org-table ((t (:inherit fixed-pitch :foreground "#8cc4ff" :height 98))) t)
  '(org-verbatim ((t (:inherit org-code))))
  '(sp-pair-overlay-face ((t (:background "#004a5d"))))
- '(variable-pitch ((t (:weight semi-light :height 120 :family "Arial"))))
+ '(sp-show-pair-enclosing ((t (:background "#004a5d"))))
+ '(variable-pitch ((t (:weight normal :height 144 :family "CMU Bright"))))
  '(w3m-anchor ((t (:foreground "#729fcf"))) t)
- '(w3m-arrived-anchor ((t (:inherit font-lock-builtin-face))) t))
+ '(w3m-arrived-anchor ((t (:inherit font-lock-builtin-face))) t)
+ '(wgrep-delete-face ((t (:inherit font-lock-warning-face)))))
 ;;; Global key bindigns
 
 ;; setting the PC keyboard's various keys to
-;; Super or Hyper, for emacs running on Windows.
+;; Super or Hyper, or emacs running on Windows.
 (setq w32-pass-lwindow-to-system nil
       w32-pass-rwindow-to-system nil
       w32-pass-apps-to-system nil
 (bind-key "<f1> <f2>" (lambda () (interactive) (find-file "~/.emacs.d/init.el")))
 (bind-key "<f1> <f3>" 'view-echo-area-messages)
 (bind-key "<f1> <f4>" 'ffap)
+(bind-key "<f1> <f5>" (lambda () (interactive) (let ((default-directory "~")) (ido-find-file))))
 (bind-key "<f1> <f12>" 'my-switch-to-scratch)
 
 ;; ibuffer > list-buffers
 (bind-key "C-. i" 'ctl-dot-i-prefix-map)
 (bind-key "C-. i m" 'set-input-method)
 (bind-key "C-. i e" 'toggle-input-method)
+(bind-key "<XF86HomePage>" 'toggle-input-method)
 (bind-key "C-. i s" (lambda () (interactive) (set-input-method "slovak-prog-2")))
 (bind-key "C-. i c" (lambda () (interactive) (set-input-method "czech")))
 (bind-key "C-. i r" (lambda () (interactive) (set-input-method "russian-computer")))
 (bind-key "M-g RET" 'skeleton-display-abbrev)
 
 ;; input methods
-;;(bind-key "C-\\" 'toggle-input-method)
+(bind-key "C-\\" 'toggle-input-method)
 (bind-key "C-\\" 'my-cycle-language)
 (defvar my-input-method :english)
 
         (when new-input-method
           (customize-mark-as-set 'default-input-method))))))
 
+;; emms
+;; (bind-key "<A-XF86AudioPlay>" 'emms-pause)
+;; (require 'emms-setup)
+;; (emms-standard)
+;; (emms-default-players)
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Jump to "logical" top/bottom of buffer in listing buffers
 

files/mode-line.el

 ;; set frame format
 (setq-default
  frame-title-format
- '("%b  ;  %*"
+ '("%b ; %*"
    (:eval (when (buffer-file-name)
-            (concat "  ;  "
-                    (abbreviate-file-name default-directory))))
+            (concat " ; "
+                    (my-abbreviate-file-name default-directory (buffer-name)))))
    " - Emacs"))
 
 ;; set line format

files/smartparens.el

   (sp-local-pair "*" "*" :unless '(sp-point-after-word-p sp-point-at-bol-p) :wrap "C-*" :skip-match 'sp--org-skip-asterisk)
   (sp-local-pair "_" "_" :unless '(sp-point-after-word-p) :wrap "C-_" :skip-match 'sp--org-skip-markup)
   (sp-local-pair "/" "/" :unless '(sp-point-after-word-p) :skip-match 'sp--org-skip-markup)
-  (sp-local-pair "~" "~" :unless '(sp-point-after-word-p) :skip-match 'sp--org-skip-code))
+  (sp-local-pair "~" "~" :unless '(sp-point-after-word-p) :skip-match 'sp--org-skip-code)
+  (sp-local-pair "«" "»"))
 
 (defun sp--org-skip-markup (ms mb me)
   (save-excursion
   (sp-local-pair "(" nil
                  :wrap "C-("
                  :pre-handlers '(my-add-space-before-sexp-insertion)
-                 :post-handlers '(my-add-space-after-sexp-insertion))
-  (sp-local-pair "`" nil
-                 :skip-match (lambda (ms mb me)
-                               (cond
-                                ((equal ms "'")
-                                 (or (sp--org-skip-markup ms mb me)
-                                     (not (sp-point-in-string-or-comment))))
-                                (t (not (sp-point-in-string-or-comment)))))))
+                 :post-handlers '(my-add-space-after-sexp-insertion)))
+
+
 
 (defun my-add-space-after-sexp-insertion (id action _context)
   (when (eq action 'insert)
 (sp-local-pair 'c++-mode "{" nil :post-handlers '(("||\n[i]" "RET")))
 (sp-local-pair 'c++-mode "/*" "*/" :post-handlers '((" | " "SPC")
                                                     ("* ||\n[i]" "RET")))
-(defun my-create-newline-and-enter-sexp (&rest _ignored)
-  "Open a new brace or bracket expression, with relevant newlines and indent. "
-  (newline)
-  (indent-according-to-mode)
-  (forward-line -1)
-  (indent-according-to-mode))
 
 ;;; haskell mode
 (sp-with-modes '(haskell-mode)
     (require 'wgrep-ag)
     (add-hook 'ag-mode-hook 'wgrep-ag-setup)))
 
+(use-package allout
+  :commands allout-mode
+  :config
+  (progn
+    (defun my-allout-init ()
+      (unbind-key "M-k" allout-mode-map))
+
+    (add-hook 'allout-mode-hook 'my-allout-init)
+    ;; redefine this to make it work with smartparens
+    (defun allout-pre-command-business ()
+      "Outline `pre-command-hook' function for outline buffers.
+
+Among other things, implements special behavior when the cursor is on the
+topic bullet character.
+
+When the cursor is on the bullet character, self-insert
+characters are reinterpreted as the corresponding
+control-character in the `allout-mode-map-value'.  The
+`allout-mode' `post-command-hook' insures that the cursor which
+has moved as a result of such reinterpretation is positioned on
+the bullet character of the destination topic.
+
+The upshot is that you can get easy, single (ie, unmodified) key
+outline maneuvering operations by positioning the cursor on the bullet
+char.  When in this mode you can use regular cursor-positioning
+command/keystrokes to relocate the cursor off of a bullet character to
+return to regular interpretation of self-insert characters."
+
+      (if (not (allout-mode-p))
+          nil
+        (setq allout-command-counter (1+ allout-command-counter))
+        (setq allout-this-command-hid-text nil)
+        ;; Do hot-spot navigation.
+        (if (and (memq this-command '(sp--self-insert-command self-insert-command))
+                 (eq (point)(allout-current-bullet-pos)))
+            (allout-hotspot-key-handler))))))
+
+(use-package auto-complete-config
+  :commands auto-complete-mode
+  :config
+  (progn
+    (ac-config-default)
+    (setq-default ac-sources
+                  (append '(
+                            ac-source-filename
+                            ac-source-yasnippet
+                            )
+                          ac-sources))
+
+    (setq ac-use-menu-map t)
+    (bind-key "RET" 'popup-isearch-done popup-isearch-keymap)))
+
+(use-package calendar
+  :defer t
+  :config
+  (progn
+    (defadvice calendar-exit (around close-window activate)
+      (let* ((wl (window-list))
+             (cb (calendar-buffer-list))
+             (wins-to-kill (mapcar (lambda (w) (cons (member (window-buffer w) cb) w)) wl)))
+        ad-do-it
+        (mapc (lambda (w) (when (car w) (delete-window (cdr w)))) wins-to-kill)))))
+
 (use-package clippy
   :commands clippy-describe-function)
 
+(use-package css-mode
+  :defer t
+  :config
+  (progn
+    (defun my-css-mode-setup ()
+      (multi-web-mode 1)
+      (emmet-mode 1))
+    (add-hook 'css-mode-hook 'my-css-mode-setup)))
+
+;; see commentary in dired-defs.el
+(use-package dired
+  :mode ("\\.wdired\\'" . my-virtual-dired-mode)
+  :bind (("C-x d"  . my-dired-files)
+         ("C-x C-j" . dired-jump))
+  :init
+  (progn
+    (defun my-virtual-dired-mode ()
+      (save-excursion
+        (goto-char (point-min))
+        (back-to-indentation)
+        (let ((ddir (thing-at-point 'filename)))
+          (virtual-dired (substring ddir 0 (1- (length ddir)))))
+        (dired-virtual-revert)))
+
+    (defun my-dired-files (&optional arg)
+      "Like `ido-dired'.  With prefix argument call
+`diredp-dired-files' with negative argument."
+      (interactive "P")
+      (if arg
+          (progn
+            (when (not (featurep 'icicles))
+              (require 'icicles))
+            (setq current-prefix-arg -1)
+            (call-interactively 'diredp-dired-files))
+        (ido-dired))))
+  :config
+  (progn
+    (load "files/dired-defs")))
+
 (use-package ediff
   :pre-init
   (progn
   (progn
     (add-hook 'dired-mode-hook (lambda () (bind-key "M-o" 'elwm-activate-window dired-mode-map)))))
 
+(use-package emmet-mode
+  :defer t
+  :diminish emmet-mode)
+
+(use-package erc
+  :defer t
+  :config
+  (progn
+    (erc-track-mode 1)
+    (erc-track-minor-mode 1)))
+
+(use-package eshell
+  :commands eshell
+  :config
+  (progn
+    (load "files/eshell-defs")))
+
 (use-package expand-region
   :bind ("s-'" . er/expand-region))
 
 (use-package golden-ratio
+  :diminish golden-ratio-mode
   :config
   (progn
     (defun my-golden-ratio-inhibit ()
       (or (--any? (string-match-p "\\*Ediff Control Panel" it)
-                  (mapcar 'buffer-name (mapcar 'window-buffer (window-list))))
-          ))))
+                  (mapcar 'buffer-name (mapcar 'window-buffer (window-list))))))))
 
 (use-package google-maps
   :commands google-maps)
 
 (use-package guide-key
-  :commands guide-key-mode
-  :init
-  (progn (guide-key-mode 1))
+  :diminish guide-key-mode
   :config
   (progn
-    ;; (defadvice guide-key/popup-guide-buffer (around fix-width activate)
-    ;;   (let ((window (car (get-buffer-window-list " *guide-key*")))
-    ;;         (config popwin:popup-last-config))
-    ;;     ad-do-it
-    ;;     (save-window-excursion
-    ;;       (select-window window)
-    ;;       (goto-char (point-max))
-    ;;       (let ((cl (line-number-at-pos))
-    ;;             (wh (window-height window)))
-    ;;         (message "%d %d" cl wh)
-    ;;         (when (< cl wh)
-    ;;           (window-resize window (- (- wh cl))))))
-    ;;     (setq popwin:popup-last-config config)))
-    ))
+    (defadvice guide-key/popup-guide-buffer (around fix-golden-ration activate)
+      (golden-ratio-mode -1)
+      ad-do-it
+      (golden-ratio-mode 1))))
 
 (use-package free-keys
   :commands free-keys)
 
+(use-package haskell-mode
+  :mode ("\\.hs\\'" . haskell-mode)
+  :config
+  (progn
+    (require 'haskell-indentation)
+    (bind-key "C-c h" 'haskell-hoogle haskell-mode-map)
+    (bind-key "C-c C-r" 'my-haskell-reload haskell-mode-map)
+    (bind-key "<backspace>" 'sp-backward-delete-char haskell-indentation-mode-map)
+
+    (defun my-haskell-reload (&optional reload)
+      (interactive)
+      (inferior-haskell-load-file reload)
+      (other-window 1))
+
+    (defun my-hs-end-of-defun ()
+      (forward-char)
+      (re-search-forward "^[[:alpha:]]")
+      (backward-char))
+
+    (defun my-hs-beg-of-defun ()
+      (re-search-backward "^[[:alpha:]]"))
+
+    (defun my-haskell-init ()
+      (set (make-local-variable 'end-of-defun-function) 'my-hs-end-of-defun)
+      (set (make-local-variable 'beginning-of-defun-function) 'my-hs-beg-of-defun))
+
+    (add-hook 'haskell-mode-hook 'my-haskell-init)))
+
+(use-package ibuffer
+  :bind ("<f1> <f1>" . ibuffer)
+  :init
+  (progn
+    ;; startup function
+    (defun customize-ibuffer-mode ()
+      "Startup function."
+      (ibuffer-switch-to-saved-filter-groups "default")
+      (add-to-list 'ibuffer-hidden-filter-groups "Tramp")
+      (add-to-list 'ibuffer-hidden-filter-groups "emacs-elpa")
+      (visual-line-mode -1)
+      (toggle-truncate-lines 1))
+    (add-hook 'ibuffer-mode-hook 'customize-ibuffer-mode))
+  :config
+  (progn
+    (load "files/ibuffer-defs")))
+
+(use-package ido
+  :defer t
+  :bind (("M-." . ido-goto-symbol)) ;; was Find tag
+  :config
+  (progn
+    (load "files/ido-defs")))
+
+(use-package "isearch"
+  :bind (("C-s" . isearch-forward-regexp)
+         ("C-r" . isearch-backward-regexp))
+  :config
+  (progn
+    (load "files/isearch-defs")))
+
+(use-package ispell
+  :bind (("<f10>" . ispell-word)
+         ("C-<f10>" . flyspell-mode))
+  :config
+  (progn
+    (defadvice ispell-word (around fix-golden-ration activate)
+      (golden-ratio-mode -1)
+      ad-do-it
+      (golden-ratio-mode 1))))
+
 (use-package jump-char
   :bind (("M-m" . jump-char-forward)))
 
   (progn
     (require 'flyspell)))
 
+(use-package markdown-mode
+  :mode ("\\.md$" . gfm-mode)
+  :config
+  (progn
+    (load "files/markdown-defs")))
+
+(use-package multi-web-mode
+  :defer t
+  :config
+  (progn
+    (setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
+                      (javascript-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>")
+                      (css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))
+    (setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5"))))
+
+(use-package org
+  :mode ("\\.org\\'" . org-mode)
+  ;; The following lines are always needed.  Choose your own keys.
+  :bind  (("C-c l" . org-store-link)
+          ("<f12>" . org-agenda)
+          ("C-c C-x C-o" . org-clock-out)
+          ("C-c C-x <C-i-key>" . org-clock-in))
+  :config
+  (progn
+    (load "files/org-defs.el")))
+
 (use-package popwin
   :commands popwin-mode
   :config
 
 (use-package projectile
   :defer t
+  :diminish projectile-mode
   :config
   (progn
     (defun projectile-project-root ()
                     (concat "-path \"*/" x "\"")) projectile-globally-ignored-directories " -not ")
        " -type f -print0"))))
 
+(use-package recentf
+  :bind (("C-c r f" . recentf-open-files)
+         ("C-x C-r" . recentf-open-files)
+         ("C-c r c" . recentf-cleanup))
+  :config
+  (progn
+    (load "files/recentf-defs")))
+
 (use-package revbufs
   :bind ("C-<f5>" . revbufs))
 
+(use-package sgml-mode
+  :defer t
+  :config
+  (progn
+    (defadvice sgml-delete-tag (after reindent-buffer activate)
+      (cleanup-buffer))
+
+    (defun my-html-mode-setup ()
+      (multi-web-mode 1)
+      (emmet-mode 1)
+      (with-map-bind-keys html-mode-map
+        ("C-c C-f" 'sp-html-next-tag)
+        ("C-c C-b" 'sp-html-previous-tag)))
+    (add-hook 'html-mode-hook 'my-html-mode-setup)))
+
+(use-package skeleton-complete
+  :defer t
+  :diminish skeleton-complete-mode)
+
 (use-package smartparens
   :defer t
+  :diminish smartparens-mode
   :init
   (progn
     (load "~/.emacs.d/files/smartparens")))
       (define-key ido-completion-map (kbd "C-a") 'move-beginning-of-line)
       (define-key ido-completion-map (kbd "=") "-"))))
 
+(use-package sunrise-commander
+  :defer t
+  :config
+  (progn
+    (defadvice sr-tabs-add (after remove-sunrise-from-name activate)
+      (sr-tabs-rename (replace-regexp-in-string "(Sunrise)" "" (buffer-name))))))
+
+(use-package tex-site
+  :load-path "site-lisp/auctex/"
+  :mode ("\\.tex\\'" . TeX-latex-mode)
+  :commands (TeX-latex-mode
+             TeX-mode
+             tex-mode
+             LaTeX-mode
+             latex-mode)
+  :config
+  (progn
+    (load "files/latex-defs")))
+
+(use-package tramp
+  :defer t
+  :config
+  (progn
+    ;; (setq tramp-default-method "plinkx")
+    ;; (setq tramp-terminal-type "dumb")
+
+    ;; in file `tramp-sh.el' it is necessary to add
+    ;; (tramp-password-end-of-line "xy") ;see docstring for "xy"
+    ;; to "plinkx" method.
+    ))
+
+(use-package two-column
+  :defer t
+  :config
+  (progn
+    (defadvice 2C-dissociate (after close-window-after-disconnect activate)
+      (delete-window))))
+
+(use-package undo-tree
+  :bind (("C-x u" . undo-tree-visualize))
+  :diminish undo-tree-mode)
+
 (use-package wc-mode
   :commands wc-mode)
 
 (use-package wiktionary-translate
   :bind ("<insert>" . wd-show-translation))
 
-(use-package "world-time-mode"
+(use-package world-time-mode
   :bind ("C-. t" . world-time-list))
 
 (use-package yasnippet
         ("rubinius" . "rbx -r irb/completion")
         ("yarv"     . "irb1.9 -r irb/completion")
         ("macruby"  . "macirb -r irb/completion")
-        ("pry"      . "pry")))))
+        ("pry"      . "pry"))))
+
+  (defadvice shell-command (around fix-encoding activate)
+    (let ((coding-system-for-read 'cp1250))
+      ad-do-it)))
 (server-start)
+(add-to-list 'load-path "~/.emacs.d/vendor/use-package/")
+(require 'use-package)
+
 (defconst emacs-start-time (current-time))
 
 ;; Emacs gurus don't need no stinking scroll bars & widgets
                          ("marmalade" . "http://marmalade-repo.org/packages/")
                          ("melpa" . "http://melpa.milkbox.net/packages/")
                          ("org" . "http://orgmode.org/elpa/")))
-(defconst emacs-package-init-time (current-time))
-(package-initialize)
-(load "~/.emacs.d/autoinstall")
-(let ((elapsed (float-time (time-subtract (current-time)
-                                          emacs-package-init-time))))
-  (message "Initializing packages... done (%.3fs)" elapsed))
 
-(require 'parenface)
-(require 'uniquify)
-(require 'dash)
-(require 'f)
-(require 's)
+(with-elapsed-timer "Initializing packages"
+  (package-initialize)
+  (load "~/.emacs.d/autoinstall")
+
+  (require 'parenface)
+  (require 'uniquify)
+  (require 'dash)
+  (require 'f)
+  (require 's))
 
 ;; add load paths
 (add-to-list 'load-path "~/.emacs.d/")
 (mapc (apply-partially 'add-to-list 'load-path) (f-directories "~/.emacs.d/vendor"))
 
-(require 'use-package)
-
 ;; autoloads
 (autoload 'calc-same-interface "calc" nil t)
 (autoload 'zap-up-to-char "misc"
   "Kill up to, but not including ARGth occurrence of CHAR." t)
 
-;; load site lisp
-(load "site-lisp/advices")
-(load "site-lisp/defuns-buffer")
-(load "site-lisp/defuns-edit")
-(load "site-lisp/defuns-macros")
-(load "site-lisp/defuns")
-(load "site-lisp/emacs-lisp-mode")
-(load "site-lisp/macros")
-(load "site-lisp/vendor")
-(load "site-lisp/redef")
+(with-elapsed-timer "Loading site lisp"
+  ;; load site lisp
+  (load "site-lisp/advices")
+  (load "site-lisp/defuns-buffer")
+  (load "site-lisp/defuns-edit")
+  (load "site-lisp/defuns-macros")
+  (load "site-lisp/defuns")
+  (load "site-lisp/emacs-lisp-mode")
+  (load "site-lisp/macros")
+  (load "site-lisp/vendor")
+  (load "site-lisp/redef")
 
-;; load keys
-(load "files/keys")
+  ;; ;; load keys
+  (load "files/keys"))
 
 ;; load settings
-(load "files/global")
-(load "files/layouts")
-(load "files/mode-line")
-(load "files/tabs")
-(load "files/windows")
+(with-elapsed-timer "Loading settings"
+  (load "files/global")
+  (load "files/layouts")
+  (load "files/mode-line")
+  (load "files/tabs")
+  (load "files/windows"))
 
 ;; load config files
-(load "files/ack")
-(load "files/allout-config")
-(load "files/auto-complete")
-(load "files/dired-setup")
-(load "files/eshell-mode")
-(load "files/haskell")
-(load "files/ibuffer-config")
-(load "files/ido-config")
-(load "files/isearch-config")
-(load "files/ispell-config")
-(load "files/latex-mode-config")
-(load "files/markdown-config")
-(load "files/multi-web-mode-config")
-(load "files/org-mode-config")
-(load "files/recentf-config")
-(load "files/tramp")
-(load "files/vendor")
+(with-elapsed-timer "Loading vendor"
+  (load "files/vendor"))
 
 ;; diminish useless modeline clutter
-(load "files/diminish")
+(require 'diminish)
+(diminish 'visual-line-mode)
+(eval-after-load "eldoc" '(diminish 'eldoc-mode " δ"))
+(eval-after-load "face-remap" '(diminish 'buffer-face-mode))
 
 ;; Customize
 (setq custom-file "~/.emacs.d/files/emacs-custom.el")
 (load custom-file)
 
 ;; Reload theme -- hackish
-(load "~/.emacs.d/themes/my-tango-dark-theme")
+;; (load "~/.emacs.d/themes/my-tango-dark-theme")
+
+;; xiki support
+;; (add-to-list 'load-path "/usr/share/emacs/site-lisp")
+;; (require 'el4r)
+;; (el4r-boot)
 
 ;;; post init.
 (when window-system
-  (let ((elapsed (float-time (time-subtract (current-time)
-                                            emacs-start-time))))
-    (message "Loading %s...done (%.3fs)" load-file-name elapsed))
-
   (add-hook 'after-init-hook
             `(lambda ()
                (let ((elapsed (float-time (time-subtract (current-time)
                  (message "Loading %s...done (%.3fs) [after-init]"
                           ,load-file-name elapsed)))
             t))
-
-;; removed packages:
-;; sunrise-commander

site-lisp/advices.el

-(defadvice sgml-delete-tag (after reindent-buffer)
-  (cleanup-buffer))
-
-(defadvice sr-tabs-add (after remove-sunrise-from-name activate)
-  (sr-tabs-rename (replace-regexp-in-string "(Sunrise)" "" (buffer-name))))
-
+;; from simple.el
 (defadvice kill-line (before kill-line-autoreindent activate)
   (if (member major-mode
               '(
                  (just-one-space 0)
                  (backward-char 1)))))
 
-(defadvice beginning-of-defun (before fix-org-navig activate)
-  (when (eq major-mode 'org-mode) (previous-line)))
-
-(defadvice 2C-dissociate (after close-window-after-disconnect activate)
-  (delete-window))
-
-(defadvice ispell-word (around fix-golden-ration activate)
-  (golden-ratio-mode -1)
-  ad-do-it
-  (golden-ratio-mode 1))
-
-(defadvice guide-key/popup-guide-buffer (around fix-golden-ration activate)
-  (golden-ratio-mode -1)
-  ad-do-it
-  (golden-ratio-mode 1))
-
+
+;; from window.el
 (defadvice quit-window (around fix-golden-ration activate)
   ad-do-it
   (golden-ratio))
-
-(defadvice calendar-exit (around close-window activate)
-  (let* ((wl (window-list))
-         (cb (calendar-buffer-list))
-         (wins-to-kill (mapcar (lambda (w) (cons (member (window-buffer w) cb) w)) wl)))
-    ad-do-it
-    (mapc (lambda (w) (when (car w) (delete-window (cdr w)))) wins-to-kill)))
-
-(defadvice shell-command (around fix-encoding activate)
-  (let ((coding-system-for-read 'cp1250))
-    ad-do-it))

site-lisp/defuns-buffer.el

         (kill-buffer (current-buffer)))
     (kill-buffer (current-buffer))))
 
+(defvar my-inhibit-buffer-cleanup nil)
+
 (defun cleanup-buffer-safe ()
   "Perform a bunch of safe operations on the whitespace content of a buffer.
 Does not indent buffer, because it is used for a before-save-hook, and that
 might be bad."
   (interactive)
-  (let ((inhibit-read-only t))
-    (unless (memq major-mode '(makefile-gmake-mode))
-      (untabify-buffer))
-    (delete-trailing-whitespace)
-    (set-buffer-file-coding-system 'utf-8)))
+  (unless my-inhibit-buffer-cleanup
+    (let ((inhibit-read-only t))
+      (unless (memq major-mode '(makefile-gmake-mode))
+        (untabify-buffer))
+      (delete-trailing-whitespace)
+      (set-buffer-file-coding-system 'utf-8))))
 
 (defun cleanup-buffer ()
   "Perform a bunch of operations on the whitespace content of a buffer.
   (cleanup-buffer-safe)
   (indent-buffer))
 
-(defun my-create-directory-on-save ()
+(defun my-create-directory-on-save (&optional _)
   (when buffer-file-name
     (let ((dir (file-name-directory buffer-file-name)))
       (when (and (not (file-exists-p dir))

site-lisp/redef.el

 ;; on my system
 
 ;; /usr/local/share/emacs/24.3/lisp/net/browse-url.el.gz
-(defun browse-url-can-use-xdg-open ()
-  "Return non-nil if the \"xdg-open\" program can be used.
+(eval-after-load "browse-url"
+  '(defun browse-url-can-use-xdg-open ()
+     "Return non-nil if the \"xdg-open\" program can be used.
 xdg-open is a desktop utility that calls your preferred web browser.
 This requires you to be running either Gnome, KDE, Xfce4 or LXDE."
-  t)
+     t))

vendor/use-package/bind-key.el

-;;; bind-key --- A simple way to manage personal keybindings
+;;; bind-key.el --- A simple way to manage personal keybindings
 
 ;; Copyright (C) 2012 John Wiegley
 
 ;; Created: 16 Jun 2012
 ;; Version: 1.0
 ;; Keywords: keys keybinding config dotemacs
-;; X-URL: https://github.com/jwiegley/bind-key
+;; URL: https://github.com/jwiegley/use-package
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
 
 (define-minor-mode override-global-mode
   "A minor mode so that keymap settings override other modes."
-  t "" override-global-map)
+  t "")
 
-(add-hook 'after-init-hook
-          (function
-           (lambda ()
-             (override-global-mode 1))))
+;; the keymaps in `emulation-mode-map-alists' take precedence over
+;; `minor-mode-map-alist'
+(add-to-list 'emulation-mode-map-alists
+             `((override-global-mode . ,override-global-map)))
 
 (defvar personal-keybindings nil)
 
       (cons (string< (caar l) (caar r)) nil)))))
 
 (defun describe-personal-keybindings ()
+  "Display all the personal keybindings defined by `bind-key'."
   (interactive)
-  (with-current-buffer (get-buffer-create "*Personal Keybindings*")
-    (delete-region (point-min) (point-max))
-    (insert "Key name          Command                                 Comments
+  (with-output-to-temp-buffer "*Personal Keybindings*"
+    (princ "Key name          Command                                 Comments
 ----------------- --------------------------------------- ---------------------
 ")
     (let (last-binding)
                                (car (compare-keybindings l r))))))
 
         (if (not (eq (cdar last-binding) (cdar binding)))
-            (insert ?\n (format "\n%s\n%s\n\n"
-                                (cdar binding)
-                                (make-string 79 ?-)))
+            (princ (format "\n\n%s\n%s\n\n"
+                           (cdar binding)
+                           (make-string 79 ?-)))
           (if (and last-binding
                    (cdr (compare-keybindings last-binding binding)))
-              (insert ?\n)))
+              (princ "\n")))
 
         (let* ((key-name (caar binding))
                (at-present (lookup-key (or (symbol-value (cdar binding))
                                       (get-binding-description was-command)))
                (at-present-desc (get-binding-description at-present))
                )
-          (insert
-           (format
-            "%-18s%-40s%s\n"
-            key-name command-desc
-            (if (string= command-desc at-present-desc)
-                (if (or (null was-command)
-                        (string= command-desc was-command-desc))
-                    ""
-                  (format "(%s)" was-command-desc))
-              (format "[now: %s]" at-present)))))
+          (let ((line
+                 (format
+                  "%-18s%-40s%s\n"
+                  key-name (format "`%s\'" command-desc)
+                  (if (string= command-desc at-present-desc)
+                      (if (or (null was-command)
+                              (string= command-desc was-command-desc))
+                          ""
+                        (format "was `%s\'" was-command-desc))
+                    (format "[now: `%s\']" at-present)))))
+            (princ (if (string-match "[ \t]+\n" line)
+                       (replace-match "\n" t t line)
+                     line))))
 
-        (setq last-binding binding)))
-
-    (goto-char (point-min))
-    (display-buffer (current-buffer))))
+        (setq last-binding binding)))))
 
 (provide 'bind-key)
-
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
 ;;; bind-key.el ends here

vendor/use-package/use-package.el

-;;; use-package --- A use-package declaration for simplifying your .emacs
+;;; use-package.el --- A use-package declaration for simplifying your .emacs
 
 ;; Copyright (C) 2012 John Wiegley
 
 ;; Author: John Wiegley <jwiegley@gmail.com>
 ;; Created: 17 Jun 2012
 ;; Version: 1.0
+;; Package-Requires: ((bind-key "1.0") (diminish "0.44"))
 ;; Keywords: dotemacs startup speed config package
 ;; X-URL: https://github.com/jwiegley/use-package
 
 ;; utility my total load time is just under 1 second, with no loss of
 ;; functionality!
 ;;
-;; Here is the simplest `use-package' declaration:
-;;
-;;   (use-package foo)
-;;
-;; This loads in the package foo, but only if foo is available on your system.
-;; If not, a warning is logged to your `*Messages*' buffer.  If it succeeds a
-;; message about "Loading foo" is logged, along with the time it took to load,
-;; if that time is over 0.01s.
-;;
-;; Use the :init keywoard to do some stuff to initialize foo, but only if foo
-;; actually gets loaded:
-;;
-;;   (use-package foo
-;;     :init
-;;     (progn
-;;       (setq foo-variable t)
-;;       (foo-mode 1)))
-;;
-;; A very common thing to do when loading a module is to bind a key to primary
-;; commands within that module:
-;;
-;;   (use-package ace-jump-mode
-;;     :bind ("C-." . ace-jump-mode))
-;;
-;; This does two things: first, it creates autoload for the `ace-jump-mode'
-;; command, and defers loading of `ace-jump-mode' until you actually use it.
-;; Second, it binds the key `C-.' to that command.  After loading, you can use
-;; `M-x describe-personal-keybindings' to see all such bindings you've set
-;; throughout your Emacs.
-;;
-;; A more literal way to do the exact same thing is:
-;;
-;;   (use-package ace-jump-mode
-;;     :commands ace-jump-mode
-;;     :init
-;;     (bind-key "C-." 'ace-jump-mode))
-;;
-;; When you use the `:commands' keyword, it creates autoloads for those
-;; commands and defers loading of the module until they are used.  In this
-;; case, the `:init' form is always run -- even if ace-jump-mode might not be
-;; on your system.  So remember to keep `:init' activities to only those that
-;; would succeed either way.
-;;
-;; Similar to `:bind', you can use `:mode' and `:interpreter' to establish a
-;; deferred binding within `auto-mode-alist' and `auto-interpreter-alist'.
-;; The specifier to either keyword can be a single cons or a list:
-;;
-;;   (use-package python-mode
-;;     :mode ("\\.py$" . python-mode)
-;;     :interpreter ("python" . python-mode))
-;;
-;; If you aren't using `:commands', `:bind', `:mode', or `:interpreter' (all
-;; of which imply `:commands'), you can still defer loading with the `:defer'
-;; keyword:
-;;
-;;   (use-package ace-jump-mode
-;;     :defer t
-;;     :init
-;;     (progn
-;;       (autoload 'ace-jump-mode "ace-jump-mode" nil t)
-;;       (bind-key "C-." 'ace-jump-mode)))
-;;
-;; This does exactly the same thing as the other two commands above.
-;;
-;; A companion to the `:init' keyword is `:config'.  Although `:init' always
-;; happens in the case of deferred modules (which are likely to be the most
-;; common kind), `:config' form only run after the module has been loaded by
-;; Emacs:
-;;
-;;   (use-package ace-jump-mode
-;;     :bind ("C-." . ace-jump-mode)
-;;     :config
-;;     (message "Yay, ace-jump-mode was actually loaded!"))
-;;
-;; You will see a "Configured..." message in your `*Messages*' log when a
-;; package is configured, and a timing if the configuration time was longer
-;; than 0.01s.  You should keep `:init' forms as simple as possible, and put
-;; as much as you can get away with on the `:config' side.
-;;
-;; You can have both `:init' and `:config':
-;;
-;;   (use-package haskell-mode
-;;     :commands haskell-mode
-;;     :init
-;;     (add-to-list 'auto-mode-alist '("\\.l?hs$" . haskell-mode))
-;;     :config
-;;     (progn
-;;       (use-package inf-haskell)
-;;       (use-package hs-lint)))
-;;
-;; In this case, I want to autoload the command `haskell-mode' from
-;; "haskell-mode.el", add it to `auto-mode-alist' at the time ".emacs" is
-;; loaded, but wait until after I've opened a Haskell file before loading
-;; "inf-haskell.el" and "hs-lint.el".
-;;
-;; The `:bind' keyword takes either a cons or a list of conses:
-;;
-;;   (use-package hi-lock
-;;     :bind (("M-o l" . highlight-lines-matching-regexp)
-;;            ("M-o r" . highlight-regexp)
-;;            ("M-o w" . highlight-phrase)))
-;;
-;; The `:commands' keyword likewise takes either a symbol or a list of
-;; symbols.
-;;
-;; You can use the `:if' keyword to predicate the loading and initialization
-;; of a module.  For example, I only want an `edit-server' running for my
-;; main, graphical Emacs, not for Emacsen I may start at the command line:
-;;
-;;   (use-package edit-server
-;;     :if window-system
-;;     :init
-;;     (progn
-;;       (add-hook 'after-init-hook 'server-start t)
-;;       (add-hook 'after-init-hook 'edit-server-start t)))
-;;
-;; The `:disabled' keyword can be used to turn off a module that you're having
-;; difficulties with, or to stop loading something you're not really using at
-;; the present time:
-;;
-;;   (use-package ess-site
-;;     :disabled t
-;;     :commands R)
-;;
-;; Another feature of `use-package' is that it always loads every file that it
-;; can when your ".emacs" is being byte-compiled (if you do that, which I
-;; recommend).  This helps to silence spurious warnings about unknown
-;; variables and functions.
-;;
-;; However, there are times when this is just not enough.  For those times,
-;; use the `:defines' keyword to introduce empty variable definitions solely
-;; for the sake of the byte-compiler:
-;;
-;;   (use-package texinfo
-;;     :defines texinfo-section-list
-;;     :commands texinfo-mode
-;;     :init
-;;     (add-to-list 'auto-mode-alist '("\\.texi$" . texinfo-mode)))
-;;
-;; If you need to silence a missing function warning, do it with an autoload
-;; stub in your `:init' block:
-;;
-;;   (use-package w3m
-;;     :commands (w3m-browse-url w3m-session-crash-recovery-remove)
-;;     :init
-;;     (eval-when-compile
-;;       (autoload 'w3m-search-escape-query-string "w3m-search")))
-;;
-;; If your package needs a directory added to the `load-path' in order load,
-;; use `:load-path'.  It takes a string or a list of strings.  If the path is
-;; relative, it will be expanded within `user-emacs-directory':
-;;
-;;   (use-package ess-site
-;;     :disabled t
-;;     :load-path "site-lisp/ess/lisp/"
-;;     :commands R)
-;;
-;; Lastly, `use-package' provides built-in support for the diminish utility,
-;; if you have that installed.  It's purpose is to remove strings from your
-;; mode-line that would otherwise always be there and provide no useful
-;; information.  It is invoked with the `:diminish' keyword, which is passed
-;; either the minor mode symbol, or a cons of the symbol and a replacement string:
-;;
-;;   (use-package abbrev
-;;     :diminish abbrev-mode
-;;     :init
-;;     (if (file-exists-p abbrev-file-name)
-;;         (quietly-read-abbrev-file))
-;;
-;;     :config
-;;     (add-hook 'expand-load-hook
-;;               (lambda ()
-;;                 (add-hook 'expand-expand-hook 'indent-according-to-mode)
-;;                 (add-hook 'expand-jump-hook 'indent-according-to-mode))))
-;;
-;; If you noticed that this declaration has neither a `:bind', `:commands' or
-;; `:defer' keyword: congratulations, you're an A student!  What it means is
-;; that both the `:init' and `:config' forms will be executed when ".emacs" is
-;; loaded, with no delays until later.  Is this useful?  Not really.  I just
-;; happen to like separating my configuration into things that must happen at
-;; startup time, and things that could potentioally wait until after the
-;; actual load.  In this case, everything could be put inside `:init' and
-;; there would be no difference.
-;;
-;; * For el-get users
-;;
-;; You can use `use-package' as a way to create source definitions for el-get.
-;; All that's needed is to add a `:type' keyword to your declaration.  When
-;; this is present, certain keywords get translated to what el-get expects in
-;; the `el-get-sources' list:
-;;
-;;   :config   -> :after
-;;   :requires -> :depends
-;;
-;; A `:name' will be added also, if one is not provided explicitly, which will
-;; be the same as the name of the package.
-;;
-;; But why would you want to use `use-package' when you have el-get?  My
-;; answer is that I'd like to use el-get to install and update some packages,
-;; but I don't want it managing configuration.  Just loading el-get -- without
-;; call (el-get 'sync) -- takes a quarter second on my machine.  That's 25% of
-;; my load time!  `use-package' is designed for performance, so I only want to
-;; load el-get when it's time to install or update on of my used packages.
-;;
-;; Here is the `use-package' declaration I use for setting up el-get, but only
-;; when I want to install or update:
-;;
-;;   (defvar el-get-sources nil)
-;;
-;;   (use-package el-get
-;;     :commands (el-get
-;;                el-get-install
-;;                el-get-update
-;;                el-get-list-packages)
-;;     :config
-;;     (defun el-get-read-status-file ()
-;;       (mapcar #'(lambda (entry)
-;;                   (cons (plist-get entry :symbol)
-;;                         `(status "installed" recipe ,entry)))
-;;               el-get-sources)))
+;; Please see README.md from the same repository for documentation.
 
 ;;; Code:
 
 (require 'bytecomp)
 (require 'diminish nil t)
 
-(eval-when-compile
-  (require 'cl))
+(when (fboundp 'declare-function)
+  (declare-function package-installed-p 'package))
 
 (defgroup use-package nil
-  "A use-package declaration for simplifying your .emacs"
+  "A use-package declaration for simplifying your `.emacs'."
   :group 'startup)
 
-(defcustom use-package-verbose t
+(defcustom use-package-verbose nil
   "Whether to report about loading and configuration details."
   :type 'boolean
   :group 'use-package)
 
-(defcustom use-package-debug nil
-  "Whether to report more information, mostly regarding el-get"
-  :type 'boolean
-  :group 'use-package)
-
 (defcustom use-package-minimum-reported-time 0.01
   "Minimal load time that will be reported"
   :type 'number
-  :group 'use-package
-  )
+  :group 'use-package)
 
-(defmacro with-elapsed-timer (text &rest forms)
-  `(let ((now ,(if use-package-verbose
-                   '(current-time))))
-     ,(if use-package-verbose
-          `(message "%s..." ,text))
-     (prog1
-         ,@forms
-       ,(when use-package-verbose
-          `(let ((elapsed
-                  (float-time (time-subtract (current-time) now))))
-             (if (> elapsed use-package-minimum-reported-time)
-                 (message "%s...done (%.3fs)" ,text elapsed)
-               (message "%s...done" ,text)))))))
+(defmacro use-package-with-elapsed-timer (text &rest forms)
+  (let ((body `(progn ,@forms)))
+    (if use-package-verbose
+        (let ((nowvar (make-symbol "now")))
+          `(let ((,nowvar (current-time)))
+             (message "%s..." ,text)
+             (prog1 ,body
+               (let ((elapsed
+                      (float-time (time-subtract (current-time) ,nowvar))))
+                 (if (> elapsed ,use-package-minimum-reported-time)
+                     (message "%s...done (%.3fs)" ,text elapsed)
+                   (message "%s...done" ,text))))))
+      body)))
 
-(put 'with-elapsed-timer 'lisp-indent-function 1)
+(put 'use-package-with-elapsed-timer 'lisp-indent-function 1)
 
-(defun use-package-discover-el-get-type (args)
-  (let* ((pkg-name (plist-get args :name))
-         (git-config  (expand-file-name
-                       (concat pkg-name "/.git/config")
-                       (if (boundp 'user-site-lisp-directory)
-                           user-site-lisp-directory
-                         user-emacs-directory))))
+(defvar use-package-idle-timer nil)
+(defvar use-package-idle-forms nil)
 
-    (catch 'found
-      ;; Look for a readable .git/config with at least one defined remote.
-      (if (file-readable-p git-config)
-          (with-temp-buffer
-            (insert-file-contents-literally git-config)
-            (while (re-search-forward "\\[remote" nil t)
-              (if (re-search-forward "url = \\(.+\\)"
-                                     (save-excursion
-                                       (re-search-forward "\\[remote" nil t)
-                                       (point)) t)
-                  (nconc args (list :type 'git
-                                    :url (match-string 1))))))))
-    args))
+(defun use-package-start-idle-timer ()
+  "Ensure that the idle timer is running."
+  (unless use-package-idle-timer
+    (setq use-package-idle-timer
+          (run-with-idle-timer
+           3 t
+           'use-package-idle-eval))))
 
+(defun use-package-init-on-idle (form)
+  "Add a new form to the idle queue."
+  (use-package-start-idle-timer)
+  (if use-package-idle-forms
+      (add-to-list 'use-package-idle-forms
+                   form t)
+    (setq use-package-idle-forms (list form))))
+
+(defun use-package-idle-eval()
+  "Start to eval idle-commands from the idle queue."
+  (let ((next (pop use-package-idle-forms)))
+    (if next
+        (progn
+          (when use-package-verbose
+            (message "use-package idle:%s" next))
+
+          (condition-case e
+              (funcall next)
+            (error
+             (message
+              "Failure on use-package idle. Form: %s, Error: %s"
+              next e)))
+          ;; recurse after a bit
+          (when (sit-for 3)
+            (use-package-idle-eval)))
+      ;; finished (so far!)
+      (cancel-timer use-package-idle-timer)
+      (setq use-package-idle-timer nil))))
 
 (defun use-package-ensure-elpa (package)
   (when (not (package-installed-p package))
     (package-install package)))
 
+(defvar use-package-keywords
+  '(
+     :bind
+     :commands
+     :config
+     :defer
+     :defines
+     :demand
+     :diminish
+     :disabled
+     :ensure
+     :idle
+     :if
+     :init
+     :interpreter
+     :load-path
+     :mode
+     :pre-init
+     :pre-load
+     :requires
+  )
+  "Keywords recognized by `use-package'.")
+
+(defun plist-keys (plist)
+  "Return a list containing all the keys in PLIST."
+  (when plist
+    (cons
+      (car plist)
+      (plist-keys
+        (cddr plist)))))
+
+(defun use-package-validate-keywords (args)
+  "Error if any keyword given in ARGS is not recognized.
+Return the list of recognized keywords."
+  (mapc
+    (function
+      (lambda (keyword)
+        (unless (memq keyword use-package-keywords)
+          (error "Unrecognized keyword: %s" keyword))))
+    (plist-keys args)))
+
+(defun plist-get-value (plist prop)
+  "Return the value of PROP in PLIST as if it was backquoted."
+  (eval (list '\` (plist-get plist prop))))
 
 (defmacro use-package (name &rest args)
-"Use a package with configuration options.
+  "Use a package with configuration options.
 
 For full documentation. please see commentary.
 
 :bind Perform key bindings, and define autoload for bound
       commands.
 :commands Define autoloads for given commands.
+:pre-load Code to run when `use-package' form evals and before
+       anything else. Unlike :init this form runs before the
+       package is required or autoloads added.
 :mode Form to be added to `auto-mode-alist'.
-:interpreter Form to be added to `auto-interpreter-alist'.
+:interpreter Form to be added to `interpreter-mode-alist'.
 :defer Defer loading of package -- automatic
        if :commands, :bind, :mode or :interpreter are used.
+:demand Prevent deferred loading in all cases.
 :config Runs if and when package loads.
 :if Conditional loading.
 :disabled Ignore everything.
 :defines Define vars to silence byte-compiler.
 :load-path Add to `load-path' before loading.
 :diminish Support for diminish package (if it's installed).
-"
+:idle adds a form to run on an idle timer
+:ensure loads package using package.el if necessary."
+  (use-package-validate-keywords args) ; error if any bad keyword, ignore result
   (let* ((commands (plist-get args :commands))
          (pre-init-body (plist-get args :pre-init))
+         (pre-load-body (plist-get args :pre-load))
          (init-body (plist-get args :init))
          (config-body (plist-get args :config))
-         (diminish-var (plist-get args :diminish))
-         (defines (plist-get args :defines))
-         (keybindings )
-         (mode-alist )
-         (interpreter-alist )
+         (diminish-var (plist-get-value args :diminish))
+         (defines (plist-get-value args :defines))
+         (idle-body (plist-get args :idle))
+         (keybindings-alist (plist-get-value args :bind))
+         (mode (plist-get-value args :mode))
+         (mode-alist
+          (if (stringp mode) (cons mode name) mode))
+         (interpreter (plist-get-value args :interpreter))
+         (interpreter-alist
+          (if (stringp interpreter) (cons interpreter name) interpreter))
          (predicate (plist-get args :if))
-         (pkg-load-path (plist-get args :load-path))
+         (pkg-load-path (plist-get-value args :load-path))
          (defines-eval (if (null defines)
                            nil
                          (if (listp defines)
                              (mapcar (lambda (var) `(defvar ,var)) defines)
                            `((defvar ,defines)))))
-         (requires (plist-get args :requires))
+         (requires (plist-get-value args :requires))
          (requires-test (if (null requires)
                             t
                           (if (listp requires)
 
     ;; force this immediately -- one off cost
     (unless (plist-get args :disabled)
+
       (let* ((ensure (plist-get args :ensure))
              (package-name
               (or (and (eq ensure t)
                        name)
                   ensure)))
-      (when package-name
-        (use-package-ensure-elpa package-name)))
+
+        (when package-name
+          (require 'package)
+          (use-package-ensure-elpa package-name)))
 
 
       (if diminish-var
                 `(progn
                    ,config-body
                    (ignore-errors
-                     ,@(if (listp diminish-var)
-                           (if (listp (cdr diminish-var))
-                               (mapcar (lambda (var)
-                                           (if (listp var)
-                                               `(diminish (quote ,(car var)) ,(cdr var))
-                                               `(diminish (quote ,var))))
-                                diminish-var)
-                               `((diminish (quote ,(car diminish-var)) ,(cdr diminish-var)))
-                           )
-                         `((diminish (quote ,diminish-var))))))))
+                     ,@(cond
+                        ((stringp diminish-var)
+                         `((diminish (quote ,(intern (concat name-string "-mode")))
+                                     ,diminish-var)))
+                        ((symbolp diminish-var)
+                         `((diminish (quote ,diminish-var))))
+                        ((and (consp diminish-var) (stringp (cdr diminish-var)))
+                         `((diminish (quote ,(car diminish-var)) ,(cdr diminish-var))))
+                        (t      ; list of symbols or (symbol . "string") pairs
+                         (mapcar (lambda (var)
+                                   (if (listp var)
+                                       `(diminish (quote ,(car var)) ,(cdr var))
+                                     `(diminish (quote ,var))))
+                                 diminish-var)))))))
 
       (if (and commands (symbolp commands))
           (setq commands (list commands)))
 
-      (flet ((init-for-commands
-              (func sym-or-list)
-              (let ((cons-list (if (and (consp sym-or-list)
-                                        (stringp (car sym-or-list)))
-                                   (list sym-or-list)
-                                 sym-or-list)))
-                (if cons-list
-                    (setq init-body
-                          `(progn
-                             ,init-body
-                             ,@(mapcar #'(lambda (elem)
-                                           (push (cdr elem) commands)
-                                           (funcall func elem))
-                                       cons-list)))))))
 
-        (init-for-commands #'(lambda (binding)
-                               `(bind-key ,(car binding)
-                                          (quote ,(cdr binding))))
-                           (plist-get args :bind))
+      (when idle-body
+        (setq init-body
+              `(progn
+                 (require 'use-package)
+                 (use-package-init-on-idle (lambda () ,idle-body))
+                 ,init-body)))
 
-        (init-for-commands #'(lambda (mode)
-                               `(add-to-list 'auto-mode-alist
-                                             (quote ,mode)))
-                           (plist-get args :mode))
 
-        (init-for-commands #'(lambda (interpreter)
-                               `(add-to-list 'interpreter-mode-alist
-                                             (quote ,interpreter)))
-                           (plist-get args :interpreter)))
+      (let ((init-for-commands
+             (lambda (func sym-or-list)
+               (let ((cons-list (if (and (consp sym-or-list)
+                                         (stringp (car sym-or-list)))
+                                    (list sym-or-list)
+                                  sym-or-list)))
+                 (if cons-list
+                     (setq init-body
+                           `(progn
+                              ,init-body
+                              ,@(mapcar #'(lambda (elem)
+                                            (push (cdr elem) commands)
+                                            (funcall func elem))
+                                        cons-list))))))))
+
+        (funcall init-for-commands
+                 #'(lambda (binding)
+                     `(bind-key ,(car binding)
+                                (quote ,(cdr binding))))
+                 keybindings-alist)
+
+        (funcall init-for-commands
+                 #'(lambda (mode)
+                     `(add-to-list 'auto-mode-alist
+                                   (quote ,mode)))
+                 mode-alist)
+
+        (funcall init-for-commands
+                 #'(lambda (interpreter)
+                     `(add-to-list 'interpreter-mode-alist
+                                   (quote ,interpreter)))
+                 interpreter-alist))
 
       `(progn
+         ,pre-load-body
          ,@(mapcar
             #'(lambda (path)
                 `(add-to-list 'load-path
                   (t
                    pkg-load-path)))
 
-         (when byte-compile-current-file
-           ,@defines-eval
-           ,(if (stringp name)
-                `(load ,name t)
-              `(require ',name nil t)))
+         (eval-when-compile
+           (when (bound-and-true-p byte-compile-current-file)
+             ,@defines-eval
+             ,(if (stringp name)
+                  `(load ,name t)
+                `(require ',name nil t))))
 
-         ,(when (boundp 'el-get-sources)
-            (require 'el-get)
-
-            (let ((recipe (ignore-errors
-                            (el-get-read-recipe name-symbol))))
-              (if (null recipe)
-                  (if use-package-debug
-                      (message "No el-get recipe found for package `%s'"
-                               name-symbol))
-                (setq args
-                      (mapcar #'(lambda (arg)
-                                  (cond
-                                   ((eq arg :config)
-                                    :after)
-                                   ((eq arg :requires)
-                                    :depends)
-                                   (t
-                                    arg)))
-                              args))
-
-                (nconc args (list :symbol (intern name-string)))
-
-                (let ((elem args))
-                  (while elem
-                    (unless (plist-get recipe (car elem))
-                      (plist-put recipe (car elem) (cadr elem)))
-                    (setq elem (cddr elem))))
-
-                (unless (plist-get recipe :name)
-                  (nconc recipe (list :name name-string)))
-
-                (unless (plist-get recipe :type)
-                  (setq recipe (use-package-discover-el-get-type recipe)))
-
-                (ignore
-                 (setq el-get-sources (cons recipe el-get-sources))))))
-
-         ,(if (or commands (plist-get args :defer))
+         ,(if (and (or commands (plist-get args :defer))
+                   (not (plist-get args :demand)))
               (let (form)
                 (mapc #'(lambda (command)
                           (push `(autoload (function ,command)
                    ,@form
                    ,init-body
                    ,(unless (null config-body)
-                      `(eval-after-load ,name-string
-                         (quote
-                           (if ,requires-test
-                               ,(macroexpand-all
-                                  `(with-elapsed-timer
-                                       ,(format "Configuring package %s" name-string)
-                                     ,config-body))))))
+                      `(eval-after-load ,(if (stringp name) name `',name)
+                         `(,(lambda ()
+                              (if ,requires-test
+                                  (use-package-with-elapsed-timer
+                                      ,(format "Configuring package %s" name-string)
+                                    ,config-body))))))
                    t))
             `(if (and ,(or predicate t)
                       ,requires-test)
-                 (with-elapsed-timer
+                 (use-package-with-elapsed-timer
                      ,(format "Loading package %s" name-string)
                    (if (not ,(if (stringp name)
                                  `(load ,name t)
                      ,config-body
                      t))))))))
 
-(put 'use-package 'lisp-indent-function 1)
+(put 'use-package 'lisp-indent-function 'defun)
+
+(defconst use-package-font-lock-keywords
+  '(("(\\(use-package\\)\\_>[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
+     (1 font-lock-keyword-face)
+     (2 font-lock-constant-face nil t))))
+
+(font-lock-add-keywords 'emacs-lisp-mode use-package-font-lock-keywords)
 
 (provide 'use-package)
-
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
 ;;; use-package.el ends here