[PATCH 1 of 2] mercurial.el: ignore errors on hg-after-save-hook()

NIIMI Satoshi sa2c at sa2c.net
Mon May 21 18:13:50 CDT 2007


# HG changeset patch
# User NIIMI Satoshi <sa2c at sa2c.net>
# Date 1179786246 -32400
# Node ID 7d521254e9e0961dd6af3a67ed4dab9d360f1955
# Parent  3900f684a150ba9a847c499dd7bf6bf139070866
mercurial.el: ignore errors on hg-after-save-hook()

Don't signal an error even if running hg command fails.  Otherwise,
succeeding hooks won't be called.

diff --git a/contrib/mercurial.el b/contrib/mercurial.el
--- a/contrib/mercurial.el
+++ b/contrib/mercurial.el
@@ -764,10 +764,11 @@
 (add-hook 'find-file-hooks 'hg-find-file-hook)
 
 (defun hg-after-save-hook ()
-  (let ((old-status hg-status))
-    (hg-mode-line)
-    (if (and (not old-status) hg-status)
-	(hg-mode))))
+  (ignore-errors
+    (let ((old-status hg-status))
+      (hg-mode-line)
+      (if (and (not old-status) hg-status)
+	  (hg-mode)))))
 
 (add-hook 'after-save-hook 'hg-after-save-hook)
 


More information about the Mercurial-devel mailing list