From 459c9fb2fc1ea83ebc141cc8b898c4e704eafa63 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 30 Jan 2008 18:38:58 +0000 Subject: [PATCH] emacs: Support more Git and StGIT packages which look cool. Also provide (badly) the function line-number-at-pos, which StGIT needs because it assumes that I have Emacs 22. --- dot-emacs.el | 13 +++++++++++++ emacs | 2 ++ 2 files changed, 15 insertions(+) diff --git a/dot-emacs.el b/dot-emacs.el index 74eb428..0599106 100644 --- a/dot-emacs.el +++ b/dot-emacs.el @@ -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 55845f6..2ae4bc1 100644 --- 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))) -- 2.11.0