changeset 2456:aa16b42628b8

merge with crew.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Sun, 18 Jun 2006 21:04:42 -0700
parents ff83112332f9 (current diff) b5902db74ba3 (diff)
children 8e1004c61796
files contrib/mercurial.el
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/mercurial.el	Sun Jun 18 04:13:33 2006 +0900
+++ b/contrib/mercurial.el	Sun Jun 18 21:04:42 2006 -0700
@@ -380,7 +380,7 @@
   (save-excursion
     (while hg-prev-buffer
       (set-buffer hg-prev-buffer))
-    (let ((path (or default (buffer-file-name))))
+    (let ((path (or default (buffer-file-name) default-directory)))
       (if (or (not path) current-prefix-arg)
           (expand-file-name
            (eval (list* 'read-file-name
@@ -712,7 +712,8 @@
     (let ((pos (point)))
       (insert (documentation 'hg-mode))
       (goto-char pos)
-      (kill-line))))
+      (end-of-line 1)
+      (delete-region pos (point)))))
 
 (defun hg-add (path)
   "Add PATH to the Mercurial repository on the next commit.
@@ -976,8 +977,8 @@
 (defun hg-log-mode ()
   "Mode for viewing a Mercurial change log."
   (goto-char (point-min))
-  (when (looking-at "^searching for changes")
-    (kill-entire-line))
+  (when (looking-at "^searching for changes.*$")
+    (delete-region (match-beginning 0) (match-end 0)))
   (run-hooks 'hg-log-mode-hook))
 
 (defun hg-log (path &optional rev1 rev2 log-limit)
@@ -1102,7 +1103,11 @@
   (interactive (list (hg-read-file-name)))
   (if (or path (not hg-root))
       (let ((root (do ((prev nil dir)
-		       (dir (file-name-directory (or path buffer-file-name ""))
+		       (dir (file-name-directory
+                             (or
+                              path
+                              buffer-file-name
+                              (expand-file-name default-directory)))
 			    (file-name-directory (directory-file-name dir))))
 		      ((equal prev dir))
 		    (when (file-directory-p (concat dir ".hg"))