chiark / gitweb /
Merge commit 'crybaby/master'; commit 'ponder/master'
authorMark Wooding <mdw@distorted.org.uk>
Mon, 16 Mar 2009 15:53:46 +0000 (15:53 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 16 Mar 2009 15:53:46 +0000 (15:53 +0000)
* commit 'crybaby/master':
  bash_profile: Extend the collection of INFOPATH directories.

* commit 'ponder/master':
  zile: Yet another editor configuration.
  emacs: Give org-iswitchb a key binding, and include diary stuff in agenda.
  emacs, dot-emacs.el: Extend and semi-automate evil-keymap hacking.
  dot-emacs.el: Insert missing blank line before section header.

bash_profile
dot-emacs.el
emacs
screenrc
setup
zile [new file with mode: 0644]

index 017ff4cffb8ddd39cb9132be071b3645e31eeab0..57475a83ea7d7449ea8514a8f5d4e96ee5e79b79 100644 (file)
@@ -94,7 +94,7 @@ emacs_startup_args="--no-site-file --mdw-fast-startup -nw"
 for ed in \
        "emacs22 $emacs_startup_args" \
        "emacs21 $emacs_startup_args" \
-       mg \
+       zile mg \
        "emacs -nw" \
        vi pico nano ae; do
   name=`echo $ed | sed 's/ .*$//'`
index 14d06a69316a752bf3b2c99cc254f76044e5579a..5b9408fd7a7018f2951b7b1d3cfd29a7e83cf2be 100644 (file)
@@ -188,6 +188,43 @@ (defun mdw-todo (&optional when)
                                (nth 2 when))))))))
     (eq w d)))
 
