Merge branch 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile
authorMark Wooding <mdw@distorted.org.uk>
Wed, 30 Jan 2008 22:27:48 +0000 (22:27 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 30 Jan 2008 22:27:48 +0000 (22:27 +0000)
* 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile:
  emacs: Support more Git and StGIT packages which look cool.
  mdw-editor: Use gnuclient if stdin or stdout is noninteractive.
  Install configuration for `mg' editor.

dot-emacs.el
emacs
mdw-editor
mg [new file with mode: 0644]
setup

index 74eb428..0599106 100644 (file)
@@ -128,6 +128,19 @@ symbols `sunday', `monday', etc. (or a mixture).  If the date stored in
 
 ;;;----- Utility functions --------------------------------------------------
 
+(defun line-number-at-pos (&optional pos)
+  "Print the current buffer line number and narrowed line number of point."
+  (let ((opoint (or pos (point))) start)
+    (save-excursion
+      (save-restriction
+       (goto-char (point-min))
+       (widen)
+       (forward-line 0)
+       (setq start (point))
+       (goto-char opoint)
+       (forward-line 0)
+       (1+ (count-lines 1 (point)))))))
+
 ;; --- mdw-uniquify-alist ---
 
 (defun mdw-uniquify-alist (&rest alists)
diff --git a/emacs b/emacs
index 0d640fe..995afd6 100644 (file)
--- a/emacs
+++ b/emacs
@@ -39,6 +39,8 @@
 (maybe-autoload 'cvs-update "pcl-cvs" nil t)
 (maybe-autoload 'debian-changelog-mode "debian-changelog-mode" nil t)
 (maybe-autoload 'git-status "git" nil t)
+(maybe-autoload 'git-blame-mode "git-blame" nil t)
+(maybe-autoload 'stgit "stgit" nil t)
 (and (library-exists-p "vc-git")
      (not (memq 'GIT vc-handled-backends))
      (setq vc-handled-backends (cons 'GIT vc-handled-backends)))
index cca7310..a58ee95 100755 (executable)
@@ -2,6 +2,7 @@
 
 set -e
 editor=${MDW_EDITOR-ed}
+[ -t 0 -a -t 1 ] || TERM=dumb
 case "$EDITOR,$VISUAL,$TERM" in
   mdw-editor,mdw-editor,dumb) editor=gnuclient;;
   mdw-editor,mdw-editor,*);;
diff --git a/mg b/mg
new file mode 100644 (file)
index 0000000..fcea1cb
--- /dev/null
+++ b/mg
@@ -0,0 +1,15 @@
+meta-key-mode
+global-set-key ")" blink-matching-paren-hack
+global-set-key "]" blink-matching-paren-hack
+global-set-key "}" blink-matching-paren-hack
+blink-matching-paren
+set-fill-column 72
+
+global-set-key "\e[1~" beginning-of-buffer
+global-set-key "\e[2~" overwrite-mode
+global-set-key "\e[4~" end-of-buffer
+global-set-key "\e[17~" auto-fill-mode
+global-set-key "\e[15~" goto-line
+global-set-key "\e[19~" undo
+
+global-set-key "\e\r" call-last-kbd-macro
diff --git a/setup b/setup
index 323a164..3a3d673 100755 (executable)
--- a/setup
+++ b/setup
@@ -144,7 +144,7 @@ fi
 dotfiles="
   bash_profile bash_logout bashrc inputrc bash_completion
   emacs emacs-calc vm
-  vimrc
+  vimrc mg
   mailrc signature
   gitconfig cgrc tigrc
   lisp-init.lisp:.cmucl-init.lisp