" . help-on-click/key)))
-
(use-package which-func
:defer t
:idle (which-function-mode)
--
cgit 1.4.1
From 185c5978fe924b157214975b21042bb1bf94fa51 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 12:47:22 +0100
Subject: Emacs: add setup for nginx-mode
---
emacs/init.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 6056b7d0..6e34426b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -530,6 +530,10 @@ Values: `desktop', `server', `laptop'")
:mode (("\\.hs\\'" . haskell-mode)
("xmobarrc\\'" . haskell-mode)))
+(use-package nginx-mode
+ :ensure t
+ :mode (("nginx.conf" . nginx-mode)))
+
(use-package lua-mode
:mode (("\\.lua\\'" . lua-mode)))
--
cgit 1.4.1
From 821fca1da57005f24e2395a07f484ba4e35320c8 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 12:49:49 +0100
Subject: Emacs: ensure that lua-mode and haskell-mode are installed before use
---
emacs/init.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 6e34426b..c19ad14c 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -527,6 +527,7 @@ Values: `desktop', `server', `laptop'")
("\\.Xresources\\'" . xrdb-mode)))
(use-package haskell-mode
+ :ensure t
:mode (("\\.hs\\'" . haskell-mode)
("xmobarrc\\'" . haskell-mode)))
@@ -535,6 +536,7 @@ Values: `desktop', `server', `laptop'")
:mode (("nginx.conf" . nginx-mode)))
(use-package lua-mode
+ :ensure t
:mode (("\\.lua\\'" . lua-mode)))
;;;; Planning
--
cgit 1.4.1
From af49c8fc39c05846a144e4ecd58704c8e7079db5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 12:53:05 +0100
Subject: Emacs: only delete a frame when calling exit-emacs in a daemon
---
emacs/init.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index c19ad14c..09b62313 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -467,7 +467,9 @@ Values: `desktop', `server', `laptop'")
:defer t
:idle (minibuffer-depth-indicate-mode t))
-(defalias 'exit-emacs 'save-buffers-kill-emacs)
+(if (daemonp)
+ (defalias 'exit-emacs #'delete-frame)
+ (defalias 'exit-emacs #'save-buffers-kill-emacs))
(use-package lacarte
:bind (("M-`" . lacarte-execute-menu-command)))
--
cgit 1.4.1
From 43fe8ed5db5744133870ea28854de8de9b555a04 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 12:58:59 +0100
Subject: Emacs: remove unnecessary :idle forms
---
emacs/init.el | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 09b62313..8bc85e8c 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -238,8 +238,6 @@ Values: `desktop', `server', `laptop'")
filename-and-process)))))
(use-package uniquify
- :defer t
- :idle (require 'uniquify)
:config (progn
(setq uniquify-buffer-name-style 'reverse
uniquify-separator "/"
@@ -325,18 +323,15 @@ Values: `desktop', `server', `laptop'")
:bind (("C-c h" . rgr/toggle-context-help)))
(use-package which-func
- :defer t
- :idle (which-function-mode)
- :init (setq which-func-modes t))
+ :init (which-function-mode)
+ :config (setq which-func-modes t))
;;;; Files
(prefer-coding-system 'utf-8-auto-unix)
(set-default-coding-systems 'utf-8-auto-unix)
(setq-default buffer-file-coding-system 'utf-8-auto-unix)
-(use-package autorevert
- :defer t
- :idle (global-auto-revert-mode 1))
+(global-auto-revert-mode 1)
(add-hook 'before-save-hook #'delete-trailing-whitespace)
@@ -374,8 +369,6 @@ Values: `desktop', `server', `laptop'")
(message "File '%s' successfully removed" filename))))))
(use-package saveplace
- :defer t
- :idle (require 'saveplace)
:config (progn (setq-default save-place t)
(setq save-place-file (expand-file-name ".saveplace" user-emacs-directory))))
@@ -463,9 +456,7 @@ Values: `desktop', `server', `laptop'")
;;;; Minibuffer
(setq enable-recursive-minibuffers t)
-(use-package mb-depth
- :defer t
- :idle (minibuffer-depth-indicate-mode t))
+(minibuffer-depth-indicate-mode t)
(if (daemonp)
(defalias 'exit-emacs #'delete-frame)
@@ -821,8 +812,6 @@ Also returns nil if pid is nil."
(use-package undo-tree
:ensure t
- :idle (require 'undo-tree)
- :defer t
:config (progn
(global-undo-tree-mode)
;; Keep region when undoing in region
--
cgit 1.4.1
From 623ecd835c7fe2500c5ecc8f4c1c5e67568524fc Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 13:00:15 +0100
Subject: Emacs: add autoload for mu4e
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 8bc85e8c..842c6259 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -269,6 +269,7 @@ Values: `desktop', `server', `laptop'")
:if (and (eq env/location 'home)
(eq env/system-type 'desktop))
:load-path "/usr/share/emacs/site-lisp/mu4e"
+ :commands (mu4e)
:config (progn
(setq mu4e-get-mail-command "true"
mu4e-update-interval 300
--
cgit 1.4.1
From 99601454e1ec5a7675987a1f0dea69aa96108b49 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 13:56:24 +0100
Subject: Emacs: install quickrun-mode
---
emacs/init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 842c6259..28f52df2 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -959,6 +959,9 @@ Works with: arglist-cont-nonempty, arglist-close."
(- (current-column) 2)
(current-column))))))))))
+(use-package quickrun
+ :ensure t)
+
;;;; Web Development
(use-package moz
--
cgit 1.4.1
From f309dcf76f145ab84ac1fc624d0bd49ce942073d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 15:36:17 +0100
Subject: zsh: use 32-bit wine by default
---
zsh/zshrc_prefect | 2 ++
1 file changed, 2 insertions(+)
diff --git a/zsh/zshrc_prefect b/zsh/zshrc_prefect
index e86b955b..997ba391 100644
--- a/zsh/zshrc_prefect
+++ b/zsh/zshrc_prefect
@@ -6,3 +6,5 @@ then
eval `ssh-agent | sed -e '/^echo/d'`
linkAuthSock $SSH_AUTH_SOCK
fi
+
+export WINEARCH="win32"
\ No newline at end of file
--
cgit 1.4.1
From 7c20d9e6e237b1c1e9cb1ac7f1e7174a6fda5a1f Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 15:36:59 +0100
Subject: Xbindkeys: Remove binding for xbindkeys_show
---
xbindkeysrc.scm | 3 ---
1 file changed, 3 deletions(-)
diff --git a/xbindkeysrc.scm b/xbindkeysrc.scm
index 99e78cb6..e44500f1 100644
--- a/xbindkeysrc.scm
+++ b/xbindkeysrc.scm
@@ -47,9 +47,6 @@
;; (remove-all-keys)
;; (debug)
-
-(xbindkey '(control shift q) "xbindkeys_show")
-
(xbindkey '(mod4 F9) "mpc toggle")
(xbindkey '(mod4 F10) "mpc prev")
(xbindkey '(mod4 F11) "mpc next")
--
cgit 1.4.1
From 28fc7ea231b5a5c28186000c535380e7f086881c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 15:48:07 +0100
Subject: Emacs: remove unmaintained tromey ELPA repository
---
emacs/init.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 28f52df2..6957818c 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -43,8 +43,7 @@ Values: `desktop', `server', `laptop'")
;;;; Package Management
(setq *elisp-dir* (expand-file-name "elisp/" user-emacs-directory)
- package-archives '(("ELPA" . "http://tromey.com/elpa/")
- ("gnu" . "http://elpa.gnu.org/packages/")
+ package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
--
cgit 1.4.1
From 928c7723f2375c6c39107113986c74f936519439 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 16:00:06 +0100
Subject: Emacs: add official org-mode package repository
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 6957818c..d96b25ad 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -45,7 +45,8 @@ Values: `desktop', `server', `laptop'")
(setq *elisp-dir* (expand-file-name "elisp/" user-emacs-directory)
package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
- ("melpa" . "http://melpa.milkbox.net/packages/")))
+ ("melpa" . "http://melpa.milkbox.net/packages/")
+ ("org" . "http://orgmode.org/elpa/")))
(package-initialize)
--
cgit 1.4.1
From dedb10c3319ae3dc67e75126c9c610c7af2cdaf5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 16:01:30 +0100
Subject: Emacs: remove workaround for compile errors from diminish
---
emacs/init.el | 4 ----
1 file changed, 4 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index d96b25ad..3f00d346 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -61,10 +61,6 @@ Values: `desktop', `server', `laptop'")
(require 'use-package)
-(eval-when-compile
- (unless (fboundp 'diminish)
- (require 'diminish nil t)))
-
;;;; Style
(use-package linum
--
cgit 1.4.1
From 0237a514e03c62b32680c7b9f5a4571f37b6b125 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 16:06:40 +0100
Subject: Emacs: remove eldoc-context
---
emacs/elisp/eldoc-context.el | 40 ----------------------------------------
emacs/init.el | 3 ---
2 files changed, 43 deletions(-)
delete mode 100644 emacs/elisp/eldoc-context.el
diff --git a/emacs/elisp/eldoc-context.el b/emacs/elisp/eldoc-context.el
deleted file mode 100644
index df8797f2..00000000
--- a/emacs/elisp/eldoc-context.el
+++ /dev/null
@@ -1,40 +0,0 @@
-(provide 'eldoc-context)
-
-(defun rgr/toggle-context-help ()
- "Turn on or off the context help.
-Note that if ON and you hide the help buffer then you need to
-manually reshow it. A double toggle will make it reappear"
- (interactive)
- (with-current-buffer (help-buffer)
- (unless (local-variable-p 'context-help)
- (set (make-local-variable 'context-help) t))
- (if (setq context-help (not context-help))
- (progn
- (if (not (get-buffer-window (help-buffer)))
- (display-buffer (help-buffer)))))
- (message "Context help %s" (if context-help "ON" "OFF"))))
-
-(defun rgr/context-help ()
- "Display function or variable at point in *Help* buffer if visible.
-Default behaviour can be turned off by setting the buffer local
-context-help to false"
- (interactive)
- (let ((rgr-symbol (symbol-at-point))) ; symbol-at-point http://www.emacswiki.org/cgi-bin/wiki/thingatpt%2B.el
- (with-current-buffer (help-buffer)
- (unless (local-variable-p 'context-help)
- (set (make-local-variable 'context-help) t))
- (if (and context-help (get-buffer-window (help-buffer))
- rgr-symbol)
- (if (fboundp rgr-symbol)
- (describe-function rgr-symbol)
- (if (boundp rgr-symbol) (describe-variable rgr-symbol)))))))
-
-(defadvice eldoc-print-current-symbol-info
- (around eldoc-show-c-tag activate)
- (cond
- ((eq major-mode 'emacs-lisp-mode) (rgr/context-help) ad-do-it)
- ((eq major-mode 'lisp-interaction-mode) (rgr/context-help) ad-do-it)
- ((eq major-mode 'apropos-mode) (rgr/context-help) ad-do-it)
- (t ad-do-it)))
-
-(global-set-key (kbd "C-c h") 'rgr/toggle-context-help)
\ No newline at end of file
diff --git a/emacs/init.el b/emacs/init.el
index 3f00d346..face66d6 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -316,9 +316,6 @@ Values: `desktop', `server', `laptop'")
(concat user-emacs-directory
"info"))
-(use-package eldoc-context
- :bind (("C-c h" . rgr/toggle-context-help)))
-
(use-package which-func
:init (which-function-mode)
:config (setq which-func-modes t))
--
cgit 1.4.1
From 95830ed17e5e64e4eb4fcdd755eb05677eb580b8 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 16:21:51 +0100
Subject: Emacs: make JIT fontification faster
---
emacs/init.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index face66d6..3ab0700f 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -90,8 +90,9 @@ Values: `desktop', `server', `laptop'")
(global-font-lock-mode t)
;; Allow font-lock-mode to do background parsing
(setq jit-lock-stealth-time 1
- jit-lock-stealth-load 5
- jit-lock-defer-time 0.1)
+ jit-lock-stealth-load 100
+ jit-lock-chunk-size 1000
+ jit-lock-defer-time 0.01)
(use-package solarized-theme
:ensure t
--
cgit 1.4.1
From 41d5123ac903f11518ee8dfbda79a69750ba1698 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 17:26:47 +0100
Subject: Emacs: enable init.el to be batch byte-compiled
---
emacs/init.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 3ab0700f..08a793f7 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -48,7 +48,8 @@ Values: `desktop', `server', `laptop'")
("melpa" . "http://melpa.milkbox.net/packages/")
("org" . "http://orgmode.org/elpa/")))
-(package-initialize)
+(eval-and-compile
+ (package-initialize))
(add-to-list 'load-path *elisp-dir*)
@@ -59,7 +60,8 @@ Values: `desktop', `server', `laptop'")
diminish
use-package))
-(require 'use-package)
+(eval-and-compile
+ (require 'use-package))
;;;; Style
--
cgit 1.4.1
From 9c6faab4adf09bd93e3ae84174df220538fa9a0b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 17:48:48 +0100
Subject: Add git hooks to recompile emacs init file and elisp directory
---
git-hooks/post-checkout | 6 ++++++
install | 1 +
2 files changed, 7 insertions(+)
create mode 100755 git-hooks/post-checkout
diff --git a/git-hooks/post-checkout b/git-hooks/post-checkout
new file mode 100755
index 00000000..dfceaee2
--- /dev/null
+++ b/git-hooks/post-checkout
@@ -0,0 +1,6 @@
+#!/usr/bin/env zsh
+if [[ -x =emacs ]]
+then
+ emacs --batch -f batch-byte-compile ~/.emacs.d/init.el
+ emacs --batch -f batch-byte-compile ~/.emacs.d/elisp/*.el
+fi
diff --git a/install b/install
index d7e89c0f..0596b3e4 100755
--- a/install
+++ b/install
@@ -33,6 +33,7 @@ install-dot () {
done
}
+install-dot dotfiles/.git/hooks/ dotfiles/git-hooks/*
install-dot .emacs.d/ dotfiles/emacs/*
install-dot . dotfiles/^install(.) dotfiles/zsh/zshrc
install-dot .ssh/ dotfiles/ssh/*
--
cgit 1.4.1
From 5649afdf7e4ab16bbbe8f9fb9c487125efa76b5f Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:00:12 +0100
Subject: Migrate zsh file compilation to post-checkout hook
---
git-hooks/post-checkout | 26 ++++++++++++++++++++++++++
zsh/zshrc | 23 +----------------------
2 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/git-hooks/post-checkout b/git-hooks/post-checkout
index dfceaee2..910716f7 100755
--- a/git-hooks/post-checkout
+++ b/git-hooks/post-checkout
@@ -4,3 +4,29 @@ then
emacs --batch -f batch-byte-compile ~/.emacs.d/init.el
emacs --batch -f batch-byte-compile ~/.emacs.d/elisp/*.el
fi
+
+fasd_cache=~/.zsh/cache/fasd-init-zsh
+if [[ ! -s "$fasd_cache" || zsh/functions/fasd -nt "$fasd_cache" ]]; then
+ zsh/functions/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
+fi
+
+autoload -U zrecompile
+local -a zfiles
+zfiles=(
+ zsh/functions/fasd/fasd
+ $fasd_cache
+ zsh/zshrc
+ zsh/zshrc_${HOST%%.*}
+)
+if [[ -e /usr/bin/emerge ]]; then
+ zfiles+=zsh/zshrc_gentoo
+fi
+if [[ $OSTYPE == freebsd ]]; then
+ zfiles+=zsh/zshrc_freebsd
+fi
+
+zrecompile -p -R ~/.zshrc.zwc $zfiles
+
+for fp in zsh/functions/*(/); do
+ zrecompile -p $fp $fp/*
+done
diff --git a/zsh/zshrc b/zsh/zshrc
index e47adaf3..9437fcc8 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -340,30 +340,9 @@ smart_compile () {
fi
}
-host=${HOST%%.*}
-if [[ -e ~alan/dotfiles/zsh/zshrc_$host ]]; then
- # Don't recompile as toor|root
- smart_compile ~alan/dotfiles/zsh/zshrc_$host 1
-fi
-if [[ -e /usr/bin/emerge ]]; then
- smart_compile ~alan/dotfiles/zsh/zshrc_gentoo 1
-elif [[ $freebsd -eq 1 ]]; then
- smart_compile ~alan/dotfiles/zsh/zshrc_freebsd 1
-fi
-
-for fp in $myfuncs; do
- zrecompile -p $fp $fp/*
-done
-
_FASD_DATA="$HOME/.zsh/fasd-data"
-fasd_cache="$HOME/.zsh/cache/fasd-init-zsh"
autoload -U fasd
-if [[ ! -s "$fasd_cache" || ~alan/dotfiles/zsh/functions/fasd -nt "$fasd_cache" ]]; then
- fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
-fi
-smart_compile "$fasd_cache" 1
-unset fasd_cache
+source ~/.zsh/cache/fasd-init-zsh
alias e="f -e $EDITOR"
-smart_compile ~/.zshrc
alias s="smart_sudo "
--
cgit 1.4.1
From 40d623657794a009617ca0b28634649914870d02 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:16:52 +0100
Subject: Migrate post-checkout hook code to install and run install from
post-checkout hook
---
git-hooks/post-checkout | 32 +-------------------------------
install | 32 ++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 31 deletions(-)
diff --git a/git-hooks/post-checkout b/git-hooks/post-checkout
index 910716f7..96f22007 100755
--- a/git-hooks/post-checkout
+++ b/git-hooks/post-checkout
@@ -1,32 +1,2 @@
#!/usr/bin/env zsh
-if [[ -x =emacs ]]
-then
- emacs --batch -f batch-byte-compile ~/.emacs.d/init.el
- emacs --batch -f batch-byte-compile ~/.emacs.d/elisp/*.el
-fi
-
-fasd_cache=~/.zsh/cache/fasd-init-zsh
-if [[ ! -s "$fasd_cache" || zsh/functions/fasd -nt "$fasd_cache" ]]; then
- zsh/functions/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
-fi
-
-autoload -U zrecompile
-local -a zfiles
-zfiles=(
- zsh/functions/fasd/fasd
- $fasd_cache
- zsh/zshrc
- zsh/zshrc_${HOST%%.*}
-)
-if [[ -e /usr/bin/emerge ]]; then
- zfiles+=zsh/zshrc_gentoo
-fi
-if [[ $OSTYPE == freebsd ]]; then
- zfiles+=zsh/zshrc_freebsd
-fi
-
-zrecompile -p -R ~/.zshrc.zwc $zfiles
-
-for fp in zsh/functions/*(/); do
- zrecompile -p $fp $fp/*
-done
+exec "$GIT_DIR/../install"
diff --git a/install b/install
index 0596b3e4..96ea4410 100755
--- a/install
+++ b/install
@@ -43,3 +43,35 @@ then
fi
popd
+
+if [[ -x =emacs ]]
+then
+ emacs --batch -f batch-byte-compile ~/.emacs.d/init.el
+ emacs --batch -f batch-byte-compile ~/.emacs.d/elisp/*.el
+fi
+
+fasd_cache=~/.zsh/cache/fasd-init-zsh
+if [[ ! -s "$fasd_cache" || zsh/functions/fasd -nt "$fasd_cache" ]]; then
+ zsh/functions/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
+fi
+
+autoload -U zrecompile
+local -a zfiles
+zfiles=(
+ zsh/functions/fasd/fasd
+ $fasd_cache
+ zsh/zshrc
+ zsh/zshrc_${HOST%%.*}
+)
+if [[ -e /usr/bin/emerge ]]; then
+ zfiles+=zsh/zshrc_gentoo
+fi
+if [[ $OSTYPE == freebsd ]]; then
+ zfiles+=zsh/zshrc_freebsd
+fi
+
+zrecompile -p -R ~/.zshrc.zwc $zfiles
+
+for fp in zsh/functions/*(/); do
+ zrecompile -p $fp $fp/*
+done
--
cgit 1.4.1
From 929b15f975cba6515e44abe35c0ff2e807bc7be1 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:21:56 +0100
Subject: Use post-merge hook instead of post-checkout
---
git-hooks/post-checkout | 2 --
git-hooks/post-merge | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
delete mode 100755 git-hooks/post-checkout
create mode 100755 git-hooks/post-merge
diff --git a/git-hooks/post-checkout b/git-hooks/post-checkout
deleted file mode 100755
index 96f22007..00000000
--- a/git-hooks/post-checkout
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env zsh
-exec "$GIT_DIR/../install"
diff --git a/git-hooks/post-merge b/git-hooks/post-merge
new file mode 100755
index 00000000..96f22007
--- /dev/null
+++ b/git-hooks/post-merge
@@ -0,0 +1,2 @@
+#!/usr/bin/env zsh
+exec "$GIT_DIR/../install"
--
cgit 1.4.1
From f863fa4ec320235719957b4309ca0e94d63b6d9d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:31:25 +0100
Subject: Emacs: download package lists if nonexistant to ease bootstrapping
---
emacs/init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 08a793f7..c64a6ce3 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -51,6 +51,9 @@ Values: `desktop', `server', `laptop'")
(eval-and-compile
(package-initialize))
+(when (not package-archive-contents)
+ (package-refresh-contents))
+
(add-to-list 'load-path *elisp-dir*)
(mapc (lambda (package-name)
--
cgit 1.4.1
From 3c1096586c0469e025d3e2559589559b1dae3945 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:33:43 +0100
Subject: Fix typo in install
---
install | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install b/install
index 96ea4410..efc03cb9 100755
--- a/install
+++ b/install
@@ -52,7 +52,7 @@ fi
fasd_cache=~/.zsh/cache/fasd-init-zsh
if [[ ! -s "$fasd_cache" || zsh/functions/fasd -nt "$fasd_cache" ]]; then
- zsh/functions/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
+ zsh/functions/fasd/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
fi
autoload -U zrecompile
--
cgit 1.4.1
From 2815b63c2be710ebf9d77104e2a0ae1a9f1f925d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:35:18 +0100
Subject: Make fasd function executable
---
zsh/functions/fasd/fasd | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 zsh/functions/fasd/fasd
diff --git a/zsh/functions/fasd/fasd b/zsh/functions/fasd/fasd
old mode 100644
new mode 100755
--
cgit 1.4.1
From 98500a2e5f73f72d4b120ef98cab40f8a225d212 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:38:21 +0100
Subject: Emacs: set package-archives whilst compiling for bootstrapping
awesomeness
---
emacs/init.el | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index c64a6ce3..46ecbdec 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -42,19 +42,17 @@ Values: `desktop', `server', `laptop'")
(setq env/location (env/get-location)))
;;;; Package Management
-(setq *elisp-dir* (expand-file-name "elisp/" user-emacs-directory)
- package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
- ("marmalade" . "http://marmalade-repo.org/packages/")
- ("melpa" . "http://melpa.milkbox.net/packages/")
- ("org" . "http://orgmode.org/elpa/")))
-
(eval-and-compile
+ (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
+ ("marmalade" . "http://marmalade-repo.org/packages/")
+ ("melpa" . "http://melpa.milkbox.net/packages/")
+ ("org" . "http://orgmode.org/elpa/")))
(package-initialize))
(when (not package-archive-contents)
(package-refresh-contents))
-(add-to-list 'load-path *elisp-dir*)
+(add-to-list 'load-path (expand-file-name "elisp/" user-emacs-directory))
(mapc (lambda (package-name)
(unless (package-installed-p package-name)
--
cgit 1.4.1
From d67bf2ed02d312a943caa11c13a65cd20ca9aba3 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:39:31 +0100
Subject: Emacs: remove unused web-vcs
---
emacs/elisp/web-vcs.el | 2342 ------------------------------------------------
1 file changed, 2342 deletions(-)
delete mode 100644 emacs/elisp/web-vcs.el
diff --git a/emacs/elisp/web-vcs.el b/emacs/elisp/web-vcs.el
deleted file mode 100644
index 1e2c3226..00000000
--- a/emacs/elisp/web-vcs.el
+++ /dev/null
@@ -1,2342 +0,0 @@
-;;; web-vcs.el --- Download file trees from VCS web pages
-;;
-;; Author: Lennart Borgman (lennart O borgman A gmail O com)
-;; Created: 2009-11-26 Thu
-(defconst web-vcs:version "0.62") ;; Version:
-;; Last-Updated: 2011-03-12 Sat
-;; URL:
-;; Keywords:
-;; Compatibility:
-;;
-;; Features that might be required by this library:
-;;
-;; `advice', `advice-preload', `backquote', `bytecomp', `cus-edit',
-;; `cus-face', `cus-load', `cus-start', `help-fns', `ietf-drums',
-;; `mail-parse', `mail-prsvr', `mm-bodies', `mm-decode',
-;; `mm-encode', `mm-util', `rfc2045', `rfc2047', `rfc2231',
-;; `timer', `web-autoload', `wid-edit'.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; Update file trees within Emacs from VCS systems using information
-;; on their web pages.
-;;
-;; Available download commands are currently:
-;;
-;; `web-vcs-nxhtml'
-;;
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Change log:
-;;
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 3, or
-;; (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
-;; Floor, Boston, MA 02110-1301, USA.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Code:
-
-(eval-when-compile (require 'cl))
-(eval-when-compile (require 'compile))
-(eval-and-compile (require 'cus-edit))
-(eval-and-compile (require 'mm-decode))
-(eval-when-compile (require 'url-http))
-
-(require 'advice)
-(require 'web-autoload nil t)
-;; (require 'url-util)
-;; (require 'url)
-;;(require 'url-parse)
-
-(defvar web-vcs-comp-dir nil)
-
-(defgroup web-vcs nil
- "Customization group for web-vcs."
- :group 'nxhtml)
-
-(defcustom web-vcs-links-regexp
- `(
- (lp-1-10 ;; Id
- ;; Comment:
- "http://www.launchpad.com/ uses this 2009-11-29 with Loggerhead 1.10 (generic?)"
- ;; Files URL regexp:
- ;;
- ;; Extend this format to catch date/time too.
- ;;
- ;; ((patt (rx ...))
- ;; ;; use subexp numbers
- ;; (url 1)
- ;; (time 2)
- ;; (rev 3))
-
- ((time 1)
- (url 2)
- (patt ,(rx-to-string '(and ""
- (submatch (regexp "[^<]*"))
- " | "
- (0+ space)
- ""
- (regexp ".+")
- " | "
- (*? (regexp ".\\|\n"))
- "href=\""
- (submatch (regexp ".*/download/[^\"]*"))
- "\""))))
- ;; Dirs URL regexp:
- ,(rx-to-string '(and "href=\""
- (group (regexp ".*%3A/[^\"]*/"))
- "\""))
- ;; File name URL part regexp:
- "\\([^\/]*\\)$"
- ;; Page revision regexp:
- ,(rx-to-string '(and "for revision"
- (+ whitespace)
- ""
- (submatch (+ digit))
- ""))
- ;; Release revision regexp:
- ,(rx-to-string '(and "/"
- (submatch (+ digit))
- "\"" (+ (not (any ">"))) ">"
- (optional "Release ")
- (+ digit) "." (+ digit) "<"))
- )
- (lp ;; Id
- ;; Comment:
- "http://www.launchpad.com/ uses this 2010-06-26 with Loggerhead 1.17 (generic?)"
- ;; Files URL regexp:
- ;;
- ;; Extend this format to catch date/time too.
- ;;
- ;; ((patt (rx ...))
- ;; ;; use subexp numbers
- ;; (url 1)
- ;; (time 2)
- ;; (rev 3))
- ((time 1)
- (url 2)
- (patt ,(rx-to-string '(and ""
- (submatch
- (*\?
- (not (any "<"))))
- " | "
- (*? anything)
- "")
- ;;(and "href=\"" (group (regexp ".*%3A/[^\"]*/")) "\"")
- )
- ;; File name URL part regexp:
- "\\([^\/]*\\)$"
- ;; Page revision regexp:
- ,(rx-to-string '(and "for revision"
- (+ whitespace)
- ""
- (submatch (+ digit))
- ""))
- ;; Release revision regexp:
- ,(rx-to-string '(and "/"
- (submatch (+ digit))
- "\"" (+ (not (any ">"))) ">"
- (optional "Release ")
- (+ digit) "." (+ digit) "<"))
- )
- )
- "Regexp patterns for matching links on a VCS web page.
-The patterns are grouped by VCS web system type.
-
-\\
-To make a new pattern you can do like this:
-
-- Open the file in Firefox.
-- View the buffer source in Emacs in some way.
-- Turn on `mozadd-mirror-mode'.
-- Use the command `mozadd-init-href-patten'.
-- Then start `re-builder' to refine the pattern.
- (Or, use isearch if you prefer that.)
-- Use `ourcomments-copy-target-region-to-reb' for
- easy copying from target buffer to re-builder.
-- To see what you patterns matches in the web page
- use `M-x mozadd-update-mozilla'.
-- If the page looks terrible then add a
- tag by doing `M-x mozadd-add-href-base'.
-
-*Note: It is always sub match 1 from these patterns that are
- used."
- :type '(repeat
- (list
- (symbol :tag "VCS web system type specifier")
- (string :tag "Description")
- (set (list (const time) integer)
- (list (const url) integer)
- (list (const patt) regexp))
- ;;(regexp :tag "Files URL regexp")
- (regexp :tag "Dirs URL regexp")
- (regexp :tag "File name URL part regexp")
- (regexp :tag "Page revision regexp")
- (regexp :tag "Release revision regexp")
- ))
- :group 'web-vcs)
-
-(defface web-vcs-mode-line
- '((t (:foreground "black" :background "OrangeRed")))
- "Mode line face during download."
- :group 'web-vcs)
-
-(defface web-vcs-mode-line-inactive
- '((t (:foreground "black" :background "Orange")))
- "Mode line face during download."
- :group 'web-vcs)
-
-(defface web-vcs-gold
- '((t (:foreground "black" :background "gold")))
- "Face for web-vcs messages."
- :group 'web-vcs)
-
-(defface web-vcs-red
- '((t (:foreground "black" :background "#f86")))
- "Face for web-vcs messages."
- :group 'web-vcs)
-
-(defface web-vcs-green
- '((t (:foreground "black" :background "#8f6")))
- "Face for web-vcs messages."
- :group 'web-vcs)
-
-(defface web-vcs-yellow
- '((t (:foreground "black" :background "yellow")))
- "Face for web-vcs messages."
- :group 'web-vcs)
-
-(defface web-vcs-pink
- '((t (:foreground "black" :background "pink")))
- "Face for web-vcs messages."
- :group 'web-vcs)
-
-(defcustom web-vcs-default-download-directory
- "~/.emacs.d/"
- "Default download directory."
- :type '(choice (const :tag "~/.emacs.d/" "~/.emacs.d/")
- (const :tag "Fist site-lisp in `load-path'" site-lisp-dir)
- (const :tag "Directory where `site-run-file' lives" site-run-dir)
- (string :tag "Specify directory"))
- :group 'web-vcs)
-
-;;(web-vcs-default-download-directory)
-;;;###autoload
-(defun web-vcs-default-download-directory ()
- "Try to find a suitable place.
-Use the choice in `web-vcs-default-download-directory'.
-If this does not fit fall back to \"~/.emacs.d/\"."
- (let* ((site-run-dir (when site-run-file
- (let ((lib (locate-library site-run-file)))
- (when lib
- (file-name-directory lib)))))
- (site-lisp-dir (catch 'first-site-lisp
- (dolist (d load-path)
- (let ((dir (file-name-nondirectory (directory-file-name d))))
- (when (string= dir "site-lisp")
- (throw 'first-site-lisp (file-name-as-directory d)))))))
- (dummy (message "site-run-dir=%S site-lisp-dir=%S" site-run-dir site-lisp-dir))
- (dir (or (case web-vcs-default-download-directory
- ;;('~/.emacs.d/ "~/.emacs.d/")
- ('site-lisp-dir site-lisp-dir)
- ('site-run-dir site-run-dir))
- web-vcs-default-download-directory)))
- (or dir "~/.emacs.d/")))
-
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Logging
-
-(defcustom web-vcs-log-file "~/.emacs.d/web-vcs-log.org"
- "Log file for web-vcs."
- :type 'file
- :group 'web-vcs)
-
-;;;###autoload
-(defun web-vcs-log-edit ()
- "Open log file."
- (interactive)
- (find-file web-vcs-log-file))
-
-(defvar web-vcs-log-save-timer nil)
-
-(defun web-vcs-log-save-when-idle ()
- (when (timerp web-vcs-log-save-timer) (cancel-timer web-vcs-log-save-timer))
- (run-with-idle-timer 0 nil 'web-vcs-log-save))
-
-(defun web-vcs-log-save ()
- (let ((log-buf (find-buffer-visiting web-vcs-log-file)))
- (when (and log-buf (buffer-modified-p log-buf))
- (with-current-buffer log-buf
- (basic-save-buffer)))
- log-buf))
-
-(defun web-vcs-log-close ()
- (let ((log-buf (web-vcs-log-save)))
- (when log-buf
- (kill-buffer log-buf))))
-
-;; Fix-me: Add some package descriptor to log
-(defun web-vcs-log (url dl-file msg)
- (unless (file-exists-p web-vcs-log-file)
- (let ((dir (file-name-directory web-vcs-log-file)))
- (unless (file-directory-p dir)
- (make-directory dir))))
- (with-current-buffer (find-file-noselect web-vcs-log-file)
- (setq buffer-save-without-query t)
- (web-vcs-log-save-when-idle)
- (save-restriction
- (widen)
- (let ((today-entries (format-time-string "* %Y-%m-%d"))
- (now (format-time-string "%H:%M:%S GMT" nil t)))
- (goto-char (point-max))
- (unless (re-search-backward (concat "^" today-entries) nil t)
- (goto-char (point-max))
- (insert "\n" today-entries "\n"))
- (goto-char (point-max))
- (when url
- (insert "** Downloading file " now "\n"
- (format " file [[file:%s][%s]]\n from %s\n" dl-file dl-file url)
- ))
- (cond
- ((stringp msg)
- (goto-char (point-max))
- (insert msg "\n"))
- (msg (basic-save-buffer)))))))
-
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Finding and downloading files
-
-;;;###autoload
-(defun web-vcs-get-files-from-root (web-vcs full-url dl-dir)
- "Download a file tree from VCS system using the web interface.
-Use WEB-VCS entry in variable `web-vcs-links-regexp' to download
-files via http from FULL-URL to directory DL-DIR.
-
-Show FULL-URL first and offer to visit the page. That page will
-give you information about version control system \(VCS) system
-used etc."
- (unless (web-vcs-contains-moved-files dl-dir)
- (let ((resize-mini-windows (or resize-mini-windows t)))
- (when (if (not (y-or-n-p (concat "Download files from \"" full-url "\".\n"
- "You can see on that page which files will be downloaded.\n\n"
- "Visit that page before downloading? ")))
- t
- (browse-url full-url)
- (if (y-or-n-p "Start downloading? ")
- t
- (message "Aborted")
- nil))
- (message "")
- (web-vcs-get-files-on-page web-vcs full-url t (file-name-as-directory dl-dir) nil)
- t))))
-
-(defun web-vcs-get-files-on-page (web-vcs page-url recursive dl-dir test)
- "Download files listed by WEB-VCS on web page PAGE-URL.
-WEB-VCS is a specifier in `web-vcs-links-regexp'.
-
-If RECURSIVE go into sub folders on the web page and download
-files from them too.
-
-Place the files under DL-DIR.
-
-Before downloading check if the downloaded revision already is
-the same as the one on the web page. This is stored in the file
-web-vcs-revision.txt. After downloading update this file.
-
-If TEST is non-nil then do not download, just list the files."
- (unless (string= dl-dir (file-name-as-directory (expand-file-name dl-dir)))
- (error "Download dir dl-dir=%S must be a full directory path" dl-dir))
- (catch 'command-level
- (when (web-vcs-contains-moved-files dl-dir)
- (throw 'command-level nil))
- (let ((vcs-rec (or (assq web-vcs web-vcs-links-regexp)
- (error "Does not know web-cvs %S" web-vcs)))
- (start-time (current-time)))
- (unless (file-directory-p dl-dir)
- (if (yes-or-no-p (format "Directory %S does not exist, create it? "
- (file-name-as-directory
- (expand-file-name dl-dir))))
- (make-directory dl-dir t)
- (message "Can't download then")
- (throw 'command-level nil)))
- ;; (let ((old-win (selected-window)))
- ;; (unless (eq (get-buffer "*Messages*") (window-buffer old-win))
- ;; (switch-to-buffer-other-window "*Messages*"))
- ;; (goto-char (point-max))
- ;; (insert "\n")
- ;; (insert (propertize (format "\n\nWeb-Vcs Download: %S\n" page-url) 'face 'web-vcs-gold))
- ;; (insert "\n")
- ;; (redisplay t)
- ;; (set-window-point (selected-window) (point-max))
- ;; (select-window old-win))
- (web-vcs-message-with-face 'web-vcs-gold "\n\nWeb-Vcs Download: %S\n" page-url)
- (web-vcs-display-messages nil)
- (let* ((rev-file (expand-file-name "web-vcs-revision.txt" dl-dir))
- (rev-buf (find-file-noselect rev-file))
- ;; Fix-me: Per web vcs speficier.
- (old-rev-range (with-current-buffer rev-buf
- (widen)
- (goto-char (point-min))
- (when (re-search-forward (format "%s:\\(.*\\)\n" web-vcs) nil t)
- ;;(buffer-substring-no-properties (point-min) (line-end-position))
- ;;(match-string 1)
- (cons (match-beginning 1) (match-end 1))
- )))
- (old-revision (when old-rev-range
- (with-current-buffer rev-buf
- (buffer-substring-no-properties (car old-rev-range)
- (cdr old-rev-range)))))
- (dl-revision (web-vcs-get-revision-on-page vcs-rec page-url))
- ret
- moved)
- (when (and old-revision (string= old-revision dl-revision))
- (when (y-or-n-p (format "You already have revision %s. Quit? " dl-revision))
- (message "Aborted")
- (kill-buffer rev-buf)
- (throw 'command-level nil)))
- ;; We do not have a revision number once we start download.
- (with-current-buffer rev-buf
- (when old-rev-range
- (delete-region (car old-rev-range) (cdr old-rev-range))
- (basic-save-buffer)))
- (setq ret (web-vcs-get-files-on-page-1
- vcs-rec page-url
- dl-dir
- ""
- nil
- (if recursive 0 nil)
- dl-revision
- test
- 0))
- (setq moved (nth 1 ret))
- ;; Now we have a revision number again.
- (with-current-buffer rev-buf
- (when (= 0 (buffer-size))
- (insert "WEB VCS Revisions\n\n"))
- (goto-char (point-max))
- (unless (eolp) (insert "\n"))
- (insert (format "%s:%s\n" web-vcs dl-revision))
- (basic-save-buffer)
- (kill-buffer))
- (message "-----------------")
- (web-vcs-message-with-face 'web-vcs-gold "Web-Vcs Download Ready: %S" page-url)
- (web-vcs-message-with-face 'web-vcs-gold " Time elapsed: %S"
- (web-vcs-nice-elapsed start-time (current-time)))
- (when (> moved 0)
- (web-vcs-message-with-face 'web-vcs-yellow
- " %i files updated (old versions renamed to *.moved)"
- moved))))))
-
-(defun web-vcs-get-files-on-page-1 (vcs-rec page-url dl-root dl-relative file-mask recursive dl-revision test num-files)
- "Download files listed by VCS-REC on web page page-URL.
-VCS-REC should be an entry like the entries in the list
-`web-vcs-links-regexp'.
-
-If FILE-MASK is non-nil then it is used to match a file relative
-path. Only matching files will be downloaded. FILE-MASK can
-have two forms, a regular expression or a function.
-
-If FILE-MASK is a regular expression then each part of the path
-may be a regular expresion \(not containing /).
-
-If FILE-MASK is a function then this function is called in each
-directory under DL-ROOT. The function is called with the
-directory as a parameter and should return a cons. The first
-element of the cons should be a regular expression matching file
-names in that directory that should be downloaded. The cdr
-should be t if subdirectories should be visited.
-
-If RECURSIVE go into sub folders on the web page and download
-files from them too.
-
-Place the files under DL-DIR.
-
-The revision on the page page-URL should match DL-REVISION if this is non-nil.
-
-If TEST is non-nil then do not download, just list the files"
- ;;(web-vcs-message-with-face 'font-lock-comment-face "web-vcs-get-files-on-page-1 %S %S %S %S" page-url dl-root dl-relative file-mask)
- (let* ((files-matcher (nth 2 vcs-rec))
- (dirs-href-regexp (nth 3 vcs-rec))
- (revision-regexp (nth 5 vcs-rec))
- ;; (setq x (url-generic-parse-url "http://somewhere.com/file/path.el"))
- ;; (setq x (url-generic-parse-url "http://somewhere.com"))
- ;; (setq x (url-generic-parse-url "/somewhere.com"))
- ;; (url-type x)
- ;; (url-host x)
- ;; (url-filename x)
- ;; (url-fullness x)
- ;; (url-port x)
- ;; (setq y (url-expand-file-name "/suburl/other.el" x))
- ;; (setq y (url-expand-file-name "http://other.com/suburl/other.el" x))
- ;;(page-urlobj (url-generic-parse-url page-url))
- ;;(page-url-fullness (or (url-fullness page-urlobj) (error "Incomplete URL: %S" page-url)))
- ;;(page-url-host (url-host page-urlobj))
- ;;(page-url-type (url-type page-urlobj))
- ;;(page-url-file (url-filename page-urlobj))
- ;;(page-host-url (concat page-url-type "://" page-url-host))
- (dl-dir (file-name-as-directory (expand-file-name dl-relative dl-root)))
- (lst-dl-relative (web-vcs-file-name-as-list dl-relative))
- (lst-file-mask (when (stringp file-mask) (web-vcs-file-name-as-list file-mask)))
- ;;(url-buf (url-retrieve-synchronously page-url))
- this-page-revision
- files
- suburls
- (moved 0)
- (temp-file-base (expand-file-name "web-vcs-temp-list.tmp" dl-dir))
- temp-list-file
- temp-list-buf
- folder-res
- http-sts)
- ;; Fix-me: It looks like there is maybe a bug in url-copy-file so
- ;; that it runs synchronously. Try to workaround the problem by
- ;; making a new file temp file name.
- (web-vcs-display-messages nil)
- (unless (file-directory-p dl-dir) (make-directory dl-dir t))
- ;;(message "TRACE: dl-dir=%S" dl-dir)
- (setq temp-list-file (make-temp-name temp-file-base))
- (setq temp-list-buf (web-vcs-ass-folder-cache page-url))
- (unless temp-list-buf
- ;;(setq temp-list-buf (generate-new-buffer "web-wcs-folder"))
- ;;(web-vcs-url-copy-file-and-check page-url temp-list-file nil)
- (let ((ready nil))
- (while (not ready)
- (setq folder-res (web-vcs-url-retrieve-synch page-url))
- ;; (with-current-buffer temp-list-buf
- ;; (insert-file-contents temp-list-file))
- (if (memq (cdr folder-res) '(200 201))
- (setq ready t)
- (web-vcs-message-with-face 'web-vcs-red "Could not get %S" page-url)
- (web-vcs-display-messages t)
- (when (y-or-n-p (format "Could not get %S, visit page to see what is wrong? " page-url))
- (browse-url page-url))
- (unless (y-or-n-p "Try again? (It is safe to break here and try again later.) ")
- (throw 'command-level nil))))))
- ;;(with-current-buffer temp-list-buf
- (with-current-buffer (car folder-res)
- ;;(delete-file temp-list-file)
- ;;(find-file-noselect temp-list-file)
- (when dl-revision
- (setq this-page-revision (web-vcs-get-revision-from-url-buf vcs-rec (current-buffer) page-url)))
- (when dl-revision
- (unless (string= dl-revision this-page-revision)
- (web-vcs-message-with-face 'web-vcs-red "Revision on %S is %S, but should be %S"
- page-url this-page-revision dl-revision)
- (web-vcs-display-messages t)
- (throw 'command-level nil)))
- ;; Find files
- (goto-char (point-min))
- (let ((files-href-regexp (nth 1 (assq 'patt files-matcher)))
- (url-num (nth 1 (assq 'url files-matcher)))
- (time-num (nth 1 (assq 'time files-matcher))))
- (while (re-search-forward files-href-regexp nil t)
- ;; Fix-me: What happened to full url???
- (let* ((file (match-string url-num))
- (time (match-string time-num))
- (full-file (url-expand-file-name file page-url)))
- (add-to-list 'files (list full-file time)))))
- (when (< (length files) num-files)
- (message "files-on-page-1: found %d files, expected %d" (length files) num-files))
- ;; Find subdirs
- (when recursive
- (goto-char (point-min))
- (while (re-search-forward dirs-href-regexp nil t)
- (let* ((suburl (match-string 1))
- (lenurl (length page-url))
- (full-suburl (url-expand-file-name suburl page-url)))
- ;;(message "suburl=%S" suburl)
- (when (and (> (length full-suburl) lenurl)
- (string= (substring full-suburl 0 lenurl) page-url))
- ;;(message "...added")
- (add-to-list 'suburls full-suburl)))))
- (kill-buffer))
- ;; Download files
- ;;(message "TRACE: files=%S" files)
- (web-vcs-download-files vcs-rec files dl-dir dl-root)
- ;; Download subdirs
- (when suburls
- (dolist (suburl (reverse suburls))
- (let* ((dl-sub-dir (substring suburl (length page-url)))
- (full-dl-sub-dir (file-name-as-directory
- (expand-file-name dl-sub-dir dl-dir)))
- (rel-dl-sub-dir (file-relative-name full-dl-sub-dir dl-root)))
- ;;(message "web-vcs-get-revision-from-url-buf dir: %S %S" file-mask rel-dl-sub-dir)
- (when (or (not file-mask)
- (not (stringp file-mask))
- (= 1 (length (web-vcs-file-name-as-list file-mask)))
- (web-vcs-match-folderwise file-mask rel-dl-sub-dir))
- ;;(message "matched dir %S" rel-dl-sub-dir)
- (unless (web-vcs-contains-file dl-dir full-dl-sub-dir)
- (error "Subdir %S not in %S" dl-sub-dir dl-dir))
- (let* ((ret (web-vcs-get-files-on-page-1 vcs-rec
- suburl
- dl-root
- rel-dl-sub-dir
- file-mask
- (1+ recursive)
- this-page-revision
- test
- 0)))
- (setq moved (+ moved (nth 1 ret))))))))
- (list this-page-revision moved)))
-
-(defun web-vcs-get-missing-matching-files (web-vcs url dl-dir file-mask num-files)
- "Download missing files from VCS system using the web interface.
-Use WEB-VCS entry in variable `web-vcs-links-regexp' to download
-files via http from URL to directory DL-DIR.
-
-FILE-MASK is used to match files that should be downloaded. See
-`web-vcs-get-files-on-page-1' for more information.
-
-Before downloading offer to visit the page from which the
-downloading will be made.
-"
- (unless file-mask (error "file-mask is nil"))
- (let ((vcs-rec (or (assq web-vcs web-vcs-links-regexp)
- (error "Does not know web-cvs %S" web-vcs))))
- (web-vcs-get-files-on-page-1 vcs-rec url dl-dir "" file-mask 0 nil nil num-files)))
-
-
-;; (web-vcs-get-files-on-page 'lp "http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/files/head%3A/" t "c:/test/temp13/" t)
-
-(defvar web-vcs-folder-cache nil) ;; dyn var
-(defun web-vcs-add-folder-cache (url buf)
- (add-to-list 'web-vcs-folder-cache (list url buf)))
-(defun web-vcs-ass-folder-cache (url)
- (assoc url web-vcs-folder-cache))
-(defun web-vcs-clear-folder-cache ()
- (while web-vcs-folder-cache
- (let ((ub (car web-vcs-folder-cache)))
- (setq web-vcs-folder-cache (cdr web-vcs-folder-cache))
- (kill-buffer (nth 1 ub)))))
-
-(defun web-vcs-url-copy-file-and-check (file-url dl-file dest-file)
- "Copy FILE-URL to DL-FILE.
-Log what happened. Use DEST-FILE in the log, not DL-FILE which is
-a temporary file."
- (let ((http-sts nil)
- (file-nonempty nil)
- (fail-reason nil))
- (when dest-file (web-vcs-log file-url dest-file nil))
- (web-vcs-display-messages nil)
- ;;(message "before url-copy-file %S" dl-file)
- (setq http-sts (web-vcs-url-copy-file file-url dl-file nil t)) ;; don't overwrite, keep time
- ;;(message "after url-copy-file %S" dl-file)
- (if (and (file-exists-p dl-file)
- (setq file-nonempty (< 0 (nth 7 (file-attributes dl-file)))) ;; file size 0
- (memq http-sts '(200 201)))
- (when dest-file
- (web-vcs-log nil nil " Done.\n"))
- (setq fail-reason
- (cond
- (http-sts (format "HTTP %s" http-sts))
- (file-nonempty "File looks bad")
- (t "Server did not respond")))
- (unless dest-file (web-vcs-log file-url dl-file "TEMP FILE"))
- (web-vcs-log nil nil (format " *Failed:* %s\n" fail-reason))
- ;; Requires user attention and intervention
- (web-vcs-message-with-face 'web-vcs-red "Download failed: %s, %S" fail-reason file-url)
- (web-vcs-display-messages t)
- (when (y-or-n-p (format "Vist page %S to see what is wrong? " file-url))
- (browse-url file-url))
- (message "\n")
- (web-vcs-message-with-face 'web-vcs-yellow "Please retry what you did before!\n")
- (throw 'command-level nil))))
-
-(defvar web-autoload-temp-file-prefix "TEMPORARY-WEB-AUTO-LOAD-")
-(defvar web-autoload-active-file-sub-url) ;; Dyn var, active during file download check
-(defun web-autoload-acvtive ()
- (and (boundp 'web-autoload-active-file-sub-url)
- web-autoload-active-file-sub-url))
-
-(defun web-vcs-download-files (vcs-rec files dl-dir dl-root)
- (dolist (file (reverse files))
- (let* ((url-file (nth 0 file))
- (url-file-time-str (nth 1 file))
- ;; date-to-time assumes GMT so this is ok:
- (url-file-time (when url-file-time-str (date-to-time url-file-time-str)))
- (url-file-name-regexp (nth 4 vcs-rec))
- (url-file-rel-name (progn
- (when (string-match url-file-name-regexp url-file)
- (match-string 1 url-file))))
- (dl-file-name (expand-file-name url-file-rel-name dl-dir))
- (dl-file-time (nth 5 (file-attributes dl-file-name)))
- (file-rel-name (file-relative-name dl-file-name dl-root))
- (file-name (file-name-nondirectory dl-file-name))
- (temp-file (expand-file-name (concat web-autoload-temp-file-prefix file-name) dl-dir))
- temp-buf)
- (cond
- ;;((and file-mask (not (web-vcs-match-folderwise file-mask file-rel-name))))
- ((and dl-file-time
- url-file-time
- (progn
- ;;(message "dl-file-time =%s" (when dl-file-time (current-time-string dl-file-time)))
- ;;(message "url-file-time=%s" (when url-file-time (current-time-string url-file-time)))
- ;;(message "url-file-tstr=%s" (when url-file-time url-file-time-str))
- t)
- (time-less-p url-file-time
- (time-add dl-file-time (seconds-to-time 1))))
- (web-vcs-message-with-face 'web-vcs-green "Local file %s is newer or same age" file-rel-name))
- ;;(test (progn (message "TEST url-file=%S" url-file) (message "TEST url-file-rel-name=%S" url-file-rel-name) (message "TEST dl-file-name=%S" dl-file-name) ))
- (t
- ;; Avoid trouble with temp file
- (while (setq temp-buf (find-buffer-visiting temp-file))
- (set-buffer-modified-p nil) (kill-buffer temp-buf))
- (when (file-exists-p temp-file) (delete-file temp-file))
- ;;(web-vcs-message-with-face 'font-lock-comment-face "Starting url-copy-file %S %S t t" url-file temp-file)
- (web-vcs-url-copy-file-and-check url-file temp-file dl-file-name)
- ;;(web-vcs-message-with-face 'font-lock-comment-face "Finished url-copy-file %S %S t t" url-file temp-file)
- (let* ((time-after-url-copy (current-time))
- (old-buf-open (find-buffer-visiting dl-file-name)))
- (when (and old-buf-open (buffer-modified-p old-buf-open))
- (save-excursion
- (switch-to-buffer old-buf-open)
- (when (y-or-n-p (format "Buffer %S is modified, save to make a backup? " dl-file-name))
- (save-buffer))))
- (if (and dl-file-time (web-vcs-equal-files dl-file-name temp-file))
- (progn
- (delete-file temp-file)
- (when url-file-time (set-file-times dl-file-name url-file-time))
- (web-vcs-message-with-face 'web-vcs-green "File %S was ok" dl-file-name))
- (when dl-file-time
- (let ((backup (concat dl-file-name ".moved")))
- (rename-file dl-file-name backup t)))
- ;; Be paranoid and let user check here. I actually
- ;; believe that is a very good thing here.
- (web-vcs-be-paranoid temp-file dl-file-name file-rel-name)
- (rename-file temp-file dl-file-name)
- (when url-file-time (set-file-times dl-file-name url-file-time))
- ;; (let ((buf (find-buffer-visiting dl-file-name)))
- ;; (when buf
- ;; (with-current-buffer buf
- ;; (message "before revert-buffer")
- ;; (revert-buffer nil t t)
- ;; (message "after revert-buffer")
- ;; )))
- (if dl-file-time
- (web-vcs-message-with-face 'web-vcs-yellow "Updated %S" dl-file-name)
- (web-vcs-message-with-face 'web-vcs-green "Downloaded %S" dl-file-name))
- (when old-buf-open
- (with-current-buffer old-buf-open
- (set-buffer-modified-p nil)
- (revert-buffer nil t t)))
- (with-current-buffer (find-file-noselect dl-file-name)
- (setq header-line-format
- (propertize (format-time-string "This file was downloaded %Y-%m-%d %H:%M")
- 'face 'web-vcs-green))))
- (web-vcs-display-messages nil)
- ;; This is both for user and remote server load. Do not remove this.
- (redisplay t) (sit-for (- 1.0 (float-time (time-subtract (current-time) time-after-url-copy))))
- ;; (unless old-buf-open
- ;; (when old-buf
- ;; (kill-buffer old-buf)))
- )))
- (redisplay t))))
-
-(defun web-vcs-get-revision-on-page (vcs-rec url)
- "Get revision number using VCS-REC on page URL.
-VCS-REC should be an entry like the entries in the list
-`web-vcs-links-regexp'."
- ;; url-insert-file-contents
- (let ((url-buf (url-retrieve-synchronously url)))
- (web-vcs-get-revision-from-url-buf vcs-rec url-buf url)))
-
-(defun web-vcs-get-revision-from-url-buf (vcs-rec url-buf rev-page-url)
- "Get revision number using VCS-REC.
-VCS-REC should be an entry in the list `web-vcs-links-regexp'.
-The buffer URL-BUF should contain the content on page
-REV-PAGE-URL."
- (let ((revision-regexp (nth 5 vcs-rec)))
- ;; Get revision number
- (with-current-buffer url-buf
- (goto-char (point-min))
- (if (not (re-search-forward revision-regexp nil t))
- (progn
- (web-vcs-message-with-face 'web-vcs-red "Can't find revision number on %S" rev-page-url)
- (web-vcs-display-messages t)
- (when (y-or-n-p (format "Coult not find rev no on %S, visit page to see what is wrong? " rev-page-url))
- (browse-url rev-page-url))
- (throw 'command-level nil))
- (match-string 1)))))
-
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Auto Download
-
-
-;; fix-me: To emulation-mode-map
-;; Fix-me: put this on better keys
-(defvar web-vcs-paranoid-state-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map [(control ?c)(control ?c)] 'exit-recursive-edit)
- (define-key map [(control ?c)(control ?n)] 'web-autoload-continue-no-stop)
- (define-key map [(control ?c)(control ?r)] 'web-vcs-investigate-elisp-file)
- (define-key map [(control ?c)(control ?q)] 'web-vcs-quit-auto-download)
- map))
-
-(defun web-vcs-quit-auto-download ()
- "Quit download process.
-This stops the current web autoload processing."
- (interactive)
- ;; Fix-me.
- (when (y-or-n-p "Stop web autoload processing? You can resume it later. ")
- (web-vcs-message-with-face 'web-vcs-red
- "Stopped autoloading in process. It will be resumed when necessary again.")
- (web-vcs-log nil nil "User stopped autoloading")
- (throw 'top-level 'web-autoload-stop)))
-
-(define-minor-mode web-vcs-paranoid-state-mode
- "Mode used temporarily during user check of downloaded file.
-Do not turn on this yourself."
- :lighter (concat " " (propertize "Download file check" 'face 'font-lock-warning-face))
- :global t
- :group 'web-vcs
- (or (not web-vcs-paranoid-state-mode)
- (web-autoload-acvtive)
- (error "This mode can't be used when not downloading")))
-
-(defcustom web-autoload-paranoid t
- "Be paranoid and break to check each file after download."
- :type 'boolean
- :group 'web-vcs)
-
-(defun web-autoload-continue-no-stop ()
- "Continue web auto download.
-This is used after inspecting downloaded elisp files. Set
-`web-autoload-paranoid' to nil before contiuning to avoid further
-breaks to check downloaded files."
- (interactive)
- (setq web-autoload-paranoid nil)
- (web-autoload-continue))
-
-(defun web-autoload-continue ()
- "Continue web auto download.
-This is used after inspecting downloaded elisp files."
- (interactive)
- (if (< 0 (recursion-depth))
- (exit-recursive-edit)
- (web-autoload-byte-compile-queue)))
-
-(defun web-vcs-be-paranoid (temp-file file-dl-name file-sub-url)
- "Be paranoid and check FILE-DL-NAME."
- (when (or (not (boundp 'web-autoload-paranoid))
- web-autoload-paranoid)
- (save-window-excursion
- (let* ((comp-buf (get-buffer "*Compilation*"))
- (comp-win (and comp-buf
- (get-buffer-window comp-buf)))
- (msg-win (web-vcs-display-messages nil))
- temp-buf
- (kf-desc (lambda (fun)
- (let* ((key (where-is-internal fun nil t))
- (k-desc (when key (key-description key)))
- (fmt-kf "\n %s (or %s)")
- (fmt-f "\n %s"))
- (if key
- (format fmt-kf k-desc fun)
- (format fmt-f fun)
- )))))
- (if comp-win
- (progn
- (select-window comp-win)
- (find-file file-dl-name))
- (select-window msg-win)
- (find-file-other-window temp-file))
- (setq temp-buf (current-buffer))
- (web-vcs-log-save)
- (message "-")
- (message "")
- (with-selected-window msg-win
- (goto-char (point-max)))
- (let ((proceed nil)
- (web-autoload-active-file-sub-url file-sub-url) ;; Dyn var, active during file download check
- (ws (with-current-buffer "*Messages*" (point-marker))))
- (web-vcs-paranoid-state-mode 1)
- (web-vcs-message-with-face
- 'secondary-selection
- (concat "Please check the downloaded file and then continue by doing"
- (funcall kf-desc 'exit-recursive-edit)
- (if (fboundp 'web-autoload-continue-no-stop)
- (concat
- "\n\nOr, for no more breaks to check files do"
- (funcall kf-desc 'web-autoload-continue-no-stop))
- "")
- "\n\nTo stop the web autoloading process for now do"
- (funcall kf-desc 'web-autoload-quit-download)
- "\n\nTo see the log file you can do"
- (funcall kf-desc 'web-vcs-log-edit)
- "\n"))
- (message "")
- (let ((msg-win (car (get-buffer-window-list "*Messages*" nil nil))))
- (when msg-win (set-window-start msg-win ws)))
- (while (not proceed)
- (condition-case err
- (when (eq 'web-autoload-stop
- (catch 'top-level
- ;; Fix-me: review file before rename!
- (setq header-line-format
- (propertize
- (format "Review for downloading. Continue: C-c C-c%s. Destination: %S"
- (if (string= "el" (file-name-extension file-dl-name))
- ", Check: C-c C-r"
- "")
- file-dl-name)
- 'face 'web-vcs-red))
- (unwind-protect
- (progn
- (recursive-edit))
- (web-vcs-paranoid-state-mode -1))
- (with-current-buffer temp-buf
- (set-buffer-modified-p nil)
- (kill-buffer temp-buf))
- (setq proceed t)))
- (throw 'top-level t))
- (error (message "%s" (error-message-string err))))))
- (web-vcs-display-messages t)
- ))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Auto Download Compile Queue
-;;
-;; Downloaded elisp files are placed in a compile queue. They are not
-;; compiled until all required elisp files are downloaded (and
-;; optionally compiled).
-;;
-;; This mechanism works through
-;; - reading (eval-when-compile ...) etc in the files
-;; - a defadviced require that is the driver of the process
-
-(defvar web-autoload-compile-queue nil)
-
-(defvar web-autoload-byte-compile-queue-active nil) ;; Dyn var
-
-(defun web-autoload-byte-compile-file (file load comp-fun)
- (if nil ;;(file-exists-p file)
- (byte-compile-file file load)
- (let ((added-entry (list file load comp-fun nil)))
- (if (member added-entry web-autoload-compile-queue)
- (setq added-entry nil)
- (web-vcs-message-with-face 'web-vcs-gold "Add to compile queue (%S %s)" file load)
- (setq web-autoload-compile-queue (cons added-entry
- web-autoload-compile-queue)))
- (when added-entry
- (if web-autoload-byte-compile-queue-active
- (throw 'web-autoload-comp-restart t)
- (web-autoload-byte-compile-queue))))))
-
-;;(web-autoload-byte-compile-queue)
-(defun web-autoload-byte-compile-queue ()
- (let ((top-entry)
- (web-autoload-byte-compile-queue-active t))
- (while (and web-autoload-compile-queue
- (not (equal top-entry
- (car web-autoload-compile-queue))))
- (setq top-entry (car web-autoload-compile-queue))
- (catch 'web-autoload-comp-restart
- (web-autoload-byte-compile-first)
- (setq web-autoload-compile-queue (cdr web-autoload-compile-queue))))))
-
-(defun web-autoload-byte-compile-first ()
- "Compile first file on compile queue and maybe load it.
-Compile the car of `web-autoload-compile-queue' and load if this
-entry says so."
- (let* ((compiled-it nil)
- (first-entry (car web-autoload-compile-queue))
- (el-file (nth 0 first-entry))
- (load (nth 1 first-entry))
- (comp-fun (nth 2 first-entry))
- (req-done (nth 3 first-entry))
- (elc-file (byte-compile-dest-file el-file))
- (need-compile (or (not (file-exists-p elc-file))
- (file-newer-than-file-p el-file elc-file))))
- (if (not need-compile)
- nil ;;(when load (load elc-file))
- (unless req-done
- (web-autoload-do-eval-requires el-file)
- (setcar (nthcdr 3 first-entry) t))
- (when (catch 'web-autoload-comp-restart
- (condition-case err
- (progn
- (web-vcs-message-with-face 'font-lock-comment-face "Start byte compiling %S" el-file)
- (web-vcs-message-with-face 'web-vcs-pink "Compiling QUEUE: %S" web-autoload-compile-queue)
- (let ((web-autoload-skip-require-advice t)) (funcall comp-fun el-file load))
- (web-vcs-message-with-face 'font-lock-comment-face "Ready byte compiling %S" el-file)
- ;; Return nil to tell there are no known problems
- (if (file-exists-p elc-file)
- nil
- (web-vcs-message-with-face
- 'web-vcs-red "Error: byte compiling did not produce %S" elc-file)
- (web-vcs-display-messages nil)
- ;; Clean up before restart
- (web-autoload-try-cleanup-after-failed-compile first-entry)
- t))
- (error
- (web-vcs-message-with-face
- 'web-vcs-red "Error in byte compiling %S: %s" el-file (error-message-string err))
- (web-vcs-display-messages nil)
- ;; Clean up before restart
- (web-autoload-try-cleanup-after-failed-compile first-entry)
- t ;; error
- )))
- (throw 'web-autoload-comp-restart t)
- ))))
-
-(defun web-autoload-do-eval-requires (el-file)
- "Do eval-when-compile and eval-and-compile."
- ;;(message "web-autoload-do-eval-requires %S" el-file)
- (let ((old-buf (find-buffer-visiting el-file)))
- (with-current-buffer (or old-buf (find-file-noselect el-file))
- (let ((here (point))
- (web-autoload-require-skip-noerror-entries t))
- (save-restriction
- (widen)
- (goto-char (point-min))
- ;;(message "web-autoload-do-eval-requires cb=%s" (current-buffer))
- (while (progn
- (while (progn (skip-chars-forward " \t\n\^l")
- (looking-at ";"))
- (forward-line 1))
- (not (eobp)))
- (let ((form (read (current-buffer))))
- (when (memq (car form) '(eval-when-compile eval-and-compile))
- (web-vcs-message-with-face 'web-vcs-gold " eval %S" form)
- (eval form))
- )))
- (if old-buf (kill-buffer) (goto-char here))))))
-
-
-;; Fix-me: protect against deep nesting
-(defun web-autoload-do-require (feature filename noerror)
- (let* ((feat-name (symbol-name feature))
- (lib (or filename feat-name)))
- (if (load lib noerror t)
- (progn
- (unless (featurep feature)
- (error "web-autoload: Required feature `%s' was not provided" feature))
- feature)
- nil
- )))
-
-(defvar web-autoload-require-skip-noerror-entries nil)
-
-(defadvice require (around
- web-autoload-ad-require)
- (let ((feature (ad-get-arg 0))
- (filename (ad-get-arg 1))
- (noerror (ad-get-arg 2)))
- (if (featurep feature)
- feature
- (if (or filename
- (and noerror
- (or (not (boundp 'web-autoload-skip-require-advice))
- web-autoload-skip-require-advice)))
- (progn
- (message "Doing nearly original require %s, because skipping" (ad-get-arg 0))
- ;; Can't ad-do-it because defadviced functions in load
- ;;(web-autoload-do-require feature filename noerror)
- ;;
- ;; Fix-me: Implement lazy loading here? Could it be done with while-no-input?
- ;;
- ;;(when (assq feature web-autoload-require-list) )
- ad-do-it)
- (unless (and noerror
- web-autoload-require-skip-noerror-entries)
- (let* ((auto-rec (assq feature web-autoload-require-list))
- (web-vcs (nth 1 auto-rec))
- (base-url (nth 2 auto-rec))
- (relative-url (nth 3 auto-rec))
- (base-dir (nth 4 auto-rec))
- (comp-fun (nth 5 auto-rec)))
- (if (not auto-rec)
- ad-do-it
- (let* ((full-el (concat (expand-file-name relative-url base-dir) ".el"))
- (full-elc (byte-compile-dest-file full-el))
- (our-buffer (current-buffer)) ;; Need to come back here
- (our-wcfg (current-window-configuration))
- (mode-line-old (web-vcs-redefine-face 'mode-line 'web-vcs-mode-line))
- (mode-line-inactive-old (web-vcs-redefine-face 'mode-line-inactive 'web-vcs-mode-line-inactive))
- (header-line-format-old (with-current-buffer "*Messages*"
- (prog1
- header-line-format
- (setq header-line-format
- (propertize "Downloading needed files..."
- 'face 'web-vcs-mode-line
- ;;'face '(:height 1.5) ;; does not work
- ))))))
- ;; Fix-me: can't update while accessing the menus
- ;;(message "trying (redisplay t) ;; mode line")
- ;;(sit-for 1) (redisplay t) ;; mode line
- (unwind-protect
- (progn
- (web-vcs-message-with-face 'web-vcs-gold "Doing the really adviced require for %s" feature)
- ;; Check if already downloaded first
- (unless (file-exists-p full-el)
- (setq base-url (eval base-url))
- ;; Download and try again
- (setq relative-url (concat relative-url ".el"))
- (web-vcs-message-with-face 'web-vcs-green "Need to download feature '%s" feature)
- (catch 'web-autoload-comp-restart
- (web-vcs-get-missing-matching-files web-vcs base-url base-dir relative-url)))
- (set-buffer our-buffer) ;; Before we load..
- (when web-autoload-autocompile
- (unless (file-exists-p full-elc)
- ;; Byte compile the downloaded file
- (web-autoload-byte-compile-file full-el t comp-fun)))
- (web-vcs-message-with-face 'web-vcs-gold "Doing finally require for %s" feature)
- (set-buffer our-buffer) ;; ... and after we load
- (set-window-configuration our-wcfg))
- (with-current-buffer "*Messages*" (setq header-line-format header-line-format-old))
- (web-vcs-redefine-face 'mode-line mode-line-old)
- (web-vcs-redefine-face 'mode-line-inactive mode-line-inactive-old)))
- ad-do-it)))))))
-
-;; (setq x (web-vcs-redefine-face 'mode-line (setq z (face-all-attributes 'web-vcs-mode-line (selected-frame)))))
-;; (setq x (web-vcs-redefine-face 'mode-line 'web-vcs-mode-line))
-;; (setq y (web-vcs-redefine-face 'mode-line x))
-;; (describe-face 'web-vcs-mode-line)
-(defun web-vcs-redefine-face (face as-new)
- "Redefine FACE to use the attributes in AS-NEW.
-AS-NEW may be either a face or a list returned by `face-all-attributes'.
-Return an alist with old attributes."
- (let ((ret (face-all-attributes face (selected-frame)))
- (new-face-att (if (facep as-new)
- (face-all-attributes as-new (selected-frame))
- as-new))
- new-at-prop-list
- )
- (dolist (at new-face-att)
- (let ((sym (car at))
- (val (cdr at)))
- (unless (eq val 'unspecified)
- (setq new-at-prop-list (cons sym
- (cons val
- new-at-prop-list)))
- ;;(message "new=%S" new-at-prop-list)
- )))
- (apply 'set-face-attribute face (selected-frame) new-at-prop-list)
- ret
- ))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Web Autoload Define
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Helpers
-
-;;(web-vcs-file-name-as-list "/a/b/c.el")
-;;(web-vcs-file-name-as-list "a/b/c.el")
-;;(web-vcs-file-name-as-list "c:/a/b/c.el")
-;;(web-vcs-file-name-as-list ".*/a/c/")
-;;(web-vcs-file-name-as-list "[^/]*/a/c/") ;; Just avoid this.
-;;(web-vcs-file-name-as-list "\\(?:\\.\\.?\\|README\\.txt\\(?:\\.moved\\)?\\|a\\(?:lts\\|utostart\\(?:\\.elc?\\|22\\.elc?\\)\\)\\|e\\(?:macs22\\.cmd\\|tc\\)\\|nxhtml\\(?:-\\(?:base\\.elc?\\|loaddefs\\.el\\(?:\\.moved\\|c\\)?\\|web-vcs\\.el\\(?:\\.moved\\|c\\)?\\)\\|maint\\.elc?\\)?\\|related\\|tests\\|util\\|web-\\(?:autoload\\.elc?\\|vcs\\.el\\(?:\\.moved\\|c\\)?\\)\\)")
-
-(defun web-vcs-file-name-as-list (filename)
- "Split file name FILENAME into a list with file names."
- ;; We can't use the primitives since they converts \ to / and
- ;; therefore damages the reg exps. Just use our knowledge of the
- ;; internal file name representation instead.
- (split-string filename "/"))
-;; (let ((lst-name nil)
-;; (head filename)
-;; (old-head ""))
-;; (while (and (not (string= old-head head))
-;; (> (length head) 0))
-;; (let* ((file-head (directory-file-name head))
-;; (tail (file-name-nondirectory (directory-file-name head))))
-;; (setq old-head head)
-;; (setq head (file-name-directory file-head))
-;; ;; For an abs path the final tail is "", use root instead:
-;; (when (= 0 (length tail))
-;; (setq tail head))
-;; (setq lst-name (cons tail lst-name))))
-;; lst-name))
-
-;;(web-vcs-match-folderwise ".*/util/mum.el" "top/util/mum.el")
-;;(web-vcs-match-folderwise ".*/util/mu.el" "top/util/mum.el")
-;;(web-vcs-match-folderwise ".*/ut/mum.el" "top/util/mum.el")
-;;(web-vcs-match-folderwise ".*/ut../mum.el" "top/util/mum.el")
-;;(web-vcs-match-folderwise ".*/ut../mum.el" "top/util")
-;;(web-vcs-match-folderwise ".*/ut../mum.el" "top")
-;;(web-vcs-match-folderwise "top/ut../mum.el" "top")
-(defun web-vcs-match-folderwise (regex file)
- "Split REGEXP as a file path and match against FILE parts."
- ;;(message "folderwise %S %S" regex file)
- (let ((lst-regex (web-vcs-file-name-as-list regex))
- (lst-file (web-vcs-file-name-as-list file)))
- ;; Called from web-vcs-download-files for tree?
- (when (= 1 (length lst-regex))
- (setq lst-file (last lst-file))
- (message "lst-file => %S" lst-file)
- )
- (when (>= (length lst-regex) (length lst-file))
- (catch 'match
- (while lst-file
- (let ((head-file (car lst-file))
- (head-regex (car lst-regex)))
- (unless (or (= 0 (length head-file)) ;; Last /, if present, gives ""
- (string-match-p (concat "^" head-regex "$") head-file))
- (throw 'match nil)))
- (setq lst-file (cdr lst-file))
- (setq lst-regex (cdr lst-regex)))
- t))))
-
-(defun web-vcs-contains-file (dir file)
- "Return t if DIR contain FILE."
- (assert (string= dir (file-name-as-directory (expand-file-name dir))) t)
- (assert (or (string= file (file-name-as-directory (expand-file-name file)))
- (string= file (expand-file-name file))) t)
- (let ((dir-len (length dir)))
- (assert (string= "/" (substring dir (1- dir-len))))
- (when (> (length file) dir-len)
- (string= dir (substring file 0 dir-len)))))
-
-(defun web-vcs-nice-elapsed (start-time end-time)
- "Format elapsed time between START-TIME and END-TIME nicely.
-Those times should have the same format as time returned by
-`current-time'."
- (format-seconds "%h h %m m %z%s s" (float-time (time-subtract end-time start-time))))
-
-;; (web-vcs-equal-files "web-vcs.el" "temp.tmp")
-;; (web-vcs-equal-files "../.nosearch" "temp.tmp")
-(defun web-vcs-equal-files (file-a file-b)
- "Return t if files FILE-A and FILE-B are equal."
- (let* ((cmd (if (eq system-type 'windows-nt)
- (list "fc" nil nil nil
- "/B" "/OFF"
- (convert-standard-filename file-a)
- (convert-standard-filename file-b))
- (list diff-command nil nil nil
- "--binary" "-q" file-a file-b)))
- (ret (apply 'call-process cmd)))
- ;;(message "ret=%s, cmd=%S" ret cmd) (sit-for 2)
- (cond
- ((= 1 ret)
- nil)
- ((= 0 ret)
- t)
- (t
- (error "%S returned %d" cmd ret)))))
-
-(defun web-vcs-display-messages (select)
- "Display *Messages* buffer. Select its window if SELECT."
- (let ((msg-win (display-buffer "*Messages*")))
- (with-selected-window msg-win (goto-char (point-max)))
- (when select (select-window msg-win))
- msg-win))
-
-;; (web-vcs-message-with-face 'secondary-selection "I am saying: %s and %s" "Hi" "Farwell!")
-;;;###autoload
-(defun web-vcs-message-with-face (face format-string &rest args)
- "Display a colored message at the bottom of the string.
-FACE is the face to use for the message.
-FORMAT-STRING and ARGS are the same as for `message'.
-
-Also put FACE on the message in *Messages* buffer."
- (with-current-buffer "*Messages*"
- (save-restriction
- (widen)
- (let* ((start (let ((here (point)))
- (goto-char (point-max))
- (prog1
- (copy-marker
- (if (bolp) (point-max)
- (1+ (point-max))))
- (goto-char here))))
- (msg-with-face (propertize (apply 'format format-string args)
- 'face face)))
- ;; This is for the echo area:
- (message "%s" msg-with-face)
- ;; This is for the buffer:
- (when (< 0 (length msg-with-face))
- (goto-char (1- (point-max)))
- ;;(backward-char)
- ;;(unless (eolp) (goto-char (line-end-position)))
- (put-text-property start (point)
- 'face face))))))
-
-(defun web-vcs-num-moved (root)
- "Return nof files matching *.moved inside directory ROOT."
- (let* ((file-regexp ".*\\.moved$")
- (files (directory-files root t file-regexp))
- (subdirs (directory-files root t)))
- (dolist (subdir subdirs)
- (when (and (file-directory-p subdir)
- (not (or (string= "/." (substring subdir -2))
- (string= "/.." (substring subdir -3)))))
- (setq files (append files (web-vcs-rdir-get-files subdir file-regexp) nil))))
- (length files)))
-
-;; Copy of rdir-get-files in ourcomment-util.el
-(defun web-vcs-rdir-get-files (root file-regexp)
- (let ((files (directory-files root t file-regexp))
- (subdirs (directory-files root t)))
- (dolist (subdir subdirs)
- (when (and (file-directory-p subdir)
- (not (or (string= "/." (substring subdir -2))
- (string= "/.." (substring subdir -3)))))
- (setq files (append files (web-vcs-rdir-get-files subdir file-regexp) nil))))
- files))
-
-(defun web-vcs-contains-moved-files (dl-dir)
- "Return t if there are *.moved files in DL-DIR."
- (let ((num-moved (web-vcs-num-moved dl-dir)))
- (when (> num-moved 0)
- (web-vcs-message-with-face 'font-lock-warning-face
- (concat "There are %d *.moved files (probably from prev download)\n"
- "in %S.\nPlease delete them first.")
- num-moved dl-dir)
- t)))
-
-
-(defun web-vcs-set&save-option (symbol value)
- (customize-set-variable symbol value)
- (customize-set-value symbol value)
- (when (condition-case nil (custom-file) (error nil))
- (customize-mark-to-save symbol)
- (custom-save-all)
- (message "web-vcs: Saved option %s with value %s" symbol value)))
-
-(defvar web-vcs-el-this (or load-file-name
- (when (boundp 'bytecomp-filename) bytecomp-filename)
- buffer-file-name))
-
-
-(require 'bytecomp)
-(defun web-vcs-byte-compile-newer-file (el-file load)
- (let ((elc-file (byte-compile-dest-file el-file)))
- (when (or (not (file-exists-p elc-file))
- (file-newer-than-file-p el-file elc-file))
- (byte-compile-file el-file load))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Compiling
-
-;;;###autoload
-(defun web-vcs-byte-compile-file (file &optional load extra-load-path comp-dir)
- "Byte compile FILE in a new Emacs sub process.
-EXTRA-LOAD-PATH is added to the front of `load-path' during
-compilation.
-
-FILE is set to `buffer-file-name' when called interactively.
-If LOAD"
- (interactive (list (buffer-file-name)
- t))
- (when (with-no-warnings (called-interactively-p))
- (unless (eq major-mode 'emacs-lisp-mode)
- (error "Must be in emacs-lisp-mode")))
- (let* ((old-env-load-path (getenv "EMACSLOADPATH"))
- (sub-env-load-path (or old-env-load-path
- ;;(mapconcat 'identity load-path ";")))
- (mapconcat 'identity load-path path-separator)))
- ;; Fix-me: name of compile log buffer. When should it be
- ;; deleted? How do I bind it to byte-compile-file? Or do I?
- (file-buf (find-buffer-visiting file))
- (old-out-buf (get-buffer "*Compile-Log*"))
- (default-directory (or (when old-out-buf
- (with-current-buffer old-out-buf
- default-directory))
- comp-dir
- (and (boundp 'nxhtml-install-dir) nxhtml-install-dir)
- default-directory))
- (out-buf (or old-out-buf (get-buffer-create "*Compile-Log*")))
- (elc-file (byte-compile-dest-file file))
- (this-emacs-exe (locate-file invocation-name
- (list invocation-directory)
- exec-suffixes))
- (debug-on-error t)
- start)
- ;; (when (and file-buf
- ;; (buffer-modified-p file-buf))
- ;; (switch-to-buffer file-buf)
- ;; (error "Buffer must be saved first: %S" file-buf))
- (dolist (full-p extra-load-path)
- ;;(setq sub-env-load-path (concat full-p ";" sub-env-load-path)))
- (setq sub-env-load-path (concat full-p path-separator sub-env-load-path)))
- (unless (get-buffer-window out-buf (selected-frame))
- (if (string= file (buffer-file-name))
- (display-buffer out-buf)
- (unless (eq (current-buffer) out-buf)
- (switch-to-buffer out-buf))))
- (with-selected-window (get-buffer-window out-buf)
- (with-current-buffer out-buf
- (unless (local-variable-p 'web-vcs-comp-dir)
- (set (make-local-variable 'web-vcs-comp-dir) (or comp-dir default-directory)))
- (setq default-directory web-vcs-comp-dir)
- (widen)
- (goto-char (point-max))
- (when (or (= 0 (buffer-size))
- (not (derived-mode-p 'compilation-mode)))
- (insert (propertize "\nWeb VCS compilation output" 'font-lock-face 'font-lock-comment-face))
- (compilation-mode)
- (setq font-lock-verbose nil)
- (font-lock-add-keywords nil
- '(("\\" . 'compilation-info))))
- (let ((inhibit-read-only t)
- (rel-file (file-relative-name file)))
- (insert "\n\n")
- (insert "** Compile " rel-file "\n"))
- (setq start (point))
- (when (file-exists-p elc-file) (delete-file elc-file))
- (if (or (not window-system)
- (< emacs-major-version 23))
- (byte-compile-file file)
- ;;(message "web-vcs-byte-compile-file:sub-env-load-path=%s" sub-env-load-path)
- (unless (file-exists-p this-emacs-exe)
- (error "Can't find this-emacs-exe=%s" this-emacs-exe))
- (unless (stringp sub-env-load-path) (error "I did it again, sub-env-load-path=%S" sub-env-load-path))
- (setenv "EMACSLOADPATH" sub-env-load-path)
- ;; Fix-me: status
- (let* ((inhibit-read-only t)
- (ret (apply 'call-process this-emacs-exe nil out-buf t
- "-Q" "--batch"
- "--eval" "(setq debug-on-error t)"
- "--eval" "(remove-hook 'find-file-hook 'vc-find-file-hook)"
- "--file" file
- "-f" "emacs-lisp-byte-compile"
- nil)))
- ;;(insert (format "call-process returned: %s\n" ret))
- )
- (setenv "EMACSLOADPATH" old-env-load-path))
- (goto-char start)
- (while (re-search-forward "^\\([a-zA-Z0-9/\._-]+\\):[0-9]+:[0-9]+:" nil t)
- (let ((rel-file (file-relative-name file))
- (inhibit-read-only t))
- (replace-match rel-file nil nil nil 1)))
- (goto-char (point-max))))
- (when (file-exists-p elc-file)
- (when (and load window-system) (load elc-file))
- t)))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Temporary helpers, possibly included in Emacs
-
-;; Fix-me: Doing (require 'url-http) in the functions below led to
-;; that url-show-status is void. So I require it here instead.
-;;(require 'url-http)
-
-;; (setq x (web-vcs-url-retrieve-synch "http://emacswiki.org/"))
-;;;###autoload
-(defun web-vcs-url-retrieve-synch (url)
- "Retrieve URL, return cons with buffer and http status."
- (require 'url-http)
- (let* ((url-show-status nil) ;; just annoying showing status here
- (buffer (url-retrieve-synchronously url))
- (handle nil)
- (http-status nil))
- (if (not buffer)
- (error "Retrieving url %s gave no buffer" url))
- (with-current-buffer buffer
- (if (= 0 (buffer-size))
- (progn
- (kill-buffer)
- nil)
- (setq http-status (url-http-parse-response))
- (if (memq http-status '(200 201))
- (progn
- (goto-char (point-min))
- (unless (search-forward "\n\n" nil t)
- (error "Could not find header end in buffer for %s" url))
- (delete-region (point-min) (point))
- (set-buffer-modified-p nil)
- (goto-char (point-min)))
- (kill-buffer buffer)
- (setq buffer nil))))
- (cons buffer http-status)))
-
-;; Modified just to return http status
-;;;###autoload
-(defun web-vcs-url-copy-file (url newname &optional ok-if-already-exists
- keep-time preserve-uid-gid)
- "Copy URL to NEWNAME. Both args must be strings.
-Signals a `file-already-exists' error if file NEWNAME already exists,
-unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil.
-A number as third arg means request confirmation if NEWNAME already exists.
-This is what happens in interactive use with M-x.
-Fourth arg KEEP-TIME non-nil means give the new file the same
-last-modified time as the old one. (This works on only some systems.)
-Fifth arg PRESERVE-UID-GID is ignored.
-A prefix arg makes KEEP-TIME non-nil."
- (if (and (file-exists-p newname)
- (not ok-if-already-exists))
- (error "Opening output file: File already exists, %s" newname))
- (require 'url-http)
- (let ((buffer (url-retrieve-synchronously url))
- (handle nil)
- (ret nil))
- (if (not buffer)
- (error "Retrieving url %s gave no buffer" url))
- (with-current-buffer buffer
- (if (= 0 (buffer-size))
- (progn
- (kill-buffer)
- nil)
- (setq ret (url-http-parse-response))
- (setq handle (mm-dissect-buffer t))
- (mm-save-part-to-file handle newname)
- (kill-buffer buffer)
- (mm-destroy-parts handle)))
- ret))
-
-(defun web-vcs-read-and-accept-key (prompt accepted &optional reject-message help-function)
- (let ((key nil)
- rejected
- (resize-mini-windows (or resize-mini-windows t)))
- (while (not (member key accepted))
- (if (and help-function
- (or (member key help-event-list)
- (eq key ??)))
- (funcall help-function)
- (unless rejected
- (setq rejected t)
- (setq prompt (concat (or reject-message "Please answer with one of the alternatives.")
- "\n\n"
- prompt))
- (setq key (web-vcs-read-key prompt)))))
- key))
-
-(defconst web-vcs-read-key-empty-map (make-sparse-keymap))
-
-(defvar web-vcs-read-key-delay 0.01) ;Fast enough for 100Hz repeat rate, hopefully.
-
-(defun web-vcs-read-key (&optional prompt)
- "Read a key from the keyboard.
-Contrary to `read-event' this will not return a raw event but instead will
-obey the input decoding and translations usually done by `read-key-sequence'.
-So escape sequences and keyboard encoding are taken into account.
-When there's an ambiguity because the key looks like the prefix of
-some sort of escape sequence, the ambiguity is resolved via `web-vcs-read-key-delay'."
- (let ((overriding-terminal-local-map web-vcs-read-key-empty-map)
- (overriding-local-map nil)
- (old-global-map (current-global-map))
- (timer (run-with-idle-timer
- ;; Wait long enough that Emacs has the time to receive and
- ;; process all the raw events associated with the single-key.
- ;; But don't wait too long, or the user may find the delay
- ;; annoying (or keep hitting more keys which may then get
- ;; lost or misinterpreted).
- ;; This is only relevant for keys which Emacs perceives as
- ;; "prefixes", such as C-x (because of the C-x 8 map in
- ;; key-translate-table and the C-x @ map in function-key-map)
- ;; or ESC (because of terminal escape sequences in
- ;; input-decode-map).
- web-vcs-read-key-delay t
- (lambda ()
- (let ((keys (this-command-keys-vector)))
- (unless (zerop (length keys))
- ;; `keys' is non-empty, so the user has hit at least
- ;; one key; there's no point waiting any longer, even
- ;; though read-key-sequence thinks we should wait
- ;; for more input to decide how to interpret the
- ;; current input.
- (throw 'read-key keys)))))))
- (unwind-protect
- (progn
- (use-global-map web-vcs-read-key-empty-map)
- (message (concat (apply 'propertize prompt (member 'face minibuffer-prompt-properties))
- (propertize " " 'face 'cursor)))
- (aref (catch 'read-key (read-key-sequence-vector nil nil t)) 0))
- (cancel-timer timer)
- (use-global-map old-global-map))))
-
-;; End temp helpers
-;;;;;;;;;;;;;;;;;;;;;;;;
-
-;;(web-vcs-existing-files-matcher default-directory)
-(defun web-vcs-existing-files-matcher (dir)
- (let ((files-and-dirs (directory-files dir nil "[^#~]$"))
- files
- (default-directory dir))
- (dolist (df files-and-dirs)
- (unless (file-directory-p df)
- (setq files (cons df files))))
- (cons (regexp-opt files) t)))
-
-(defun web-vcs-update-existing-files (vcs base-url dl-dir this-dir)
- (let ((files-and-dirs (directory-files this-dir nil "\\(?:\\.elc\\|\\.moved\\|[^#~]\\)$"))
- files
- dirs
- (this-rel (file-relative-name this-dir dl-dir))
- file-mask)
- (when (string= "./" this-rel) (setq this-rel ""))
- (dolist (df files-and-dirs)
- (if (and (file-directory-p df)
- (not (member df '("." ".."))))
- (setq dirs (cons df dirs))
- (setq files (cons df files))))
- ;;(web-vcs-message-with-face 'hi-blue "this-rel=%S %S %S" this-rel dl-dir this-dir)
- (setq file-mask (concat this-rel (regexp-opt files)))
- ;;(web-vcs-message-with-face 'hi-blue "r=%S" file-mask)
- (web-vcs-get-missing-matching-files vcs base-url dl-dir file-mask (length files))
- (dolist (d dirs)
- (web-vcs-update-existing-files vcs base-url dl-dir
- (file-name-as-directory
- (expand-file-name d this-dir))))))
-
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Some small bits for security and just overview.
-
-(defun web-vcs-fontify-as-ps-print()
- (save-restriction
- (widen)
- (let ((start (point-min))
- (end (point-max)))
- (cond ((and (boundp 'jit-lock-mode) (symbol-value 'jit-lock-mode))
- (jit-lock-fontify-now start end))
- ;; ((and (boundp 'lazy-lock-mode) (symbol-value 'lazy-lock-mode))
- ;; (lazy-lock-fontify-region start end))
- ))))
-
-
-;;(web-vcs-get-fun-details 'describe-function)
-;;(web-vcs-get-fun-details 'require)
-;;(describe-function 'describe-function)
-(defun web-vcs-get-fun-details (function)
- (unless (symbolp function) (error "Not a symbol: %s" function))
- (unless (functionp function) (error "Not a function: %s" function))
- ;; Do as in `describe-function':
- (let* ((advised (and (symbolp function) (featurep 'advice)
- (ad-get-advice-info function)))
- ;; If the function is advised, use the symbol that has the
- ;; real definition, if that symbol is already set up.
- (real-function
- (or (and advised
- (let ((origname (cdr (assq 'origname advised))))
- (and (fboundp origname) origname)))
- function))
- ;; Get the real definition.
- (def (if (symbolp real-function)
- (symbol-function real-function)
- function))
- errtype file-name (beg "") string)
- ;; Just keep this as it is to more easily compare with `describe-function-1'.
- (setq string
- (cond ((or (stringp def)
- (vectorp def))
- "a keyboard macro")
- ((subrp def)
- (if (eq 'unevalled (cdr (subr-arity def)))
- (concat beg "special form")
- (concat beg "built-in function")))
- ((byte-code-function-p def)
- (concat beg "compiled Lisp function"))
- ((symbolp def)
- (while (and (fboundp def)
- (symbolp (symbol-function def)))
- (setq def (symbol-function def)))
- ;; Handle (defalias 'foo 'bar), where bar is undefined.
- (or (fboundp def) (setq errtype 'alias))
- (format "an alias for `%s'" def))
- ((eq (car-safe def) 'lambda)
- (concat beg "Lisp function"))
- ((eq (car-safe def) 'macro)
- "a Lisp macro")
- ((eq (car-safe def) 'autoload)
- ;;(setq file-name-auto (nth 1 def))
- ;;(setq file-name-auto (find-lisp-object-file-name function def))
- ;;(setq file-auto-noext (file-name-sans-extension file-name-auto))
- (format "%s autoloaded %s"
- (if (commandp def) "an interactive" "an")
- (if (eq (nth 4 def) 'keymap) "keymap"
- (if (nth 4 def) "Lisp macro" "Lisp function"))))
- ((keymapp def)
- (let ((is-full nil)
- (elts (cdr-safe def)))
- (while elts
- (if (char-table-p (car-safe elts))
- (setq is-full t
- elts nil))
- (setq elts (cdr-safe elts)))
- (if is-full
- "a full keymap"
- "a sparse keymap")))
- (t "")))
- (setq file-name (find-lisp-object-file-name function def))
- (list errtype advised file-name string)
- ))
-
-;; (setq next-error-function 'web-vcs-investigate-next-error)
-;; fix-me:
-;; (defvar web-vcs-investigate-header-str "Found these possible problems when reading the file:\n")
-;; (defun web-vcs-investigate-next-error (argp reset)
-;; (interactive "p")
-;; ;; Search from within the investigate output buffer
-;; (with-current-buffer
-;; ;; Choose the buffer and make it current.
-;; (if (next-error-buffer-p (current-buffer))
-;; (current-buffer)
-;; (next-error-find-buffer nil nil
-;; (lambda ()
-;; (let ((here (point)))
-;; (save-restriction
-;; (widen)
-;; (goto-char (point-min))
-;; (string= (buffer-substring-no-properties
-;; 0 (length web-vcs-investigate-header-str))
-;; web-vcs-investigate-header-str))))))
-
-;; (goto-char (cond (reset (point-min))
-;; ((< argp 0) (line-beginning-position))
-;; ((> argp 0) (line-end-position))
-;; ((point))))
-;; (occur-find-match
-;; (abs argp)
-;; (if (> 0 argp)
-;; #'previous-single-property-change
-;; #'next-single-property-change)
-;; "No more matches")
-;; ;; In case the *Occur* buffer is visible in a nonselected window.
-;; (let ((win (get-buffer-window (current-buffer) t)))
-;; (if win (set-window-point win (point))))
-;; (occur-mode-goto-occurrence)))
-
-;;(web-vcs-investigate-read "c:/emacsw32/nxhtml/nxhtml/nxhtml-autoload.el" "*Messages*")
-(defun web-vcs-investigate-read (elisp out-buf)
- "Check forms in buffer by reading it."
- (let* ((here (point))
- unsafe-eval re-fun re-var
- elisp-el-file
- (is-same-file (lambda (file)
- (when file
- (setq file (concat (file-name-sans-extension file) ".el"))
- (string= (file-truename file) elisp-el-file)))))
- (with-current-buffer elisp
- (setq elisp-el-file (when (buffer-file-name)
- (file-truename (buffer-file-name))))
- (save-restriction
- (widen)
- (web-vcs-fontify-as-ps-print)
- (goto-char (point-min))
- (while (progn
- (while (progn (skip-chars-forward " \t\n\^l")
- (looking-at ";"))
- (forward-line 1))
- (not (eobp)))
- (let* ((pos (point))
- (form (read (current-buffer)))
- (def (nth 0 form))
- (sym (and (listp form)
- (symbolp (nth 1 form))
- (nth 1 form)))
- (form-fun (and sym
- (functionp sym)
- (symbol-function sym)))
- (form-var (boundp sym))
- (safe-forms '( declare-function
- defun defmacro defsubst
- define-minor-mode define-globalized-minor-mode
- defvar defconst
- defcustom
- defface defgroup
- ;; fix-me: check if these do re-fun too:
- define-derived-mode
- define-global-minor-mode
- define-globalized-minor-mode
-
- make-local-variable make-variable-buffer-local
- provide
- require
- message))
- (safe-eval (or (memq def safe-forms)
- (and (memq def '( eval-when-compile eval-and-compile))
- (or (not (consp (nth 1 form)))
- (memq (car (nth 1 form)) safe-forms)))))
- )
- (cond
- ((not safe-eval)
- (setq unsafe-eval
- (cons (list form (copy-marker pos) (buffer-substring pos (point)))
- unsafe-eval)))
- ((and form-fun
- (memq def '( defun defmacro define-minor-mode define-globalized-minor-mode)))
- (setq re-fun (cons (cons sym pos) re-fun)))
- ((and form-var
- (memq def '( defvar defconst defcustom))
- (or (not (eq sym 'defvar))
- (< 2 (length form))))
- (setq re-var (cons sym re-var)))))))
- (goto-char here))
- (with-current-buffer out-buf
- (save-restriction
- (widen)
- (goto-char (point-max))
- (unless (bobp) (insert "\n\n"))
- (insert (propertize "Found these possible problems when reading the file:\n"
- 'font-lock-face '(:height 1.5)))
- (or unsafe-eval
- re-fun
- (insert "\n"
- "Found no problems (but there may still be)"
- "\n"))
-
- ;; Fix-me: Link
- (when unsafe-eval
- (insert "\n"
- (propertize
- (format "* Forms that are executed when loading the file (found %s):"
- (length unsafe-eval))
- 'font-lock-face '(:background "yellow" :height 1.2))
- "\n\n")
- (dolist (u (reverse unsafe-eval))
- (insert (format "Line %s\n"
- (with-current-buffer elisp
- (line-number-at-pos (marker-position (nth 1 u))))))
- ;; (insert-text-button (format "Go to form below, line %s" (marker-position (nth 1 u)))
- ;; 'font-lock-face '(compilation-info underline)
- ;; 'action
- ;; `(lambda (button)
- ;; (let* ((marker ,(nth 1 u))
- ;; (buf (marker-buffer marker)))
- ;; (switch-to-buffer-other-window buf)
- ;; (unless (and (< marker (point-max))
- ;; (> marker (point-min)))
- ;; (widen))
- ;; (goto-char marker))))
- (insert (nth 2 u) "\n\n"))
- (insert "\n"))
- (when re-fun
- (insert (propertize
- (format "\n* The file perhaps redefines these functions that are defined now (%s):\n"
- (length re-fun))
- 'font-lock-face '(:background "yellow" :height 1.2)))
- (setq re-fun (sort re-fun (lambda (a b) (string< (symbol-name (car a)) (symbol-name (car b))))))
- (let ((row 0)
- (re-fun-with-info (mapcar (lambda (fun)
- (cons fun (web-vcs-get-fun-details (car fun))))
- re-fun))
- re-fun-other-files
- (n-same 0)
- (n-web-auto 0))
- ;; Check same file
- (dolist (info re-fun-with-info)
- (let* ((file-name (nth 3 info))
- (fun (car (nth 0 info)))
- (web-auto (get fun 'web-autoload)))
- (cond ((funcall is-same-file file-name)
- (setq n-same (1+ n-same)))
- (web-auto
- (setq n-web-auto (1+ n-web-auto))
- (setq re-fun-other-files (cons info re-fun-other-files)))
- (t
- (setq re-fun-other-files (cons info re-fun-other-files))))))
-
- (when (< 0 n-same)
- (insert "\n "
- (propertize (format "%s functions alreay defined by this file (which seems ok)" n-same)
- 'font-lock-face 'web-vcs-green)
- "\n"))
-
- (dolist (info re-fun-other-files)
- (let* ((fun-rec (nth 0 info))
- (errtype (nth 1 info))
- (advised (nth 2 info))
- (file-name (nth 3 info))
- (string (nth 4 info))
- (fun (car fun-rec))
- (fun-pos (cdr fun-rec))
- (fun-web-auto (get fun 'web-autoload))
- )
- (when (= 0 (% row 5)) (insert "\n"))
- (setq row (1+ row))
- (insert " `")
- (insert-text-button (format "%s" fun)
- 'action
- `(lambda (button)
- (describe-function ',fun)))
- (insert "'")
- (insert " (" string)
- (when fun-web-auto
- (insert " autoloaded from web, ")
- (insert-text-button "info"
- 'action
- `(lambda (button)
- ;; Fix-me: maybe a bit more informative ... ;-)
- (message "%S" ',fun-web-auto))))
- (insert ")")
- (when advised (insert ", " (propertize "adviced" 'font-lock-face 'font-lock-warning-face)))
- (insert ", "
- (cond
- ((funcall is-same-file file-name)
- (propertize "defined in this file" 'font-lock-face 'web-vcs-green)
- )
- (fun-web-auto
- (if (not (web-autoload-acvtive))
- (propertize "web download not active" 'font-lock-face 'web-vcs-yellow)
- ;; See if file matches
- (let ((active-sub-url web-autoload-active-file-sub-url)
- (fun-sub-url (nth 2 fun-web-auto)))
- (setq active-sub-url (file-name-sans-extension active-sub-url))
- (if (string-match-p fun-sub-url active-sub-url)
- (propertize "web download, matches" 'font-lock-face 'web-vcs-yellow)
- (propertize "web download, doesn't matches" 'font-lock-face 'web-vcs-red)
- ))))
- (t
- (propertize "defined in other file" 'font-lock-face 'web-vcs-red))))
- (unless (funcall is-same-file file-name)
- (insert " (")
- (insert-text-button "go to new definition"
- 'action
- `(lambda (button)
- (interactive)
- (let ((m-pos ,(with-current-buffer elisp
- (copy-marker fun-pos))))
- (switch-to-buffer-other-window (marker-buffer m-pos))
- (goto-char m-pos))))
- (insert ")"))
- (insert "\n")
- )))))
- (web-vcs-investigate-output-mode)
- )))
-
-(defvar web-vcs-investigate-current-file nil)
-(make-variable-buffer-local 'web-vcs-investigate-current-file)
-(put 'web-vcs-investigate-current-file 'permanent-local t)
-
-(defun web-vcs-investigate-current-file ()
- `(,web-vcs-investigate-current-file))
-
-;; (defun web-vcs-investigate-fontification-fun (bound)
-;; ;;(compilation-error-properties (file line end-line col end-col type fmt)
-;; (while (re-search-forward "^Line \\([0-9]+\\)$" bound t)
-;; (put-text-property (match-beginning 1) (match-end 1)
-;; 'face 'highlight)
-;; (let ((line (string-to-number (match-string-no-properties 1))))
-;; (compilation-error-properties 'web-vcs-investigate-current-file line line nil nil nil nil))
-;; )
-;; nil)
-
-
-;; (defvar web-vcs-investigate-output-font-lock-keywords
-;; ;; '(("^\\*\\*\\* \\(.+\\.el\\): \\([^ \n]+\\)"
-;; ;; '(("^\\*\\*\\* \\(.+\\.el\\): \\([^ \n]+\\)"
-;; ;; (1 font-lock-function-name-face)
-;; ;; (2 font-lock-comment-face)))
-;; ;; "Keywords used to highlight a checkdoc diagnostic buffer.")
-;; nil)
-;; ;;'(("^\\(Line\\) \\([0-9]+\\)$" 1 2)))
-;; ;;'(web-vcs-investigate-fontification-fun))
-
-(defvar web-vcs-investigate-output-error-regex-alist
- '(
- ("^Line \\([0-9]+\\)$" web-vcs-investigate-current-file 1
- ;; column type
- nil 1)
- ;; Fix-me: This is just a terrible hack making the hit into a
- ;; compilation error point with # as the link and the rest as the
- ;; action for that line. And it even does not work... - Only the
- ;; first line becomes an error line. No idea why at the moment.
- ("\\(#\\)Eval the file with all" web-vcs-investigate-current-file nil nil nil 1)
- ("\\(#\\)Eval the file with just" web-vcs-investigate-current-file nil nil nil 1)
- ("\\(#\\)Eval the file with no" web-vcs-investigate-current-file nil nil nil 1)
- ))
-
-;; (defvar checkdoc-pending-errors nil
-;; "Non-nil when there are errors that have not been displayed yet.")
-
-(define-compilation-mode web-vcs-investigate-output-mode "Investigate Elisp"
- "Set up the major mode for the buffer containing the list of errors."
- (set (make-local-variable 'compilation-error-regexp-alist)
- web-vcs-investigate-output-error-regex-alist)
- ;;(set (make-local-variable 'compilation-error-face) grep-hit-face)
- ;; (set (make-local-variable 'compilation-mode-font-lock-keywords)
- ;; web-vcs-investigate-output-font-lock-keywords)
- )
-
-;; I am quite tired of doing this over and over again. Why is this not
-;; in Emacs?
-(defvar web-vcs-button-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map [tab] 'forward-button)
- (define-key map [(shift tab)] 'backward-button)
- map))
-(define-minor-mode web-vcs-button-mode
- "Just to bind `forward-button' etc"
- :lighter nil)
-
-(defvar web-vcs-eval-output-start nil)
-(make-variable-buffer-local 'web-vcs-eval-output-start)
-(defvar web-vcs-eval-output-end nil)
-(make-variable-buffer-local 'web-vcs-eval-output-end)
-
-;;(web-vcs-investigate-elisp-file)
-;;;###autoload
-(defun web-vcs-investigate-elisp-file (file-or-buffer)
- (interactive (list
- (if (derived-mode-p 'emacs-lisp-mode)
- (current-buffer)
- (read-file-name "Elisp file to check: "))))
- (let* ((elisp (if (bufferp file-or-buffer)
- file-or-buffer
- (find-file-noselect file-or-buffer)))
- (elisp-file (with-current-buffer elisp (buffer-file-name)))
- (out-buf-name "Web VCS Sec Inv")
- (out-buf (let ((old-buf (get-buffer out-buf-name)))
- (when old-buf (kill-buffer old-buf))
- (get-buffer-create out-buf-name))))
- (if (not (with-current-buffer elisp (derived-mode-p 'emacs-lisp-mode)))
- (progn
- (unless (eq (current-buffer) elisp)
- (display-buffer elisp))
- (message "Buffer %s is not in emacs-lisp-mode" (buffer-name elisp)))
- (switch-to-buffer-other-window out-buf)
- (setq web-vcs-investigate-current-file elisp-file)
- (let ((inhibit-read-only t))
- (erase-buffer)
- (setq buffer-read-only t)
- (web-vcs-button-mode 1)
- (insert (propertize "A quick look for problems" 'font-lock-face '(:height 1.5)))
- (let ((here (point)))
- (insert
- "\n"
- (propertize
- (concat "Note that this is just a quick look at the file."
- " You have to investigate the file more carefully yourself"
- " (or be sure someone else has done it for you)."
- " The following are checked for here:"
- "\n")
- 'font-lock-face font-lock-comment-face))
- (fill-region here (point)))
- (insert
- (propertize
- (concat
- "- Top level forms that might be executed when loading the file.\n"
- "- Redefinition of functions.\n")
- 'font-lock-face font-lock-comment-face))
-
- (insert "\n")
- (if elisp-file
- (progn
- (insert "File ")
- (insert-text-button elisp-file
- 'action
- `(lambda (button)
- (interactive)
- (find-file-other-window ,elisp-file))))
- (insert "Buffer ")
- (insert-text-button (buffer-name elisp)
- 'action
- `(lambda (button)
- (interactive)
- (switch-to-buffer-other-window ,elisp))))
-
- (web-vcs-investigate-read elisp out-buf)
- (when elisp-file
- (insert "\n\n\n")
- (insert (propertize "* Investigate what the file loads and redefines\n"
- 'font-lock-face '(:background "yellow" :height 1.2)))
- (let ((here (point)))
- (insert "\nIf you want to see what will actually be added to `load-history'"
- " and which functions will be defined you can"
- " load the file in a batch Emacs session"
- " and show the result here."
- " (`load-path' will be set to your current value for the loading.)"
- "\n"
- )
- (fill-region here (point))
-
- (setq here (point))
- (insert "\nYour current Emacs will not be affected by the loading,"
- " but please be aware that this does not mean your computer can not be."
- "\n"
- )
- (fill-region here (point))
-
- (insert (propertize "\n Note: Click the part after #.\n" 'font-lock-face 'italic))
- (when t ;init-file-user
- (insert " ")
- (insert-text-button "#Load the file with all your current init files"
- 'action `(lambda (button) (interactive)
- (web-vcs-investigate-eval ,elisp-file ,out-buf "--debug-init")))
- (insert "\n"))
- (when t ;(and site-run-file (not init-file-user))
- (insert " ")
- (insert-text-button "#Load the file with just your site init file (i.e. -q)"
- 'action `(lambda (button) (interactive)
- (web-vcs-investigate-eval ,elisp-file ,out-buf "-q")))
- (insert "\n"))
- (when t ;(not site-run-file)
- (insert " ")
- (insert-text-button "#Load the file with no init file (i.e. -Q)"
- 'action `(lambda (button) (interactive)
- (web-vcs-investigate-eval ,elisp-file ,out-buf "-Q")))
- (insert "\n"))
-
- (setq web-vcs-eval-output-start (point))
- (setq web-vcs-eval-output-end (point-max))
- ))
- (set-buffer-modified-p nil)
- (goto-char (point-min))))))
-
-
-;;(web-vcs-investigate-eval "c:/emacsw32/nxhtml/nxhtml/nxhtml-autoload.el" "*Messages*")
-;;(web-vcs-investigate-eval "c:/emacsw32/nxhtml/autostart.el" "*Messages*")
-(defun web-vcs-investigate-eval (elisp-file out-buf init)
- "Get compile loads when evaling buffer.
-Eval the buffer in a fresh Emacs and return the resulting
-load-history entries with comments about what is new etc."
- (let* ((emacs-exe (locate-file invocation-name
- (list invocation-directory)
- exec-suffixes))
- ;; see custom-load-symbol
- (get-lhe '(let ((lhe (or (assoc buffer-file-name load-history)
- (assoc (concat (file-name-sans-extension buffer-file-name) ".elc")
- load-history))))
- (prin1 "STARTHERE\n")
- (prin1 lhe)))
- (elisp-file-name (file-name-sans-extension (file-name-nondirectory elisp-file)))
- (elisp-el-file (file-truename (concat (file-name-sans-extension elisp-file) ".el")))
- (temp-prefix web-autoload-temp-file-prefix)
- (temp-prefix-len (length temp-prefix))
- (is-downloading (and (boundp 'web-autoload-paranoid)
- web-autoload-paranoid))
- (is-temp-file (and is-downloading
- (< (length temp-prefix) (length elisp-file-name))
- (string= temp-prefix
- (substring elisp-file-name 0 temp-prefix-len))))
- (elisp-feature-name (if is-temp-file
- (substring elisp-file-name temp-prefix-len)
- elisp-file-name))
- (is-same-file (lambda (file)
- (when file ;; self protecting
- (setq file (concat (file-name-sans-extension file) ".el"))
- (string= (file-truename file) elisp-el-file))))
- (active-sub-url (when (web-autoload-acvtive)
- (file-name-sans-extension web-autoload-active-file-sub-url)))
- whole-result
- batch-error
- result)
- (with-current-buffer out-buf
- (when web-vcs-eval-output-start
- (let ((here (point))
- (inhibit-read-only t))
- (save-restriction
- (widen)
- ;;(goto-char web-vcs-eval-output-start)
- (delete-region web-vcs-eval-output-start web-vcs-eval-output-end))
- (goto-char here))))
- ;; Fix-me: do not use temp buffer so we can check errors
- (with-temp-buffer
- (let ((old-loadpath (getenv "EMACSLOADPATH"))
- ;;(new-loadpath (mapconcat 'identity load-path ";"))
- (new-loadpath (mapconcat 'identity load-path path-separator))
- ret-val)
- (setenv new-loadpath)
- (message "Loading file in batch Emacs...")
- (setq ret-val
- (call-process emacs-exe nil
- (current-buffer)
- t "--batch"
- ;; fix-me: "-Q" - should be run in the users current environment.
- ;; init-file-user nil => -Q
- ;; site-run-file nil => -q
-
- ;; (cond
- ;; ((not init-file-user) "-Q")
- ;; ((not site-run-file) "-q")
- ;; (t "--debug-init")) ;; have to have something here...
- init
-
- "-eval" (format "(setq load-path '%S)" load-path)
- "-l" elisp-file
- elisp-file
- "-eval" (format "%S" get-lhe)))
- (message "Loading file in batch Emacs... done, returned %S" ret-val)
- (setenv old-loadpath))
- ;; Fix-me: how do you check the exit status on different platforms?
- (setq whole-result (buffer-substring-no-properties (point-min) (point-max)))
- (condition-case err
- (progn
- (goto-char (point-min))
- (search-forward "STARTHERE")
- (search-forward "(")
- (backward-char)
- (setq result (read (current-buffer))))
- (error (message "")
- ;; Process should probably have failed if we are here,
- ;; but anyway... ;-)
- (setq batch-error
- (concat "Sorry, batch Emacs failed. It returned this message:\n\n"
- whole-result
- (if is-downloading
- (concat
- "\n--------\n"
- "The error may depend on that not all needed files are yet downloaded.\n")
- "\n")))
- )))
- (with-current-buffer out-buf
- (let ((here (point))
- (inhibit-read-only t))
- (save-restriction
- (widen)
- ;;(goto-char (point-max))
- (goto-char web-vcs-eval-output-start)
- (if batch-error
- (progn
- (insert "\n\n")
- (insert (propertize batch-error 'font-lock-face 'web-vcs-red)))
- (insert (propertize (format "\n\nLoading file (%s) added to `load-history':\n\n" init)
- 'font-lock-face '(:height 1.5)))
- (insert " (\"" (car result) "\"\n")
- (dolist (e (cdr result))
- (insert (format " %S" e))
- (cond ((stringp e)) ;; Should not happen...
- ;; Variables
- ((symbolp e)
- (insert " - ")
- (insert (if (not (boundp e))
- (propertize "New" 'font-lock-face 'web-vcs-yellow)
- (let ((e-file (symbol-file e)))
- (if (funcall is-same-file e-file)
- (propertize "Same file now" 'font-lock-face 'web-vcs-green)
- (let* ((fun-web-auto (get e 'web-autoload))
- (fun-sub-url (nth 2 fun-web-auto)))
- (if (and fun-sub-url
- (string= fun-sub-url active-sub-url))
- (propertize "Web download, matches current download"
- 'font-lock-face 'web-vcs-yellow)
- (propertize (format "Loaded from %S now" e-file)
- 'font-lock-face 'web-vcs-red))))))))
- ;; provide
- ((eq (car e) 'provide)
- (insert " - ")
- (let* ((feat (car e))
- (feat-name (symbol-name feat)))
- (insert (cond
- ((not (featurep feat))
- (if (or (string= elisp-feature-name
- (symbol-name (cdr e))))
- (propertize "Web download, matches file name" 'font-lock-face 'web-vcs-green)
- (propertize "Does not match file name" 'font-lock-face 'web-vcs-red)))
- (t
- ;; symbol-file will be where it is loaded
- ;; so check load-path instead.
- (let ((file (locate-library feat-name)))
- (if (funcall is-same-file file)
- (propertize "Probably loaded from same file now" 'font-lock-face 'web-vcs-yellow)
- (propertize (format "Probably loaded from %S now" file)
- 'font-lock-face 'web-vcs-yellow))))))))
- ;; require
- ((eq (car e) 'require)
- (if (featurep (cdr e))
- (insert " - " (propertize "Loaded now" 'font-lock-face 'web-vcs-green))
- (insert " - " (propertize "Not loaded now" 'font-lock-face 'web-vcs-yellow))))
- ;; Functions
- ((memq (car e) '( defun macro))
- (insert " - ")
- (let ((fun (cdr e)))
- (insert (if (functionp fun)
- (let ((e-file (symbol-file e)))
- (if (funcall is-same-file e-file)
- (propertize "Same file now" 'font-lock-face 'web-vcs-green)
- (let* ((fun-web-auto (get fun 'web-autoload))
- (fun-sub-url (nth 2 fun-web-auto)))
- ;; Fix-me: check for temp download file.
- (if (string= fun-sub-url active-sub-url)
- (propertize "Web download, matches current download"
- 'font-lock-face 'web-vcs-yellow)
- (propertize (format "Loaded from %S now" e-file)
- 'font-lock-face 'web-vcs-yellow)))))
- ;; Note that web autoloaded functions are already defined.
- (propertize "New" 'font-lock-face 'web-vcs-yellow))))))
- (insert "\n"))
- (insert " )\n")
- (setq web-vcs-eval-output-end (point-max))
- (goto-char here))))
- (set-buffer-modified-p nil))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Specific for nXhtml
-
-;;(defvar nxhtml-web-vcs-base-url "http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/")
-(defvar nxhtml-web-vcs-base-url "http://bazaar.launchpad.net/~nxhtml/nxhtml/main/")
-
-;; Fix-me: make gen for 'lp etc
-(defun nxhtml-download-root-url (revision)
- (let* ((base-url nxhtml-web-vcs-base-url)
- (files-url (concat base-url "files/"))
- (rev-part (if revision (number-to-string revision)
- ;; "head%3A/"
- "head:/"
- )))
- (concat files-url rev-part)))
-
-(defun web-vcs-nxhtml ()
- "Install nXhtml.
-Download and install nXhtml."
- (interactive)
- (catch 'command-level
- (setq debug-on-error t)
- (let* ((this-dir (file-name-directory web-vcs-el-this))
- (root-url (nxhtml-download-root-url nil))
- ;;(files '("nxhtml-web-vcs.el" "nxhtml-base.el"))
- (files '("nxhtml-web-vcs.el"))
- (files2 (mapcar (lambda (file)
- (cons file (expand-file-name file this-dir)))
- files))
- need-dl)
- (dolist (file files2)
- (unless (file-exists-p (cdr file))
- (setq need-dl t)))
- (when need-dl
- (let ((prompt
- (concat "Welcome to install nXhtml."
- "\nFirst the nXhtml specific web install file must be downloaded."
- "\nYou will get a chance to review it before it is used."
- "\n\nDo you want to continue? "))
- (resize-mini-windows (or resize-mini-windows t)))
- (unless (y-or-n-p prompt)
- (message "Aborted")
- (throw 'command-level nil))))
- (message nil)
- (unless (get-buffer-window "*Messages*")
- (web-vcs-display-messages t)
- (delete-other-windows))
- (dolist (file files2)
- (unless (file-exists-p (cdr file))
- (web-vcs-get-missing-matching-files 'lp root-url this-dir (car file) 0)))
- (load (cdr (car files2))))
- (call-interactively 'nxhtml-setup-install)))
-
-
-(provide 'web-vcs)
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; web-vcs.el ends here
--
cgit 1.4.1
From 6c6d76608301c24973a948bb693940a003f2a747 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:53:26 +0100
Subject: Emacs: add redshank-mode and install into lisp hooks
---
emacs/init.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 46ecbdec..877e5fd3 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -831,6 +831,7 @@ Also returns nil if pid is nil."
(if (featurep 'autopair)
(autopair-mode -1))
(paredit-mode +1)
+ (redshank-mode +1)
(eldoc-add-command 'paredit-backward-delete 'paredit-close-round)
(if (featurep 'auto-indent-mode)
@@ -861,6 +862,9 @@ Also returns nil if pid is nil."
run-geiser
run-racket))
+(use-package redshank
+ :ensure t)
+
(use-package geiser-base
:defer t
:config (use-package quack))
--
cgit 1.4.1
From 5f93ac74f283ed752b66de9c7fc61815654ba5d6 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 21:57:01 +0100
Subject: Emacs: delete obsolete package-install.el
---
emacs/elisp/package-install.el | 129 -----------------------------------------
1 file changed, 129 deletions(-)
delete mode 100644 emacs/elisp/package-install.el
diff --git a/emacs/elisp/package-install.el b/emacs/elisp/package-install.el
deleted file mode 100644
index f4ac9768..00000000
--- a/emacs/elisp/package-install.el
+++ /dev/null
@@ -1,129 +0,0 @@
-;;; package-install.el --- auto-installer for package.el
-
-;; Copyright (C) 2007, 2008 Tom Tromey
-
-;; This file is not (yet) part of GNU Emacs.
-;; However, it is distributed under the same license.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;; Code:
-
-;;; We don't want to define anything global here, so no defuns or
-;;; defvars.
-
-;; Some values we need, copied from package.el, but with different
-;; names.
-(let ((my-archive-base "http://tromey.com/elpa/")
- (my-user-dir (expand-file-name "~/.emacs.d/elpa")))
-
- (require 'pp)
- (let ((download
- (lambda (url)
- (if (fboundp 'url-retrieve-synchronously)
- ;; Use URL to download.
- (let ((buffer (url-retrieve-synchronously url)))
- (save-excursion
- (set-buffer buffer)
- (goto-char (point-min))
- (re-search-forward "^$" nil 'move)
- (forward-char)
- (delete-region (point-min) (point))
- buffer))
- ;; Use wget to download.
- (save-excursion
- (with-current-buffer
- (get-buffer-create
- (generate-new-buffer-name " *Download*"))
- (shell-command (concat "wget -q -O- " url)
- (current-buffer))
- (goto-char (point-min))
- (current-buffer)))))))
-
- ;; Make the ELPA directory.
- (make-directory my-user-dir t)
-
- ;; Download package.el and put it in the user dir.
- (let ((pkg-buffer (funcall download (concat my-archive-base "package.el"))))
- (save-excursion
- (set-buffer pkg-buffer)
- (setq buffer-file-name
- (concat (file-name-as-directory my-user-dir)
- "package.el"))
- (save-buffer)
- (kill-buffer pkg-buffer)))
-
- ;; Load package.el.
- (load (expand-file-name "~/.emacs.d/elpa/package.el"))
-
- ;; Download URL package if we need it.
- (unless (fboundp 'url-retrieve-synchronously)
- ;; Note that we don't name the symbol "url-version", as that
- ;; will cause us not to define the real url-version when
- ;; url-vars is loaded, which in turn will cause errors later.
- ;; Thanks to Tom Breton for this subtlety.
- (let* ((the-version "1.15")
- (pkg-buffer (funcall download (concat my-archive-base
- "url-" the-version ".tar"))))
- (save-excursion
- (set-buffer pkg-buffer)
- (package-unpack 'url the-version)
- (kill-buffer pkg-buffer))))
-
- ;; Arrange to load package.el at startup.
- ;; Partly copied from custom-save-all.
-
-
- (let ((filename (or user-init-file
- (and (yes-or-no-p "You have no user-init-file, probably because Emacs was started with -q. Use ~/.emacs? ")
- (convert-standard-filename "~/.emacs"))))
- (magic (pp-to-string
- '(when (load (expand-file-name "~/.emacs.d/elpa/package.el"))
- (package-initialize)))))
- (if (not filename)
- (warn (concat "Cannot automatically activate package.el after reboot.\n"
- "Please append the following code to your .emacs manually:\n"
- "%s") magic)
- (let ((old-buffer (find-buffer-visiting filename)))
- (with-current-buffer (let ((find-file-visit-truename t))
- (or old-buffer (find-file-noselect filename)))
- (unless (eq major-mode 'emacs-lisp-mode)
- (emacs-lisp-mode))
- (let ((inhibit-read-only t))
- (save-excursion
- (goto-char (point-max))
- (newline (if (bolp) 2 1))
- (insert ";;; This was installed by package-install.el.\n")
- (insert ";;; This provides support for the package system and\n")
- (insert ";;; interfacing with ELPA, the package archive.\n")
- (insert ";;; Move this code earlier if you want to reference\n")
- (insert ";;; packages in your .emacs.\n")
- (insert magic)))
- (let ((file-precious-flag t))
- (save-buffer))
- (unless old-buffer
- (kill-buffer (current-buffer)))))))
-
- ;; Start the package manager.
- (package-initialize)
-
- ;; Read package archive to give the user a nice initial
- ;; experience. FIXME: this doesn't work, at least squid gave a
- ;; weird error when I tried it :(
- ;; (package-refresh-contents)
- ))
-
-;;; package-install.el ends here
--
cgit 1.4.1
From 0e2e827dd3103c3cd354048de1475f79b5ea5335 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 22:00:15 +0100
Subject: Byte-compile all the emacs files
---
install | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/install b/install
index efc03cb9..dfb8d5ff 100755
--- a/install
+++ b/install
@@ -46,8 +46,7 @@ popd
if [[ -x =emacs ]]
then
- emacs --batch -f batch-byte-compile ~/.emacs.d/init.el
- emacs --batch -f batch-byte-compile ~/.emacs.d/elisp/*.el
+ emacs --batch --eval '(batch-byte-recompile-directory 0)' ~/.emacs.d/
fi
fasd_cache=~/.zsh/cache/fasd-init-zsh
--
cgit 1.4.1
From 29f84991f8dadd33ef61b4a902db5620f76b81e3 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 18 May 2013 23:21:13 +0100
Subject: zsh: move smart_sudo alias from s to su to allow fasd to use s
---
zsh/zshrc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index 9437fcc8..938dcbd9 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -269,6 +269,7 @@ alias lsr="ls -tld *(m-2)" # mtime < -2days
alias trans="transmission-remote transmission.home"
alias bitcoin="bitcoind"
alias namecoin="~alan/applications/namecoin/src/namecoind"
+alias su="smart_sudo "
alias e="$EDITOR"
alias E="SUDO_EDITOR=\emacsclient -c -a emacs\" sudoedit"
alias aticonfig="DISPLAY=:0 \aticonfig"
@@ -344,5 +345,3 @@ _FASD_DATA="$HOME/.zsh/fasd-data"
autoload -U fasd
source ~/.zsh/cache/fasd-init-zsh
alias e="f -e $EDITOR"
-
-alias s="smart_sudo "
--
cgit 1.4.1
From a0b0e04d9f47729697eba4bb491b647bfd8d81f9 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 20 May 2013 12:44:49 +0100
Subject: Emacs: Don't call redshank-mode if redshank is not loaded
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 877e5fd3..9c17e403 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -831,7 +831,8 @@ Also returns nil if pid is nil."
(if (featurep 'autopair)
(autopair-mode -1))
(paredit-mode +1)
- (redshank-mode +1)
+ (if (featurep 'redshank)
+ (redshank-mode +1))
(eldoc-add-command 'paredit-backward-delete 'paredit-close-round)
(if (featurep 'auto-indent-mode)
--
cgit 1.4.1
From 71c88bc14e9d0c9ebbaa7f119206e71f66cd7a45 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 22 May 2013 19:30:03 +0100
Subject: Emacs: Add localhost to the list of TRAMP remotes which should not be
proxied
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 9c17e403..9d097395 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -384,6 +384,7 @@ Values: `desktop', `server', `laptop'")
tramp-shell-prompt-pattern "\\(?:^\\|
\\)[^#$%>\n]*#?[#$%>›] *\\(\\[[0-9;]*[a-zA-Z] *\\)*")
(add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" (concat "/" tramp-default-method ":%h:")))
(add-to-list 'tramp-default-proxies-alist '((regexp-quote (system-name)) nil nil))
+ (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil))
(add-to-list 'tramp-default-proxies-alist '("router" nil nil))))
(use-package tramp-sh
--
cgit 1.4.1
From 7dc707c8c32b972ed505f16a3bb1f865766003b5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 22 May 2013 19:30:56 +0100
Subject: Emacs: bind d in mu4e headers to mark for delete instead of for trash
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 9d097395..d5c9cb1b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -276,7 +276,8 @@ Values: `desktop', `server', `laptop'")
mu4e-sent-folder "/alanpearce/Sent"
mu4e-drafts-folder "/alanpearce/Drafts"
mu4e-refile-folder "/alanpearce/Archive")
- (define-key mu4e-main-mode-map "q" #'bury-buffer)))
+ (bind-key "q" #'bury-buffer mu4e-main-mode-map)
+ (bind-key "d" #'mu4e-headers-mark-for-delete mu4e-headers-mode-map)))
;;;; Completion
--
cgit 1.4.1
From f3f77f580bd9d0ebcf49fb471e1913a26ac2f7e8 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 24 May 2013 10:51:42 +0100
Subject: Emacs: only enable moz-minor-mode in javascript if loaded
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index d5c9cb1b..77f12c2a 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -992,7 +992,8 @@ Works with: arglist-cont-nonempty, arglist-close."
:mode ("\\.js\\'" . js3-mode)
:config (progn
(defun ap/javascript-setup ()
- (moz-minor-mode t)
+ (if (featurep 'moz)
+ (moz-minor-mode t))
(autopair-mode -1)
(auto-indent-mode -t))
(add-hook 'js3-mode-hook #'ap/javascript-setup)
--
cgit 1.4.1
From 7d03c01ed268d7dccd5dc74fa62ab44cb74b133d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 24 May 2013 10:52:06 +0100
Subject: Emacs: fix typo in javascript setup
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 77f12c2a..e9e3d38a 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -995,7 +995,7 @@ Works with: arglist-cont-nonempty, arglist-close."
(if (featurep 'moz)
(moz-minor-mode t))
(autopair-mode -1)
- (auto-indent-mode -t))
+ (auto-indent-mode -1))
(add-hook 'js3-mode-hook #'ap/javascript-setup)
(setq js3-indent-level 4
js3-expr-indent-offset 4
--
cgit 1.4.1
From 7a7f3c1caab84d65b051b593a69b349ea4442a9b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 24 May 2013 10:52:24 +0100
Subject: Emacs: setup javascript indentation rules
---
emacs/init.el | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index e9e3d38a..d17031b4 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -998,10 +998,8 @@ Works with: arglist-cont-nonempty, arglist-close."
(auto-indent-mode -1))
(add-hook 'js3-mode-hook #'ap/javascript-setup)
(setq js3-indent-level 4
- js3-expr-indent-offset 4
- js3-paren-indent-offset 4
- js3-square-indent-offset 4
- js3-curly-indent-offset 4)))
+ js3-indent-tabs-mode t
+ js3-global-externs '("$"))))
(use-package mustache-mode
:ensure t
--
cgit 1.4.1
From b19e6b7177b67fdd15fd306a47754a313068a6df Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 25 May 2013 17:26:36 +0100
Subject: Emacs: turn on ido-mode instead of toggling
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index d17031b4..b6e20b31 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -474,7 +474,7 @@ Values: `desktop', `server', `laptop'")
:init (bind-key* "C-x C-f" #'ido-find-file)
:bind (("C-x b" . ido-switch-buffer))
:config (progn
- (ido-mode)
+ (ido-mode 1)
(setq ido-decorations (quote ("\n›" "" "\n " "\n …" "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
(setq ido-auto-merge-delay-time 99999
ido-enable-flex-matching t)
--
cgit 1.4.1
From 298e9d8b43006588d3a4f1ecbcfaf48d9df42af0 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 27 May 2013 14:32:08 +0100
Subject: Emacs: add use-package declarations to Imenu when in elisp
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index b6e20b31..7dc6e42f 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -880,7 +880,8 @@ Also returns nil if pid is nil."
(defun imenu-elisp-sections ()
(setq imenu-prev-index-position-function nil)
- (add-to-list 'imenu-generic-expression '("Sections" "^;;;; \\(.+\\)$" 1) t))
+ (add-to-list 'imenu-generic-expression '("Sections" "^;;;; \\(.+\\)$" 1) t)
+ (add-to-list 'imenu-generic-expression '("Packages" "^(use-package\\s-+\\(\\(\\sw\\|\\s_\\)+\\)$" 1) t))
(defun init-narrow-to-section ()
(interactive)
--
cgit 1.4.1
From d46e831026aeff0f6577edab0a3accfbecc68d0b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 27 May 2013 14:32:28 +0100
Subject: Emacs: always disable C-z
---
emacs/init.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 7dc6e42f..033ab4ed 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -438,8 +438,7 @@ Values: `desktop', `server', `laptop'")
(bind-key "" #'execute-extended-command)
-(if (display-graphic-p)
- (unbind-key "C-z"))
+(unbind-key "C-z")
(bind-key "C-" #'other-window)
(bind-key "C-x C-r" #'revert-buffer)
--
cgit 1.4.1
From 83923895305252c639019ffa2e0270f5cc54f614 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 28 May 2013 19:09:11 +0100
Subject: Emacs: make shell-execute work when buffer is not visiting a file
---
emacs/elisp/ap-functions.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/emacs/elisp/ap-functions.el b/emacs/elisp/ap-functions.el
index d9278fa0..b6994643 100644
--- a/emacs/elisp/ap-functions.el
+++ b/emacs/elisp/ap-functions.el
@@ -39,6 +39,8 @@
;;;###autoload
(defun shell-execute ()
(interactive)
- (let ((file-buffer (or (file-name-nondirectory (buffer-file-name)) ""))
+ (let ((file-buffer (if (buffer-file-name)
+ (file-name-nondirectory (buffer-file-name))
+ ""))
(command (read-shell-command "Shell command: " nil nil nil)))
(shell-command (replace-regexp-in-string "%" file-buffer command))))
--
cgit 1.4.1
From 833cdbc654cc90cb9c922fe80a9d9dcfb635e6e2 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 28 May 2013 19:44:06 +0100
Subject: Emacs: use em-smart package to return to previous command in eshell
sessions
---
emacs/init.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 033ab4ed..502a1ec2 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -712,7 +712,14 @@ Also returns nil if pid is nil."
(use-package eshell
:defer t
- :config (setq eshell-directory-name "~/.emacs.d/eshell"))
+ :config (progn
+ (setq eshell-directory-name "~/.emacs.d/eshell")
+ (use-package em-smart
+ :init (progn
+ (setq eshell-where-to-jump 'begin
+ eshell-review-quick-commands nil
+ eshell-smart-space-goes-to-end t)
+ (eshell-smart-initialize)))))
(use-package shell
:defer t
--
cgit 1.4.1
From 018c54df934153322f82b1c1c500dce00c83979f Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 28 May 2013 21:01:30 +0100
Subject: Emacs: move calendar setup to new ‘Dates & Times’ section
---
emacs/init.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 502a1ec2..30b4e6b6 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -298,6 +298,14 @@ Values: `desktop', `server', `laptop'")
:init (progn
(add-hook 'prog-mode-hook #'company-mode)))
+;;;; Dates & Times
+
+(use-package calendar
+ :defer t
+ :config (progn
+ (setq calendar-week-start-day 1)
+ (calendar-set-date-style 'iso)))
+
;;;; Directory browsing
(use-package dired
:defer t
@@ -533,12 +541,6 @@ Values: `desktop', `server', `laptop'")
;;;; Planning
-(use-package calendar
- :defer t
- :config (progn
- (setq calendar-week-start-day 1)
- (calendar-set-date-style 'iso)))
-
(use-package org
:bind (("C-c C-a" . org-agenda-list)
("C-c a" . org-agenda)
--
cgit 1.4.1
From ea157ffc4382057bd3f2e924e80866ebd2fd33d7 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 28 May 2013 21:05:51 +0100
Subject: Emacs: add command to insert a formatted date
---
emacs/init.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 30b4e6b6..4941e36b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -306,6 +306,16 @@ Values: `desktop', `server', `laptop'")
(setq calendar-week-start-day 1)
(calendar-set-date-style 'iso)))
+(defun insert-date (prefix)
+ "Insert the current date. With prefix-argument, use British format. With
+ two prefix arguments, write out the day and month name."
+ (interactive "P")
+ (let ((format (cond
+ ((not prefix) "%Y-%m-%d")
+ ((equal prefix '(4)) "%d/%m/%Y")
+ ((equal prefix '(16)) "%A, %d %B %Y"))))
+ (insert (format-time-string format))))
+
;;;; Directory browsing
(use-package dired
:defer t
--
cgit 1.4.1
From f59f31505c64291c7f247fcfded0ba8ff3c513b5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 28 May 2013 21:21:04 +0100
Subject: Emacs: add register bindings for emacs init file and organiser.org
---
emacs/init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 4941e36b..13833c27 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -465,6 +465,8 @@ Values: `desktop', `server', `laptop'")
(bind-key "C-c i" #'ucs-insert)
+(set-register ?e `(file . ,user-init-file))
+
;; Enable narrowing functions C-x n
(put 'narrow-to-defun 'disabled nil)
(put 'narrow-to-page 'disabled nil)
@@ -596,6 +598,7 @@ Values: `desktop', `server', `laptop'")
org-todo-keywords '((sequence "TODO" "STARTED" "|" "DONE")
(sequence "TOLEARN" "LEARNING" "LEARNED" "|" "MASTERED")
(sequence "|" "CANCELLED")))
+ (set-register ?o `(file . ,(expand-file-name "organiser.org" org-directory)))
(defadvice org-clock-in (after wicked activate)
"Mark STARTED when clocked in"
(save-excursion
--
cgit 1.4.1
From f40ae73f2968e4b5343741839fe5af7b10f903a0 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 28 May 2013 21:21:55 +0100
Subject: Emacs: change goto-last-change binding to C-x to avoid
conflicting with pop-global-mark
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 13833c27..95363eba 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -799,7 +799,7 @@ Also returns nil if pid is nil."
:bind ("C-M-SPC" . er/expand-region))
(use-package goto-chg
- :bind ("C-x C-SPC" . goto-last-change))
+ :bind ("C-x SPC" . goto-last-change))
(use-package multiple-cursors
:ensure t
--
cgit 1.4.1
From adcfe2752fa9a229953256c32c68f67d28f0aaf2 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 30 May 2013 15:07:41 +0100
Subject: Emacs: replace js3-mode with js2-mode
---
emacs/init.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 95363eba..0fafe5fb 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1010,18 +1010,18 @@ Works with: arglist-cont-nonempty, arglist-close."
(comint-send-string (inferior-moz-process)
"BrowserReload();"))))
-(use-package js3
- :mode ("\\.js\\'" . js3-mode)
+(use-package js2
+ :ensure t
+ :mode ("\\.js\\'" . js2-mode)
:config (progn
(defun ap/javascript-setup ()
(if (featurep 'moz)
(moz-minor-mode t))
(autopair-mode -1)
(auto-indent-mode -1))
- (add-hook 'js3-mode-hook #'ap/javascript-setup)
- (setq js3-indent-level 4
- js3-indent-tabs-mode t
- js3-global-externs '("$"))))
+ (add-hook 'js2-mode-hook #'ap/javascript-setup)
+ (setq js2-basic-offset 4
+ js2-global-externs '("$"))))
(use-package mustache-mode
:ensure t
--
cgit 1.4.1
From fa74d8eea2244394882fe05f0add8874a44ae5ba Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 30 May 2013 15:10:25 +0100
Subject: Emacs: install and skewer-mode and hook into js2-mode
---
emacs/init.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 0fafe5fb..1b43f143 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1008,6 +1008,8 @@ Works with: arglist-cont-nonempty, arglist-close."
"Reload Firefox"
(interactive)
(comint-send-string (inferior-moz-process)
+(use-package skewer-mode
+ :ensure t)
"BrowserReload();"))))
(use-package js2
@@ -1016,6 +1018,8 @@ Works with: arglist-cont-nonempty, arglist-close."
:config (progn
(defun ap/javascript-setup ()
(if (featurep 'moz)
+ (if (featurep 'skewer-mode)
+ (skewer-mode +1))
(moz-minor-mode t))
(autopair-mode -1)
(auto-indent-mode -1))
--
cgit 1.4.1
From 0189acaf9bb17d8c70c4187ae3c700a7d491d4e1 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 30 May 2013 15:21:12 +0100
Subject: Emacs: fix bad diff
---
emacs/init.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 1b43f143..491a570f 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1007,10 +1007,10 @@ Works with: arglist-cont-nonempty, arglist-close."
(defun moz-firefox-reload ()
"Reload Firefox"
(interactive)
- (comint-send-string (inferior-moz-process)
+ (comint-send-string (inferior-moz-process) "BrowserReload();"))))
+
(use-package skewer-mode
:ensure t)
- "BrowserReload();"))))
(use-package js2
:ensure t
--
cgit 1.4.1
From 333dd7930ef9e79fd76e8b6ec9157b9d0c5bd52d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 30 May 2013 15:21:28 +0100
Subject: Emacs: fix incorrect package name for js2-mode
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 491a570f..fdd288ad 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1012,7 +1012,7 @@ Works with: arglist-cont-nonempty, arglist-close."
(use-package skewer-mode
:ensure t)
-(use-package js2
+(use-package js2-mode
:ensure t
:mode ("\\.js\\'" . js2-mode)
:config (progn
--
cgit 1.4.1
From 693a2104ef68de2146d074fc47691c4ffdb8dd38 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 30 May 2013 15:23:42 +0100
Subject: Emacs: fix bad diff again
---
emacs/init.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index fdd288ad..5c1f4969 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1017,10 +1017,10 @@ Works with: arglist-cont-nonempty, arglist-close."
:mode ("\\.js\\'" . js2-mode)
:config (progn
(defun ap/javascript-setup ()
- (if (featurep 'moz)
- (if (featurep 'skewer-mode)
+ (if (featurep 'moz)
+ (moz-minor-mode))
+ (if (featurep 'skewer-mode)
(skewer-mode +1))
- (moz-minor-mode t))
(autopair-mode -1)
(auto-indent-mode -1))
(add-hook 'js2-mode-hook #'ap/javascript-setup)
--
cgit 1.4.1
From 2b5aca224fcdc119e5fe0f8b7c5c277aecd3daab Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 31 May 2013 19:43:00 +0100
Subject: Emacs: rename deprecated org-alphabetical-lists variable
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 5c1f4969..7eb05bec 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -582,7 +582,7 @@ Values: `desktop', `server', `laptop'")
;; Allow refiling into any org file
org-refile-targets '((org-agenda-files :maxlevel . 3))
- org-alphabetical-lists t
+ org-list-allow-alphabetical t
org-pretty-entities t
--
cgit 1.4.1
From e328a3a136377f0ccf5d56ee5ddfbc259f999f92 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 1 Jun 2013 14:30:22 +0100
Subject: Installer: Fix directory stack popping too early
---
install | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/install b/install
index dfb8d5ff..fef5b4e9 100755
--- a/install
+++ b/install
@@ -42,8 +42,6 @@ then
install-dot projects/dwm/ dotfiles/dwm/*
fi
-popd
-
if [[ -x =emacs ]]
then
emacs --batch --eval '(batch-byte-recompile-directory 0)' ~/.emacs.d/
@@ -74,3 +72,5 @@ zrecompile -p -R ~/.zshrc.zwc $zfiles
for fp in zsh/functions/*(/); do
zrecompile -p $fp $fp/*
done
+
+popd
--
cgit 1.4.1
From 10353603cc72f37034b86071f9c495d866dafeaf Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 1 Jun 2013 14:36:15 +0100
Subject: Installer: Fix FreeBSD detection
---
install | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install b/install
index fef5b4e9..8d6ae180 100755
--- a/install
+++ b/install
@@ -63,7 +63,7 @@ zfiles=(
if [[ -e /usr/bin/emerge ]]; then
zfiles+=zsh/zshrc_gentoo
fi
-if [[ $OSTYPE == freebsd ]]; then
+if [[ $OSTYPE == freebsd* ]]; then
zfiles+=zsh/zshrc_freebsd
fi
--
cgit 1.4.1
From d87f35f675e774bcab14db580795ebbc9c86d5d4 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 1 Jun 2013 14:39:28 +0100
Subject: Installer: Fix relative paths
---
install | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/install b/install
index 8d6ae180..0fa5859e 100755
--- a/install
+++ b/install
@@ -48,28 +48,28 @@ then
fi
fasd_cache=~/.zsh/cache/fasd-init-zsh
-if [[ ! -s "$fasd_cache" || zsh/functions/fasd -nt "$fasd_cache" ]]; then
- zsh/functions/fasd/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
+if [[ ! -s "$fasd_cache" || dotfiles/zsh/functions/fasd -nt "$fasd_cache" ]]; then
+ dotfiles/zsh/functions/fasd/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
fi
autoload -U zrecompile
local -a zfiles
zfiles=(
- zsh/functions/fasd/fasd
+ dotfiles/zsh/functions/fasd/fasd
$fasd_cache
- zsh/zshrc
- zsh/zshrc_${HOST%%.*}
+ dotfiles/zsh/zshrc
+ dotfiles/zsh/zshrc_${HOST%%.*}
)
if [[ -e /usr/bin/emerge ]]; then
- zfiles+=zsh/zshrc_gentoo
+ zfiles+=dotfiles/zsh/zshrc_gentoo
fi
if [[ $OSTYPE == freebsd* ]]; then
- zfiles+=zsh/zshrc_freebsd
+ zfiles+=dotfiles/zsh/zshrc_freebsd
fi
zrecompile -p -R ~/.zshrc.zwc $zfiles
-for fp in zsh/functions/*(/); do
+for fp in dotfiles/zsh/functions/*(/); do
zrecompile -p $fp $fp/*
done
--
cgit 1.4.1
From 70a4bc8fb2620ed7cec9ab21626733dfaf952272 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 1 Jun 2013 16:08:12 +0100
Subject: Emacs: make company overlay display more quickly
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 7eb05bec..1c224b43 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -296,7 +296,8 @@ Values: `desktop', `server', `laptop'")
:commands (company-mode)
:bind (("C-" . company-complete))
:init (progn
- (add-hook 'prog-mode-hook #'company-mode)))
+ (add-hook 'prog-mode-hook #'company-mode)
+ (setq company-idle-delay .3)))
;;;; Dates & Times
--
cgit 1.4.1
From e89e6343160ae694fdf51feaac7e2531c83de5c2 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 2 Jun 2013 10:50:05 +0100
Subject: Emacs: use *init-file* to track the location of init.el through
symlinks
---
emacs/init.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 1c224b43..f880cb3b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -41,6 +41,9 @@ Values: `desktop', `server', `laptop'")
(interactive)
(setq env/location (env/get-location)))
+(defvar *init-file* (expand-file-name "init.el" (file-name-directory (file-truename user-init-file)))
+ "Where the emacs init file really is, passing through symlinks.")
+
;;;; Package Management
(eval-and-compile
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
@@ -466,7 +469,7 @@ Values: `desktop', `server', `laptop'")
(bind-key "C-c i" #'ucs-insert)
-(set-register ?e `(file . ,user-init-file))
+(set-register ?e `(file . ,*init-file*))
;; Enable narrowing functions C-x n
(put 'narrow-to-defun 'disabled nil)
@@ -919,7 +922,7 @@ Also returns nil if pid is nil."
(defun init-imenu (p)
(interactive "P")
- (find-file-existing "~/dotfiles/emacs/init.el")
+ (find-file-existing *init-file*)
(widen)
(helm-imenu)
(if p (init-narrow-to-section)))
--
cgit 1.4.1
From f9e008b9fa277dad7e412f74b563951187f7f003 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 2 Jun 2013 11:05:02 +0100
Subject: Emacs: enable auto-indent-mode in lisps and set its indent level to 2
---
emacs/init.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index f880cb3b..0df2b1f1 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -863,8 +863,8 @@ Also returns nil if pid is nil."
(eldoc-add-command 'paredit-backward-delete 'paredit-close-round)
(if (featurep 'auto-indent-mode)
- (progn (auto-indent-mode -1)
- (setq lisp-body-indent 2)))
+ (progn (set (make-local-variable 'auto-indent-assign-indent-level) 2)
+ (auto-indent-mode +1)))
(show-paren-mode t)
(setq indent-tabs-mode nil)
--
cgit 1.4.1
From c9f6f4efd9963a5037253e5f51be59f67ac096dd Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 2 Jun 2013 11:09:54 +0100
Subject: Emacs: install multi-term if it is not available
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 0df2b1f1..6c972190 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -746,6 +746,7 @@ Also returns nil if pid is nil."
(kbd "C-d") 'comint-delchar-or-eof-or-kill-buffer))
(use-package multi-term
+ :ensure t
:if (not (eq system-type 'windows-nt))
:bind ("C-`" . multi-term-dedicated-toggle))
--
cgit 1.4.1
From 9e7d9adf4d10dc9437f30eb7bd49f21bb904a05b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 2 Jun 2013 12:28:31 +0100
Subject: Emacs: make helm update the candidate selection window more quickly
---
emacs/init.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 6c972190..b00aac48 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -491,7 +491,9 @@ Values: `desktop', `server', `laptop'")
(use-package helm-config
:ensure helm
:bind (("C-x i" . helm-imenu)
- ("C-x C-b" . helm-mini)))
+ ("C-x C-b" . helm-mini))
+ :config (setq helm-idle-delay .1
+ helm-input-idle-delay .1))
(use-package ido
:init (bind-key* "C-x C-f" #'ido-find-file)
--
cgit 1.4.1
From 954a691139a1756af64e2db7091c6ea66cb92fe9 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 2 Jun 2013 20:19:34 +0100
Subject: Emacs: add keyboard binding for switching to eshell
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index b00aac48..e88c9233 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -732,6 +732,7 @@ Also returns nil if pid is nil."
;;;; Shells & REPLs
(use-package eshell
+ :bind ("C-c s" . eshell)
:defer t
:config (progn
(setq eshell-directory-name "~/.emacs.d/eshell")
--
cgit 1.4.1
From 6ce4aa99a7ea9a7996b971e38c83a56e4bab82af Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 2 Jun 2013 20:20:17 +0100
Subject: Emacs: add function and keybinding for opening eshell in the current
directory
---
emacs/init.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index e88c9233..96d105e5 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -743,6 +743,13 @@ Also returns nil if pid is nil."
eshell-smart-space-goes-to-end t)
(eshell-smart-initialize)))))
+(defun eshell-goto-current-dir (&optional arg)
+ (interactive "P")
+ (let ((dir default-directory))
+ (eshell arg)
+ (eshell/cd dir)))
+(bind-key "C-c S" #'eshell-goto-current-dir)
+
(use-package shell
:defer t
:config (define-key shell-mode-map
--
cgit 1.4.1
From 089fc46ad23ad12b9be83705b10121750c325f08 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 2 Jun 2013 20:21:43 +0100
Subject: Emacs: Improve X11 clipboard interoperability
---
emacs/init.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 96d105e5..973b94a2 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -774,6 +774,10 @@ Also returns nil if pid is nil."
(setq sentence-end-double-space nil
line-move-visual nil)
+(setq x-select-enable-clipboard t)
+(if (functionp 'x-cut-buffer-or-selection-value)
+ (setq interprogram-paste-function 'x-cut-buffer-or-selection-value))
+
;; replace highlighted text rather than just inserting at point
(delete-selection-mode t)
--
cgit 1.4.1
From 95ccf32f4ab3f8bc42582093d711a61f8c988f3d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 2 Jun 2013 20:24:13 +0100
Subject: Emacs: Bind shift+space to set the mark
---
emacs/init.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 973b94a2..5a93632d 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -781,6 +781,8 @@ Also returns nil if pid is nil."
;; replace highlighted text rather than just inserting at point
(delete-selection-mode t)
+(bind-key "S-SPC" #'set-mark-command)
+
(use-package subword
:init (global-subword-mode t))
--
cgit 1.4.1
From e4760e1c9358c48887ff47f5a4b28ebc30328471 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 3 Jun 2013 21:37:01 +0100
Subject: Emacs: disable CEDET configuration until I figure out how to update
it again
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 5a93632d..65a2501e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -617,7 +617,7 @@ Values: `desktop', `server', `laptop'")
;;;; Programming
(use-package cedet
- :defer t
+ :disabled t
:config (progn
(semantic-load-enable-code-helpers)
(global-semantic-idle-completions-mode t)
--
cgit 1.4.1
From 840c6f683c5fa5f41b95d254e3a87aa245630160 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Jun 2013 13:34:44 +0100
Subject: Emacs: add lisp-common-mode-hook to allow cleaner setup of Lisp modes
---
emacs/init.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 65a2501e..6a370309 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -9,6 +9,12 @@
user-full-name "Alan Pearce"
custom-file "~/.emacs.d/custom.el")
+;;; Allow lisps to use a common setup. I don't know why they don't have some lispy mode as their parent, but this is close enough
+(defcustom lisp-common-mode-hook nil
+ "Hook run when entering any Lisp mode."
+ :type 'hook
+ :group 'lisp)
+
;;;; Environment & Location
(defun env/get-location ()
--
cgit 1.4.1
From c69634f046284580989ae7c7cd6705bbd0f2b243 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Jun 2013 13:46:11 +0100
Subject: Emacs: migrate expressions from ap/lisp-setup to
lisp-common-mode-hook where possible
---
emacs/init.el | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 6a370309..641cdc29 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -446,7 +446,10 @@ Values: `desktop', `server', `laptop'")
auto-indent-backward-delete-char-behavior nil
auto-indent-delete-trailing-whitespace-on-save-file t
auto-indent-mode-untabify-on-yank-or-paste nil)
- (auto-indent-global-mode)))
+ (auto-indent-global-mode)
+ (defun lisp-auto-indent-mode ()
+ (set (make-local-variable 'auto-indent-assign-indent-level) 2))
+ (add-hook 'lisp-common-mode-hook #'lisp-auto-indent-mode)))
(use-package smart-tabs-mode
:ensure t
@@ -815,9 +818,13 @@ Also returns nil if pid is nil."
(use-package autopair
:ensure t
- :commands (autopair-mode)
+ :commands (autopair-mode
+ autopair-on)
:init (progn
- (add-hook 'prog-mode-hook #'autopair-mode)
+ (add-hook 'prog-mode-hook #'autopair-on)
+ (defun autopair-off ()
+ (autopair-mode -1))
+ (add-hook 'lisp-common-mode-hook #'autopair-off)
(setq autopair-blink nil
autopair-skip-whitespace nil)))
@@ -836,10 +843,16 @@ Also returns nil if pid is nil."
("C-" . mc/mark-more-like-this-extended)
("C-S-L" . mc/edit-lines)))
+(use-package eldoc
+ :defuns (eldoc-add-command)
+ :config (progn
+ (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)))
+
(use-package paredit
:ensure t
:commands (paredit-mode)
:init (progn
+ (add-hook 'lisp-common-mode-hook #'enable-paredit-mode)
(put #'paredit-forward-delete 'delete-selection 'supersede)
(put #'paredit-backward-delete 'delete-selection 'supersede)
(add-hook 'minibuffer-setup-hook #'conditionally-enable-paredit-mode)
@@ -878,17 +891,7 @@ Also returns nil if pid is nil."
;;;; Lisps
(defun ap/lisp-setup ()
- (if (featurep 'autopair)
- (autopair-mode -1))
- (paredit-mode +1)
- (if (featurep 'redshank)
- (redshank-mode +1))
- (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)
-
- (if (featurep 'auto-indent-mode)
- (progn (set (make-local-variable 'auto-indent-assign-indent-level) 2)
- (auto-indent-mode +1)))
-
+ (run-hooks 'lisp-common-mode-hook)
(show-paren-mode t)
(setq indent-tabs-mode nil)
(local-set-key (kbd "RET") #'paredit-newline))
@@ -914,7 +917,9 @@ Also returns nil if pid is nil."
run-racket))
(use-package redshank
- :ensure t)
+ :ensure t
+ :init (progn
+ (add-hook 'lisp-common-mode-hook #'turn-on-redshank-mode)))
(use-package geiser-base
:defer t
--
cgit 1.4.1
From 34bb5369da5ed09c712131e9b076db949f208e7e Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Jun 2013 13:54:04 +0100
Subject: Emacs: globally highlight matching parentheses
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 641cdc29..1b335436 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -790,6 +790,8 @@ Also returns nil if pid is nil."
;; replace highlighted text rather than just inserting at point
(delete-selection-mode t)
+(show-paren-mode t)
+
(bind-key "S-SPC" #'set-mark-command)
(use-package subword
@@ -892,7 +894,6 @@ Also returns nil if pid is nil."
(defun ap/lisp-setup ()
(run-hooks 'lisp-common-mode-hook)
- (show-paren-mode t)
(setq indent-tabs-mode nil)
(local-set-key (kbd "RET") #'paredit-newline))
--
cgit 1.4.1
From 67c1c83f61eaf206ccbb0bd939a81dfa54ac109e Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Jun 2013 13:54:32 +0100
Subject: Emacs: remove redundant :defer specifications
---
emacs/init.el | 2 --
1 file changed, 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 1b335436..c3a7743b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -434,7 +434,6 @@ Values: `desktop', `server', `laptop'")
tab-always-indent 'complete)
(use-package auto-indent-mode
- :defer t
:ensure t
:commands (auto-indent-minor-mode
auto-indent-mode)
@@ -911,7 +910,6 @@ Also returns nil if pid is nil."
:diminish elisp-slime-nav-mode)
(use-package geiser
- :defer t
:commands (geiser-mode
geiser
run-geiser
--
cgit 1.4.1
From 1684ef963ebee889ed76dede11807882b588bba6 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Jun 2013 14:04:41 +0100
Subject: Emacs: delay loading skewer until needed
---
emacs/init.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index c3a7743b..141ad58a 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1041,7 +1041,12 @@ Works with: arglist-cont-nonempty, arglist-close."
(comint-send-string (inferior-moz-process) "BrowserReload();"))))
(use-package skewer-mode
- :ensure t)
+ :ensure t
+ :defer t
+ :init (progn
+ (add-hook 'js2-mode-hook #'skewer-mode)
+ (add-hook 'html-mode-hook #'skewer-html-mode)
+ (add-hook 'css-mode-hook #'skewer-css-mode)))
(use-package js2-mode
:ensure t
@@ -1050,8 +1055,6 @@ Works with: arglist-cont-nonempty, arglist-close."
(defun ap/javascript-setup ()
(if (featurep 'moz)
(moz-minor-mode))
- (if (featurep 'skewer-mode)
- (skewer-mode +1))
(autopair-mode -1)
(auto-indent-mode -1))
(add-hook 'js2-mode-hook #'ap/javascript-setup)
--
cgit 1.4.1
From 82e8081c4c9f04a8f1e65b0d410becee6982c17f Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Jun 2013 14:04:57 +0100
Subject: Emacs: delay loading quickrun until needed
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 141ad58a..747bfa0a 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1017,6 +1017,7 @@ Works with: arglist-cont-nonempty, arglist-close."
(current-column))))))))))
(use-package quickrun
+ :defer t
:ensure t)
;;;; Web Development
--
cgit 1.4.1
From 8b00c6e89dfc49c1d8f1016b28c0199b40d8b75a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Jun 2013 14:06:41 +0100
Subject: Emacs: delay loading eldoc until needed
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 747bfa0a..0a68bc3b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -845,7 +845,7 @@ Also returns nil if pid is nil."
("C-S-L" . mc/edit-lines)))
(use-package eldoc
- :defuns (eldoc-add-command)
+ :defer t
:config (progn
(eldoc-add-command 'paredit-backward-delete 'paredit-close-round)))
--
cgit 1.4.1
From cd607bf68816e6322f56c89b11c04aa77058db30 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Jun 2013 14:07:53 +0100
Subject: Emacs: delay loading redshank until needed
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 0a68bc3b..001dbb64 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -917,6 +917,7 @@ Also returns nil if pid is nil."
(use-package redshank
:ensure t
+ :defer t
:init (progn
(add-hook 'lisp-common-mode-hook #'turn-on-redshank-mode)))
--
cgit 1.4.1
From e08c19b54fe61fe787d2129cc97d469e0d36962a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 11 Jun 2013 21:31:35 +0100
Subject: Emacs: setup slime with the quicklisp-slime-helper
---
emacs/init.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 001dbb64..330ad5a0 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -926,10 +926,14 @@ Also returns nil if pid is nil."
:config (use-package quack))
(use-package slime
+ :ensure t
:commands (slime)
:config (progn
- (setq inferior-lisp-program (executable-find "sbcl"))
- (slime-setup)))
+ (let ((ql-slime-helper (expand-file-name "~/quicklisp/slime-helper.el")))
+ (if (file-exists-p ql-slime-helper)
+ (load ql-slime-helper))
+ (slime-setup))
+ (setq inferior-lisp-program (executable-find "sbcl"))))
(defun imenu-elisp-sections ()
(setq imenu-prev-index-position-function nil)
--
cgit 1.4.1
From 904e18d318ce25bc5a7ab589bd64fa42c404d68c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 11 Jun 2013 21:31:53 +0100
Subject: Emacs: install and configure org-journal
---
emacs/init.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 330ad5a0..5f323a6f 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -622,6 +622,10 @@ Values: `desktop', `server', `laptop'")
(if (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)"))
(org-todo "STARTED")))))))
+(use-package org-journal
+ :config (progn
+ (setq org-journal-date-format "%A, %d %B %Y")))
+
;;;; Programming
(use-package cedet
--
cgit 1.4.1
From 3b77cea165c47d617035c3fb622aaa9cfcc3bcaa Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 22 Jun 2013 09:05:40 +0100
Subject: Emacs: setup jinja2-mode
---
emacs/init.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 5f323a6f..b9b29e16 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1077,6 +1077,10 @@ Works with: arglist-cont-nonempty, arglist-close."
("\\.mt\\'" . mustache-mode)
("\\.template\\'" . mustache-mode)))
+(use-package jinja2-mode
+ :ensure t
+ :mode (("\\.j2\\'" . jinja2-mode)))
+
(use-package nxhtml-mode
:defer t
:if (eq env/system-type 'laptop)
--
cgit 1.4.1
From bd70cf69863edb293f2cf4a14275327ea411fdcf Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 22 Jun 2013 10:04:20 +0100
Subject: Emacs: don't initialise *init-file* when user-init-file is not set
---
emacs/init.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index b9b29e16..6ab12fe4 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -47,7 +47,10 @@ Values: `desktop', `server', `laptop'")
(interactive)
(setq env/location (env/get-location)))
-(defvar *init-file* (expand-file-name "init.el" (file-name-directory (file-truename user-init-file)))
+(defvar *init-file*
+ (when user-init-file
+ (expand-file-name "init.el"
+ (file-name-directory (file-truename user-init-file))))
"Where the emacs init file really is, passing through symlinks.")
;;;; Package Management
--
cgit 1.4.1
From 189f41ba7afb45813b810810472793f5c9f0c7fa Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 22 Jun 2013 10:04:31 +0100
Subject: Emacs: load custom file
---
emacs/init.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 6ab12fe4..f65b1386 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -9,6 +9,8 @@
user-full-name "Alan Pearce"
custom-file "~/.emacs.d/custom.el")
+(load custom-file :noerror)
+
;;; Allow lisps to use a common setup. I don't know why they don't have some lispy mode as their parent, but this is close enough
(defcustom lisp-common-mode-hook nil
"Hook run when entering any Lisp mode."
--
cgit 1.4.1
From eeb7399103580db187077cbb2aa406348e3a6b6c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 22 Jun 2013 10:04:57 +0100
Subject: Emacs: fix compilation warning regarding eshell/cd
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index f65b1386..9d658ab1 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -760,6 +760,7 @@ Also returns nil if pid is nil."
eshell-smart-space-goes-to-end t)
(eshell-smart-initialize)))))
+(autoload #'eshell/cd "em-dirs")
(defun eshell-goto-current-dir (&optional arg)
(interactive "P")
(let ((dir default-directory))
--
cgit 1.4.1
From 47587e317708996e6966adf23859e39194869fba Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 30 Jun 2013 12:08:49 +0100
Subject: Emacs: ensure org-mode package with contrib/ is installed
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 9d658ab1..43a1314b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -573,6 +573,7 @@ Values: `desktop', `server', `laptop'")
;;;; Planning
(use-package org
+ :ensure org-plus-contrib
:bind (("C-c C-a" . org-agenda-list)
("C-c a" . org-agenda)
("C-c l" . org-store-link)
--
cgit 1.4.1
From 5905ec6debb6dcf9df9843b8f166305c849f0e61 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 17 Jul 2013 13:57:05 +0100
Subject: Make shell-execute work with a universal prefix argument
---
emacs/elisp/ap-functions.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/emacs/elisp/ap-functions.el b/emacs/elisp/ap-functions.el
index b6994643..104b4449 100644
--- a/emacs/elisp/ap-functions.el
+++ b/emacs/elisp/ap-functions.el
@@ -37,10 +37,10 @@
(byte-compile-dest-file filename))))))
;;;###autoload
-(defun shell-execute ()
- (interactive)
+(defun shell-execute (to-current-buffer)
+ (interactive "P")
(let ((file-buffer (if (buffer-file-name)
(file-name-nondirectory (buffer-file-name))
""))
(command (read-shell-command "Shell command: " nil nil nil)))
- (shell-command (replace-regexp-in-string "%" file-buffer command))))
+ (shell-command (replace-regexp-in-string "%" file-buffer command) to-current-buffer)))
--
cgit 1.4.1
From f26545a8cb75a4aeb0773ac309d8145aeb087d1d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 29 Jul 2013 14:08:04 +0100
Subject: zshrc: add X11 window role to wprop alias
---
zsh/zshrc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index 938dcbd9..c017029f 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -275,7 +275,8 @@ alias E="SUDO_EDITOR=\emacsclient -c -a emacs\" sudoedit"
alias aticonfig="DISPLAY=:0 \aticonfig"
alias wprop='xprop |awk '\''
/^WM_CLASS/{sub(/.* =/, "instance:"); sub(/,/, "\nclass:"); print}
- /^WM_NAME/{sub(/.* =/, "title:"); print}'\'''
+ /^WM_NAME/{sub(/.* =/, "title:"); print}
+ /^WM_WINDOW_ROLE/{sub(/.* =/, "role:"); print}'\'''
alias -g ...='../..'
--
cgit 1.4.1
From 72aa9219773cb0717c4f27a28056c4fef5ce2e6a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 29 Jul 2013 14:08:53 +0100
Subject: Emacs: add eval-and-replace and bind to C-c e
---
emacs/init.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 43a1314b..26defe92 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -972,6 +972,18 @@ Also returns nil if pid is nil."
(add-hook 'emacs-lisp-mode-hook 'imenu-elisp-sections)
+(defun eval-and-replace ()
+ "Replace the preceding sexp with its value."
+ (interactive)
+ (backward-kill-sexp)
+ (condition-case nil
+ (prin1 (eval (read (current-kill 0)))
+ (current-buffer))
+ (error (message "Invalid expression")
+ (insert (current-kill 0)))))
+
+(bind-key "C-c e" #'eval-and-replace)
+
;;;; Programming
(use-package auto-compile
--
cgit 1.4.1
From b17e1928f120ba559929754a26e77b0c04d0aeb9 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 29 Jul 2013 14:10:02 +0100
Subject: Emacs: improve configuration of common-lisp mode
---
emacs/init.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 26defe92..1278c556 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -907,10 +907,16 @@ Also returns nil if pid is nil."
(setq indent-tabs-mode nil)
(local-set-key (kbd "RET") #'paredit-newline))
+(defun set-common-lisp-indentation ()
+ (set (make-local-variable 'lisp-indent-function)
+ #'common-lisp-indent-function))
+
(add-hook 'emacs-lisp-mode-hook #'ap/lisp-setup)
(add-hook 'emacs-lisp-mode-hook #'turn-on-eldoc-mode)
(add-hook 'scheme-mode-hook #'ap/lisp-setup)
+(add-hook 'lisp-mode-hook #'ap/lisp-setup)
+(add-hook 'lisp-mode-hook #'set-common-lisp-indentation)
(use-package bytecomp
:defer t
--
cgit 1.4.1
From 1ba96a0584267853ff15e255bfae7afb39bceb7c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 29 Jul 2013 15:42:44 +0100
Subject: zsh: check for gem directory and add bin folder to path if found
---
zsh/zshrc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/zsh/zshrc b/zsh/zshrc
index c017029f..3bf6e3b9 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -10,6 +10,13 @@ then
$defpath
~/bin
)
+ if [[ -d ~/.gem/ruby ]]
+ then
+ path=(
+ $path
+ ~/.gem/ruby/*/bin
+ )
+ fi
fi
if [[ ! -d ~/.zsh/cache ]]
--
cgit 1.4.1
From 496df6c119046e450f4e047bbb6cf0428c7168b9 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 1 Aug 2013 13:23:44 +0100
Subject: Emacs: switch control and command keys
---
emacs/init.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 5f323a6f..34fab378 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -461,6 +461,11 @@ Values: `desktop', `server', `laptop'")
;;;; Keybindings
+(when (eq system-type 'darwin)
+ (setq mac-option-modifier 'meta
+ mac-control-modifier 'command
+ mac-command-modifier 'control))
+
(unbind-key "")
(bind-key "" #'compile)
(bind-key "" #'kmacro-start-macro-or-insert-counter)
--
cgit 1.4.1
From ae1b7c3d17f24726bfdf1f59a95c6bf0b32824f7 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 1 Aug 2013 13:29:45 +0100
Subject: Emacs: make right modifier keys consistent with their left
counterparts on OS X
---
emacs/init.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 34fab378..2a383eda 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -464,7 +464,9 @@ Values: `desktop', `server', `laptop'")
(when (eq system-type 'darwin)
(setq mac-option-modifier 'meta
mac-control-modifier 'command
- mac-command-modifier 'control))
+ mac-right-control-modifier 'command
+ mac-command-modifier 'control
+ mac-right-command-modifier 'control))
(unbind-key "")
(bind-key "" #'compile)
--
cgit 1.4.1
From 1e5ba0b55f289e00d9c78683b79aefc9fd55f4e2 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 1 Aug 2013 13:30:40 +0100
Subject: Emacs: allow the option key to be used without inputting special
characters
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 2a383eda..71c2ffbc 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -462,6 +462,7 @@ Values: `desktop', `server', `laptop'")
;;;; Keybindings
(when (eq system-type 'darwin)
+ (set-keyboard-coding-system nil)
(setq mac-option-modifier 'meta
mac-control-modifier 'command
mac-right-control-modifier 'command
--
cgit 1.4.1
From 07a7dedaed8646445c2d8b213186c89833c30e59 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 2 Aug 2013 10:35:02 +0100
Subject: Ignore .DS_Store system files
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index fa943767..76e98f5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@
*.elc
*.zwc
*.zwc.old
+.DS_Store
--
cgit 1.4.1
From 19c2511ca46d792cbd348dd68f9f6db1a4d75dfe Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 2 Aug 2013 10:52:10 +0100
Subject: Installer: check for host-specific zshrc before trying to compile
---
install | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/install b/install
index 0fa5859e..40c134f8 100755
--- a/install
+++ b/install
@@ -58,8 +58,10 @@ zfiles=(
dotfiles/zsh/functions/fasd/fasd
$fasd_cache
dotfiles/zsh/zshrc
- dotfiles/zsh/zshrc_${HOST%%.*}
)
+if [[ -f dotfiles/zsh/zshrc_${HOST%%.*} ]]; then
+ zfiles+=dotfiles/zsh/zshrc_${HOST%%.*}
+fi
if [[ -e /usr/bin/emerge ]]; then
zfiles+=dotfiles/zsh/zshrc_gentoo
fi
--
cgit 1.4.1
From 4716b456014f52e847a63f2fc4a72b85c4b00a60 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 14 Aug 2013 14:16:30 +0100
Subject: Emacs: setup puppet-mode
---
emacs/init.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 1092e9bd..225e0198 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -578,6 +578,11 @@ Values: `desktop', `server', `laptop'")
:ensure t
:mode (("\\.lua\\'" . lua-mode)))
+(use-package puppet-mode
+ :mode (("\\.pp\\'" . puppet-mode))
+ :config (progn
+ (add-hook 'puppet-mode-hook #'autopair-mode)))
+
;;;; Planning
(use-package org
--
cgit 1.4.1
From 1f18bfaaf03f2696d53535d433478a5671fcb97f Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 14 Aug 2013 14:17:20 +0100
Subject: Emacs: make right modifier keys on Mac inherit the configuration of
their left counterparts
---
emacs/init.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 225e0198..0f05bc0c 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -470,9 +470,9 @@ Values: `desktop', `server', `laptop'")
(set-keyboard-coding-system nil)
(setq mac-option-modifier 'meta
mac-control-modifier 'command
- mac-right-control-modifier 'command
+ mac-right-control-modifier 'left
mac-command-modifier 'control
- mac-right-command-modifier 'control))
+ mac-right-command-modifier 'left))
(unbind-key "")
(bind-key "" #'compile)
--
cgit 1.4.1
From 4eb69405683c90659e7f2a9c3a2fd947dd027ed0 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 17 Aug 2013 15:21:01 +0100
Subject: Emacs: Provide ap-functions in ap-functions.el
---
emacs/elisp/ap-functions.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/emacs/elisp/ap-functions.el b/emacs/elisp/ap-functions.el
index 104b4449..4c300015 100644
--- a/emacs/elisp/ap-functions.el
+++ b/emacs/elisp/ap-functions.el
@@ -44,3 +44,5 @@
""))
(command (read-shell-command "Shell command: " nil nil nil)))
(shell-command (replace-regexp-in-string "%" file-buffer command) to-current-buffer)))
+
+(provide 'ap-functions)
--
cgit 1.4.1
From 7af9f474a725c084931594ca52c775ec060daf81 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 17 Aug 2013 15:22:37 +0100
Subject: Setup ediff configuration
---
emacs/init.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 0f05bc0c..d142da47 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -427,6 +427,12 @@ Values: `desktop', `server', `laptop'")
(add-to-list 'tramp-remote-path "/usr/local/sbin")
(add-to-list 'tramp-remote-path "~/bin")))
+(use-package ediff
+ :defer t
+ :config (progn
+ (setq ediff-split-window-function 'split-window-horizontally
+ ediff-window-setup-function 'ediff-setup-windows-plain)))
+
;;;; Indentation
(setq-default tab-width 4
--
cgit 1.4.1
From 314c9708d77bf367b775bf71be374faa690bcb1f Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 17 Aug 2013 15:23:10 +0100
Subject: Git: use the patience diff algorithm
---
gitconfig | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gitconfig b/gitconfig
index 74d13ecb..0e4d5afe 100644
--- a/gitconfig
+++ b/gitconfig
@@ -18,4 +18,6 @@
standup = log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --since yesterday --author alan
ignored = ls-files --others -i --exclude-standard
[github]
- user = alan@alanpearce.co.uk
\ No newline at end of file
+ user = alan@alanpearce.co.uk
+[diff]
+ algorithm = patience
--
cgit 1.4.1
From 94ab675f400ca76e1c45376393bcf974579caacb Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 25 Aug 2013 19:32:23 +0100
Subject: Emacs: save ido state file in emacs directory
---
emacs/init.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index d142da47..f15386fe 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -529,7 +529,9 @@ Values: `desktop', `server', `laptop'")
(ido-mode 1)
(setq ido-decorations (quote ("\n›" "" "\n " "\n …" "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
(setq ido-auto-merge-delay-time 99999
- ido-enable-flex-matching t)
+ ido-enable-flex-matching t
+ ido-save-directory-list-file (expand-file-name user-emacs-directory
+ "ido-state"))
(ido-init-completion-maps)
(defun ido-manual-merge ()
(interactive)
--
cgit 1.4.1
From 15dd3bf7481143411a0598770ce0eabc7dd02213 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 27 Aug 2013 13:07:22 +0100
Subject: Emacs: Fix control key issue on OSX
---
emacs/init.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 0f05bc0c..41daa4a5 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -469,10 +469,12 @@ Values: `desktop', `server', `laptop'")
(when (eq system-type 'darwin)
(set-keyboard-coding-system nil)
(setq mac-option-modifier 'meta
- mac-control-modifier 'command
+ mac-right-option-modifier 'left
+ mac-control-modifier 'super
mac-right-control-modifier 'left
mac-command-modifier 'control
- mac-right-command-modifier 'left))
+ mac-right-command-modifier 'left
+ mac-function-modifier 'hyper))
(unbind-key "")
(bind-key "" #'compile)
--
cgit 1.4.1
From 5ac5ba3ba8e7b78736ff0e12a065713658579063 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 27 Aug 2013 13:08:22 +0100
Subject: Emacs: unbind unhelpful s-n key
---
emacs/init.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 41daa4a5..499636f9 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -492,6 +492,8 @@ Values: `desktop', `server', `laptop'")
(bind-key "C-c i" #'ucs-insert)
+(unbind-key "s-n")
+
(set-register ?e `(file . ,*init-file*))
;; Enable narrowing functions C-x n
--
cgit 1.4.1
From 114df7733b3534738c23e170b563cb7abd29da43 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 27 Aug 2013 13:09:35 +0100
Subject: Emacs: add extra keybinding for projectile-find-file
---
emacs/init.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 499636f9..e7e080ce 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -494,6 +494,8 @@ Values: `desktop', `server', `laptop'")
(unbind-key "s-n")
+(bind-key "s-x" (define-prefix-command 'super-x-map))
+
(set-register ?e `(file . ,*init-file*))
;; Enable narrowing functions C-x n
@@ -664,7 +666,8 @@ Values: `desktop', `server', `laptop'")
(use-package projectile
:ensure t
- :bind (("C-c C-f" . projectile-find-file))
+ :bind (("C-c C-f" . projectile-find-file)
+ ("s-x s-f" . projectile-find-file))
:commands (projectile-global-mode))
(use-package project-persist
--
cgit 1.4.1
From b064712dfa6f4a3e727ad18568fc9f852c3e2c0d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 28 Aug 2013 09:00:11 +0100
Subject: Emacs: Switch control and command on OSX
---
emacs/init.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index e7e080ce..916cc420 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -470,9 +470,9 @@ Values: `desktop', `server', `laptop'")
(set-keyboard-coding-system nil)
(setq mac-option-modifier 'meta
mac-right-option-modifier 'left
- mac-control-modifier 'super
+ mac-control-modifier 'control
mac-right-control-modifier 'left
- mac-command-modifier 'control
+ mac-command-modifier 'super
mac-right-command-modifier 'left
mac-function-modifier 'hyper))
--
cgit 1.4.1
From 6741fa31da1ac4d2e14114fdf2a3d6d841ac6962 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 28 Aug 2013 16:33:18 +0100
Subject: Emacs: Unbind more unhelpful Mac keybindings
---
emacs/init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 1b7b4950..b445c1e4 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -498,7 +498,10 @@ Values: `desktop', `server', `laptop'")
(bind-key "C-c i" #'ucs-insert)
+(unbind-key "s-h")
(unbind-key "s-n")
+(unbind-key "s-p")
+(unbind-key "s-w")
(bind-key "s-x" (define-prefix-command 'super-x-map))
--
cgit 1.4.1
From 2e6468f9225fbb9ef889271cdb48248f3d345d52 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 28 Aug 2013 16:33:57 +0100
Subject: Emacs: add s-G magit keybinding like s-D
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index b445c1e4..ab1d3c2b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -750,7 +750,8 @@ Also returns nil if pid is nil."
(use-package magit
:commands (magit-status)
- :bind (("C-x g" . magit-status))
+ :bind (("C-x g" . magit-status)
+ ("s-G" . magit-status))
:init (add-hook 'magit-mode-hook #'magit-load-config-extensions))
;;;; Spelling
--
cgit 1.4.1
From a4fd9c1ab8fd8a7e1dc2695876ede8c83f5eaff4 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 28 Aug 2013 17:07:31 +0100
Subject: Emacs: unbind s-m
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index ab1d3c2b..4eab004e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -502,6 +502,7 @@ Values: `desktop', `server', `laptop'")
(unbind-key "s-n")
(unbind-key "s-p")
(unbind-key "s-w")
+(unbind-key "s-m")
(bind-key "s-x" (define-prefix-command 'super-x-map))
--
cgit 1.4.1
From 4995c1c2200c7ca5c20a1de0aad3f8a465fb911d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 1 Sep 2013 13:01:49 +0100
Subject: Xbindkeys: run dmenu with cache settings
---
xbindkeysrc.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xbindkeysrc.scm b/xbindkeysrc.scm
index e44500f1..7b00c38d 100644
--- a/xbindkeysrc.scm
+++ b/xbindkeysrc.scm
@@ -52,6 +52,6 @@
(xbindkey '(mod4 F11) "mpc next")
(xbindkey '(mod4 F12) "mpc stop")
-(xbindkey '(mod4 p) "dmenu_run -fn '-misc-termsyn-medium-r-normal--11-79-100-100-c-60-*-*' -nb '#002b36' -nf '#fdf6e3' -sb '#586e75' -sf '#fdf6e3'")
+(xbindkey '(mod4 p) "dmenu_run -fn '-misc-termsyn-medium-r-normal--11-79-100-100-c-60-*-*' -nb '#002b36' -nf '#fdf6e3' -sb '#586e75' -sf '#fdf6e3' -hist '/home/alan/.cache/dmenu_run_history'")
(xbindkey '(mod4 shift T) "urxvtc")
(xbindkey '(mod4 shift E) "emacsclient -c")
--
cgit 1.4.1
From 8214342af8a51b9ed63d9bea27cbf7b8051f0b4b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 2 Sep 2013 09:29:29 +0100
Subject: Emacs: setup web-mode
---
emacs/init.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index c26d1428..2d80bc81 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1170,6 +1170,14 @@ Works with: arglist-cont-nonempty, arglist-close."
:defer t
:config (setq sgml-basic-offset 4))
+(use-package web-mode
+ :defer t
+ :mode (("/views/.*\\.php\\'" . web-mode)
+ ("/templates/.*\\.php\\'" . web-mode))
+ :config (setq web-mode-code-indent-offset 4
+ web-mode-css-indent-offset 4
+ web-mode-markup-indent-offset 4))
+
;;;; Windows & Frames
(setq frame-title-format
--
cgit 1.4.1
From c0b1db9dd382dfa75980888433936645ac17bf97 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 2 Sep 2013 09:32:58 +0100
Subject: Emacs: initialise smex on startup for faster usage
---
emacs/init.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 2d80bc81..337d6630 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -559,13 +559,13 @@ Values: `desktop', `server', `laptop'")
(setq smex-history-length 100
smex-save-file (concat user-emacs-directory
"smex-items"))
- (smex-initialize)
(setq smex-key-advice-ignore-menu-bar t
smex-auto-update nil)
(defun smex-update-after-load (unused)
(if (boundp 'smex-cache)
(smex-update)))
- (add-hook 'after-load-functions 'smex-update-after-load)))
+ (add-hook 'after-load-functions 'smex-update-after-load))
+ :init (smex-initialize))
;;;; Modeline
--
cgit 1.4.1
From 13ddd4cb0f91cb6c78f94eb5fa8bbee1b5b83920 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 2 Sep 2013 13:32:47 +0100
Subject: Add global gitignore file
---
gitconfig | 2 ++
global.gitignore | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 global.gitignore
diff --git a/gitconfig b/gitconfig
index 0e4d5afe..9d616709 100644
--- a/gitconfig
+++ b/gitconfig
@@ -21,3 +21,5 @@
user = alan@alanpearce.co.uk
[diff]
algorithm = patience
+[core]
+ excludesfile = /Users/alan/dotfiles/global.gitignore
diff --git a/global.gitignore b/global.gitignore
new file mode 100644
index 00000000..02b15bfa
--- /dev/null
+++ b/global.gitignore
@@ -0,0 +1,23 @@
+.DS_Store
+.AppleDouble
+.LSOverride
+Icon
+Desktop.ini
+
+# Thumbnails
+._*
+Thumbs.db
+
+# Emacs
+*~
+\#*\#
+/.emacs.desktop
+/.emacs.desktop.lock
+.elc
+auto-save-list
+tramp
+.\#*
+
+# Org-mode
+.org-id-locations
+*_archive
\ No newline at end of file
--
cgit 1.4.1
From f2badf30beb5fd8a758574cddd3a2f7cc7159080 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 27 Aug 2013 13:07:22 +0100
Subject: Emacs: Fix control key issue on OSX
---
emacs/init.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 337d6630..0a220735 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -476,9 +476,9 @@ Values: `desktop', `server', `laptop'")
(set-keyboard-coding-system nil)
(setq mac-option-modifier 'meta
mac-right-option-modifier 'left
- mac-control-modifier 'control
+ mac-control-modifier 'super
mac-right-control-modifier 'left
- mac-command-modifier 'super
+ mac-command-modifier 'control
mac-right-command-modifier 'left
mac-function-modifier 'hyper))
--
cgit 1.4.1
From 9719bca673b354a1dbd495afb55c5dec74482a51 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 27 Aug 2013 13:08:22 +0100
Subject: Emacs: unbind unhelpful s-n key
---
emacs/init.el | 6 ------
1 file changed, 6 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 0a220735..e07ef0bc 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -498,13 +498,7 @@ Values: `desktop', `server', `laptop'")
(bind-key "C-c i" #'ucs-insert)
-(unbind-key "s-h")
(unbind-key "s-n")
-(unbind-key "s-p")
-(unbind-key "s-w")
-(unbind-key "s-m")
-
-(bind-key "s-x" (define-prefix-command 'super-x-map))
(set-register ?e `(file . ,*init-file*))
--
cgit 1.4.1
From 6e26c674b93629c3d1cfeb79d6c6f2268510a420 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 27 Aug 2013 13:09:35 +0100
Subject: Emacs: add extra keybinding for projectile-find-file
---
emacs/init.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index e07ef0bc..dd73f19c 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -500,6 +500,8 @@ Values: `desktop', `server', `laptop'")
(unbind-key "s-n")
+(bind-key "s-x" (define-prefix-command 'super-x-map))
+
(set-register ?e `(file . ,*init-file*))
;; Enable narrowing functions C-x n
--
cgit 1.4.1
From 17147f0bb602a34f7b1cb669718813339fa21400 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 28 Aug 2013 09:00:11 +0100
Subject: Emacs: Switch control and command on OSX
---
emacs/init.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index dd73f19c..b70f90ba 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -476,9 +476,9 @@ Values: `desktop', `server', `laptop'")
(set-keyboard-coding-system nil)
(setq mac-option-modifier 'meta
mac-right-option-modifier 'left
- mac-control-modifier 'super
+ mac-control-modifier 'control
mac-right-control-modifier 'left
- mac-command-modifier 'control
+ mac-command-modifier 'super
mac-right-command-modifier 'left
mac-function-modifier 'hyper))
--
cgit 1.4.1
From 07522b7ea7a158949cb24ecce2ebcf3084fe5b67 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 28 Aug 2013 16:33:18 +0100
Subject: Emacs: Unbind more unhelpful Mac keybindings
---
emacs/init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index b70f90ba..b9597020 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -498,7 +498,10 @@ Values: `desktop', `server', `laptop'")
(bind-key "C-c i" #'ucs-insert)
+(unbind-key "s-h")
(unbind-key "s-n")
+(unbind-key "s-p")
+(unbind-key "s-w")
(bind-key "s-x" (define-prefix-command 'super-x-map))
--
cgit 1.4.1
--
cgit 1.4.1
From c12b575f04d653d12edfc9188a70f709607a30c3 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 9 Sep 2013 13:46:37 +0100
Subject: Emacs: set company completion to only happen after inserting text
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index b9597020..620c5b30 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -311,7 +311,8 @@ Values: `desktop', `server', `laptop'")
:bind (("C-" . company-complete))
:init (progn
(add-hook 'prog-mode-hook #'company-mode)
- (setq company-idle-delay .3)))
+ (setq company-idle-delay .3
+ company-begin-commands '(self-insert-command))))
;;;; Dates & Times
--
cgit 1.4.1
From ff9984e5698068e56a38cd3193231adc8d296e37 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 9 Sep 2013 13:49:21 +0100
Subject: Emacs: rebind M-/ to hippie-expand
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 620c5b30..191545c5 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -498,6 +498,7 @@ Values: `desktop', `server', `laptop'")
(unbind-key "C-x C-c")
(bind-key "C-c i" #'ucs-insert)
+(bind-key "M-/" #'hippie-expand)
(unbind-key "s-h")
(unbind-key "s-n")
--
cgit 1.4.1
From 8be7aa09302953dd74aff58b6a9ca141efa8b693 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 9 Sep 2013 14:13:28 +0100
Subject: Emacs: Remove configuration for nxhtml mode
---
emacs/init.el | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 191545c5..c26f3e24 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1140,20 +1140,6 @@ Works with: arglist-cont-nonempty, arglist-close."
:ensure t
:mode (("\\.j2\\'" . jinja2-mode)))
-(use-package nxhtml-mode
- :defer t
- :if (eq env/system-type 'laptop)
- :load-path "nxhtml"
- :config (progn
- (when (and (equal emacs-major-version 24)
- (> emacs-minor-version 1))
- (setq mumamo-per-buffer-local-vars
- (delq 'buffer-file-name mumamo-per-buffer-local-vars)))
- (setq mumamo-chunk-coloring 4
- nxhtml-skip-welcome t
- nxhtml-autoload-web nil)
- (nxhtml-menu-mode -1)))
-
(use-package php-mode
:mode ("\\.php\\'" . php-mode)
:config (progn
--
cgit 1.4.1
From 270a82dbed30eb256736b11c0af54aa7d175f56a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 13 Sep 2013 13:05:06 +0100
Subject: Make installer create .zsh and .zsh/cache, if necessary
---
install | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/install b/install
index 40c134f8..16d30c58 100755
--- a/install
+++ b/install
@@ -47,6 +47,11 @@ then
emacs --batch --eval '(batch-byte-recompile-directory 0)' ~/.emacs.d/
fi
+if [[ ! -d ~/.zsh/cache ]]
+then
+ mkdir -p ~/.zsh/cache
+fi
+
fasd_cache=~/.zsh/cache/fasd-init-zsh
if [[ ! -s "$fasd_cache" || dotfiles/zsh/functions/fasd -nt "$fasd_cache" ]]; then
dotfiles/zsh/functions/fasd/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
--
cgit 1.4.1
From 6cc5e9856fd0875f767f17a6494eb4a174538ebd Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 16:47:18 +0100
Subject: zsh: Install and use the pure prompt
---
zsh/functions/pure/prompt_pure_setup | 78 ++++++++++++++++++++++++++++++++++++
zsh/zshrc | 9 ++---
2 files changed, 81 insertions(+), 6 deletions(-)
create mode 100644 zsh/functions/pure/prompt_pure_setup
diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup
new file mode 100644
index 00000000..9c2a7520
--- /dev/null
+++ b/zsh/functions/pure/prompt_pure_setup
@@ -0,0 +1,78 @@
+# Pure
+# by Sindre Sorhus
+# https://github.com/sindresorhus/pure
+# MIT License
+
+# For my own and others sanity
+# git:
+# %b => current branch
+# %a => current action (rebase/merge)
+# prompt:
+# %F => color dict
+# %f => reset color
+# %~ => current path
+# %* => time
+# %n => username
+# %m => shortname host
+# %(?..) => prompt conditional - %(condition.true.false)
+
+# fastest possible way to check if repo is dirty
+prompt_pure_git_dirty() {
+ # check if we're in a git repo
+ command git rev-parse --is-inside-work-tree &>/dev/null || return
+ # check if it's dirty
+ command git diff --quiet --ignore-submodules HEAD &>/dev/null
+
+ (($? == 1)) && echo '*'
+}
+
+# displays the exec time of the last command if set threshold was exceeded
+prompt_pure_cmd_exec_time() {
+ local stop=`date +%s`
+ local start=${cmd_timestamp:-$stop}
+ integer elapsed=$stop-$start
+ (($elapsed > ${PURE_CMD_MAX_EXEC_TIME:=5})) && echo ${elapsed}s
+}
+
+prompt_pure_preexec() {
+ cmd_timestamp=`date +%s`
+
+ # shows the current dir and executed command in the title when a process is active
+ print -Pn "\e]0;$PWD:t: $2\a"
+}
+
+prompt_pure_precmd() {
+ # shows the full path in the title
+ print -Pn '\e]0;%~\a'
+
+ # git info
+ vcs_info
+
+ print -P '\n%F{blue}%~%F{8}$vcs_info_msg_0_`prompt_pure_git_dirty` $prompt_pure_username%f %F{yellow}`prompt_pure_cmd_exec_time`%f'
+
+ # reset value since `preexec` isn't always triggered
+ unset cmd_timestamp
+}
+
+
+prompt_pure_setup() {
+ prompt_opts=(cr subst percent)
+
+ autoload -Uz add-zsh-hook
+ autoload -Uz vcs_info
+
+ add-zsh-hook precmd prompt_pure_precmd
+ add-zsh-hook preexec prompt_pure_preexec
+
+ zstyle ':vcs_info:*' enable git
+ zstyle ':vcs_info:git*' formats ' %b'
+ zstyle ':vcs_info:git*' actionformats ' %b|%a'
+
+ # show username@host if logged in through SSH
+ [[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username='%n@%m '
+
+ # prompt turns red if the previous command didn't exit with 0
+ PROMPT='%(?.%F{magenta}.%F{red})❯%f '
+}
+
+prompt_pure_setup "$@"
diff --git a/zsh/zshrc b/zsh/zshrc
index 3bf6e3b9..18cc118e 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -168,13 +168,10 @@ zstyle ':vcs_info:*' enable git hg
zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' '*?.old' '*?.pro'
## Prompt
-if [[ $term = "putty" ]];then
- prompt_char="›"
-else
- prompt_char=">"
-fi
+autoload -U promptinit
+promptinit
-PS1="%B%~%(!.%{$fg[red]%}.%{$fg[green]%})$prompt_char%f%b "
+prompt pure
# Options
--
cgit 1.4.1
From 090d543a3b7429e4a3bb071018b827dce4775dee Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:11:27 +0100
Subject: zsh: Add solarized dircolors (ansi-universal)
---
zsh/zshrc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/zsh/zshrc b/zsh/zshrc
index 18cc118e..0442f015 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -92,6 +92,8 @@ then
ls_isodate="-D '%F %k:%M'"
fi
+LS_COLORS='no=00:fi=00:di=36:ln=35:pi=30;44:so=35;44:do=35;44:bd=33;44:cd=37;44:or=05;37;41:mi=05;37;41:ex=01;31:*.cmd=01;31:*.exe=01;31:*.com=01;31:*.bat=01;31:*.reg=01;31:*.app=01;31:*.txt=32:*.org=32:*.md=32:*.mkd=32:*.h=32:*.c=32:*.C=32:*.cc=32:*.cpp=32:*.cxx=32:*.objc=32:*.sh=32:*.csh=32:*.zsh=32:*.el=32:*.vim=32:*.java=32:*.pl=32:*.pm=32:*.py=32:*.rb=32:*.hs=32:*.php=32:*.htm=32:*.html=32:*.shtml=32:*.erb=32:*.haml=32:*.xml=32:*.rdf=32:*.css=32:*.sass=32:*.scss=32:*.less=32:*.js=32:*.coffee=32:*.man=32:*.0=32:*.1=32:*.2=32:*.3=32:*.4=32:*.5=32:*.6=32:*.7=32:*.8=32:*.9=32:*.l=32:*.n=32:*.p=32:*.pod=32:*.tex=32:*.bmp=33:*.cgm=33:*.dl=33:*.dvi=33:*.emf=33:*.eps=33:*.gif=33:*.jpeg=33:*.jpg=33:*.JPG=33:*.mng=33:*.pbm=33:*.pcx=33:*.pdf=33:*.pgm=33:*.png=33:*.ppm=33:*.pps=33:*.ppsx=33:*.ps=33:*.svg=33:*.svgz=33:*.tga=33:*.tif=33:*.tiff=33:*.xbm=33:*.xcf=33:*.xpm=33:*.xwd=33:*.xwd=33:*.yuv=33:*.aac=33:*.au=33:*.flac=33:*.mid=33:*.midi=33:*.mka=33:*.mp3=33:*.mpa=33:*.mpeg=33:*.mpg=33:*.ogg=33:*.ra=33:*.wav=33:*.anx=33:*.asf=33:*.avi=33:*.axv=33:*.flc=33:*.fli=33:*.flv=33:*.gl=33:*.m2v=33:*.m4v=33:*.mkv=33:*.mov=33:*.mp4=33:*.mp4v=33:*.mpeg=33:*.mpg=33:*.nuv=33:*.ogm=33:*.ogv=33:*.ogx=33:*.qt=33:*.rm=33:*.rmvb=33:*.swf=33:*.vob=33:*.wmv=33:*.doc=31:*.docx=31:*.rtf=31:*.dot=31:*.dotx=31:*.xls=31:*.xlsx=31:*.ppt=31:*.pptx=31:*.fla=31:*.psd=31:*.7z=1;35:*.apk=1;35:*.arj=1;35:*.bin=1;35:*.bz=1;35:*.bz2=1;35:*.cab=1;35:*.deb=1;35:*.dmg=1;35:*.gem=1;35:*.gz=1;35:*.iso=1;35:*.jar=1;35:*.msi=1;35:*.rar=1;35:*.rpm=1;35:*.tar=1;35:*.tbz=1;35:*.tbz2=1;35:*.tgz=1;35:*.tx=1;35:*.war=1;35:*.xpi=1;35:*.xz=1;35:*.z=1;35:*.Z=1;35:*.zip=1;35:*.ANSI-30-black=30:*.ANSI-01;30-brblack=01;30:*.ANSI-31-red=31:*.ANSI-01;31-brred=01;31:*.ANSI-32-green=32:*.ANSI-01;32-brgreen=01;32:*.ANSI-33-yellow=33:*.ANSI-01;33-bryellow=01;33:*.ANSI-34-blue=34:*.ANSI-01;34-brblue=01;34:*.ANSI-35-magenta=35:*.ANSI-01;35-brmagenta=01;35:*.ANSI-36-cyan=36:*.ANSI-01;36-brcyan=01;36:*.ANSI-37-white=37:*.ANSI-01;37-brwhite=01;37:*.log=01;34:*~=01;34:*#=01;34:*.bak=01;36:*.BAK=01;36:*.old=01;36:*.OLD=01;36:*.org_archive=01;36:*.off=01;36:*.OFF=01;36:*.dist=01;36:*.DIST=01;36:*.orig=01;36:*.ORIG=01;36:*.swp=01;36:*.swo=01;36:*,v=01;36:*.gpg=34:*.gpg=34:*.pgp=34:*.asc=34:*.3des=34:*.aes=34:*.enc=34:'
+
#Ignore suffixes in completion
fignore=(
svbin
--
cgit 1.4.1
From f5035c449c73b3712078a43f044298f2498af405 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:12:09 +0100
Subject: Urxvt: use bright colours without bold fonts
---
xresources/main | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xresources/main b/xresources/main
index 94f005a2..0af5db9b 100644
--- a/xresources/main
+++ b/xresources/main
@@ -16,7 +16,8 @@ URxvt.saveLines: 16384
URxvt.secondaryScroll: false
URxvt.font: -xos4-terminus-medium-r-normal--14-140-72-72-c-80-*-*
-URxvt.boldFont: -xos4-terminus-bold-r-normal--14-140-72-72-c-80-*-*
+URxvt.boldFont:
+URxvt.intensityStyles: true
URxvt.pointerBlank: true
URxvt.pointerBlankDelay: 987654321
--
cgit 1.4.1
From b0c124161c2df4e5762b918dfcbf142d61ea9a77 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:12:51 +0100
Subject: zsh: Optimise pure prompt git checking
---
zsh/functions/pure/prompt_pure_setup | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup
index 9c2a7520..2cf91013 100644
--- a/zsh/functions/pure/prompt_pure_setup
+++ b/zsh/functions/pure/prompt_pure_setup
@@ -18,8 +18,8 @@
# fastest possible way to check if repo is dirty
prompt_pure_git_dirty() {
- # check if we're in a git repo
- command git rev-parse --is-inside-work-tree &>/dev/null || return
+ # check if we're at the top level of a git repo
+ [[ -d .git ]] || return
# check if it's dirty
command git diff --quiet --ignore-submodules HEAD &>/dev/null
--
cgit 1.4.1
From 3b12b4c63a9e988de466828fc78bf865988465ad Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:17:34 +0100
Subject: zsh: Make git branch name visible in pure prompt
---
zsh/functions/pure/prompt_pure_setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup
index 2cf91013..138a4b5a 100644
--- a/zsh/functions/pure/prompt_pure_setup
+++ b/zsh/functions/pure/prompt_pure_setup
@@ -48,7 +48,7 @@ prompt_pure_precmd() {
# git info
vcs_info
- print -P '\n%F{blue}%~%F{8}$vcs_info_msg_0_`prompt_pure_git_dirty` $prompt_pure_username%f %F{yellow}`prompt_pure_cmd_exec_time`%f'
+ print -P '\n%F{blue}%~%F{11}$vcs_info_msg_0_`prompt_pure_git_dirty` $prompt_pure_username%f %F{yellow}`prompt_pure_cmd_exec_time`%f'
# reset value since `preexec` isn't always triggered
unset cmd_timestamp
--
cgit 1.4.1
From e42f1774217ea88916344261c56b737ed2a1fade Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:17:59 +0100
Subject: zsh: Add more contrast between success and failure prompt colours
---
zsh/functions/pure/prompt_pure_setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup
index 138a4b5a..3dd6820e 100644
--- a/zsh/functions/pure/prompt_pure_setup
+++ b/zsh/functions/pure/prompt_pure_setup
@@ -72,7 +72,7 @@ prompt_pure_setup() {
[[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username='%n@%m '
# prompt turns red if the previous command didn't exit with 0
- PROMPT='%(?.%F{magenta}.%F{red})❯%f '
+ PROMPT='%(?.%F{14}.%F{magenta})❯%f '
}
prompt_pure_setup "$@"
--
cgit 1.4.1
From 3e8b0b63104acfd5a845ac56dc56d6284b7e16a9 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:34:41 +0100
Subject: zsh: Remove extra newline from pure prompt
---
zsh/functions/pure/prompt_pure_setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup
index 3dd6820e..1bbe2673 100644
--- a/zsh/functions/pure/prompt_pure_setup
+++ b/zsh/functions/pure/prompt_pure_setup
@@ -48,7 +48,7 @@ prompt_pure_precmd() {
# git info
vcs_info
- print -P '\n%F{blue}%~%F{11}$vcs_info_msg_0_`prompt_pure_git_dirty` $prompt_pure_username%f %F{yellow}`prompt_pure_cmd_exec_time`%f'
+ print -P '%F{blue}%~%F{11}$vcs_info_msg_0_`prompt_pure_git_dirty` $prompt_pure_username%f %F{yellow}`prompt_pure_cmd_exec_time`%f'
# reset value since `preexec` isn't always triggered
unset cmd_timestamp
--
cgit 1.4.1
From e0d700c3ecff62f434ffebff34b3a08cd4ce75ff Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:46:22 +0100
Subject: zsh: Remove unused namecoin alias
---
zsh/zshrc | 1 -
1 file changed, 1 deletion(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index 0442f015..ffb01ada 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -274,7 +274,6 @@ alias lsr="ls -tld *(m-2)" # mtime < -2days
alias trans="transmission-remote transmission.home"
alias bitcoin="bitcoind"
-alias namecoin="~alan/applications/namecoin/src/namecoind"
alias su="smart_sudo "
alias e="$EDITOR"
alias E="SUDO_EDITOR=\emacsclient -c -a emacs\" sudoedit"
--
cgit 1.4.1
From 75cb3c23b9bc89f9743be6454164c7fe28102bbb Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:49:26 +0100
Subject: zsh: Refactor OS check and include OSX
---
zsh/zshrc | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index ffb01ada..64222622 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -80,17 +80,20 @@ then
fi
fi
-if [[ "$OSTYPE" == *gnu* ]]
-then
- eval `dircolors -b` #exports LSCOLORS
- ls_options="-v --group-directories-first --color=auto"
- ls_isodate="--time-style=long-iso"
-elif [[ "$OSTYPE" == freebsd* ]]
-then
- freebsd=1
- ls_options="-p"
- ls_isodate="-D '%F %k:%M'"
-fi
+case $OSTYPE in
+ *gnu*)
+ eval `dircolors -b` #exports LSCOLORS
+ ls_options="-v --group-directories-first --color=auto"
+ ls_isodate="--time-style=long-iso"
+ ;;
+ freebsd*)
+ freebsd=1
+ ls_options="-p"
+ ls_isodate="-D '%F %k:%M'"
+ ;;
+ darwin*)
+ osx=1
+esac
LS_COLORS='no=00:fi=00:di=36:ln=35:pi=30;44:so=35;44:do=35;44:bd=33;44:cd=37;44:or=05;37;41:mi=05;37;41:ex=01;31:*.cmd=01;31:*.exe=01;31:*.com=01;31:*.bat=01;31:*.reg=01;31:*.app=01;31:*.txt=32:*.org=32:*.md=32:*.mkd=32:*.h=32:*.c=32:*.C=32:*.cc=32:*.cpp=32:*.cxx=32:*.objc=32:*.sh=32:*.csh=32:*.zsh=32:*.el=32:*.vim=32:*.java=32:*.pl=32:*.pm=32:*.py=32:*.rb=32:*.hs=32:*.php=32:*.htm=32:*.html=32:*.shtml=32:*.erb=32:*.haml=32:*.xml=32:*.rdf=32:*.css=32:*.sass=32:*.scss=32:*.less=32:*.js=32:*.coffee=32:*.man=32:*.0=32:*.1=32:*.2=32:*.3=32:*.4=32:*.5=32:*.6=32:*.7=32:*.8=32:*.9=32:*.l=32:*.n=32:*.p=32:*.pod=32:*.tex=32:*.bmp=33:*.cgm=33:*.dl=33:*.dvi=33:*.emf=33:*.eps=33:*.gif=33:*.jpeg=33:*.jpg=33:*.JPG=33:*.mng=33:*.pbm=33:*.pcx=33:*.pdf=33:*.pgm=33:*.png=33:*.ppm=33:*.pps=33:*.ppsx=33:*.ps=33:*.svg=33:*.svgz=33:*.tga=33:*.tif=33:*.tiff=33:*.xbm=33:*.xcf=33:*.xpm=33:*.xwd=33:*.xwd=33:*.yuv=33:*.aac=33:*.au=33:*.flac=33:*.mid=33:*.midi=33:*.mka=33:*.mp3=33:*.mpa=33:*.mpeg=33:*.mpg=33:*.ogg=33:*.ra=33:*.wav=33:*.anx=33:*.asf=33:*.avi=33:*.axv=33:*.flc=33:*.fli=33:*.flv=33:*.gl=33:*.m2v=33:*.m4v=33:*.mkv=33:*.mov=33:*.mp4=33:*.mp4v=33:*.mpeg=33:*.mpg=33:*.nuv=33:*.ogm=33:*.ogv=33:*.ogx=33:*.qt=33:*.rm=33:*.rmvb=33:*.swf=33:*.vob=33:*.wmv=33:*.doc=31:*.docx=31:*.rtf=31:*.dot=31:*.dotx=31:*.xls=31:*.xlsx=31:*.ppt=31:*.pptx=31:*.fla=31:*.psd=31:*.7z=1;35:*.apk=1;35:*.arj=1;35:*.bin=1;35:*.bz=1;35:*.bz2=1;35:*.cab=1;35:*.deb=1;35:*.dmg=1;35:*.gem=1;35:*.gz=1;35:*.iso=1;35:*.jar=1;35:*.msi=1;35:*.rar=1;35:*.rpm=1;35:*.tar=1;35:*.tbz=1;35:*.tbz2=1;35:*.tgz=1;35:*.tx=1;35:*.war=1;35:*.xpi=1;35:*.xz=1;35:*.z=1;35:*.Z=1;35:*.zip=1;35:*.ANSI-30-black=30:*.ANSI-01;30-brblack=01;30:*.ANSI-31-red=31:*.ANSI-01;31-brred=01;31:*.ANSI-32-green=32:*.ANSI-01;32-brgreen=01;32:*.ANSI-33-yellow=33:*.ANSI-01;33-bryellow=01;33:*.ANSI-34-blue=34:*.ANSI-01;34-brblue=01;34:*.ANSI-35-magenta=35:*.ANSI-01;35-brmagenta=01;35:*.ANSI-36-cyan=36:*.ANSI-01;36-brcyan=01;36:*.ANSI-37-white=37:*.ANSI-01;37-brwhite=01;37:*.log=01;34:*~=01;34:*#=01;34:*.bak=01;36:*.BAK=01;36:*.old=01;36:*.OLD=01;36:*.org_archive=01;36:*.off=01;36:*.OFF=01;36:*.dist=01;36:*.DIST=01;36:*.orig=01;36:*.ORIG=01;36:*.swp=01;36:*.swo=01;36:*,v=01;36:*.gpg=34:*.gpg=34:*.pgp=34:*.asc=34:*.3des=34:*.aes=34:*.enc=34:'
--
cgit 1.4.1
From 52cb39f3cc213cb652e7a22a33614244dbfc25b0 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:51:13 +0100
Subject: zsh: Use gls instead of ls if available
---
zsh/zshrc | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index 64222622..cefe87f5 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -264,16 +264,22 @@ alias md='mkdir -p'
alias rd='rmdir'
alias .='source'
-alias l="\ls ${ls_options} -Bp"
-alias l1="\ls ${ls_options} -1"
-alias ls="\ls ${ls_options} -hF"
-alias la="\ls ${ls_options} -hA"
-alias ll="\ls ${ls_options} ${ls_isodate} -hl"
+if [[ -n $osx && -n $commands[gls] ]]
+then
+ ls='\gls'
+else
+ ls='\ls'
+fi
+alias l="${ls} ${ls_options} -Bp"
+alias l1="${ls} ${ls_options} -1"
+alias ls="${ls} ${ls_options} -hF"
+alias la="${ls} ${ls_options} -hA"
+alias ll="${ls} ${ls_options} ${ls_isodate} -hl"
alias lal="ll -A"
alias lla="lal"
alias llr="ll -t"
alias gpp='g++'
-alias lsr="ls -tld *(m-2)" # mtime < -2days
+alias lsr="${ls} -tld *(m-2)" # mtime < -2days
alias trans="transmission-remote transmission.home"
alias bitcoin="bitcoind"
--
cgit 1.4.1
From 458b42a257357c968f491328abb3fcbc7c7d4b10 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:55:54 +0100
Subject: zsh: Remove gnu-only dircolors assignment
---
zsh/zshrc | 1 -
1 file changed, 1 deletion(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index cefe87f5..db94294c 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -82,7 +82,6 @@ fi
case $OSTYPE in
*gnu*)
- eval `dircolors -b` #exports LSCOLORS
ls_options="-v --group-directories-first --color=auto"
ls_isodate="--time-style=long-iso"
;;
--
cgit 1.4.1
From 273902cebbd5a2ded8905ab117341fca05627657 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 17:58:47 +0100
Subject: zsh: Refactor OS checking to use just one variable
---
zsh/zshrc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index db94294c..d6ae52ea 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -82,16 +82,17 @@ fi
case $OSTYPE in
*gnu*)
+ os=gnu
ls_options="-v --group-directories-first --color=auto"
ls_isodate="--time-style=long-iso"
;;
freebsd*)
- freebsd=1
+ os=freebsd
ls_options="-p"
ls_isodate="-D '%F %k:%M'"
;;
darwin*)
- osx=1
+ os=osx
esac
LS_COLORS='no=00:fi=00:di=36:ln=35:pi=30;44:so=35;44:do=35;44:bd=33;44:cd=37;44:or=05;37;41:mi=05;37;41:ex=01;31:*.cmd=01;31:*.exe=01;31:*.com=01;31:*.bat=01;31:*.reg=01;31:*.app=01;31:*.txt=32:*.org=32:*.md=32:*.mkd=32:*.h=32:*.c=32:*.C=32:*.cc=32:*.cpp=32:*.cxx=32:*.objc=32:*.sh=32:*.csh=32:*.zsh=32:*.el=32:*.vim=32:*.java=32:*.pl=32:*.pm=32:*.py=32:*.rb=32:*.hs=32:*.php=32:*.htm=32:*.html=32:*.shtml=32:*.erb=32:*.haml=32:*.xml=32:*.rdf=32:*.css=32:*.sass=32:*.scss=32:*.less=32:*.js=32:*.coffee=32:*.man=32:*.0=32:*.1=32:*.2=32:*.3=32:*.4=32:*.5=32:*.6=32:*.7=32:*.8=32:*.9=32:*.l=32:*.n=32:*.p=32:*.pod=32:*.tex=32:*.bmp=33:*.cgm=33:*.dl=33:*.dvi=33:*.emf=33:*.eps=33:*.gif=33:*.jpeg=33:*.jpg=33:*.JPG=33:*.mng=33:*.pbm=33:*.pcx=33:*.pdf=33:*.pgm=33:*.png=33:*.ppm=33:*.pps=33:*.ppsx=33:*.ps=33:*.svg=33:*.svgz=33:*.tga=33:*.tif=33:*.tiff=33:*.xbm=33:*.xcf=33:*.xpm=33:*.xwd=33:*.xwd=33:*.yuv=33:*.aac=33:*.au=33:*.flac=33:*.mid=33:*.midi=33:*.mka=33:*.mp3=33:*.mpa=33:*.mpeg=33:*.mpg=33:*.ogg=33:*.ra=33:*.wav=33:*.anx=33:*.asf=33:*.avi=33:*.axv=33:*.flc=33:*.fli=33:*.flv=33:*.gl=33:*.m2v=33:*.m4v=33:*.mkv=33:*.mov=33:*.mp4=33:*.mp4v=33:*.mpeg=33:*.mpg=33:*.nuv=33:*.ogm=33:*.ogv=33:*.ogx=33:*.qt=33:*.rm=33:*.rmvb=33:*.swf=33:*.vob=33:*.wmv=33:*.doc=31:*.docx=31:*.rtf=31:*.dot=31:*.dotx=31:*.xls=31:*.xlsx=31:*.ppt=31:*.pptx=31:*.fla=31:*.psd=31:*.7z=1;35:*.apk=1;35:*.arj=1;35:*.bin=1;35:*.bz=1;35:*.bz2=1;35:*.cab=1;35:*.deb=1;35:*.dmg=1;35:*.gem=1;35:*.gz=1;35:*.iso=1;35:*.jar=1;35:*.msi=1;35:*.rar=1;35:*.rpm=1;35:*.tar=1;35:*.tbz=1;35:*.tbz2=1;35:*.tgz=1;35:*.tx=1;35:*.war=1;35:*.xpi=1;35:*.xz=1;35:*.z=1;35:*.Z=1;35:*.zip=1;35:*.ANSI-30-black=30:*.ANSI-01;30-brblack=01;30:*.ANSI-31-red=31:*.ANSI-01;31-brred=01;31:*.ANSI-32-green=32:*.ANSI-01;32-brgreen=01;32:*.ANSI-33-yellow=33:*.ANSI-01;33-bryellow=01;33:*.ANSI-34-blue=34:*.ANSI-01;34-brblue=01;34:*.ANSI-35-magenta=35:*.ANSI-01;35-brmagenta=01;35:*.ANSI-36-cyan=36:*.ANSI-01;36-brcyan=01;36:*.ANSI-37-white=37:*.ANSI-01;37-brwhite=01;37:*.log=01;34:*~=01;34:*#=01;34:*.bak=01;36:*.BAK=01;36:*.old=01;36:*.OLD=01;36:*.org_archive=01;36:*.off=01;36:*.OFF=01;36:*.dist=01;36:*.DIST=01;36:*.orig=01;36:*.ORIG=01;36:*.swp=01;36:*.swo=01;36:*,v=01;36:*.gpg=34:*.gpg=34:*.pgp=34:*.asc=34:*.3des=34:*.aes=34:*.enc=34:'
@@ -263,7 +264,7 @@ alias md='mkdir -p'
alias rd='rmdir'
alias .='source'
-if [[ -n $osx && -n $commands[gls] ]]
+if [[ $os == osx ]]
then
ls='\gls'
else
--
cgit 1.4.1
From 4315126ae683a32d3310f565629309c98cd11f97 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 18:04:02 +0100
Subject: zsh: Refactor and improve cross-platform handling of ls options
---
zsh/zshrc | 37 +++++++++++++++++++++++++++----------
1 file changed, 27 insertions(+), 10 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index d6ae52ea..bbfa9301 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -83,13 +83,9 @@ fi
case $OSTYPE in
*gnu*)
os=gnu
- ls_options="-v --group-directories-first --color=auto"
- ls_isodate="--time-style=long-iso"
;;
freebsd*)
os=freebsd
- ls_options="-p"
- ls_isodate="-D '%F %k:%M'"
;;
darwin*)
os=osx
@@ -264,12 +260,33 @@ alias md='mkdir -p'
alias rd='rmdir'
alias .='source'
-if [[ $os == osx ]]
-then
- ls='\gls'
-else
- ls='\ls'
-fi
+ls='\ls'
+gnu_ls_options="-v --group-directories-first --color=auto"
+gnu_ls_isodate="--time-style=long-iso"
+bsd_ls_options="-p"
+bsd_ls_isodate="-D '%F %k:%M'"
+
+case $os in
+ osx)
+ if [[ -n $commands[gls] ]]
+ then
+ ls='\gls'
+ ls_options=$gnu_ls_options
+ ls_isodate=$gnu_ls_isodate
+ else
+ ls_options=$bsd_ls_options
+ ls_isodate=$bsd_ls_isodate
+ fi
+ ;;
+ freebsd)
+ ls_options=$bsd_ls_options
+ ls_isodate=$bsd_ls_isodate
+ ;;
+ gnu)
+ ls_options=$gnu_ls_options
+ ls_isodate=$gnu_ls_isodate
+ ;;
+esac
alias l="${ls} ${ls_options} -Bp"
alias l1="${ls} ${ls_options} -1"
alias ls="${ls} ${ls_options} -hF"
--
cgit 1.4.1
From f5456c0c3cf3e889b5995e711223f3d9f07cd96f Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 15 Sep 2013 18:15:11 +0100
Subject: zsh: Remove unused aticonfig alias
---
zsh/zshrc | 1 -
1 file changed, 1 deletion(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index bbfa9301..4cfd638e 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -303,7 +303,6 @@ alias bitcoin="bitcoind"
alias su="smart_sudo "
alias e="$EDITOR"
alias E="SUDO_EDITOR=\emacsclient -c -a emacs\" sudoedit"
-alias aticonfig="DISPLAY=:0 \aticonfig"
alias wprop='xprop |awk '\''
/^WM_CLASS/{sub(/.* =/, "instance:"); sub(/,/, "\nclass:"); print}
/^WM_NAME/{sub(/.* =/, "title:"); print}
--
cgit 1.4.1
From 1c7da5933ebaa92846b44df74e04c6ea77c8b6e3 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 18 Sep 2013 17:07:56 +0100
Subject: Set the editor to emacsclient by default
---
zsh/zshrc | 1 +
1 file changed, 1 insertion(+)
diff --git a/zsh/zshrc b/zsh/zshrc
index 4cfd638e..ecfec59b 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -33,6 +33,7 @@ fpath=(
export PATH
export PAGER="less"
+export EDITOR="emacsclient"
export CLICOLOR=true
#
--
cgit 1.4.1
From 4732920bd3fb38db009639ad55f76cdea26d1735 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 18 Sep 2013 17:26:11 +0100
Subject: Add font configuration for OSX
---
emacs/init.el | 47 ++++++++++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 17 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index c26f3e24..d9ce462e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -123,23 +123,36 @@ Values: `desktop', `server', `laptop'")
(variable-pitch-mode)
(setq cursor-type 'bar))
- (if (eq window-system 'w32)
- (let* ((font-size 10)
- (mono-face (cond
- ((member "Liberation Mono" (font-family-list))
- "Liberation Mono")
- ((member "Liberation Sans Mono" (font-family-list))
- "Liberation Sans Mono")
- ((member "Consolas" (font-family-list))
- "Consolas")))
- (variable-face "Segoe UI")
- (default-font (concat mono-face "-" (number-to-string font-size))))
- (when mono-face
- (set-face-font 'default default-font)
- (set-face-font 'fixed-pitch default-font))
- (when variable-face
- (set-face-font 'variable-pitch (concat variable-face "-"
- (number-to-string (1+ font-size))))))))
+ (cond
+ ((eq window-system 'w32)
+ (let* ((font-size 10)
+ (font-list (font-family-list))
+ (mono-face (cond
+ ((member "Liberation Mono" font-list)
+ "Liberation Mono")
+ ((member "Liberation Sans Mono" font-list)
+ "Liberation Sans Mono")
+ ((member "Consolas" font-list)
+ "Consolas")))
+ (variable-face "Segoe UI")
+ (default-font (concat mono-face "-" (number-to-string font-size))))
+ (when mono-face
+ (set-face-font 'default default-font)
+ (set-face-font 'fixed-pitch default-font))
+ (when variable-face
+ (set-face-font 'variable-pitch (concat variable-face "-"
+ (number-to-string (1+ font-size)))))))
+ ((eq window-system 'ns)
+ (let* ((font-size 14)
+ (font-list (font-family-list))
+ (mono-face (cond
+ ((member "Droid Sans Mono" font-list)
+ "Droid Sans Mono")))
+ (variable-face "Helvetica Neue")
+ (default-font (concat mono-face "-" (number-to-string font-size))))
+ (when mono-face
+ (set-face-font 'default default-font)
+ (set-face-font 'fixed-pitch default-font))))))
(with-elapsed-timer "Setting up font styles"
(let* ((font-height (face-attribute 'default :height))
--
cgit 1.4.1
From e25275c1cfc454671597c6f71901ca2e57758e99 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 19 Sep 2013 19:32:54 +0100
Subject: Change Emacs font rendering on X11
---
xresources/main | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/xresources/main b/xresources/main
index 0af5db9b..77c21ce3 100644
--- a/xresources/main
+++ b/xresources/main
@@ -28,6 +28,6 @@ Emacs.MenuBar: off
Emacs.ScrollBars: off
Emacs.CursorBlink: off
-Emacs.Font: -*-Cousine-medium-*-*-*-*-110-*-*-*-*-*-*
-Emacs.fixed-pitch.attributeFont: -*-Cousine-medium-*-*-*-*-110-*-*-*-*-*-*
-Emacs.variable-pitch.attributeFont: -*-Arimo-medium-*-*-*-*-130-*-*-*-*-*-*
+Emacs.Font: -*-Droid Sans Mono-medium-*-*-*-*-140-*-*-*-*-*-*
+Emacs.fixed-pitch.attributeFont: -*-Droid Sans Mono-medium-*-*-*-*-140-*-*-*-*-*-*
+Emacs.variable-pitch.attributeFont: -*-Arimo-medium-*-*-*-*-160-*-*-*-*-*-*
--
cgit 1.4.1
From c087c244eec20ae4b76430b5b74fa7c6f32f4cd3 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 22 Sep 2013 19:47:14 +0100
Subject: zsh: Fix prompt issues with TRAMP
---
zsh/zshrc | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index ecfec59b..b2005cbc 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -170,10 +170,12 @@ zstyle ':vcs_info:*' enable git hg
zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' '*?.old' '*?.pro'
## Prompt
-autoload -U promptinit
-promptinit
-
-prompt pure
+if [[ $TERM != 'dumb' ]]
+then
+ autoload -U promptinit
+ promptinit
+ prompt pure
+fi
# Options
--
cgit 1.4.1
From 3ac726df65fda1d27446a53d633a3ae3f4fabe00 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 22 Sep 2013 18:48:49 +0000
Subject: zsh: Fix error when no gem-based programs are installed
---
zsh/zshrc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index b2005cbc..c129e0c6 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -10,7 +10,7 @@ then
$defpath
~/bin
)
- if [[ -d ~/.gem/ruby ]]
+ if [[ -d ~/.gem/ruby/*/bin ]]
then
path=(
$path
--
cgit 1.4.1
From 6f9adfef6febe5450550f845019b6522c530bb29 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 26 Sep 2013 13:47:22 +0100
Subject: Add GNU Global tags files to global gitignore
---
global.gitignore | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/global.gitignore b/global.gitignore
index 02b15bfa..78d8d163 100644
--- a/global.gitignore
+++ b/global.gitignore
@@ -20,4 +20,8 @@ tramp
# Org-mode
.org-id-locations
-*_archive
\ No newline at end of file
+*_archive
+
+GPATH
+GRTAGS
+GTAGS
\ No newline at end of file
--
cgit 1.4.1
From 46d307ed8bb790f35d5944ac4b93e1f77e1fc2f6 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 26 Sep 2013 13:50:27 +0100
Subject: Emacs: Setup file associations for ruby mode
---
emacs/init.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index d9ce462e..19296aa8 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -615,6 +615,10 @@ Values: `desktop', `server', `laptop'")
:config (progn
(add-hook 'puppet-mode-hook #'autopair-mode)))
+(use-package ruby-mode
+ :mode (("\\.rb\\'" . ruby-mode)
+ ("\\.cap\\'" . ruby-mode)))
+
;;;; Planning
(use-package org
--
cgit 1.4.1
From 1066cf861b650ac1a40e834dc08f48137fc3936a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 27 Sep 2013 16:34:55 +0100
Subject: Setup emmet-mode
---
emacs/init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 19296aa8..c179c278 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1174,6 +1174,9 @@ Works with: arglist-cont-nonempty, arglist-close."
:defer t
:config (setq sgml-basic-offset 4))
+(use-package emmet-mode
+ :ensure t)
+
(use-package web-mode
:defer t
:mode (("/views/.*\\.php\\'" . web-mode)
--
cgit 1.4.1
From a7d64a6e05aa450dda63f9b8b68e637471b223c5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 28 Sep 2013 17:06:47 +0100
Subject: Replace auto-compile-mode with auto-async-byte-compile
---
emacs/init.el | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index c179c278..a36ae20b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1043,10 +1043,9 @@ Also returns nil if pid is nil."
;;;; Programming
-(use-package auto-compile
+(use-package auto-async-byte-compile
:ensure t
- :commands (auto-compile-on-save-mode)
- :init (add-hook 'emacs-lisp-mode-hook #'auto-compile-on-save-mode))
+ :init (add-hook 'emacs-lisp-mode-hook #'auto-async-byte-compile-mode))
(use-package cc-mode
:defer t
--
cgit 1.4.1
From 466163baf6e62fd2bbb8b5fd44de2b5c702c9268 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 28 Sep 2013 17:34:02 +0100
Subject: Emacs: Remove unnecessary eval-and-compile
---
emacs/init.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index a36ae20b..111252da 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -75,8 +75,7 @@ Values: `desktop', `server', `laptop'")
diminish
use-package))
-(eval-and-compile
- (require 'use-package))
+(require 'use-package)
;;;; Style
--
cgit 1.4.1
From f690932f87c905c52ff0fbd90101fb35d17031cb Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 29 Sep 2013 14:05:11 +0100
Subject: Emacs: add emmet-mode to web-mode-hook
---
emacs/init.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index c179c278..6695f869 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1175,7 +1175,10 @@ Works with: arglist-cont-nonempty, arglist-close."
:config (setq sgml-basic-offset 4))
(use-package emmet-mode
- :ensure t)
+ :ensure t
+ :config (progn
+ (if (functionp 'web-mode)
+ (add-hook 'web-mode-hook #'emmet-mode))))
(use-package web-mode
:defer t
--
cgit 1.4.1
From 141a4f481e4a9cce21b59b3c45a3fa3b361d008c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 29 Sep 2013 18:26:08 +0100
Subject: MinTTY: Switch fonts
---
minttyrc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/minttyrc b/minttyrc
index 37dae2b7..2e7f2d86 100644
--- a/minttyrc
+++ b/minttyrc
@@ -1,6 +1,6 @@
BoldAsFont=no
-Font=Liberation Mono
-FontHeight=10
+Font=Cousine
+FontHeight=12
FontSmoothing=default
Locale=en_GB
Charset=UTF-8
--
cgit 1.4.1
From 873e1723a54845b58aae7feb1d48efce5f6d1fc8 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 29 Sep 2013 20:15:50 +0100
Subject: Emacs: Set smex variables before calling smex-initialize
---
emacs/init.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index b1362005..8141a2ff 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -569,16 +569,17 @@ Values: `desktop', `server', `laptop'")
("M-X" . smex-major-mode-commands)
("C-c M-x" . execute-extended-command))
:config (progn
- (setq smex-history-length 100
- smex-save-file (concat user-emacs-directory
- "smex-items"))
(setq smex-key-advice-ignore-menu-bar t
smex-auto-update nil)
(defun smex-update-after-load (unused)
(if (boundp 'smex-cache)
(smex-update)))
(add-hook 'after-load-functions 'smex-update-after-load))
- :init (smex-initialize))
+ :init (progn
+ (setq smex-history-length 100
+ smex-save-file (concat user-emacs-directory
+ "smex-items"))
+ (smex-initialize)))
;;;; Modeline
--
cgit 1.4.1
From f9209f77714a65d29c9c3d7bad610de6360c8a13 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 29 Sep 2013 20:21:54 +0100
Subject: Emacs: setup recentf-mode
---
emacs/init.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 8141a2ff..67167ec3 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -413,6 +413,11 @@ Values: `desktop', `server', `laptop'")
(kill-buffer buffer)
(message "File '%s' successfully removed" filename))))))
+(use-package recentf
+ :init (progn (setq recentf-auto-cleanup 'never
+ recentf-save-file (expand-file-name "recentf" user-emacs-directory))
+ (recentf-mode 1)))
+
(use-package saveplace
:config (progn (setq-default save-place t)
(setq save-place-file (expand-file-name ".saveplace" user-emacs-directory))))
--
cgit 1.4.1
From 02eb79afe189b0ea9a72b149657c2e3d7daaee8f Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 29 Sep 2013 20:22:27 +0100
Subject: Emacs: set ido-mode to add recent files to the buffer list
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 67167ec3..1aae1d15 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -558,6 +558,7 @@ Values: `desktop', `server', `laptop'")
(setq ido-decorations (quote ("\n›" "" "\n " "\n …" "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
(setq ido-auto-merge-delay-time 99999
ido-enable-flex-matching t
+ ido-use-virtual-buffers t
ido-save-directory-list-file (expand-file-name user-emacs-directory
"ido-state"))
(ido-init-completion-maps)
--
cgit 1.4.1
From 42d7e04731c514c4abc9aa2867a4718d327a72d2 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 29 Sep 2013 21:07:44 +0100
Subject: Emacs: switch from helm-ibuffer to ibuffer
---
emacs/init.el | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 1aae1d15..146066a7 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -233,7 +233,7 @@ Values: `desktop', `server', `laptop'")
;;;; Buffers
(use-package ibuffer
- :disabled t
+ :bind (("C-x C-b" . ibuffer))
:config (progn
(setq ibuffer-saved-filter-groups
(quote (("default"
@@ -545,8 +545,7 @@ Values: `desktop', `server', `laptop'")
(use-package helm-config
:ensure helm
- :bind (("C-x i" . helm-imenu)
- ("C-x C-b" . helm-mini))
+ :bind (("C-x i" . helm-imenu))
:config (setq helm-idle-delay .1
helm-input-idle-delay .1))
--
cgit 1.4.1
From a4c0bc93085ff47092115fdf8c9cc1ac7dc70eab Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 29 Sep 2013 21:08:15 +0100
Subject: Emacs: fix ido initialisation
---
emacs/init.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 146066a7..769c703b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -550,16 +550,17 @@ Values: `desktop', `server', `laptop'")
helm-input-idle-delay .1))
(use-package ido
- :init (bind-key* "C-x C-f" #'ido-find-file)
:bind (("C-x b" . ido-switch-buffer))
+ :init (progn
+ (setq ido-save-directory-list-file (expand-file-name "ido-state" user-emacs-directory))
+ (bind-key* "C-x C-f" #'ido-find-file)
+ (ido-mode 1))
:config (progn
- (ido-mode 1)
- (setq ido-decorations (quote ("\n›" "" "\n " "\n …" "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
- (setq ido-auto-merge-delay-time 99999
+ (setq ido-decorations (quote ("\n›" "" "\n " "\n …" "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]"))
+ ido-auto-merge-delay-time 99999
ido-enable-flex-matching t
- ido-use-virtual-buffers t
- ido-save-directory-list-file (expand-file-name user-emacs-directory
- "ido-state"))
+ ido-use-virtual-buffers t)
+
(ido-init-completion-maps)
(defun ido-manual-merge ()
(interactive)
--
cgit 1.4.1
From 6a418f791a153951437596103c7695edae2474e9 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 29 Sep 2013 21:20:50 +0100
Subject: Emacs: install and enable diff-hl-mode
---
emacs/init.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 769c703b..618e718b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -775,6 +775,10 @@ Also returns nil if pid is nil."
:config (progn
(setq vc-follow-symlinks t)))
+(use-package diff-hl
+ :ensure t
+ :init (global-diff-hl-mode))
+
(use-package magit
:commands (magit-status)
:bind (("C-x g" . magit-status)
--
cgit 1.4.1
From 02dbcc8ffbdfe73d7e1923d8be8e68cfe44aa1ed Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 2 Oct 2013 07:52:17 +0100
Subject: Emacs: Load multiple-cursors eagerly
---
emacs/init.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 618e718b..546d494c 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -910,11 +910,12 @@ Also returns nil if pid is nil."
(use-package multiple-cursors
:ensure t
- :bind (("C-." . mc/mark-next-like-this)
- ("C-," . mc/mark-previous-like-this)
- ("M-" . mc/mark-all-like-this-dwim)
- ("C-" . mc/mark-more-like-this-extended)
- ("C-S-L" . mc/edit-lines)))
+ :config (progn
+ (bind-key "C-." #'mc/mark-next-like-this)
+ (bind-key "C-," #'mc/mark-previous-like-this)
+ (bind-key "M-" #'mc/mark-all-like-this-dwim)
+ (bind-key "C-" #'mc/mark-more-like-this-extended)
+ (bind-key "C-S-L" #'mc/edit-lines)))
(use-package eldoc
:defer t
--
cgit 1.4.1
From f7bc7d5d4978f57126f6e298cc917388bd6442f5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 2 Oct 2013 07:54:02 +0100
Subject: Emacs: don't insure that SLIME is installed
---
emacs/init.el | 1 -
1 file changed, 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 546d494c..925ff8ee 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1005,7 +1005,6 @@ Also returns nil if pid is nil."
:config (use-package quack))
(use-package slime
- :ensure t
:commands (slime)
:config (progn
(let ((ql-slime-helper (expand-file-name "~/quicklisp/slime-helper.el")))
--
cgit 1.4.1
From dd63c2cfabdffb0b9c8acf780e81e1562fe6e0e9 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 2 Oct 2013 08:01:37 +0100
Subject: Revert "Replace auto-compile-mode with auto-async-byte-compile"
This reverts commit a7d64a6e05aa450dda63f9b8b68e637471b223c5.
---
emacs/init.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 925ff8ee..a8526340 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1053,9 +1053,10 @@ Also returns nil if pid is nil."
;;;; Programming
-(use-package auto-async-byte-compile
+(use-package auto-compile
:ensure t
- :init (add-hook 'emacs-lisp-mode-hook #'auto-async-byte-compile-mode))
+ :commands (auto-compile-on-save-mode)
+ :init (add-hook 'emacs-lisp-mode-hook #'auto-compile-on-save-mode))
(use-package cc-mode
:defer t
--
cgit 1.4.1
From cf9e2160505c1346ff15f6c9f71741c9b715e385 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 5 Oct 2013 11:50:26 +0100
Subject: Emacs: Switch back to auto-compile from auto-async-byte-compile
---
emacs/init.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 618e718b..65f79fc3 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1053,9 +1053,9 @@ Also returns nil if pid is nil."
;;;; Programming
-(use-package auto-async-byte-compile
+(use-package auto-compile
:ensure t
- :init (add-hook 'emacs-lisp-mode-hook #'auto-async-byte-compile-mode))
+ :init (add-hook 'emacs-lisp-mode-hook #'auto-compile-on-save-mode))
(use-package cc-mode
:defer t
--
cgit 1.4.1
From 5390d0cd5e5f3fa7fc47c07e7889d9f5ccb6104b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 5 Oct 2013 11:50:55 +0100
Subject: Emacs: Enable flx in ido
---
emacs/init.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 65f79fc3..7866db6d 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -567,6 +567,11 @@ Values: `desktop', `server', `laptop'")
(ido-initiate-auto-merge (current-buffer)))
(bind-key "C-c C-s" #'ido-manual-merge ido-file-dir-completion-map)))
+(use-package flx-ido
+ :ensure t
+ :init (progn
+ (flx-ido-mode 1)))
+
(use-package smex
:ensure t
:bind (("M-x" . smex)
--
cgit 1.4.1
From 679f2843746576f48e4ffd106a21753346fc4bcb Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 5 Oct 2013 13:13:17 +0100
Subject: Emacs: disable ido-virtual-buffers due to issues with flx-ido
---
emacs/init.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 7866db6d..af453490 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -558,8 +558,7 @@ Values: `desktop', `server', `laptop'")
:config (progn
(setq ido-decorations (quote ("\n›" "" "\n " "\n …" "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]"))
ido-auto-merge-delay-time 99999
- ido-enable-flex-matching t
- ido-use-virtual-buffers t)
+ ido-enable-flex-matching t)
(ido-init-completion-maps)
(defun ido-manual-merge ()
--
cgit 1.4.1
From 375a9800c1ef5cfcaf55361479f19b8e96ef767e Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 07:50:55 +0100
Subject: zsh: remove e alias; duplicate of fasd
---
zsh/zshrc | 1 -
1 file changed, 1 deletion(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index c129e0c6..bc336e56 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -304,7 +304,6 @@ alias lsr="${ls} -tld *(m-2)" # mtime < -2days
alias trans="transmission-remote transmission.home"
alias bitcoin="bitcoind"
alias su="smart_sudo "
-alias e="$EDITOR"
alias E="SUDO_EDITOR=\emacsclient -c -a emacs\" sudoedit"
alias wprop='xprop |awk '\''
/^WM_CLASS/{sub(/.* =/, "instance:"); sub(/,/, "\nclass:"); print}
--
cgit 1.4.1
From 66e32f4a0246c67bde50cd737a3f33f7bc9feb22 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 07:55:17 +0100
Subject: zsh: Enable current path lookup in fasd only when using the e alias
---
zsh/fasdrc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/zsh/fasdrc b/zsh/fasdrc
index efe6e0a3..22259d72 100644
--- a/zsh/fasdrc
+++ b/zsh/fasdrc
@@ -5,5 +5,4 @@ current () {
done
}
-# If you want to have this behavior for all fasd queries
-_FASD_BACKENDS="native current"
+alias e="f -t -e $EDITOR -B current"
--
cgit 1.4.1
From 16b840b18e4d71f916b37ec3de7e3e2dd963449d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 07:57:33 +0100
Subject: Installer: ensure that the fasdrc is symlinked correctly
---
install | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install b/install
index 16d30c58..c3e2feb3 100755
--- a/install
+++ b/install
@@ -35,7 +35,7 @@ install-dot () {
install-dot dotfiles/.git/hooks/ dotfiles/git-hooks/*
install-dot .emacs.d/ dotfiles/emacs/*
-install-dot . dotfiles/^install(.) dotfiles/zsh/zshrc
+install-dot . dotfiles/^install(.) dotfiles/zsh/zshrc dotfiles/zsh/fasdrc
install-dot .ssh/ dotfiles/ssh/*
if [[ -d projects/dwm ]]
then
--
cgit 1.4.1
From caa651f5da454e83d35df086bd40883d6acaab54 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 08:00:38 +0100
Subject: Use git instead of mercurial for cloning dotfiles on new
installations
---
install | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install b/install
index c3e2feb3..6eb45912 100755
--- a/install
+++ b/install
@@ -6,7 +6,7 @@ setopt EXTENDED_GLOB
if [[ ! -d dotfiles && ${(L)host} =~ prefect ]]
then
- hg clone ssh://alan@home.alanpearce.co.uk:22222/dotfiles
+ git clone ssh://alan@home.alanpearce.co.uk:22222/~/dotfiles.git
fi
install-dot () {
--
cgit 1.4.1
From b9575ac8de66afd3a74665751760fa2edbda6061 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 08:16:53 +0100
Subject: Move dotfiles under ~/projects
---
install | 31 ++++++++++++++++---------------
zsh/zshrc | 4 ++--
2 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/install b/install
index 6eb45912..41d82902 100755
--- a/install
+++ b/install
@@ -1,10 +1,11 @@
#!/usr/bin/env zsh
+target=~/projects/dotfiles
pushd $HOME
setopt EXTENDED_GLOB
-if [[ ! -d dotfiles && ${(L)host} =~ prefect ]]
+if [[ ! -d $target && ${(L)host} =~ prefect ]]
then
git clone ssh://alan@home.alanpearce.co.uk:22222/~/dotfiles.git
fi
@@ -33,13 +34,13 @@ install-dot () {
done
}
-install-dot dotfiles/.git/hooks/ dotfiles/git-hooks/*
-install-dot .emacs.d/ dotfiles/emacs/*
-install-dot . dotfiles/^install(.) dotfiles/zsh/zshrc dotfiles/zsh/fasdrc
-install-dot .ssh/ dotfiles/ssh/*
+install-dot $target/.git/hooks/ $target/git-hooks/*
+install-dot .emacs.d/ $target/emacs/*
+install-dot . $target/^install(.) $target/zsh/zshrc $target/zsh/fasdrc
+install-dot .ssh/ $target/ssh/*
if [[ -d projects/dwm ]]
then
- install-dot projects/dwm/ dotfiles/dwm/*
+ install-dot projects/dwm/ $target/dwm/*
fi
if [[ -x =emacs ]]
@@ -53,30 +54,30 @@ then
fi
fasd_cache=~/.zsh/cache/fasd-init-zsh
-if [[ ! -s "$fasd_cache" || dotfiles/zsh/functions/fasd -nt "$fasd_cache" ]]; then
- dotfiles/zsh/functions/fasd/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
+if [[ ! -s "$fasd_cache" || $target/zsh/functions/fasd -nt "$fasd_cache" ]]; then
+ $target/zsh/functions/fasd/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache"
fi
autoload -U zrecompile
local -a zfiles
zfiles=(
- dotfiles/zsh/functions/fasd/fasd
+ $target/zsh/functions/fasd/fasd
$fasd_cache
- dotfiles/zsh/zshrc
+ $target/zsh/zshrc
)
-if [[ -f dotfiles/zsh/zshrc_${HOST%%.*} ]]; then
- zfiles+=dotfiles/zsh/zshrc_${HOST%%.*}
+if [[ -f $target/zsh/zshrc_${HOST%%.*} ]]; then
+ zfiles+=$target/zsh/zshrc_${HOST%%.*}
fi
if [[ -e /usr/bin/emerge ]]; then
- zfiles+=dotfiles/zsh/zshrc_gentoo
+ zfiles+=$target/zsh/zshrc_gentoo
fi
if [[ $OSTYPE == freebsd* ]]; then
- zfiles+=dotfiles/zsh/zshrc_freebsd
+ zfiles+=$target/zsh/zshrc_freebsd
fi
zrecompile -p -R ~/.zshrc.zwc $zfiles
-for fp in dotfiles/zsh/functions/*(/); do
+for fp in $target/zsh/functions/*(/); do
zrecompile -p $fp $fp/*
done
diff --git a/zsh/zshrc b/zsh/zshrc
index bc336e56..672ed7ce 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -24,10 +24,10 @@ then
mkdir -p ~/.zsh/cache
fi
-myfuncs=( ~alan/dotfiles/zsh/functions/*(/) )
+myfuncs=( ~alan/projects/dotfiles/zsh/functions/*(/) )
fpath=(
$myfuncs
- ~alan/dotfiles/zsh/completion/
+ ~alan/projects/dotfiles/zsh/completion/
$fpath
)
--
cgit 1.4.1
From cd3947fad742a604cb5be03cc1378d803cd032c5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 08:30:02 +0100
Subject: Remove unneeded canonicalisation from installer
---
install | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/install b/install
index 41d82902..b3dd84a3 100755
--- a/install
+++ b/install
@@ -11,25 +11,11 @@ then
fi
install-dot () {
- local absolute
- if [[ ${1[-1]} == "/" ]]
- then
- absolute=$PWD/
-
- if [[ ! -d $1 ]]
- then
- mkdir $1
- fi
-
- else
- absolute=""
- fi
-
for f in $@[2,-1]
do
if [[ ! -e $1$f:t ]]
then
- ln -sf $absolute$f $1$f:t
+ ln -sf $f $1$f:t
fi
done
}
--
cgit 1.4.1
From 78847369196226167bdfc8dd04615fbf7ac41f9b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 13:01:10 +0100
Subject: Emacs: switch to the Wordpress coding style in php-mode-hook
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 0b92b4e8..fd54684b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1178,6 +1178,7 @@ Works with: arglist-cont-nonempty, arglist-close."
(unbind-key "C-." php-mode-map)
(if (eq env/location 'home)
(setq php-manual-url "http://docs.home/manual/en/"))
+ (add-hook 'php-mode-hook #'php-enable-wordpress-coding-style)
(add-hook 'php-mode-hook (lambda ()
(set (make-local-variable 'eldoc-documentation-function) #'my-php-eldoc-function)))
(use-package eldoc-php
--
cgit 1.4.1
From 41eefb4a28f5aae4ab78e73cbcb925117b1076ea Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 13:02:35 +0100
Subject: Git: fix path to global gitignore file
---
gitconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gitconfig b/gitconfig
index 9d616709..a31439e2 100644
--- a/gitconfig
+++ b/gitconfig
@@ -22,4 +22,4 @@
[diff]
algorithm = patience
[core]
- excludesfile = /Users/alan/dotfiles/global.gitignore
+ excludesfile = ~/projects/dotfiles/global.gitignore
--
cgit 1.4.1
From cb812e671e45bea0c33a7361f1bd7262f020c46c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 13:10:18 +0100
Subject: Emacs: remove customisation of byte-compile-dest-file for init.el
Instead, rely on installer creating a symlink to ~/projects/dotfiles/init.elc
---
emacs/elisp/ap-functions.el | 11 -----------
emacs/init.el | 7 +------
install | 2 +-
3 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/emacs/elisp/ap-functions.el b/emacs/elisp/ap-functions.el
index 4c300015..19f63320 100644
--- a/emacs/elisp/ap-functions.el
+++ b/emacs/elisp/ap-functions.el
@@ -25,17 +25,6 @@
(error (message "Invalid expression")
(insert (current-kill 0)))))
-;;;###autoload
-(defun ap/byte-compile-get-dest (filename)
- (let ((basename (file-name-nondirectory filename))
- (dirname (file-name-directory filename)))
- (cond
- ((string-equal basename "init.el")
- (if (file-exists-p (concat user-emacs-directory "init.el"))
- (concat user-emacs-directory "init.elc")))
- (t (let (byte-compile-dest-file-function)
- (byte-compile-dest-file filename))))))
-
;;;###autoload
(defun shell-execute (to-current-buffer)
(interactive "P")
diff --git a/emacs/init.el b/emacs/init.el
index fd54684b..76a6ac90 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -877,8 +877,7 @@ Also returns nil if pid is nil."
("M-Z" . zap-to-char)))
(use-package ap-functions
- :commands (ap/remove-extra-cr
- ap/byte-compile-get-dest)
+ :commands (ap/remove-extra-cr)
:bind (("C-x r M-w" . copy-rectangle)
("M-!" . shell-execute)))
@@ -984,10 +983,6 @@ Also returns nil if pid is nil."
(add-hook 'lisp-mode-hook #'ap/lisp-setup)
(add-hook 'lisp-mode-hook #'set-common-lisp-indentation)
-(use-package bytecomp
- :defer t
- :config (setq byte-compile-dest-file-function #'ap/byte-compile-get-dest))
-
(use-package elisp-slime-nav
:commands elisp-slime-nav-mode
:diminish elisp-slime-nav-mode)
diff --git a/install b/install
index b3dd84a3..13ee6cca 100755
--- a/install
+++ b/install
@@ -21,7 +21,7 @@ install-dot () {
}
install-dot $target/.git/hooks/ $target/git-hooks/*
-install-dot .emacs.d/ $target/emacs/*
+install-dot .emacs.d/ $target/emacs/{init.el{,c},elisp}
install-dot . $target/^install(.) $target/zsh/zshrc $target/zsh/fasdrc
install-dot .ssh/ $target/ssh/*
if [[ -d projects/dwm ]]
--
cgit 1.4.1
From c0633cd67a4a6bfd40cf3eea146cbdc5679916d3 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 7 Oct 2013 13:12:23 +0100
Subject: Emacs: improve font-setting on OSX when running as a daemon
---
emacs/init.el | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 76a6ac90..da2ec6c9 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -135,23 +135,19 @@ Values: `desktop', `server', `laptop'")
"Consolas")))
(variable-face "Segoe UI")
(default-font (concat mono-face "-" (number-to-string font-size))))
- (when mono-face
- (set-face-font 'default default-font)
- (set-face-font 'fixed-pitch default-font))
- (when variable-face
- (set-face-font 'variable-pitch (concat variable-face "-"
- (number-to-string (1+ font-size)))))))
- ((eq window-system 'ns)
+ (when mono-face
+ (add-to-list 'default-frame-alist `(font . ,default-font))
+ (set-face-font 'fixed-pitch default-font))
+ (when variable-face
+ (set-face-font 'variable-pitch (concat variable-face "-"
+ (number-to-string (1+ font-size)))))))
+ ((eq system-type 'darwin)
(let* ((font-size 14)
- (font-list (font-family-list))
- (mono-face (cond
- ((member "Droid Sans Mono" font-list)
- "Droid Sans Mono")))
+ (mono-face "Droid Sans Mono")
(variable-face "Helvetica Neue")
(default-font (concat mono-face "-" (number-to-string font-size))))
- (when mono-face
- (set-face-font 'default default-font)
- (set-face-font 'fixed-pitch default-font))))))
+ (when mono-face
+ (add-to-list 'default-frame-alist `(font . ,default-font)))))))
(with-elapsed-timer "Setting up font styles"
(let* ((font-height (face-attribute 'default :height))
--
cgit 1.4.1
From 4cac4e8b64f52a05837f1f40af9fba355370d5ee Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 17:07:23 +0100
Subject: Add ec and et commands to launch emacsclient in a terminal and GUI
respectively
---
zsh/zshrc | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/zsh/zshrc b/zsh/zshrc
index 672ed7ce..6fd0362b 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -310,6 +310,8 @@ alias wprop='xprop |awk '\''
/^WM_NAME/{sub(/.* =/, "title:"); print}
/^WM_WINDOW_ROLE/{sub(/.* =/, "role:"); print}'\'''
+alias et="emacsclient -t"
+
alias -g ...='../..'
#Suffix aliases
@@ -374,6 +376,28 @@ smart_compile () {
fi
}
+emacs_change_focus () {
+ emacsclient -n -e "(select-frame-set-input-focus (selected-frame))" > /dev/null
+}
+
+ec () {
+ local visibleFrames
+ visibleFrames=`emacsclient -e '(length (visible-frame-list))'`
+ if [[ $? -ne 0 ]]; then
+ print "Daemon not running"
+ return 1
+ fi
+
+ if [[ $visibleFrames -eq 1 ]]; then
+ emacsclient -n -c "$@" && emacs_change_focus
+ else
+ emacs_change_focus
+ if [[ $# -gt 0 ]]; then
+ emacsclient -n "$@"
+ fi
+ fi
+}
+
_FASD_DATA="$HOME/.zsh/fasd-data"
autoload -U fasd
source ~/.zsh/cache/fasd-init-zsh
--
cgit 1.4.1
From 6c2e4f6c0b289fd187fb86f07ac18669d447c07a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 17:10:27 +0100
Subject: Add alias to launch magit in GUI emacs
---
zsh/zshrc | 1 +
1 file changed, 1 insertion(+)
diff --git a/zsh/zshrc b/zsh/zshrc
index 6fd0362b..93f24d04 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -311,6 +311,7 @@ alias wprop='xprop |awk '\''
/^WM_WINDOW_ROLE/{sub(/.* =/, "role:"); print}'\'''
alias et="emacsclient -t"
+alias magit='ec -e "(magit-status \"$PWD\")"'
alias -g ...='../..'
--
cgit 1.4.1
From dbb5119d03819bc73cb2fde72705d1bd40547030 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:10:42 +0100
Subject: Emacs: remove moz-repl mode
---
emacs/init.el | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index da2ec6c9..332a8914 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1111,25 +1111,6 @@ Works with: arglist-cont-nonempty, arglist-close."
;;;; Web Development
-(use-package moz
- :load-path "moz-repl"
- :commands (moz-firefox-reload
- moz-reload-on-save-mode
- moz-minor-mode)
- :config (progn
- (define-minor-mode moz-reload-on-save-mode
- "Moz Reload On Save Minor Mode"
- nil " Reload" nil
- (if moz-reload-on-save-mode
- ;; Edit hook buffer-locally.
- (add-hook 'after-save-hook 'moz-firefox-reload nil t)
- (remove-hook 'after-save-hook 'moz-firefox-reload t)))
-
- (defun moz-firefox-reload ()
- "Reload Firefox"
- (interactive)
- (comint-send-string (inferior-moz-process) "BrowserReload();"))))
-
(use-package skewer-mode
:ensure t
:defer t
--
cgit 1.4.1
From e215529e42c466ae3f3513832af4025cd7b5a92b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:15:20 +0100
Subject: Emacs: fix warning in project-persist configuration
---
emacs/init.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 332a8914..03834a1e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -714,6 +714,8 @@ Values: `desktop', `server', `laptop'")
("C-c P k" . project-persist-close)
("C-c P n" . project-persist-create)
("C-c P s" . project-persist-save))
+ :init (eval-when-compile
+ (autoload #'pp/settings-get "project-persist"))
:config (progn
(project-persist-mode t)
--
cgit 1.4.1
From f59f8736b8601fa96fd96ec643f1ee510653bf5f Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:18:14 +0100
Subject: Emacs: ensure that org-journal is installed
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 03834a1e..0c934fdb 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -684,6 +684,7 @@ Values: `desktop', `server', `laptop'")
(org-todo "STARTED")))))))
(use-package org-journal
+ :ensure t
:config (progn
(setq org-journal-date-format "%A, %d %B %Y")))
--
cgit 1.4.1
From 2cb9ae76a13edbeed2240647633bc9bd13136e69 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:22:57 +0100
Subject: Emacs: remove old-style indentation function
---
emacs/init.el | 41 +----------------------------------------
1 file changed, 1 insertion(+), 40 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 0c934fdb..b62c3085 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1067,46 +1067,7 @@ Also returns nil if pid is nil."
(awk-mode . "awk")
(other . "k&r"))
c-basic-offset 4)
- (c-set-offset 'case-label '+)
- (c-set-offset 'arglist-cont-nonempty #'ap/c-lineup-arglist)
- (defun ap/c-lineup-arglist (langelem)
- "Line up the current argument line under the first argument.
-
-As a special case, if the indented line is inside a brace block
-construct, the indentation is 0 only. This is intended
-as a \"DWIM\" measure in cases like macros that contains statement
-blocks, e.g:
-
-A_VERY_LONG_MACRO_NAME ({
- some (code, with + long, lines * in[it]);
-});
-<--> c-basic-offset
-
-Works with: arglist-cont-nonempty, arglist-close."
- (save-excursion
- (let ((indent-pos (point)))
-
- (if (c-block-in-arglist-dwim (c-langelem-2nd-pos c-syntactic-element))
- 0
-
- ;; Normal case. Indent to the token after the arglist open paren.
- (goto-char (c-langelem-2nd-pos c-syntactic-element))
- (if (and c-special-brace-lists
- (c-looking-at-special-brace-list))
- ;; Skip a special brace list opener like "({".
- (progn (c-forward-token-2)
- (forward-char))
- (forward-char))
-
- (let ((arglist-content-start (point)))
- (c-forward-syntactic-ws)
- (when (< (point) indent-pos)
- (goto-char arglist-content-start)
- (skip-chars-forward " \t"))
- (vector (if (or (looking-at ",")
- (looking-at ")"))
- (- (current-column) 2)
- (current-column))))))))))
+ (c-set-offset 'case-label '+)))
(use-package quickrun
:defer t
--
cgit 1.4.1
From bd5457d65b55bb66485090b81d0ea0f13473fdbe Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:25:01 +0100
Subject: Emacs: remove commented-out code
---
emacs/init.el | 2 --
1 file changed, 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index b62c3085..2182f38b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1059,8 +1059,6 @@ Also returns nil if pid is nil."
:defer t
:init (progn
(add-hook 'c-mode-common-hook (lambda ()
- ;; (use-package mic-paren
- ;; :init (paren-toggle-open-paren-context 1))
(electric-indent-mode 1))))
:config (progn
(setq c-default-style '((java-mode . "java")
--
cgit 1.4.1
From 1848881661a8271891e6806af061764fb0fb7a12 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:25:44 +0100
Subject: Emacs: remove unnecessary lambda function
---
emacs/init.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 2182f38b..6d2dafe1 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1058,8 +1058,7 @@ Also returns nil if pid is nil."
(use-package cc-mode
:defer t
:init (progn
- (add-hook 'c-mode-common-hook (lambda ()
- (electric-indent-mode 1))))
+ (add-hook 'c-mode-common-hook #'electric-indent-mode))
:config (progn
(setq c-default-style '((java-mode . "java")
(awk-mode . "awk")
--
cgit 1.4.1
From e3acf5d644cb1137db38e66cddbdfa87e6aa7f88 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:32:48 +0100
Subject: Emacs: silence compiler warning about unused variable
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 6d2dafe1..6844502a 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -577,7 +577,7 @@ Values: `desktop', `server', `laptop'")
:config (progn
(setq smex-key-advice-ignore-menu-bar t
smex-auto-update nil)
- (defun smex-update-after-load (unused)
+ (defun smex-update-after-load (_unused)
(if (boundp 'smex-cache)
(smex-update)))
(add-hook 'after-load-functions 'smex-update-after-load))
--
cgit 1.4.1
From d0f58576663d1005503cb148fc63c3cdaf620501 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:34:00 +0100
Subject: Emacs: set a variable pitch font under darwin
---
emacs/init.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 6844502a..12a5f53d 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -147,7 +147,10 @@ Values: `desktop', `server', `laptop'")
(variable-face "Helvetica Neue")
(default-font (concat mono-face "-" (number-to-string font-size))))
(when mono-face
- (add-to-list 'default-frame-alist `(font . ,default-font)))))))
+ (add-to-list 'default-frame-alist `(font . ,default-font)))
+ (when variable-face
+ (set-face-font 'variable-pitch (concat variable-face "-"
+ (number-to-string (1+ font-size)))))))))
(with-elapsed-timer "Setting up font styles"
(let* ((font-height (face-attribute 'default :height))
--
cgit 1.4.1
From 27aefd3262ab94a65b1dbaf093ee57e7153eeb57 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:46:00 +0100
Subject: Emacs: fix reference to missing font on OSX
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 12a5f53d..f2d8f90b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -144,7 +144,7 @@ Values: `desktop', `server', `laptop'")
((eq system-type 'darwin)
(let* ((font-size 14)
(mono-face "Droid Sans Mono")
- (variable-face "Helvetica Neue")
+ (variable-face "Helvetica_Neue")
(default-font (concat mono-face "-" (number-to-string font-size))))
(when mono-face
(add-to-list 'default-frame-alist `(font . ,default-font)))
--
cgit 1.4.1
From cb96fbeff86f259cabefd4926a97d770e0201efd Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 8 Oct 2013 21:48:57 +0100
Subject: Emacs: remove call to moz-minor-mode
---
emacs/init.el | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index f2d8f90b..60a35fd9 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1088,9 +1088,7 @@ Also returns nil if pid is nil."
:mode ("\\.js\\'" . js2-mode)
:config (progn
(defun ap/javascript-setup ()
- (if (featurep 'moz)
- (moz-minor-mode))
- (autopair-mode -1)
+ (autopair-mode -1)
(auto-indent-mode -1))
(add-hook 'js2-mode-hook #'ap/javascript-setup)
(setq js2-basic-offset 4
--
cgit 1.4.1
From b8fa55df0cee0d976d69dd188fcc64e179d04c97 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 9 Oct 2013 07:43:39 +0100
Subject: zsh: Remove duplicate fasd e alias
---
zsh/zshrc | 1 -
1 file changed, 1 deletion(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index 93f24d04..b60e3d81 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -402,4 +402,3 @@ ec () {
_FASD_DATA="$HOME/.zsh/fasd-data"
autoload -U fasd
source ~/.zsh/cache/fasd-init-zsh
-alias e="f -e $EDITOR"
--
cgit 1.4.1
From 692c8fdc954ebe282f96ca63dcfe04e8fc651116 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 10 Oct 2013 17:09:23 +0100
Subject: Emacs: add register for zshrc
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 60a35fd9..96a2cf64 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -524,6 +524,7 @@ Values: `desktop', `server', `laptop'")
(bind-key "s-x" (define-prefix-command 'super-x-map))
(set-register ?e `(file . ,*init-file*))
+(set-register ?z `(file . ,(expand-file-name ".zshrc" "~")))
;; Enable narrowing functions C-x n
(put 'narrow-to-defun 'disabled nil)
--
cgit 1.4.1
From bed8fd45eda6788e315b5ee47e09fa9e7291b63c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 10 Oct 2013 17:10:33 +0100
Subject: zsh: Add alias to open the current directory in Emacs' dired
---
zsh/zshrc | 1 +
1 file changed, 1 insertion(+)
diff --git a/zsh/zshrc b/zsh/zshrc
index b60e3d81..c3b41372 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -312,6 +312,7 @@ alias wprop='xprop |awk '\''
alias et="emacsclient -t"
alias magit='ec -e "(magit-status \"$PWD\")"'
+alias dired='ec -e "(dired \"$PWD\")"'
alias -g ...='../..'
--
cgit 1.4.1
From ff17a94532bbd44709db6b71d6d9f67de39e8a89 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 12 Oct 2013 15:12:17 +0100
Subject: Emacs: workaround issue setting variable-pitch fonts on OSX
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 96a2cf64..6b8a253d 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -148,7 +148,7 @@ Values: `desktop', `server', `laptop'")
(default-font (concat mono-face "-" (number-to-string font-size))))
(when mono-face
(add-to-list 'default-frame-alist `(font . ,default-font)))
- (when variable-face
+ (when (and variable-face (display-graphic-p))
(set-face-font 'variable-pitch (concat variable-face "-"
(number-to-string (1+ font-size)))))))))
--
cgit 1.4.1
From 9200045481dd98c9fd3fba601c53cd9040035266 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 12 Oct 2013 16:50:53 +0100
Subject: Emacs: bind s-, to open emacs init file from register
---
emacs/init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 6b8a253d..ad8fd754 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -523,6 +523,9 @@ Values: `desktop', `server', `laptop'")
(bind-key "s-x" (define-prefix-command 'super-x-map))
+(bind-key "s-," (lambda ()
+ (interactive)
+ (jump-to-register ?e)))
(set-register ?e `(file . ,*init-file*))
(set-register ?z `(file . ,(expand-file-name ".zshrc" "~")))
--
cgit 1.4.1
From 935f48e57f591495e345b976933c32dd83bfed6d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 12 Oct 2013 17:33:11 +0100
Subject: zsh: Disable globbing for the salt command
---
zsh/zshrc | 1 +
1 file changed, 1 insertion(+)
diff --git a/zsh/zshrc b/zsh/zshrc
index c3b41372..9224464a 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -301,6 +301,7 @@ alias llr="ll -t"
alias gpp='g++'
alias lsr="${ls} -tld *(m-2)" # mtime < -2days
+alias salt="noglob salt"
alias trans="transmission-remote transmission.home"
alias bitcoin="bitcoind"
alias su="smart_sudo "
--
cgit 1.4.1
From a9410aefcbeb39343a4cb11311d9bea14e99d931 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 12 Oct 2013 21:40:03 +0100
Subject: Emacs: Disable smart-tabs-mode in ruby-mode
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index ad8fd754..2c475fb6 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -484,7 +484,7 @@ Values: `desktop', `server', `laptop'")
smart-tabs-mode-enable
smart-tabs-advice)
:config (progn
- (smart-tabs-insinuate 'c 'javascript 'cperl 'python 'ruby)
+ (smart-tabs-insinuate 'c 'javascript 'cperl 'python)
(add-hook 'php-mode-hook #'smart-tabs-mode-enable)))
;;;; Keybindings
--
cgit 1.4.1
From 5437177559b02eab5348f19b716bf425bff9848c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 19 Oct 2013 14:06:06 +0100
Subject: zsh: Add alias for prettyping.sh
---
zsh/zshrc | 1 +
1 file changed, 1 insertion(+)
diff --git a/zsh/zshrc b/zsh/zshrc
index 9224464a..6fe27db7 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -302,6 +302,7 @@ alias gpp='g++'
alias lsr="${ls} -tld *(m-2)" # mtime < -2days
alias salt="noglob salt"
+alias pping="prettyping.sh"
alias trans="transmission-remote transmission.home"
alias bitcoin="bitcoind"
alias su="smart_sudo "
--
cgit 1.4.1
From d5bde98df481dbbd7407e8d968f985da32220c64 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 19 Oct 2013 17:41:01 +0100
Subject: Update pure prompt
---
zsh/functions/pure/prompt_pure_setup | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup
index 1bbe2673..275224ad 100644
--- a/zsh/functions/pure/prompt_pure_setup
+++ b/zsh/functions/pure/prompt_pure_setup
@@ -18,8 +18,8 @@
# fastest possible way to check if repo is dirty
prompt_pure_git_dirty() {
- # check if we're at the top level of a git repo
- [[ -d .git ]] || return
+ # check if we're in a git repo
+ command git rev-parse --is-inside-work-tree &>/dev/null || return
# check if it's dirty
command git diff --quiet --ignore-submodules HEAD &>/dev/null
@@ -28,17 +28,24 @@ prompt_pure_git_dirty() {
# displays the exec time of the last command if set threshold was exceeded
prompt_pure_cmd_exec_time() {
- local stop=`date +%s`
+ local stop=$(date +%s)
local start=${cmd_timestamp:-$stop}
integer elapsed=$stop-$start
(($elapsed > ${PURE_CMD_MAX_EXEC_TIME:=5})) && echo ${elapsed}s
}
prompt_pure_preexec() {
- cmd_timestamp=`date +%s`
+ cmd_timestamp=$(date +%s)
# shows the current dir and executed command in the title when a process is active
- print -Pn "\e]0;$PWD:t: $2\a"
+ print -Pn "\e]0;"
+ echo -nE "$PWD:t: $2"
+ print -Pn "\a"
+}
+
+# string length ignoring ansi escapes
+prompt_pure_string_length() {
+ echo ${#${(S%%)1//(\%([KF1]|)\{*\}|\%[Bbkf])}}
}
prompt_pure_precmd() {
@@ -48,7 +55,21 @@ prompt_pure_precmd() {
# git info
vcs_info
- print -P '%F{blue}%~%F{11}$vcs_info_msg_0_`prompt_pure_git_dirty` $prompt_pure_username%f %F{yellow}`prompt_pure_cmd_exec_time`%f'
+ local prompt_pure_preprompt='\n%F{blue}%~%F{242}$vcs_info_msg_0_`prompt_pure_git_dirty` $prompt_pure_username%f %F{yellow}`prompt_pure_cmd_exec_time`%f'
+ print -P $prompt_pure_preprompt
+
+ # check async if there is anything to pull
+ {
+ # check if we're in a git repo
+ command git rev-parse --is-inside-work-tree &>/dev/null &&
+ # check check if there is anything to pull
+ command git fetch &>/dev/null &&
+ # check if there is an upstream configured for this branch
+ command git rev-parse --abbrev-ref @'{u}' &>/dev/null &&
+ (( $(command git rev-list --count HEAD...@'{u}' 2>/dev/null) > 0 )) &&
+ # some crazy ansi magic to inject the symbol into the previous line
+ print -Pn "\e7\e[A\e[1G\e[`prompt_pure_string_length $prompt_pure_preprompt`C%F{cyan}⇣%f\e8"
+ } &!
# reset value since `preexec` isn't always triggered
unset cmd_timestamp
@@ -72,7 +93,7 @@ prompt_pure_setup() {
[[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username='%n@%m '
# prompt turns red if the previous command didn't exit with 0
- PROMPT='%(?.%F{14}.%F{magenta})❯%f '
+ PROMPT='%(?.%F{magenta}.%F{red})❯%f '
}
prompt_pure_setup "$@"
--
cgit 1.4.1
From 7155b75d6f9e33c5a5c83aacfc25421139b0c5ec Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 20 Oct 2013 09:44:52 +0100
Subject: zsh: increase contrast of pure prompt character
---
zsh/functions/pure/prompt_pure_setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup
index 275224ad..a263e67d 100644
--- a/zsh/functions/pure/prompt_pure_setup
+++ b/zsh/functions/pure/prompt_pure_setup
@@ -93,7 +93,7 @@ prompt_pure_setup() {
[[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username='%n@%m '
# prompt turns red if the previous command didn't exit with 0
- PROMPT='%(?.%F{magenta}.%F{red})❯%f '
+ PROMPT='%(?.%F{cyan}.%F{red})❯%f '
}
prompt_pure_setup "$@"
--
cgit 1.4.1
From ec791b21441395aab300552142378ff87aa2579d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 20 Oct 2013 09:45:14 +0100
Subject: zsh: Fix pure pull indicator showing when ahead of upstream
---
zsh/functions/pure/prompt_pure_setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup
index a263e67d..dae1fbb6 100644
--- a/zsh/functions/pure/prompt_pure_setup
+++ b/zsh/functions/pure/prompt_pure_setup
@@ -66,7 +66,7 @@ prompt_pure_precmd() {
command git fetch &>/dev/null &&
# check if there is an upstream configured for this branch
command git rev-parse --abbrev-ref @'{u}' &>/dev/null &&
- (( $(command git rev-list --count HEAD...@'{u}' 2>/dev/null) > 0 )) &&
+ (( $(command git rev-list --right-only --count HEAD...@'{u}' 2>/dev/null) > 0 )) &&
# some crazy ansi magic to inject the symbol into the previous line
print -Pn "\e7\e[A\e[1G\e[`prompt_pure_string_length $prompt_pure_preprompt`C%F{cyan}⇣%f\e8"
} &!
--
cgit 1.4.1
From a9e7dbba3ee826f807546e8c94df2b17e5da6518 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 21 Oct 2013 07:55:55 +0100
Subject: Emacs: eagerly load dired and dired+
---
emacs/init.el | 2 --
1 file changed, 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 2c475fb6..7704546b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -345,7 +345,6 @@ Values: `desktop', `server', `laptop'")
;;;; Directory browsing
(use-package dired
- :defer t
:config (progn
(bind-key "" #'dired-find-file dired-mode-map)
(bind-key "^" (lambda () (interactive) (find-alternate-file "..")) dired-mode-map)
@@ -356,7 +355,6 @@ Values: `desktop', `server', `laptop'")
(put 'dired-find-alternate-file 'disabled nil)))
(use-package dired+
- :defer t
:ensure t
:config (diredp-toggle-find-file-reuse-dir 1))
--
cgit 1.4.1
From 333c045fd15b0b06d76a905269a24fd8a54df7ef Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 21 Oct 2013 07:56:51 +0100
Subject: Emacs: load tramp on startup
---
emacs/init.el | 1 -
1 file changed, 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 7704546b..e6b1b0e3 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -420,7 +420,6 @@ Values: `desktop', `server', `laptop'")
(setq save-place-file (expand-file-name ".saveplace" user-emacs-directory))))
(use-package tramp
- :defer t
:config (progn
(setq tramp-default-method (if (eq system-type 'windows-nt) "plinkx" "ssh")
tramp-default-user-alist '(("\\`su\\(do\\)?\\'" nil "root") (nil nil "alan"))
--
cgit 1.4.1
From ae9ebe7419131e020ad39b67dd595cd2d64eed27 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 21 Oct 2013 07:57:48 +0100
Subject: Emacs: load cc-mode on startup
---
emacs/init.el | 1 -
1 file changed, 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index e6b1b0e3..c56c142a 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1060,7 +1060,6 @@ Also returns nil if pid is nil."
:init (add-hook 'emacs-lisp-mode-hook #'auto-compile-on-save-mode))
(use-package cc-mode
- :defer t
:init (progn
(add-hook 'c-mode-common-hook #'electric-indent-mode))
:config (progn
--
cgit 1.4.1
From 63df4b48d2e8017c98c9af35a8a8d31ff7cac78b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 22 Oct 2013 15:20:51 +0100
Subject: Emacs: use current frame when handling OSX open-file event
---
emacs/init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index c56c142a..174438a9 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1162,3 +1162,6 @@ Also returns nil if pid is nil."
("S-" . windmove-right)
("S-" . windmove-up)
("S-" . windmove-down)))
+
+(if (eq system-type 'darwin)
+ (setq ns-pop-up-frames nil))
--
cgit 1.4.1
From ac2ffde265b616d60a56b7b806fef85368bd3d25 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 31 Oct 2013 21:50:49 +0000
Subject: Emacs: run diff-hl-update when magit refreshes a buffer
---
emacs/init.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 174438a9..6a4a121d 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -784,7 +784,9 @@ Also returns nil if pid is nil."
(use-package diff-hl
:ensure t
- :init (global-diff-hl-mode))
+ :init (progn
+ (global-diff-hl-mode)
+ (add-hook 'magit-refresh-file-buffer-hook #'diff-hl-update)))
(use-package magit
:commands (magit-status)
--
cgit 1.4.1
From 6d996c60ff93d5c9ff01015e89b5932eb190eafc Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 31 Oct 2013 21:50:15 +0000
Subject: zsh: Add zsh-completions to fpath
---
zsh/zshrc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/zsh/zshrc b/zsh/zshrc
index 6fe27db7..c30c4635 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -30,6 +30,10 @@ fpath=(
~alan/projects/dotfiles/zsh/completion/
$fpath
)
+if [[ -d /usr/local/share/zsh-completions ]]
+then
+ fpath=(/usr/local/share/zsh-completions $fpath)
+fi
export PATH
export PAGER="less"
--
cgit 1.4.1
From 7d8493f63daf93beb4c82d0c9602fc21974daca7 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 1 Nov 2013 07:49:20 +0000
Subject: zsh: rename auxillary files with extension
---
install | 8 ++++----
zsh/freebsd.zsh | 8 ++++++++
zsh/gentoo.zsh | 4 ++++
zsh/prefect.zsh | 10 ++++++++++
zsh/server.zsh | 20 ++++++++++++++++++++
zsh/sheldon.zsh | 5 +++++
zsh/st.zsh | 2 ++
zsh/zshrc_freebsd | 8 --------
zsh/zshrc_gentoo | 4 ----
zsh/zshrc_prefect | 10 ----------
zsh/zshrc_server | 20 --------------------
zsh/zshrc_sheldon | 5 -----
zsh/zshrc_st | 2 --
13 files changed, 53 insertions(+), 53 deletions(-)
create mode 100755 zsh/freebsd.zsh
create mode 100644 zsh/gentoo.zsh
create mode 100644 zsh/prefect.zsh
create mode 100644 zsh/server.zsh
create mode 100644 zsh/sheldon.zsh
create mode 100644 zsh/st.zsh
delete mode 100755 zsh/zshrc_freebsd
delete mode 100644 zsh/zshrc_gentoo
delete mode 100644 zsh/zshrc_prefect
delete mode 100644 zsh/zshrc_server
delete mode 100644 zsh/zshrc_sheldon
delete mode 100644 zsh/zshrc_st
diff --git a/install b/install
index 13ee6cca..74cf8c43 100755
--- a/install
+++ b/install
@@ -51,14 +51,14 @@ zfiles=(
$fasd_cache
$target/zsh/zshrc
)
-if [[ -f $target/zsh/zshrc_${HOST%%.*} ]]; then
- zfiles+=$target/zsh/zshrc_${HOST%%.*}
+if [[ -f $target/zsh/${HOST%%.*}.zsh ]]; then
+ zfiles+=$target/zsh/${HOST%%.*}.zsh
fi
if [[ -e /usr/bin/emerge ]]; then
- zfiles+=$target/zsh/zshrc_gentoo
+ zfiles+=$target/zsh/gentoo.zsh
fi
if [[ $OSTYPE == freebsd* ]]; then
- zfiles+=$target/zsh/zshrc_freebsd
+ zfiles+=$target/zsh/freebsd.zsh
fi
zrecompile -p -R ~/.zshrc.zwc $zfiles
diff --git a/zsh/freebsd.zsh b/zsh/freebsd.zsh
new file mode 100755
index 00000000..62612611
--- /dev/null
+++ b/zsh/freebsd.zsh
@@ -0,0 +1,8 @@
+#!/usr/bin/env zsh
+function update-check () {
+ sudo portsnap update
+ sudo portmaster -L --index-only | awk '/ [Nn]ew / { print substr($0,9,9999) }'
+ sudo portaudit -Fa -X 1
+ pkg_updating -d $( ls -ltr -D '%Y%m%d' /var/db/pkg | awk 'END{print $6}' )
+}
+alias iotop="top -m io -o total"
diff --git a/zsh/gentoo.zsh b/zsh/gentoo.zsh
new file mode 100644
index 00000000..7af53466
--- /dev/null
+++ b/zsh/gentoo.zsh
@@ -0,0 +1,4 @@
+#Distributed merge
+dmerge () {
+ MAKEOPTS='-j10' FEATURES='ccache distcc' emerge "$@"
+}
\ No newline at end of file
diff --git a/zsh/prefect.zsh b/zsh/prefect.zsh
new file mode 100644
index 00000000..997ba391
--- /dev/null
+++ b/zsh/prefect.zsh
@@ -0,0 +1,10 @@
+EDITOR="emacs"
+VISUAL="emacs"
+
+if [[ ! -S $SSH_AUTH_SOCK ]]
+then
+ eval `ssh-agent | sed -e '/^echo/d'`
+ linkAuthSock $SSH_AUTH_SOCK
+fi
+
+export WINEARCH="win32"
\ No newline at end of file
diff --git a/zsh/server.zsh b/zsh/server.zsh
new file mode 100644
index 00000000..d9d74219
--- /dev/null
+++ b/zsh/server.zsh
@@ -0,0 +1,20 @@
+# -*- shell-script -*-
+
+export SVDIR=/service
+if [[ "$EUID" == "0" ]] || [[ "$USER" == "root" ]]
+then
+ export EDITOR="emacs -nw"
+else
+ export ALTERNATE_EDITOR="emacs"
+ export EDITOR="emacsclient"
+fi
+
+mailpath=
+
+# Folder aliases
+hash -d music=/tank/media/Music
+
+zstyle ':completion:*' local server /tank/www/internal ''
+zstyle ':completion:*' local external /tank/www/external
+zstyle ':completion:*' local alphapulsar.uk.to /tank/www/gaming
+zstyle ':completion:*' local home.alanpearce.co.uk /tank/www/external
diff --git a/zsh/sheldon.zsh b/zsh/sheldon.zsh
new file mode 100644
index 00000000..6168baee
--- /dev/null
+++ b/zsh/sheldon.zsh
@@ -0,0 +1,5 @@
+if [[ ! -S $SSH_AUTH_SOCK ]]
+then
+ eval `ssh-agent | sed -e '/^echo/d'`
+ linkAuthSock $SSH_AUTH_SOCK
+fi
diff --git a/zsh/st.zsh b/zsh/st.zsh
new file mode 100644
index 00000000..a449ef92
--- /dev/null
+++ b/zsh/st.zsh
@@ -0,0 +1,2 @@
+hash -d tf=/opt/steam/orangebox/tf
+hash -d sv=/etc/sv/tf2
\ No newline at end of file
diff --git a/zsh/zshrc_freebsd b/zsh/zshrc_freebsd
deleted file mode 100755
index 62612611..00000000
--- a/zsh/zshrc_freebsd
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env zsh
-function update-check () {
- sudo portsnap update
- sudo portmaster -L --index-only | awk '/ [Nn]ew / { print substr($0,9,9999) }'
- sudo portaudit -Fa -X 1
- pkg_updating -d $( ls -ltr -D '%Y%m%d' /var/db/pkg | awk 'END{print $6}' )
-}
-alias iotop="top -m io -o total"
diff --git a/zsh/zshrc_gentoo b/zsh/zshrc_gentoo
deleted file mode 100644
index 7af53466..00000000
--- a/zsh/zshrc_gentoo
+++ /dev/null
@@ -1,4 +0,0 @@
-#Distributed merge
-dmerge () {
- MAKEOPTS='-j10' FEATURES='ccache distcc' emerge "$@"
-}
\ No newline at end of file
diff --git a/zsh/zshrc_prefect b/zsh/zshrc_prefect
deleted file mode 100644
index 997ba391..00000000
--- a/zsh/zshrc_prefect
+++ /dev/null
@@ -1,10 +0,0 @@
-EDITOR="emacs"
-VISUAL="emacs"
-
-if [[ ! -S $SSH_AUTH_SOCK ]]
-then
- eval `ssh-agent | sed -e '/^echo/d'`
- linkAuthSock $SSH_AUTH_SOCK
-fi
-
-export WINEARCH="win32"
\ No newline at end of file
diff --git a/zsh/zshrc_server b/zsh/zshrc_server
deleted file mode 100644
index d9d74219..00000000
--- a/zsh/zshrc_server
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- shell-script -*-
-
-export SVDIR=/service
-if [[ "$EUID" == "0" ]] || [[ "$USER" == "root" ]]
-then
- export EDITOR="emacs -nw"
-else
- export ALTERNATE_EDITOR="emacs"
- export EDITOR="emacsclient"
-fi
-
-mailpath=
-
-# Folder aliases
-hash -d music=/tank/media/Music
-
-zstyle ':completion:*' local server /tank/www/internal ''
-zstyle ':completion:*' local external /tank/www/external
-zstyle ':completion:*' local alphapulsar.uk.to /tank/www/gaming
-zstyle ':completion:*' local home.alanpearce.co.uk /tank/www/external
diff --git a/zsh/zshrc_sheldon b/zsh/zshrc_sheldon
deleted file mode 100644
index 6168baee..00000000
--- a/zsh/zshrc_sheldon
+++ /dev/null
@@ -1,5 +0,0 @@
-if [[ ! -S $SSH_AUTH_SOCK ]]
-then
- eval `ssh-agent | sed -e '/^echo/d'`
- linkAuthSock $SSH_AUTH_SOCK
-fi
diff --git a/zsh/zshrc_st b/zsh/zshrc_st
deleted file mode 100644
index a449ef92..00000000
--- a/zsh/zshrc_st
+++ /dev/null
@@ -1,2 +0,0 @@
-hash -d tf=/opt/steam/orangebox/tf
-hash -d sv=/etc/sv/tf2
\ No newline at end of file
--
cgit 1.4.1
From ee2a411d3eb0fd2025b24a9b48aa47c9269bf728 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 1 Nov 2013 08:06:50 +0000
Subject: zsh: Recompile compdump file in dotfiles installer
---
install | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/install b/install
index 74cf8c43..d78200fd 100755
--- a/install
+++ b/install
@@ -61,7 +61,8 @@ if [[ $OSTYPE == freebsd* ]]; then
zfiles+=$target/zsh/freebsd.zsh
fi
-zrecompile -p -R ~/.zshrc.zwc $zfiles
+zrecompile -p -R ~/.zshrc.zwc $zfiles -- \
+ -M .zsh/cache/compdump
for fp in $target/zsh/functions/*(/); do
zrecompile -p $fp $fp/*
--
cgit 1.4.1
From f1a0100b3beca48b17601156da733d69027a0c4d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 1 Nov 2013 18:05:59 +0000
Subject: zsh: Remove check for cache directory; it's created by the installer
---
zsh/zshrc | 5 -----
1 file changed, 5 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index c30c4635..be73b30a 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -19,11 +19,6 @@ then
fi
fi
-if [[ ! -d ~/.zsh/cache ]]
-then
- mkdir -p ~/.zsh/cache
-fi
-
myfuncs=( ~alan/projects/dotfiles/zsh/functions/*(/) )
fpath=(
$myfuncs
--
cgit 1.4.1
From 3f38a0e5aa2dc0f22491cde5f2432275f811ed90 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 1 Nov 2013 18:13:27 +0000
Subject: zsh: Remove title-changing precmd function
---
zsh/zshrc | 8 --------
1 file changed, 8 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index be73b30a..a08cee03 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -326,14 +326,6 @@ fi
# Functions
-precmd () {
- [[ -t 1 ]] || return
- case $TERM in
- *xterm*|rxvt|putty|(dt|k|E)term|screen*) print -Pn "\e]2;%~\a"
- ;;
- esac
-}
-
pid () {
local i
for i in /proc/<->/stat
--
cgit 1.4.1
From fe9f97e2738ba591b8fc2d70f59067d5bd152fe3 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 1 Nov 2013 18:17:31 +0000
Subject: zsh: Refactor magit and dired into functions
---
zsh/zshrc | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc
index a08cee03..28356be5 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -312,8 +312,6 @@ alias wprop='xprop |awk '\''
/^WM_WINDOW_ROLE/{sub(/.* =/, "role:"); print}'\'''
alias et="emacsclient -t"
-alias magit='ec -e "(magit-status \"$PWD\")"'
-alias dired='ec -e "(dired \"$PWD\")"'
alias -g ...='../..'
@@ -326,6 +324,14 @@ fi
# Functions
+magit () {
+ emacsclient -e "(magit-status \"$PWD\")"
+}
+
+dired () {
+ emacsclient -e "(dired \"$PWD\")"
+}
+
pid () {
local i
for i in /proc/<->/stat
--
cgit 1.4.1
From 604b55aac4676abb5be423b56c3964d9b4967119 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 1 Nov 2013 18:23:22 +0000
Subject: Emacs: Add a margin to ensure the next/previous line is always
visible
---
emacs/init.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 6a4a121d..bb701b58 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1009,7 +1009,7 @@ Also returns nil if pid is nil."
:config (use-package quack))
(use-package slime
- :commands (slime)
+ :commands (slime)
:config (progn
(let ((ql-slime-helper (expand-file-name "~/quicklisp/slime-helper.el")))
(if (file-exists-p ql-slime-helper)
@@ -1065,7 +1065,7 @@ Also returns nil if pid is nil."
:init (progn
(add-hook 'c-mode-common-hook #'electric-indent-mode))
:config (progn
- (setq c-default-style '((java-mode . "java")
+ (setq c-default-style '((java-mode . "java")
(awk-mode . "awk")
(other . "k&r"))
c-basic-offset 4)
@@ -1148,6 +1148,7 @@ Also returns nil if pid is nil."
"%b"))))
(setq scroll-conservatively 100 ; Keep the cursor position when scrolling
+ scroll-margin 1
scroll-preserve-screen-position nil)
(when menu-bar-mode
--
cgit 1.4.1
From 2bba1f9db56179f50a1c8b026353b057b5772bd0 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 1 Nov 2013 18:24:52 +0000
Subject: Emacs: Improve mouse/trackpad scrolling by only scrolling one line at
a time
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index bb701b58..a254dd86 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1149,7 +1149,8 @@ Also returns nil if pid is nil."
(setq scroll-conservatively 100 ; Keep the cursor position when scrolling
scroll-margin 1
- scroll-preserve-screen-position nil)
+ scroll-preserve-screen-position nil
+ mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control))))
(when menu-bar-mode
(menu-bar-mode -1))
--
cgit 1.4.1
From e6902435ee1abeb474960dcd49ee395116f5c2d8 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 2 Nov 2013 14:22:54 +0000
Subject: zsh: Remove file for gentoo
---
zsh/gentoo.zsh | 4 ----
1 file changed, 4 deletions(-)
delete mode 100644 zsh/gentoo.zsh
diff --git a/zsh/gentoo.zsh b/zsh/gentoo.zsh
deleted file mode 100644
index 7af53466..00000000
--- a/zsh/gentoo.zsh
+++ /dev/null
@@ -1,4 +0,0 @@
-#Distributed merge
-dmerge () {
- MAKEOPTS='-j10' FEATURES='ccache distcc' emerge "$@"
-}
\ No newline at end of file
--
cgit 1.4.1
From 66c2254349db463d91d6335dfe4a25ac1329515c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 2 Nov 2013 14:23:42 +0000
Subject: zsh: Remove file for old work laptop
---
zsh/sheldon.zsh | 5 -----
1 file changed, 5 deletions(-)
delete mode 100644 zsh/sheldon.zsh
diff --git a/zsh/sheldon.zsh b/zsh/sheldon.zsh
deleted file mode 100644
index 6168baee..00000000
--- a/zsh/sheldon.zsh
+++ /dev/null
@@ -1,5 +0,0 @@
-if [[ ! -S $SSH_AUTH_SOCK ]]
-then
- eval `ssh-agent | sed -e '/^echo/d'`
- linkAuthSock $SSH_AUTH_SOCK
-fi
--
cgit 1.4.1
From ccc0aad757be54208e0cb90131ab5851ce2d30b8 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 2 Nov 2013 14:24:26 +0000
Subject: zsh: Remove unused file
---
zsh/st.zsh | 2 --
1 file changed, 2 deletions(-)
delete mode 100644 zsh/st.zsh
diff --git a/zsh/st.zsh b/zsh/st.zsh
deleted file mode 100644
index a449ef92..00000000
--- a/zsh/st.zsh
+++ /dev/null
@@ -1,2 +0,0 @@
-hash -d tf=/opt/steam/orangebox/tf
-hash -d sv=/etc/sv/tf2
\ No newline at end of file
--
cgit 1.4.1
From 1fbe0bfe24f527974285342a9cf80d245b469bc9 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 2 Nov 2013 15:15:28 +0000
Subject: zsh: Remove reference to gentoo configuration from installer
---
install | 3 ---
1 file changed, 3 deletions(-)
diff --git a/install b/install
index d78200fd..4923193f 100755
--- a/install
+++ b/install
@@ -54,9 +54,6 @@ zfiles=(
if [[ -f $target/zsh/${HOST%%.*}.zsh ]]; then
zfiles+=$target/zsh/${HOST%%.*}.zsh
fi
-if [[ -e /usr/bin/emerge ]]; then
- zfiles+=$target/zsh/gentoo.zsh
-fi
if [[ $OSTYPE == freebsd* ]]; then
zfiles+=$target/zsh/freebsd.zsh
fi
--
cgit 1.4.1
From 78a76cff334aba875f54fdb5582276e4a9f66807 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 2 Nov 2013 16:01:06 +0000
Subject: zsh: Separate startup files for different startup methods
---
install | 8 +-
zsh/environment.zsh | 43 ++++++
zsh/interactive.zsh | 360 ++++++++++++++++++++++++++++++++++++++++++++++
zsh/login.zsh | 0
zsh/logout.zsh | 0
zsh/zshrc | 404 ----------------------------------------------------
6 files changed, 410 insertions(+), 405 deletions(-)
create mode 100755 zsh/environment.zsh
create mode 100755 zsh/interactive.zsh
create mode 100755 zsh/login.zsh
create mode 100755 zsh/logout.zsh
delete mode 100755 zsh/zshrc
diff --git a/install b/install
index 4923193f..44581a1f 100755
--- a/install
+++ b/install
@@ -22,8 +22,14 @@ install-dot () {
install-dot $target/.git/hooks/ $target/git-hooks/*
install-dot .emacs.d/ $target/emacs/{init.el{,c},elisp}
-install-dot . $target/^install(.) $target/zsh/zshrc $target/zsh/fasdrc
+install-dot . $target/^install(.) $target/zsh/fasdrc
install-dot .ssh/ $target/ssh/*
+
+ln -sf $target/zsh/environment.zsh .zshenv
+ln -sf $target/zsh/interactive.zsh .zshrc
+ln -sf $target/zsh/login.zsh .zlogin
+ln -sf $target/zsh/logout.zsh .zlogout
+
if [[ -d projects/dwm ]]
then
install-dot projects/dwm/ $target/dwm/*
diff --git a/zsh/environment.zsh b/zsh/environment.zsh
new file mode 100755
index 00000000..080e2344
--- /dev/null
+++ b/zsh/environment.zsh
@@ -0,0 +1,43 @@
+if [[ $defpath == "" && -d ~/bin ]]
+then
+ defpath=($path)
+ path=(
+ $defpath
+ ~/bin
+ )
+ if [[ -d ~/.gem/ruby/*/bin ]]
+ then
+ path=(
+ $path
+ ~/.gem/ruby/*/bin
+ )
+ fi
+fi
+
+export PATH
+
+myfuncs=( ~alan/projects/dotfiles/zsh/functions/*(/) )
+fpath=(
+ $myfuncs
+ ~alan/projects/dotfiles/zsh/completion/
+ $fpath
+)
+if [[ -d /usr/local/share/zsh-completions ]]
+then
+ fpath=(/usr/local/share/zsh-completions $fpath)
+fi
+
+export FPATH
+
+case $OSTYPE in
+ *gnu*)
+ os=gnu
+ ;;
+ freebsd*)
+ os=freebsd
+ ;;
+ darwin*)
+ os=osx
+esac
+
+export os
diff --git a/zsh/interactive.zsh b/zsh/interactive.zsh
new file mode 100755
index 00000000..800d97d2
--- /dev/null
+++ b/zsh/interactive.zsh
@@ -0,0 +1,360 @@
+export PAGER="less"
+export EDITOR="emacsclient"
+export CLICOLOR=true
+
+#
+# zsh variables
+#
+HISTFILE=~/.zsh/history
+HISTSIZE=4000
+SAVEHIST=3000
+
+WORDCHARS='*?_-[]~=.&;!#$%^(){}<>'
+
+#If a command takes more than 5 seconds, give statistics
+REPORTTIME=5
+TIMEFMT="%U user %S system %P cpu %*Es total"
+
+#Check for user logins
+watch=notme
+WATCHFMT="%n has %a %l from %M at %t"
+
+hosts=(
+ server
+ prefect
+ alanpearce.co.uk
+ home.alanpearce.co.uk
+ lethalrocks.uk.to
+ alphapulsar.uk.to
+ st.alphapulsar.uk.to
+ a.st.alphapulsar.uk.to
+ st
+)
+
+users=(alan root toor)
+
+function linkAuthSock () {
+ local linkSock=~/.ssh/ssh_auth_sock
+ ln -sf $1 ~/.ssh/ssh_auth_sock
+ export SSH_AUTH_SOCK=$linkSock
+}
+
+if [[ "$SSH_AUTH_SOCK" != "" ]]
+then
+ if [[ -e ~/.ssh/ssh_auth_sock && ! -L ~/.ssh/ssh_auth_sock ]]
+ then
+ linkAuthSock $SSH_AUTH_SOCK
+ fi
+fi
+
+LS_COLORS='no=00:fi=00:di=36:ln=35:pi=30;44:so=35;44:do=35;44:bd=33;44:cd=37;44:or=05;37;41:mi=05;37;41:ex=01;31:*.cmd=01;31:*.exe=01;31:*.com=01;31:*.bat=01;31:*.reg=01;31:*.app=01;31:*.txt=32:*.org=32:*.md=32:*.mkd=32:*.h=32:*.c=32:*.C=32:*.cc=32:*.cpp=32:*.cxx=32:*.objc=32:*.sh=32:*.csh=32:*.zsh=32:*.el=32:*.vim=32:*.java=32:*.pl=32:*.pm=32:*.py=32:*.rb=32:*.hs=32:*.php=32:*.htm=32:*.html=32:*.shtml=32:*.erb=32:*.haml=32:*.xml=32:*.rdf=32:*.css=32:*.sass=32:*.scss=32:*.less=32:*.js=32:*.coffee=32:*.man=32:*.0=32:*.1=32:*.2=32:*.3=32:*.4=32:*.5=32:*.6=32:*.7=32:*.8=32:*.9=32:*.l=32:*.n=32:*.p=32:*.pod=32:*.tex=32:*.bmp=33:*.cgm=33:*.dl=33:*.dvi=33:*.emf=33:*.eps=33:*.gif=33:*.jpeg=33:*.jpg=33:*.JPG=33:*.mng=33:*.pbm=33:*.pcx=33:*.pdf=33:*.pgm=33:*.png=33:*.ppm=33:*.pps=33:*.ppsx=33:*.ps=33:*.svg=33:*.svgz=33:*.tga=33:*.tif=33:*.tiff=33:*.xbm=33:*.xcf=33:*.xpm=33:*.xwd=33:*.xwd=33:*.yuv=33:*.aac=33:*.au=33:*.flac=33:*.mid=33:*.midi=33:*.mka=33:*.mp3=33:*.mpa=33:*.mpeg=33:*.mpg=33:*.ogg=33:*.ra=33:*.wav=33:*.anx=33:*.asf=33:*.avi=33:*.axv=33:*.flc=33:*.fli=33:*.flv=33:*.gl=33:*.m2v=33:*.m4v=33:*.mkv=33:*.mov=33:*.mp4=33:*.mp4v=33:*.mpeg=33:*.mpg=33:*.nuv=33:*.ogm=33:*.ogv=33:*.ogx=33:*.qt=33:*.rm=33:*.rmvb=33:*.swf=33:*.vob=33:*.wmv=33:*.doc=31:*.docx=31:*.rtf=31:*.dot=31:*.dotx=31:*.xls=31:*.xlsx=31:*.ppt=31:*.pptx=31:*.fla=31:*.psd=31:*.7z=1;35:*.apk=1;35:*.arj=1;35:*.bin=1;35:*.bz=1;35:*.bz2=1;35:*.cab=1;35:*.deb=1;35:*.dmg=1;35:*.gem=1;35:*.gz=1;35:*.iso=1;35:*.jar=1;35:*.msi=1;35:*.rar=1;35:*.rpm=1;35:*.tar=1;35:*.tbz=1;35:*.tbz2=1;35:*.tgz=1;35:*.tx=1;35:*.war=1;35:*.xpi=1;35:*.xz=1;35:*.z=1;35:*.Z=1;35:*.zip=1;35:*.ANSI-30-black=30:*.ANSI-01;30-brblack=01;30:*.ANSI-31-red=31:*.ANSI-01;31-brred=01;31:*.ANSI-32-green=32:*.ANSI-01;32-brgreen=01;32:*.ANSI-33-yellow=33:*.ANSI-01;33-bryellow=01;33:*.ANSI-34-blue=34:*.ANSI-01;34-brblue=01;34:*.ANSI-35-magenta=35:*.ANSI-01;35-brmagenta=01;35:*.ANSI-36-cyan=36:*.ANSI-01;36-brcyan=01;36:*.ANSI-37-white=37:*.ANSI-01;37-brwhite=01;37:*.log=01;34:*~=01;34:*#=01;34:*.bak=01;36:*.BAK=01;36:*.old=01;36:*.OLD=01;36:*.org_archive=01;36:*.off=01;36:*.OFF=01;36:*.dist=01;36:*.DIST=01;36:*.orig=01;36:*.ORIG=01;36:*.swp=01;36:*.swo=01;36:*,v=01;36:*.gpg=34:*.gpg=34:*.pgp=34:*.asc=34:*.3des=34:*.aes=34:*.enc=34:'
+
+#Ignore suffixes in completion
+fignore=(
+ svbin
+)
+
+#
+# Modules
+#
+autoload -Uz compinit bashcompinit
+autoload -U colors complist zrecompile zmv zargs zed
+autoload -Uz vcs_info
+autoload insert-files
+zle -N insert-files
+zmodload -i zsh/complist
+colors
+compinit -u -d .zsh/cache/compdump
+bashcompinit
+
+zstyle :compinstall filename '/home/alan/.zshrc'
+
+autoload -Uz _tmux_pane_words
+zle -C tmux-pane-words-prefix complete-word _generic
+zle -C tmux-pane-words-anywhere complete-word _generic
+zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' completer _tmux_pane_words
+zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' ignore-line current
+zstyle ':completion:tmux-pane-words-anywhere:*' matcher-list 'b:=* m:{A-Za-z}={a-zA-Z}'
+
+# Speed up completion by not going further than a full match
+zstyle ':completion:*' accept-exact '*(N)'
+
+zstyle ':completion:*:default' use-cache on
+zstyle ':completion:*:default' cache-path ~/.zsh/cache/compcache
+
+zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' '+m:{A-Z}={a-z}'
+zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete _match
+
+zstyle ':completion:*' verbose yes
+zstyle ':completion:*:messages' format '%d'
+zstyle ':completion:*:warnings' format 'No matches for: %d'
+zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
+zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
+zstyle ':completion:*' group-name ''
+
+# Complete all user processes
+zstyle ':completion:*:processes' command 'ps -au$USER'
+# Add colour to process lists
+zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
+zstyle ':completion:*:*:kill:*' menu yes select
+zstyle ':completion:*:kill:*' force-list always
+zstyle ':completion:*:*:killall:*' menu yes select
+zstyle ':completion:*:killall:*' force-list always
+
+# Complete unreadable log filenames
+#zstyle ':completion::complete:(most|tail)::' fake-files '/var/log/*:current'
+
+# Group manpages by section
+zstyle ':completion:*' separate-sections true
+
+# Users
+#zstyle '*' users $users
+
+zstyle '*' hosts $hosts
+
+zstyle ':completion:*:functions' ignored-patterns '_*'
+zstyle ':completion:*:cd:*' ignore-parents parent pwd
+
+#This works, but isn't the same as ls
+#zstyle ':completion:*:default' list-colors ''
+zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
+
+zstyle ':vcs_info:*' enable git hg
+
+# Filename suffixes to ignore during completion (except after rm command)
+zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' '*?.old' '*?.pro'
+
+## Prompt
+if [[ $TERM != 'dumb' ]]
+then
+ autoload -U promptinit
+ promptinit
+ prompt pure
+fi
+
+# Options
+
+# Changing directories
+setopt auto_cd
+
+# Completion
+setopt auto_list # List multiple choices on first tab
+unsetopt list_ambiguous # List ambiguous choices rather than completing common prefixes
+unsetopt list_beep # Don't try to beep here
+setopt list_types # Indicate file types
+
+# Expansion and globbing
+setopt extended_glob # Use #~^ as part of filename patterns
+unsetopt nomatch
+
+# History
+unsetopt hist_beep
+setopt hist_expire_dups_first
+setopt hist_fcntl_lock # Use standard locking on histfile
+setopt hist_find_no_dups
+setopt hist_ignore_space
+setopt hist_reduce_blanks
+setopt hist_verify
+setopt inc_append_history
+
+# Input/Output
+unsetopt clobber
+unsetopt flow_control
+setopt path_dirs # Search PATH even with slashes
+setopt print_exit_value
+
+# Job Control
+setopt auto_continue
+unsetopt nohup
+setopt long_list_jobs
+unsetopt notify
+
+# Scripts and functions
+unsetopt multi_func_def
+setopt multios
+
+# Zle
+unsetopt beep
+
+############
+# Keybinds #
+############
+#KiTTY
+bindkey "OD" backward-word
+bindkey "OC" forward-word
+
+#General
+bindkey "[1~" beginning-of-line
+bindkey "[4~" end-of-line
+bindkey "[5~" beginning-of-history
+bindkey "[6~" end-of-history
+bindkey "[2~" quoted-insert
+bindkey "[3~" delete-char
+
+bindkey '' backward-delete-char
+
+bindkey '^I' expand-or-complete-prefix
+bindkey '[Z' reverse-menu-complete
+bindkey '[A' up-line-or-search
+bindkey '[B' down-line-or-search
+
+#urxvt
+bindkey '[3;5~' delete-word
+bindkey '[1;5D' backward-word
+bindkey '[1;5C' forward-word
+
+bindkey 'f' insert-files
+bindkey 'd' describe-key-briefly
+
+bindkey '\' tmux-pane-words-prefix
+bindkey '|' tmux-pane-words-anywhere
+
+# Aliases before functions
+alias getcflags='gcc -\#\#\# -march=native -E /usr/include/stdlib.h 2>&1 | grep "/usr/libexec/gcc/.*cc1"'
+alias grep='grep --color=auto'
+alias df='df -h'
+alias du='du -h'
+alias md='mkdir -p'
+alias rd='rmdir'
+alias .='source'
+
+ls='\ls'
+gnu_ls_options="-v --group-directories-first --color=auto"
+gnu_ls_isodate="--time-style=long-iso"
+bsd_ls_options="-p"
+bsd_ls_isodate="-D '%F %k:%M'"
+
+case $os in
+ osx)
+ if [[ -n $commands[gls] ]]
+ then
+ ls='\gls'
+ ls_options=$gnu_ls_options
+ ls_isodate=$gnu_ls_isodate
+ else
+ ls_options=$bsd_ls_options
+ ls_isodate=$bsd_ls_isodate
+ fi
+ ;;
+ freebsd)
+ ls_options=$bsd_ls_options
+ ls_isodate=$bsd_ls_isodate
+ ;;
+ gnu)
+ ls_options=$gnu_ls_options
+ ls_isodate=$gnu_ls_isodate
+ ;;
+esac
+alias l="${ls} ${ls_options} -Bp"
+alias l1="${ls} ${ls_options} -1"
+alias ls="${ls} ${ls_options} -hF"
+alias la="${ls} ${ls_options} -hA"
+alias ll="${ls} ${ls_options} ${ls_isodate} -hl"
+alias lal="ll -A"
+alias lla="lal"
+alias llr="ll -t"
+alias gpp='g++'
+alias lsr="${ls} -tld *(m-2)" # mtime < -2days
+
+alias salt="noglob salt"
+alias pping="prettyping.sh"
+alias trans="transmission-remote transmission.home"
+alias bitcoin="bitcoind"
+alias su="smart_sudo "
+alias E="SUDO_EDITOR=\emacsclient -c -a emacs\" sudoedit"
+alias wprop='xprop |awk '\''
+ /^WM_CLASS/{sub(/.* =/, "instance:"); sub(/,/, "\nclass:"); print}
+ /^WM_NAME/{sub(/.* =/, "title:"); print}
+ /^WM_WINDOW_ROLE/{sub(/.* =/, "role:"); print}'\'''
+
+alias et="emacsclient -t"
+
+alias -g ...='../..'
+
+#Suffix aliases
+alias -s log=less
+
+if [[ -e =hub ]]; then
+ alias git="hub"
+fi
+
+# Functions
+
+magit () {
+ emacsclient -e "(magit-status \"$PWD\")"
+}
+
+dired () {
+ emacsclient -e "(dired \"$PWD\")"
+}
+
+pid () {
+ local i
+ for i in /proc/<->/stat
+ [[ "$(< $i)" = *\((${(j:|:)~@})\)* ]] && echo $i:h:t
+ return 0
+}
+
+_force_rehash() {
+ (( CURRENT == 1 )) && rehash
+ return 1 # Because we didn't really complete anything
+}
+
+portgrep() {
+ sudo lsof -i :$1 -nP | egrep '(LISTEN|UDP|COMMAND)'
+}
+
+ipgrep() {
+ sudo lsof -i @$1 -nP
+}
+
+smart_sudo () {
+ if [[ -n $1 ]]; then
+ \sudo $argv
+ else
+ #if no parameters were given, then assume we want a root shell
+ \sudo -i -u toor
+ fi
+}
+
+compdef _sudo smart_sudo
+
+smart_compile () {
+ local zcompargs
+ if [[ $1 = *zshrc* ]]; then
+ zcompargs="-R"
+ fi
+
+ if [[ $EUID -ne 0 || $1 != *alan* ]]; then
+ zrecompile -q -p $zcompargs $1
+ fi
+ if [[ -n $2 ]]; then
+ . $1
+ fi
+}
+
+emacs_change_focus () {
+ emacsclient -n -e "(select-frame-set-input-focus (selected-frame))" > /dev/null
+}
+
+ec () {
+ local visibleFrames
+ visibleFrames=`emacsclient -e '(length (visible-frame-list))'`
+ if [[ $? -ne 0 ]]; then
+ print "Daemon not running"
+ return 1
+ fi
+
+ if [[ $visibleFrames -eq 1 ]]; then
+ emacsclient -n -c "$@" && emacs_change_focus
+ else
+ emacs_change_focus
+ if [[ $# -gt 0 ]]; then
+ emacsclient -n "$@"
+ fi
+ fi
+}
+
+_FASD_DATA="$HOME/.zsh/fasd-data"
+autoload -U fasd
+source ~/.zsh/cache/fasd-init-zsh
diff --git a/zsh/login.zsh b/zsh/login.zsh
new file mode 100755
index 00000000..e69de29b
diff --git a/zsh/logout.zsh b/zsh/logout.zsh
new file mode 100755
index 00000000..e69de29b
diff --git a/zsh/zshrc b/zsh/zshrc
deleted file mode 100755
index 28356be5..00000000
--- a/zsh/zshrc
+++ /dev/null
@@ -1,404 +0,0 @@
-#!/usr/bin/env zsh
-#
-# System variables
-#
-
-if [[ $defpath == "" && -d ~/bin ]]
-then
- defpath=($path)
- path=(
- $defpath
- ~/bin
- )
- if [[ -d ~/.gem/ruby/*/bin ]]
- then
- path=(
- $path
- ~/.gem/ruby/*/bin
- )
- fi
-fi
-
-myfuncs=( ~alan/projects/dotfiles/zsh/functions/*(/) )
-fpath=(
- $myfuncs
- ~alan/projects/dotfiles/zsh/completion/
- $fpath
-)
-if [[ -d /usr/local/share/zsh-completions ]]
-then
- fpath=(/usr/local/share/zsh-completions $fpath)
-fi
-
-export PATH
-export PAGER="less"
-export EDITOR="emacsclient"
-export CLICOLOR=true
-
-#
-# zsh variables
-#
-HISTFILE=~/.zsh/history
-HISTSIZE=4000
-SAVEHIST=3000
-
-WORDCHARS='*?_-[]~=.&;!#$%^(){}<>'
-
-#If a command takes more than 5 seconds, give statistics
-REPORTTIME=5
-TIMEFMT="%U user %S system %P cpu %*Es total"
-
-#Check for user logins
-watch=notme
-WATCHFMT="%n has %a %l from %M at %t"
-
-hosts=(
- server
- prefect
- alanpearce.co.uk
- home.alanpearce.co.uk
- lethalrocks.uk.to
- alphapulsar.uk.to
- st.alphapulsar.uk.to
- a.st.alphapulsar.uk.to
- st
-)
-
-users=(alan root toor)
-
-function linkAuthSock () {
- local linkSock=~/.ssh/ssh_auth_sock
- ln -sf $1 ~/.ssh/ssh_auth_sock
- export SSH_AUTH_SOCK=$linkSock
-}
-
-if [[ "$SSH_AUTH_SOCK" != "" ]]
-then
- if [[ -e ~/.ssh/ssh_auth_sock && ! -L ~/.ssh/ssh_auth_sock ]]
- then
- linkAuthSock $SSH_AUTH_SOCK
- fi
-fi
-
-case $OSTYPE in
- *gnu*)
- os=gnu
- ;;
- freebsd*)
- os=freebsd
- ;;
- darwin*)
- os=osx
-esac
-
-LS_COLORS='no=00:fi=00:di=36:ln=35:pi=30;44:so=35;44:do=35;44:bd=33;44:cd=37;44:or=05;37;41:mi=05;37;41:ex=01;31:*.cmd=01;31:*.exe=01;31:*.com=01;31:*.bat=01;31:*.reg=01;31:*.app=01;31:*.txt=32:*.org=32:*.md=32:*.mkd=32:*.h=32:*.c=32:*.C=32:*.cc=32:*.cpp=32:*.cxx=32:*.objc=32:*.sh=32:*.csh=32:*.zsh=32:*.el=32:*.vim=32:*.java=32:*.pl=32:*.pm=32:*.py=32:*.rb=32:*.hs=32:*.php=32:*.htm=32:*.html=32:*.shtml=32:*.erb=32:*.haml=32:*.xml=32:*.rdf=32:*.css=32:*.sass=32:*.scss=32:*.less=32:*.js=32:*.coffee=32:*.man=32:*.0=32:*.1=32:*.2=32:*.3=32:*.4=32:*.5=32:*.6=32:*.7=32:*.8=32:*.9=32:*.l=32:*.n=32:*.p=32:*.pod=32:*.tex=32:*.bmp=33:*.cgm=33:*.dl=33:*.dvi=33:*.emf=33:*.eps=33:*.gif=33:*.jpeg=33:*.jpg=33:*.JPG=33:*.mng=33:*.pbm=33:*.pcx=33:*.pdf=33:*.pgm=33:*.png=33:*.ppm=33:*.pps=33:*.ppsx=33:*.ps=33:*.svg=33:*.svgz=33:*.tga=33:*.tif=33:*.tiff=33:*.xbm=33:*.xcf=33:*.xpm=33:*.xwd=33:*.xwd=33:*.yuv=33:*.aac=33:*.au=33:*.flac=33:*.mid=33:*.midi=33:*.mka=33:*.mp3=33:*.mpa=33:*.mpeg=33:*.mpg=33:*.ogg=33:*.ra=33:*.wav=33:*.anx=33:*.asf=33:*.avi=33:*.axv=33:*.flc=33:*.fli=33:*.flv=33:*.gl=33:*.m2v=33:*.m4v=33:*.mkv=33:*.mov=33:*.mp4=33:*.mp4v=33:*.mpeg=33:*.mpg=33:*.nuv=33:*.ogm=33:*.ogv=33:*.ogx=33:*.qt=33:*.rm=33:*.rmvb=33:*.swf=33:*.vob=33:*.wmv=33:*.doc=31:*.docx=31:*.rtf=31:*.dot=31:*.dotx=31:*.xls=31:*.xlsx=31:*.ppt=31:*.pptx=31:*.fla=31:*.psd=31:*.7z=1;35:*.apk=1;35:*.arj=1;35:*.bin=1;35:*.bz=1;35:*.bz2=1;35:*.cab=1;35:*.deb=1;35:*.dmg=1;35:*.gem=1;35:*.gz=1;35:*.iso=1;35:*.jar=1;35:*.msi=1;35:*.rar=1;35:*.rpm=1;35:*.tar=1;35:*.tbz=1;35:*.tbz2=1;35:*.tgz=1;35:*.tx=1;35:*.war=1;35:*.xpi=1;35:*.xz=1;35:*.z=1;35:*.Z=1;35:*.zip=1;35:*.ANSI-30-black=30:*.ANSI-01;30-brblack=01;30:*.ANSI-31-red=31:*.ANSI-01;31-brred=01;31:*.ANSI-32-green=32:*.ANSI-01;32-brgreen=01;32:*.ANSI-33-yellow=33:*.ANSI-01;33-bryellow=01;33:*.ANSI-34-blue=34:*.ANSI-01;34-brblue=01;34:*.ANSI-35-magenta=35:*.ANSI-01;35-brmagenta=01;35:*.ANSI-36-cyan=36:*.ANSI-01;36-brcyan=01;36:*.ANSI-37-white=37:*.ANSI-01;37-brwhite=01;37:*.log=01;34:*~=01;34:*#=01;34:*.bak=01;36:*.BAK=01;36:*.old=01;36:*.OLD=01;36:*.org_archive=01;36:*.off=01;36:*.OFF=01;36:*.dist=01;36:*.DIST=01;36:*.orig=01;36:*.ORIG=01;36:*.swp=01;36:*.swo=01;36:*,v=01;36:*.gpg=34:*.gpg=34:*.pgp=34:*.asc=34:*.3des=34:*.aes=34:*.enc=34:'
-
-#Ignore suffixes in completion
-fignore=(
- svbin
-)
-
-#
-# Modules
-#
-autoload -Uz compinit bashcompinit
-autoload -U colors complist zrecompile zmv zargs zed
-autoload -Uz vcs_info
-autoload insert-files
-zle -N insert-files
-zmodload -i zsh/complist
-colors
-compinit -u -d .zsh/cache/compdump
-bashcompinit
-
-zstyle :compinstall filename '/home/alan/.zshrc'
-
-autoload -Uz _tmux_pane_words
-zle -C tmux-pane-words-prefix complete-word _generic
-zle -C tmux-pane-words-anywhere complete-word _generic
-zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' completer _tmux_pane_words
-zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' ignore-line current
-zstyle ':completion:tmux-pane-words-anywhere:*' matcher-list 'b:=* m:{A-Za-z}={a-zA-Z}'
-
-# Speed up completion by not going further than a full match
-zstyle ':completion:*' accept-exact '*(N)'
-
-zstyle ':completion:*:default' use-cache on
-zstyle ':completion:*:default' cache-path ~/.zsh/cache/compcache
-
-zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' '+m:{A-Z}={a-z}'
-zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete _match
-
-zstyle ':completion:*' verbose yes
-zstyle ':completion:*:messages' format '%d'
-zstyle ':completion:*:warnings' format 'No matches for: %d'
-zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
-zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
-zstyle ':completion:*' group-name ''
-
-# Complete all user processes
-zstyle ':completion:*:processes' command 'ps -au$USER'
-# Add colour to process lists
-zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
-zstyle ':completion:*:*:kill:*' menu yes select
-zstyle ':completion:*:kill:*' force-list always
-zstyle ':completion:*:*:killall:*' menu yes select
-zstyle ':completion:*:killall:*' force-list always
-
-# Complete unreadable log filenames
-#zstyle ':completion::complete:(most|tail)::' fake-files '/var/log/*:current'
-
-# Group manpages by section
-zstyle ':completion:*' separate-sections true
-
-# Users
-#zstyle '*' users $users
-
-zstyle '*' hosts $hosts
-
-zstyle ':completion:*:functions' ignored-patterns '_*'
-zstyle ':completion:*:cd:*' ignore-parents parent pwd
-
-#This works, but isn't the same as ls
-#zstyle ':completion:*:default' list-colors ''
-zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
-
-zstyle ':vcs_info:*' enable git hg
-
-# Filename suffixes to ignore during completion (except after rm command)
-zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' '*?.old' '*?.pro'
-
-## Prompt
-if [[ $TERM != 'dumb' ]]
-then
- autoload -U promptinit
- promptinit
- prompt pure
-fi
-
-# Options
-
-# Changing directories
-setopt auto_cd
-
-# Completion
-setopt auto_list # List multiple choices on first tab
-unsetopt list_ambiguous # List ambiguous choices rather than completing common prefixes
-unsetopt list_beep # Don't try to beep here
-setopt list_types # Indicate file types
-
-# Expansion and globbing
-setopt extended_glob # Use #~^ as part of filename patterns
-unsetopt nomatch
-
-# History
-unsetopt hist_beep
-setopt hist_expire_dups_first
-setopt hist_fcntl_lock # Use standard locking on histfile
-setopt hist_find_no_dups
-setopt hist_ignore_space
-setopt hist_reduce_blanks
-setopt hist_verify
-setopt inc_append_history
-
-# Input/Output
-unsetopt clobber
-unsetopt flow_control
-setopt path_dirs # Search PATH even with slashes
-setopt print_exit_value
-
-# Job Control
-setopt auto_continue
-unsetopt nohup
-setopt long_list_jobs
-unsetopt notify
-
-# Scripts and functions
-unsetopt multi_func_def
-setopt multios
-
-# Zle
-unsetopt beep
-
-############
-# Keybinds #
-############
-#KiTTY
-bindkey "OD" backward-word
-bindkey "OC" forward-word
-
-#General
-bindkey "[1~" beginning-of-line
-bindkey "[4~" end-of-line
-bindkey "[5~" beginning-of-history
-bindkey "[6~" end-of-history
-bindkey "[2~" quoted-insert
-bindkey "[3~" delete-char
-
-bindkey '' backward-delete-char
-
-bindkey '^I' expand-or-complete-prefix
-bindkey '[Z' reverse-menu-complete
-bindkey '[A' up-line-or-search
-bindkey '[B' down-line-or-search
-
-#urxvt
-bindkey '[3;5~' delete-word
-bindkey '[1;5D' backward-word
-bindkey '[1;5C' forward-word
-
-bindkey 'f' insert-files
-bindkey 'd' describe-key-briefly
-
-bindkey '\' tmux-pane-words-prefix
-bindkey '|' tmux-pane-words-anywhere
-
-# Aliases before functions
-alias getcflags='gcc -\#\#\# -march=native -E /usr/include/stdlib.h 2>&1 | grep "/usr/libexec/gcc/.*cc1"'
-alias grep='grep --color=auto'
-alias df='df -h'
-alias du='du -h'
-alias md='mkdir -p'
-alias rd='rmdir'
-alias .='source'
-
-ls='\ls'
-gnu_ls_options="-v --group-directories-first --color=auto"
-gnu_ls_isodate="--time-style=long-iso"
-bsd_ls_options="-p"
-bsd_ls_isodate="-D '%F %k:%M'"
-
-case $os in
- osx)
- if [[ -n $commands[gls] ]]
- then
- ls='\gls'
- ls_options=$gnu_ls_options
- ls_isodate=$gnu_ls_isodate
- else
- ls_options=$bsd_ls_options
- ls_isodate=$bsd_ls_isodate
- fi
- ;;
- freebsd)
- ls_options=$bsd_ls_options
- ls_isodate=$bsd_ls_isodate
- ;;
- gnu)
- ls_options=$gnu_ls_options
- ls_isodate=$gnu_ls_isodate
- ;;
-esac
-alias l="${ls} ${ls_options} -Bp"
-alias l1="${ls} ${ls_options} -1"
-alias ls="${ls} ${ls_options} -hF"
-alias la="${ls} ${ls_options} -hA"
-alias ll="${ls} ${ls_options} ${ls_isodate} -hl"
-alias lal="ll -A"
-alias lla="lal"
-alias llr="ll -t"
-alias gpp='g++'
-alias lsr="${ls} -tld *(m-2)" # mtime < -2days
-
-alias salt="noglob salt"
-alias pping="prettyping.sh"
-alias trans="transmission-remote transmission.home"
-alias bitcoin="bitcoind"
-alias su="smart_sudo "
-alias E="SUDO_EDITOR=\emacsclient -c -a emacs\" sudoedit"
-alias wprop='xprop |awk '\''
- /^WM_CLASS/{sub(/.* =/, "instance:"); sub(/,/, "\nclass:"); print}
- /^WM_NAME/{sub(/.* =/, "title:"); print}
- /^WM_WINDOW_ROLE/{sub(/.* =/, "role:"); print}'\'''
-
-alias et="emacsclient -t"
-
-alias -g ...='../..'
-
-#Suffix aliases
-alias -s log=less
-
-if [[ -e =hub ]]; then
- alias git="hub"
-fi
-
-# Functions
-
-magit () {
- emacsclient -e "(magit-status \"$PWD\")"
-}
-
-dired () {
- emacsclient -e "(dired \"$PWD\")"
-}
-
-pid () {
- local i
- for i in /proc/<->/stat
- [[ "$(< $i)" = *\((${(j:|:)~@})\)* ]] && echo $i:h:t
- return 0
-}
-
-_force_rehash() {
- (( CURRENT == 1 )) && rehash
- return 1 # Because we didn't really complete anything
-}
-
-portgrep() {
- sudo lsof -i :$1 -nP | egrep '(LISTEN|UDP|COMMAND)'
-}
-
-ipgrep() {
- sudo lsof -i @$1 -nP
-}
-
-smart_sudo () {
- if [[ -n $1 ]]; then
- \sudo $argv
- else
- #if no parameters were given, then assume we want a root shell
- \sudo -i -u toor
- fi
-}
-
-compdef _sudo smart_sudo
-
-smart_compile () {
- local zcompargs
- if [[ $1 = *zshrc* ]]; then
- zcompargs="-R"
- fi
-
- if [[ $EUID -ne 0 || $1 != *alan* ]]; then
- zrecompile -q -p $zcompargs $1
- fi
- if [[ -n $2 ]]; then
- . $1
- fi
-}
-
-emacs_change_focus () {
- emacsclient -n -e "(select-frame-set-input-focus (selected-frame))" > /dev/null
-}
-
-ec () {
- local visibleFrames
- visibleFrames=`emacsclient -e '(length (visible-frame-list))'`
- if [[ $? -ne 0 ]]; then
- print "Daemon not running"
- return 1
- fi
-
- if [[ $visibleFrames -eq 1 ]]; then
- emacsclient -n -c "$@" && emacs_change_focus
- else
- emacs_change_focus
- if [[ $# -gt 0 ]]; then
- emacsclient -n "$@"
- fi
- fi
-}
-
-_FASD_DATA="$HOME/.zsh/fasd-data"
-autoload -U fasd
-source ~/.zsh/cache/fasd-init-zsh
--
cgit 1.4.1
From 0f7651cd3428226a454461de8dd883e4735d8d9a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 2 Nov 2013 16:04:49 +0000
Subject: zsh: Rename dangling reference to zshrc in installer
---
install | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install b/install
index 44581a1f..f57f587d 100755
--- a/install
+++ b/install
@@ -55,7 +55,7 @@ local -a zfiles
zfiles=(
$target/zsh/functions/fasd/fasd
$fasd_cache
- $target/zsh/zshrc
+ $target/zsh/interactive.zsh
)
if [[ -f $target/zsh/${HOST%%.*}.zsh ]]; then
zfiles+=$target/zsh/${HOST%%.*}.zsh
--
cgit 1.4.1
From d658978cd6d004369edef823ec6a6b0d1b2e444a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 3 Nov 2013 12:34:02 +0000
Subject: Emacs: enable yaml-mode for ansible (group|host)_vars files
---
emacs/init.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index a254dd86..3bed12a5 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -629,6 +629,10 @@ Values: `desktop', `server', `laptop'")
:mode (("\\.rb\\'" . ruby-mode)
("\\.cap\\'" . ruby-mode)))
+(use-package yaml-mode
+ :mode (("/group_vars/.*" . yaml-mode)
+ ("/host_vars/.*" . yaml-mode)))
+
;;;; Planning
(use-package org
--
cgit 1.4.1
From 7a8e863372414120e2a25ee4f11ddc7b60e8c03d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 3 Nov 2013 12:35:20 +0000
Subject: Emacs: enable autopair-mode in yaml-mode
---
emacs/init.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 3bed12a5..7912f7a2 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -631,7 +631,9 @@ Values: `desktop', `server', `laptop'")
(use-package yaml-mode
:mode (("/group_vars/.*" . yaml-mode)
- ("/host_vars/.*" . yaml-mode)))
+ ("/host_vars/.*" . yaml-mode))
+ :config (progn
+ (add-hook 'yaml-mode-hook #'autopair-mode)))
;;;; Planning
--
cgit 1.4.1
From 7db736a3fa3e2656b8173ce53265d3648bff16b5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 9 Nov 2013 10:43:24 +0000
Subject: zsh: Add site-functions under /usr/local to fpath, if exists
---
zsh/environment.zsh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/zsh/environment.zsh b/zsh/environment.zsh
index 080e2344..65000fb8 100755
--- a/zsh/environment.zsh
+++ b/zsh/environment.zsh
@@ -27,6 +27,11 @@ then
fpath=(/usr/local/share/zsh-completions $fpath)
fi
+if [[ -d /usr/local/share/zsh/site-functions ]]
+then
+ fpath=(/usr/local/share/zsh/site-functions $fpath)
+fi
+
export FPATH
case $OSTYPE in
--
cgit 1.4.1
From eb56977552cce9ade5f215ae78a700e74da67341 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 9 Nov 2013 11:03:45 +0000
Subject: Emacs: Ensure .zsh files are opened as shell scripts
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 7912f7a2..41c66c8d 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -817,6 +817,7 @@ Also returns nil if pid is nil."
(use-package sh-script
:defer t
+ :mode (("\\`.zsh\\'" . shell-mode))
:config (setq sh-shell-file "/usr/bin/env zsh"))
(use-package ntcmd
--
cgit 1.4.1
From 047826207bfdde0d530b608186410cf48c780155 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 9 Nov 2013 12:46:07 +0000
Subject: zsh: Fix FreeBSD pkg UPDATING check
---
zsh/freebsd.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/freebsd.zsh b/zsh/freebsd.zsh
index 62612611..63f6b8b5 100755
--- a/zsh/freebsd.zsh
+++ b/zsh/freebsd.zsh
@@ -3,6 +3,6 @@ function update-check () {
sudo portsnap update
sudo portmaster -L --index-only | awk '/ [Nn]ew / { print substr($0,9,9999) }'
sudo portaudit -Fa -X 1
- pkg_updating -d $( ls -ltr -D '%Y%m%d' /var/db/pkg | awk 'END{print $6}' )
+ pkg updating -d $( ls -ltr -D '%Y%m%d' /var/db/pkg | awk 'END{print $6}' )
}
alias iotop="top -m io -o total"
--
cgit 1.4.1
From 673536be4358e9db7d683f7a1653470ba3bffe0b Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 9 Nov 2013 12:47:39 +0000
Subject: zsh: Don't fetch audit list when running update-check
---
zsh/freebsd.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/freebsd.zsh b/zsh/freebsd.zsh
index 63f6b8b5..9b1e6a28 100755
--- a/zsh/freebsd.zsh
+++ b/zsh/freebsd.zsh
@@ -2,7 +2,7 @@
function update-check () {
sudo portsnap update
sudo portmaster -L --index-only | awk '/ [Nn]ew / { print substr($0,9,9999) }'
- sudo portaudit -Fa -X 1
+ sudo portaudit -a -X 1
pkg updating -d $( ls -ltr -D '%Y%m%d' /var/db/pkg | awk 'END{print $6}' )
}
alias iotop="top -m io -o total"
--
cgit 1.4.1
From f9e7890f37abf62885b7990af732e59c981876e6 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 9 Nov 2013 13:28:42 +0000
Subject: Emacs: Fix mode specification for .zsh files
---
emacs/init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 41c66c8d..30a8181c 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -817,7 +817,7 @@ Also returns nil if pid is nil."
(use-package sh-script
:defer t
- :mode (("\\`.zsh\\'" . shell-mode))
+ :mode (("\\.zsh\\'" . shell-script-mode))
:config (setq sh-shell-file "/usr/bin/env zsh"))
(use-package ntcmd
--
cgit 1.4.1
From dd20ed50f8b9d88a87f3ef25384dcb5594b99226 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 9 Nov 2013 14:15:46 +0000
Subject: Emacs: remove defer keyword from all packages
---
emacs/init.el | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 30a8181c..35e538a5 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -80,7 +80,6 @@ Values: `desktop', `server', `laptop'")
;;;; Style
(use-package linum
- :defer t
:config (setq linum-format " %4d "))
(use-package highlight-symbol
@@ -88,7 +87,6 @@ Values: `desktop', `server', `laptop'")
:config (setq highlight-symbol-idle-delay 0.2))
(use-package whitespace
- :defer t
:config (setq whitespace-style
'(face
space
@@ -272,7 +270,6 @@ Values: `desktop', `server', `laptop'")
;;;; Communication
(use-package erc
- :defer t
:config (progn
(setq erc-user-full-name "Alan Pearce"
erc-email-userid "alan@alanpearce.co.uk"
@@ -328,7 +325,6 @@ Values: `desktop', `server', `laptop'")
;;;; Dates & Times
(use-package calendar
- :defer t
:config (progn
(setq calendar-week-start-day 1)
(calendar-set-date-style 'iso)))
@@ -436,13 +432,11 @@ Values: `desktop', `server', `laptop'")
(add-to-list 'tramp-default-proxies-alist '("router" nil nil))))
(use-package tramp-sh
- :defer t
:config (progn
(add-to-list 'tramp-remote-path "/usr/local/sbin")
(add-to-list 'tramp-remote-path "~/bin")))
(use-package ediff
- :defer t
:config (progn
(setq ediff-split-window-function 'split-window-horizontally
ediff-window-setup-function 'ediff-setup-windows-plain)))
@@ -816,7 +810,6 @@ Also returns nil if pid is nil."
#'executable-make-buffer-file-executable-if-script-p)
(use-package sh-script
- :defer t
:mode (("\\.zsh\\'" . shell-script-mode))
:config (setq sh-shell-file "/usr/bin/env zsh"))
@@ -828,7 +821,6 @@ Also returns nil if pid is nil."
(use-package eshell
:bind ("C-c s" . eshell)
- :defer t
:config (progn
(setq eshell-directory-name "~/.emacs.d/eshell")
(use-package em-smart
@@ -847,7 +839,6 @@ Also returns nil if pid is nil."
(bind-key "C-c S" #'eshell-goto-current-dir)
(use-package shell
- :defer t
:config (define-key shell-mode-map
(kbd "C-d") 'comint-delchar-or-eof-or-kill-buffer))
@@ -933,7 +924,6 @@ Also returns nil if pid is nil."
(bind-key "C-S-L" #'mc/edit-lines)))
(use-package eldoc
- :defer t
:config (progn
(eldoc-add-command 'paredit-backward-delete 'paredit-close-round)))
@@ -1007,12 +997,10 @@ Also returns nil if pid is nil."
(use-package redshank
:ensure t
- :defer t
:init (progn
(add-hook 'lisp-common-mode-hook #'turn-on-redshank-mode)))
(use-package geiser-base
- :defer t
:config (use-package quack))
(use-package slime
@@ -1079,14 +1067,12 @@ Also returns nil if pid is nil."
(c-set-offset 'case-label '+)))
(use-package quickrun
- :defer t
:ensure t)
;;;; Web Development
(use-package skewer-mode
:ensure t
- :defer t
:init (progn
(add-hook 'js2-mode-hook #'skewer-mode)
(add-hook 'html-mode-hook #'skewer-html-mode)
@@ -1128,7 +1114,6 @@ Also returns nil if pid is nil."
:config (turn-on-eldoc-mode))))
(use-package sgml-mode
- :defer t
:config (setq sgml-basic-offset 4))
(use-package emmet-mode
@@ -1138,7 +1123,6 @@ Also returns nil if pid is nil."
(add-hook 'web-mode-hook #'emmet-mode))))
(use-package web-mode
- :defer t
:mode (("/views/.*\\.php\\'" . web-mode)
("/templates/.*\\.php\\'" . web-mode))
:config (setq web-mode-code-indent-offset 4
--
cgit 1.4.1
From 7da8a6c8fac8eea7f2812d6c4f90bdd838d655bd Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 9 Nov 2013 16:12:36 +0000
Subject: Add OSX LaunchAgent installation
---
install | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/install b/install
index f57f587d..85dd7a7b 100755
--- a/install
+++ b/install
@@ -5,6 +5,11 @@ pushd $HOME
setopt EXTENDED_GLOB
+if [[ -d ~/Library/LaunchAgents ]]
+then
+ ln -sf $target/launchagents/* ~/Library/LaunchAgents
+fi
+
if [[ ! -d $target && ${(L)host} =~ prefect ]]
then
git clone ssh://alan@home.alanpearce.co.uk:22222/~/dotfiles.git
--
cgit 1.4.1
From 5b1633a64223e19e1018c30f87761dc21fc196c4 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 9 Nov 2013 16:12:58 +0000
Subject: Add Emacs daemon LaunchAgent file
---
launchagents/gnu.emacs.daemon.plist | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 launchagents/gnu.emacs.daemon.plist
diff --git a/launchagents/gnu.emacs.daemon.plist b/launchagents/gnu.emacs.daemon.plist
new file mode 100644
index 00000000..ecce7db7
--- /dev/null
+++ b/launchagents/gnu.emacs.daemon.plist
@@ -0,0 +1,19 @@
+
+
+
+
+ ServiceDescription
+ Gnu Emacs Daemon
+ ProgramArguments
+
+ /Applications/Emacs.app/Contents/MacOS/Emacs
+ --daemon
+
+ RunAtLoad
+
+ WorkingDirectory
+ /Users/alan
+ Label
+ gnu.emacs.daemon
+
+
--
cgit 1.4.1
From 85b0392ae7797220f1a75cbe59a3232d275e736e Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 9 Nov 2013 16:36:44 +0000
Subject: zsh: Ensure FreeBSD sources its own zsh configuration
---
zsh/interactive.zsh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/zsh/interactive.zsh b/zsh/interactive.zsh
index 800d97d2..bc864b3d 100755
--- a/zsh/interactive.zsh
+++ b/zsh/interactive.zsh
@@ -358,3 +358,7 @@ ec () {
_FASD_DATA="$HOME/.zsh/fasd-data"
autoload -U fasd
source ~/.zsh/cache/fasd-init-zsh
+
+if [[ $OSTYPE == freebsd* ]]; then
+ source zsh/freebsd.zsh
+fi
--
cgit 1.4.1
From 5371244cb59e37cb4b7aee20dbf9c6592c84f42d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Thu, 14 Nov 2013 13:47:37 +0000
Subject: Emacs: disable automatic-pairing in web-mode
---
emacs/init.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 35e538a5..94326801 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1127,7 +1127,8 @@ Also returns nil if pid is nil."
("/templates/.*\\.php\\'" . web-mode))
:config (setq web-mode-code-indent-offset 4
web-mode-css-indent-offset 4
- web-mode-markup-indent-offset 4))
+ web-mode-markup-indent-offset 4
+ web-mode-disable-auto-pairing t))
;;;; Windows & Frames
--
cgit 1.4.1
From cec2d2a6e071c33cdd08b04bcd7ee27ea46e696c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 1 Dec 2013 17:39:28 +0000
Subject: zsh: Fix completion for git/hub
---
zsh/interactive.zsh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/zsh/interactive.zsh b/zsh/interactive.zsh
index bc864b3d..10a58366 100755
--- a/zsh/interactive.zsh
+++ b/zsh/interactive.zsh
@@ -276,6 +276,8 @@ alias -s log=less
if [[ -e =hub ]]; then
alias git="hub"
+ autoload -U _hub
+ compdef _hub hub
fi
# Functions
--
cgit 1.4.1
From 8dbb37333590bf1719728de3931c248e83c03fd5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 4 Dec 2013 10:02:49 +0000
Subject: Emacs: Remove initial indentation of code inside script+style tags
---
emacs/init.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index 94326801..590bfb3e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1128,6 +1128,8 @@ Also returns nil if pid is nil."
:config (setq web-mode-code-indent-offset 4
web-mode-css-indent-offset 4
web-mode-markup-indent-offset 4
+ web-mode-style-padding 0
+ web-mode-script-padding 0
web-mode-disable-auto-pairing t))
;;;; Windows & Frames
--
cgit 1.4.1
From d3f52ca93be8e3e45e14d1ab388e93f148793206 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 4 Dec 2013 10:03:30 +0000
Subject: Emacs: use server-side comments inside HTML
---
emacs/init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/emacs/init.el b/emacs/init.el
index 590bfb3e..f0d31d3e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1130,6 +1130,7 @@ Also returns nil if pid is nil."
web-mode-markup-indent-offset 4
web-mode-style-padding 0
web-mode-script-padding 0
+ web-mode-comment-style 2
web-mode-disable-auto-pairing t))
;;;; Windows & Frames
--
cgit 1.4.1
From f3542e5059d9f86e813997d97eed03c47d4ff3d4 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 6 Dec 2013 14:32:05 +0000
Subject: Emacs: use coreutils' gls on OSX
---
emacs/init.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/emacs/init.el b/emacs/init.el
index f0d31d3e..72f1e4db 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -348,6 +348,8 @@ Values: `desktop', `server', `laptop'")
dired-recursive-copies 'top
dired-recursive-deletes 'top
dired-bind-jump nil)
+ (when (eq system-type 'darwin)
+ (setq insert-directory-program "/usr/local/bin/gls"))
(put 'dired-find-alternate-file 'disabled nil)))
(use-package dired+
--
cgit 1.4.1
From da3a02f228071083fc953f8e4de9c211feb72ead Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 6 Dec 2013 17:25:02 +0000
Subject: zsh: Share history between terminal windows
---
zsh/interactive.zsh | 1 +
1 file changed, 1 insertion(+)
diff --git a/zsh/interactive.zsh b/zsh/interactive.zsh
index 10a58366..f0a17031 100755
--- a/zsh/interactive.zsh
+++ b/zsh/interactive.zsh
@@ -155,6 +155,7 @@ setopt hist_find_no_dups
setopt hist_ignore_space
setopt hist_reduce_blanks
setopt hist_verify
+setopt share_history
setopt inc_append_history
# Input/Output
--
cgit 1.4.1
From e57133d03169210ebd324ece3ff3eca89e3d2a15 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 6 Dec 2013 17:29:20 +0000
Subject: Emacs: Enable and configure dired-omit-mode
---
emacs/init.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/emacs/init.el b/emacs/init.el
index 72f1e4db..9a4ddb3f 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -354,7 +354,10 @@ Values: `desktop', `server', `laptop'")
(use-package dired+
:ensure t
- :config (diredp-toggle-find-file-reuse-dir 1))
+ :config (progn
+ (diredp-toggle-find-file-reuse-dir 1)
+ (dired-omit-mode 1)
+ (setq dired-omit-files "#\\|\\.$")))
;;;; Documentation
--
cgit 1.4.1
From 11b28667fd2c59a7c8e4a81a255756c0de8cdd57 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Mon, 9 Dec 2013 13:24:34 +0000
Subject: Change git push default tracking for backwards compatibility
---
gitconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gitconfig b/gitconfig
index a31439e2..38dc9a3a 100644
--- a/gitconfig
+++ b/gitconfig
@@ -7,7 +7,7 @@
status = auto
ui = true
[push]
- default = simple
+ default = tracking
[alias]
st = status -sb
ci = commit
--
cgit 1.4.1
From 308390a148448798f0a7a2145ab568fe2473e9d1 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 11 Jan 2014 16:55:45 +0000
Subject: Emacs: Simplify geiser-racket interaction
---
emacs/init.el | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 9a4ddb3f..70882c25 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -998,16 +998,14 @@ Also returns nil if pid is nil."
:commands (geiser-mode
geiser
run-geiser
- run-racket))
+ run-racket)
+ :config (use-package quack))
(use-package redshank
:ensure t
:init (progn
(add-hook 'lisp-common-mode-hook #'turn-on-redshank-mode)))
-(use-package geiser-base
- :config (use-package quack))
-
(use-package slime
:commands (slime)
:config (progn
--
cgit 1.4.1
From 5a5b0c4a566792c0bd8f793c4a49a1f1467b1d96 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 11 Jan 2014 16:57:01 +0000
Subject: Emacs: remove with-elapsed-timer call
---
emacs/init.el | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 70882c25..f78839eb 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -150,12 +150,11 @@ Values: `desktop', `server', `laptop'")
(set-face-font 'variable-pitch (concat variable-face "-"
(number-to-string (1+ font-size)))))))))
-(with-elapsed-timer "Setting up font styles"
- (let* ((font-height (face-attribute 'default :height))
- (small-font-height (max 1 (floor (* .917 font-height)))))
+(let* ((font-height (face-attribute 'default :height))
+ (small-font-height (max 1 (floor (* .917 font-height)))))
(mapc (lambda (item)
- (put (car item) 'customized-face (cadr item))
- (face-spec-set (car item) (cadr item)))
+ (put (car item) 'customized-face (cadr item))
+ (face-spec-set (car item) (cadr item)))
`((linum
((t (:height ,small-font-height
:foreground unspecified
@@ -216,7 +215,7 @@ Values: `desktop', `server', `laptop'")
:inherit 'fixed-pitch))))
(org-done ((t (:weight normal
:strike-through t))))
- (org-headline-done ((t (:strike-through t))))))))
+ (org-headline-done ((t (:strike-through t)))))))
;;;; Autosaves & Backups
(let ((backup-dir (expand-file-name "~/.emacs.d/backups/")))
--
cgit 1.4.1
From 7b3bdc4b0be79e6d2f50e0e9ed45c1b3e430010c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 25 Jan 2014 12:40:18 +0000
Subject: Replace ido customisations for vertical candidate display with
ido-vertical-mode
---
emacs/init.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index f78839eb..72264820 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -554,8 +554,7 @@ Values: `desktop', `server', `laptop'")
(bind-key* "C-x C-f" #'ido-find-file)
(ido-mode 1))
:config (progn
- (setq ido-decorations (quote ("\n›" "" "\n " "\n …" "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]"))
- ido-auto-merge-delay-time 99999
+ (setq ido-auto-merge-delay-time 99999
ido-enable-flex-matching t)
(ido-init-completion-maps)
@@ -564,6 +563,10 @@ Values: `desktop', `server', `laptop'")
(ido-initiate-auto-merge (current-buffer)))
(bind-key "C-c C-s" #'ido-manual-merge ido-file-dir-completion-map)))
+(use-package ido-vertical-mode
+ :ensure t
+ :config (ido-vertical-mode 1))
+
(use-package flx-ido
:ensure t
:init (progn
--
cgit 1.4.1
From 0ecbf23895e730a8061f162d192e63cbc0922c80 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 25 Jan 2014 13:54:02 +0000
Subject: Update FreeBSD update-check: portaudit -> pkg audit
---
zsh/freebsd.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/freebsd.zsh b/zsh/freebsd.zsh
index 9b1e6a28..6ca0f8d6 100755
--- a/zsh/freebsd.zsh
+++ b/zsh/freebsd.zsh
@@ -2,7 +2,7 @@
function update-check () {
sudo portsnap update
sudo portmaster -L --index-only | awk '/ [Nn]ew / { print substr($0,9,9999) }'
- sudo portaudit -a -X 1
+ sudo pkg audit
pkg updating -d $( ls -ltr -D '%Y%m%d' /var/db/pkg | awk 'END{print $6}' )
}
alias iotop="top -m io -o total"
--
cgit 1.4.1
From e31d0dbcfe860fc71e1f8917ed67c893297ae930 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Tue, 4 Feb 2014 17:25:15 +0000
Subject: Update pure prompt
---
zsh/functions/pure/prompt_pure_setup | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/zsh/functions/pure/prompt_pure_setup b/zsh/functions/pure/prompt_pure_setup
index dae1fbb6..5c635037 100644
--- a/zsh/functions/pure/prompt_pure_setup
+++ b/zsh/functions/pure/prompt_pure_setup
@@ -16,6 +16,21 @@
# %m => shortname host
# %(?..) => prompt conditional - %(condition.true.false)
+
+# turns seconds into human readable time
+# 165392 => 1d 21h 56m 32s
+prompt_pure_human_time() {
+ local tmp=$1
+ local days=$(( tmp / 60 / 60 / 24 ))
+ local hours=$(( tmp / 60 / 60 % 24 ))
+ local minutes=$(( tmp / 60 % 60 ))
+ local seconds=$(( tmp % 60 ))
+ (( $days > 0 )) && echo -n "${days}d "
+ (( $hours > 0 )) && echo -n "${hours}h "
+ (( $minutes > 0 )) && echo -n "${minutes}m "
+ echo "${seconds}s"
+}
+
# fastest possible way to check if repo is dirty
prompt_pure_git_dirty() {
# check if we're in a git repo
@@ -31,7 +46,7 @@ prompt_pure_cmd_exec_time() {
local stop=$(date +%s)
local start=${cmd_timestamp:-$stop}
integer elapsed=$stop-$start
- (($elapsed > ${PURE_CMD_MAX_EXEC_TIME:=5})) && echo ${elapsed}s
+ (($elapsed > ${PURE_CMD_MAX_EXEC_TIME:=5})) && prompt_pure_human_time $elapsed
}
prompt_pure_preexec() {
@@ -59,7 +74,7 @@ prompt_pure_precmd() {
print -P $prompt_pure_preprompt
# check async if there is anything to pull
- {
+ (( ${PURE_GIT_PULL:-1} )) && {
# check if we're in a git repo
command git rev-parse --is-inside-work-tree &>/dev/null &&
# check check if there is anything to pull
@@ -77,6 +92,10 @@ prompt_pure_precmd() {
prompt_pure_setup() {
+ # prevent percentage showing up
+ # if output doesn't end with a newline
+ export PROMPT_EOL_MARK=''
+
prompt_opts=(cr subst percent)
autoload -Uz add-zsh-hook
@@ -93,7 +112,7 @@ prompt_pure_setup() {
[[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username='%n@%m '
# prompt turns red if the previous command didn't exit with 0
- PROMPT='%(?.%F{cyan}.%F{red})❯%f '
+ PROMPT='%(?.%F{magenta}.%F{red})❯%f '
}
prompt_pure_setup "$@"
--
cgit 1.4.1
From 6f4c1e62e76d861f672d270348c5ef4f2cfec8e0 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Feb 2014 20:36:09 +0000
Subject: Installer: Create ~/projects/dotfiles if missing
---
install | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/install b/install
index 85dd7a7b..da30f8cb 100755
--- a/install
+++ b/install
@@ -5,6 +5,11 @@ pushd $HOME
setopt EXTENDED_GLOB
+if [[ ! -d $target ]]
+then
+ mkdir -pv $target
+fi
+
if [[ -d ~/Library/LaunchAgents ]]
then
ln -sf $target/launchagents/* ~/Library/LaunchAgents
--
cgit 1.4.1
From 21b6f0cd68028c1e64c97e1ab7143fed4151c35d Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 5 Mar 2014 12:19:22 +0000
Subject: Emacs: check and use cask, if installed
---
emacs/Cask | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
emacs/init.el | 38 ++++++++++++++++++-------------
2 files changed, 95 insertions(+), 16 deletions(-)
create mode 100644 emacs/Cask
diff --git a/emacs/Cask b/emacs/Cask
new file mode 100644
index 00000000..8d913817
--- /dev/null
+++ b/emacs/Cask
@@ -0,0 +1,73 @@
+(source org)
+(source melpa)
+(source marmalade)
+(source gnu)
+
+(depends-on "ace-jump-mode")
+(depends-on "ag")
+(depends-on "auto-compile")
+(depends-on "auto-indent-mode")
+(depends-on "autopair")
+(depends-on "bind-key")
+(depends-on "cask")
+(depends-on "cdnjs")
+(depends-on "company")
+(depends-on "confluence")
+(depends-on "control-mode")
+(depends-on "dash")
+(depends-on "dash-at-point")
+(depends-on "deferred")
+(depends-on "diff-hl")
+(depends-on "diminish")
+(depends-on "dired+")
+(depends-on "discover")
+(depends-on "emmet-mode")
+(depends-on "epl")
+(depends-on "expand-region")
+(depends-on "f")
+(depends-on "flx")
+(depends-on "flx-ido")
+(depends-on "framemove")
+(depends-on "geiser")
+(depends-on "ggtags")
+(depends-on "git-commit-mode")
+(depends-on "git-rebase-mode")
+(depends-on "god-mode")
+(depends-on "haskell-mode")
+(depends-on "helm")
+(depends-on "ido-vertical-mode")
+(depends-on "jinja2-mode")
+(depends-on "js2-mode")
+(depends-on "lua-mode")
+(depends-on "magit")
+(depends-on "makey")
+(depends-on "multi-term")
+(depends-on "multiple-cursors")
+(depends-on "mustache-mode")
+(depends-on "nginx-mode")
+(depends-on "org-jira")
+(depends-on "org-journal")
+(depends-on "org-plus-contrib")
+(depends-on "packed")
+(depends-on "pallet")
+(depends-on "paredit")
+(depends-on "php-mode")
+(depends-on "pkg-info")
+(depends-on "project-persist")
+(depends-on "projectile")
+(depends-on "puppet-mode")
+(depends-on "quickrun")
+(depends-on "redshank")
+(depends-on "s")
+(depends-on "simple-httpd")
+(depends-on "skewer-mode")
+(depends-on "smart-tab")
+(depends-on "smart-tabs-mode")
+(depends-on "smex")
+(depends-on "solarized-theme")
+(depends-on "tup-mode")
+(depends-on "undo-tree")
+(depends-on "use-package")
+(depends-on "web-mode")
+(depends-on "xml-rpc")
+(depends-on "yaml-mode")
\ No newline at end of file
diff --git a/emacs/init.el b/emacs/init.el
index 72264820..770b5dc8 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -56,24 +56,30 @@ Values: `desktop', `server', `laptop'")
"Where the emacs init file really is, passing through symlinks.")
;;;; Package Management
-(eval-and-compile
- (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
- ("marmalade" . "http://marmalade-repo.org/packages/")
- ("melpa" . "http://melpa.milkbox.net/packages/")
- ("org" . "http://orgmode.org/elpa/")))
- (package-initialize))
-
-(when (not package-archive-contents)
- (package-refresh-contents))
-
(add-to-list 'load-path (expand-file-name "elisp/" user-emacs-directory))
-(mapc (lambda (package-name)
- (unless (package-installed-p package-name)
- (package-install package-name)))
- '(bind-key
- diminish
- use-package))
+(let ((cask-file (expand-file-name "cask.el" user-emacs-directory)))
+ (if (file-exists-p cask-file)
+ (progn
+ (add-to-list 'load-path (file-name-directory (file-truename cask-file)))
+ (require 'cask)
+ (cask-initialize))
+ (eval-and-compile
+ (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
+ ("marmalade" . "http://marmalade-repo.org/packages/")
+ ("melpa" . "http://melpa.milkbox.net/packages/")
+ ("org" . "http://orgmode.org/elpa/")))
+ (package-initialize))
+
+ (when (not package-archive-contents)
+ (package-refresh-contents))
+
+ (mapc (lambda (package-name)
+ (unless (package-installed-p package-name)
+ (package-install package-name)))
+ '(bind-key
+ diminish
+ use-package))))
(require 'use-package)
--
cgit 1.4.1
From 9094360d8c4f42f8f0a6a0475051877dc2c38fe5 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 5 Mar 2014 14:48:38 +0000
Subject: zsh: Fix path to FreeBSD configuration
---
zsh/interactive.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zsh/interactive.zsh b/zsh/interactive.zsh
index f0a17031..d2a72e4e 100755
--- a/zsh/interactive.zsh
+++ b/zsh/interactive.zsh
@@ -363,5 +363,5 @@ autoload -U fasd
source ~/.zsh/cache/fasd-init-zsh
if [[ $OSTYPE == freebsd* ]]; then
- source zsh/freebsd.zsh
+ source ~/projects/dotfiles/zsh/freebsd.zsh
fi
--
cgit 1.4.1
From d121a8e2253541e1f9606c31d27807d349409e3a Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 9 Mar 2014 15:58:14 +0000
Subject: Installer: create directories if not present
---
install | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/install b/install
index da30f8cb..a433631a 100755
--- a/install
+++ b/install
@@ -21,6 +21,11 @@ then
fi
install-dot () {
+ if [[ ! -d $1 ]]
+ then
+ mkdir $1
+ fi
+
for f in $@[2,-1]
do
if [[ ! -e $1$f:t ]]
--
cgit 1.4.1
From 325426abd41894fad8e1264d72593f03d4e5cc8c Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sun, 9 Mar 2014 15:58:29 +0000
Subject: Emacs: fix cask loading to follow official usage
---
emacs/init.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 770b5dc8..6b1f80f8 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -58,10 +58,10 @@ Values: `desktop', `server', `laptop'")
;;;; Package Management
(add-to-list 'load-path (expand-file-name "elisp/" user-emacs-directory))
-(let ((cask-file (expand-file-name "cask.el" user-emacs-directory)))
- (if (file-exists-p cask-file)
+(let ((cask-dir (expand-file-name "~/.cask")))
+ (if (file-exists-p cask-dir)
(progn
- (add-to-list 'load-path (file-name-directory (file-truename cask-file)))
+ (add-to-list 'load-path cask-dir)
(require 'cask)
(cask-initialize))
(eval-and-compile
--
cgit 1.4.1
From 7954d517f70f79ea3f916d5453b5d2fed47e1cad Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 15 Mar 2014 11:24:53 +0000
Subject: Installer: create directories for links if needed
---
install | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/install b/install
index da30f8cb..32a4f26f 100755
--- a/install
+++ b/install
@@ -21,6 +21,11 @@ then
fi
install-dot () {
+ if [[ "$1" != . && ! -d $1 ]]
+ then
+ mkdir $1
+ fi
+
for f in $@[2,-1]
do
if [[ ! -e $1$f:t ]]
--
cgit 1.4.1
From acbbc71c239dccf5aeb595a12fec1b829cbce752 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 15 Mar 2014 11:29:24 +0000
Subject: Emacs: remove use-package ensure directives in favour of cask
---
emacs/init.el | 35 +----------------------------------
1 file changed, 1 insertion(+), 34 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
index 770b5dc8..670fc763 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -115,7 +115,6 @@ Values: `desktop', `server', `laptop'")
jit-lock-defer-time 0.01)
(use-package solarized-theme
- :ensure t
:config (load-theme 'solarized-light t))
(when (or (display-graphic-p)
@@ -312,14 +311,12 @@ Values: `desktop', `server', `laptop'")
completion-ignore-case t)
(use-package smart-tab
- :ensure t
:init (global-smart-tab-mode)
:config (progn
(nconc smart-tab-completion-functions-alist '((php-mode . php-complete-function)))
(diminish 'smart-tab-mode "")))
(use-package company
- :ensure t
:commands (company-mode)
:bind (("C-" . company-complete))
:init (progn
@@ -358,7 +355,6 @@ Values: `desktop', `server', `laptop'")
(put 'dired-find-alternate-file 'disabled nil)))
(use-package dired+
- :ensure t
:config (progn
(diredp-toggle-find-file-reuse-dir 1)
(dired-omit-mode 1)
@@ -463,7 +459,6 @@ Values: `desktop', `server', `laptop'")
tab-always-indent 'complete)
(use-package auto-indent-mode
- :ensure t
:commands (auto-indent-minor-mode
auto-indent-mode)
:config (progn
@@ -480,7 +475,6 @@ Values: `desktop', `server', `laptop'")
(add-hook 'lisp-common-mode-hook #'lisp-auto-indent-mode)))
(use-package smart-tabs-mode
- :ensure t
:commands (smart-tabs-mode
smart-tabs-mode-enable
smart-tabs-advice)
@@ -548,7 +542,6 @@ Values: `desktop', `server', `laptop'")
:bind (("M-`" . lacarte-execute-menu-command)))
(use-package helm-config
- :ensure helm
:bind (("C-x i" . helm-imenu))
:config (setq helm-idle-delay .1
helm-input-idle-delay .1))
@@ -570,16 +563,13 @@ Values: `desktop', `server', `laptop'")
(bind-key "C-c C-s" #'ido-manual-merge ido-file-dir-completion-map)))
(use-package ido-vertical-mode
- :ensure t
:config (ido-vertical-mode 1))
(use-package flx-ido
- :ensure t
:init (progn
(flx-ido-mode 1)))
(use-package smex
- :ensure t
:bind (("M-x" . smex)
("" . smex)
("