[PATCH 3 of 3] mercurial.el: don't raise an error from find-file-hook

NIIMI Satoshi sa2c at sa2c.net
Sat May 5 02:24:06 CDT 2007


# HG changeset patch
# User NIIMI Satoshi <sa2c at sa2c.net>
# Date 1178348209 -32400
# Node ID f1b66a95c2ae648c8fed08cf58a43766010abd54
# Parent  eb698f8affc072d1c9c9005b00003fab8b6bbe79
mercurial.el: don't raise an error from find-file-hook

find-file() shouldn't fail even if unreadable .hg directory is exists.
Not enabling hg-mode is sufficient for that senario.

diff -r eb698f8affc0 -r f1b66a95c2ae contrib/mercurial.el
--- a/contrib/mercurial.el	Sat May 05 15:50:40 2007 +0900
+++ b/contrib/mercurial.el	Sat May 05 15:56:49 2007 +0900
@@ -750,8 +750,9 @@ Push changes                          G 
   (run-hooks 'hg-mode-hook))
 
 (defun hg-find-file-hook ()
-  (when (hg-mode-line)
-    (hg-mode)))
+  (ignore-errors
+    (when (hg-mode-line)
+      (hg-mode))))
 
 (add-hook 'find-file-hooks 'hg-find-file-hook)
 


More information about the Mercurial-devel mailing list