emacs: Support more Git and StGIT packages which look cool.
[profile] / dot-emacs.el
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)