+;; --- Fighting with Org-mode's evil key maps ---
+
+(defvar mdw-evil-keymap-keys
+  '(([S-up] . [?\C-c up])
+    ([S-down] . [?\C-c down])
+    ([S-left] . [?\C-c left])
+    ([S-right] . [?\C-c right])
+    (([M-up] [?\e up]) . [C-up])
+    (([M-down] [?\e down]) . [C-down])
+    (([M-left] [?\e left]) . [C-left])
+    (([M-right] [?\e right]) . [C-right]))
+  "Defines evil keybindings to clobber in `mdw-clobber-evil-keymap'.
+The value is an alist mapping evil keys (as a list, or singleton)
+to good keys (in the same form).")
+
+(defun mdw-clobber-evil-keymap (keymap)
+  "Replace evil key bindings in the KEYMAP.
+Evil key bindings are defined in `mdw-evil-keymap-keys'."
+  (dolist (entry mdw-evil-keymap-keys)
+    (let ((binding nil)
+         (keys (if (listp (car entry))
+                   (car entry)
+                 (list (car entry))))
+         (replacements (if (listp (cdr entry))
+                           (cdr entry)
+                         (list (cdr entry)))))
+      (catch 'found
+       (dolist (key keys)
+         (setq binding (lookup-key keymap key))
+         (when binding
+           (throw 'found nil))))
+      (when binding
+       (dolist (key keys)
+         (define-key keymap key nil))
+       (dolist (key replacements)
+         (define-key keymap key binding))))))
+
 ;;;----- Mail and news hacking ----------------------------------------------
 
 (define-derived-mode  mdwmail-mode mail-mode "[mdw] mail"
@@ -395,6 +432,7 @@ (defadvice find-file (after mdw-autorevert activate)
   (mdw-check-autorevert))
 (defadvice write-file (after mdw-autorevert activate)
   (mdw-check-autorevert))
+
 ;;;----- Dired hacking ------------------------------------------------------
 
 (defadvice dired-maybe-insert-subdir
diff --git a/emacs b/emacs
index dcb561d4c6fcaa2676b8ef5dc5334a0da476972a..4337d391d09d8b9b4893afd30f2ffcd4c6279717 100644 (file)
--- a/emacs
+++ b/emacs
 (setq sendmail-program "~/bin/sendmail-hack")
 
 (setq mail-user-agent 'message-user-agent)
-(setq message-signature-separator "^-- \\(\\|\\[mdw\\]\\)$")
+(setq message-signature-separator "^-- \\(\\|\\[mdw\\]\\)$"
+      message-yank-prefix "> "
+      message-yank-cited-prefix "> "
+      message-indent-citation-function '(message-indent-citation
+                                        mdw-trim-spaces-after-citing))
+
+(defun mdw-trim-spaces-after-citing ()
+  (save-excursion
+    (save-restriction
+      (narrow-to-region (point) (mark t))
+      (while (re-search-forward "^> +$" nil t)
+       (replace-match ">")))))
 
 (and (fboundp 'turn-on-gnus-dired-mode)
      (not mdw-fast-startup)
 (setq appt-display-interval 3)
 (setq appt-message-warning-time 10)
 
+;; --- Org-mode agenda ---
+
+(setq org-agenda-include-diary t)
+
 ;; --- Cosmetic stuff ---
 
 (setq display-time-24hr-format t)
 (global-set-key [?\C-x ?w ?l] 'windmove-right)
 (global-set-key [?\C-x ?g ?l] 'org-store-link)
 (global-set-key [?\C-x ?g ?a] 'org-agenda)
+(global-set-key [?\C-x ?g ?b] 'org-iswitchb)
 (global-set-key [?\C-x ?t ?i] 'timeclock-in)
 (global-set-key [?\C-x ?t ?c] 'timeclock-change)
 (global-set-key [?\C-x ?t ?o] 'timeclock-out)
 (and (not mdw-fast-startup) (fboundp 'hippie-expand)
      (global-set-key [?\M-/] 'hippie-expand))
 
-(defun mdw-clobber-org-mode-map ()
-  (dolist (key '([S-up] [S-down] [S-left] [S-right]
-                [?\e left] [?\e right]
-                [M-left] [M-right]))
-    (define-key org-mode-map key nil))
-  (define-key org-mode-map [?\C-c left] 'org-shiftleft)
-  (define-key org-mode-map [?\C-c right] 'org-shiftright)
-  (define-key org-mode-map [?\C-c up] 'org-shiftup)
-  (define-key org-mode-map [?\C-c down] 'org-shiftdown)
-  (define-key org-mode-map [C-left] 'org-metaleft)
-  (define-key org-mode-map [C-right] 'org-metaright)
-  (define-key org-mode-map [C-up] 'org-metaup)
-  (define-key org-mode-map [C-down] 'org-metadown))
-(add-hook 'org-mode-hook 'mdw-clobber-org-mode-map)
+(add-hook 'org-mode-hook
+         #'(lambda () (mdw-clobber-evil-keymap org-mode-map)))
+(add-hook 'org-agenda-mode-hook
+         #'(lambda () (mdw-clobber-evil-keymap org-agenda-mode-map)))
 
 ;; --- Recognising types of files ---
 
index 2c4ada0803f70aa78d7db944908ac7c456278481..134dd9bcc658a3a6edcc2724726557d704fcf4be 100644 (file)
--- a/screenrc
+++ b/screenrc
@@ -5,3 +5,4 @@ deflogin off
 defencoding utf8
 setenv LC_CTYPE en_GB.utf8
 setenv LESSCHARSET utf-8
+altscreen on
diff --git a/setup b/setup
index 79a6f34de3e510ab73ca36858f3f2590b1a52aa4..da1d071e88588a2e513c25e0fb6609b666d3afeb 100755 (executable)
--- a/setup
+++ b/setup
@@ -130,7 +130,7 @@ fi
 dotfiles="
   bash_profile bash_logout bashrc inputrc bash_completion
   emacs emacs-calc vm gnus.el
-  vimrc mg
+  vimrc mg zile
   mailrc signature
   cgrc tigrc
   gdbinit
diff --git a/zile b/zile
new file mode 100644 (file)
index 0000000..97c90d9
--- /dev/null
+++ b/zile
@@ -0,0 +1,13 @@
+;;; -*-emacs-lisp-*-
+;;;
+;;; Configuration file for ZILE.
+
+;; Indentation.
+(setq indent-tabs-mode t)
+(setq standard-indent 2)
+
+;; Key bindings.
+(global-set-key "\M-\LEFT" 'backward-word)
+(global-set-key "\M-\RIGHT" 'forward-word)
+(global-set-key "\F4" 'call-last-kbd-macro)
+(global-set-key "\C-x/" 'auto-fill-mode)