]> code.delx.au - gnu-emacs-elpa/commitdiff
Work around the mode being enabled twice
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 25 Jun 2012 23:04:46 +0000 (03:04 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 25 Jun 2012 23:04:46 +0000 (03:04 +0400)
diff-hl.el

index dc551168aa8d8afb69bd64f6c84392450b8178ba..67f05e2f5ce410c437eb769372bc581302007404 100644 (file)
     (remove-hook 'after-change-functions 'diff-hl-edit t)))\r
 \r
 (defun turn-on-diff-hl-mode ()\r
-  (when (buffer-file-name)\r
+  ;; FIXME: Why is this called twice for each buffer?\r
+  ;; Isn't fundamental-mode supposed to not run any hooks?\r
+  (when (and buffer-file-name (not (eq major-mode (default-value 'major-mode))))\r
     (diff-hl-mode 1)))\r
 \r
 ;;;###autoload\r