chiark / gitweb /
emacs: Support more Git and StGIT packages which look cool.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 30 Jan 2008 18:38:58 +0000 (18:38 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 30 Jan 2008 18:38:58 +0000 (18:38 +0000)
Also provide (badly) the function line-number-at-pos, which
StGIT needs because it assumes that I have Emacs 22.

dot-emacs.el
emacs

index 74eb4286b34aa56f7c831f1c642e6c7867c01b35..059910612bcb61c3bf1012301cc11c4d76df7ef2 100644 (file)
@@ -128,6 +128,19 @@ (defun mdw-todo (&optional when)
 
 ;;;----- 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 55845f63a3adf9a774e8d65b654d9bda79745824..2ae4bc1a51b5867e21f56bf38d8db5a8ae08167d 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)))