]> code.delx.au - gnu-emacs-elpa/blobdiff - diff-hl.el
Defer (window-system) check until a buffer is opened
[gnu-emacs-elpa] / diff-hl.el
index 8ca16791c60da8f80bfbd54cd82116be09c5b257..93bf299ded2316d9ecc05cfae8af06f32a323448 100644 (file)
@@ -3,7 +3,7 @@
 ;; Author:   Dmitry Gutov <dgutov@yandex.ru>\r
 ;; URL:      https://github.com/dgutov/diff-hl\r
 ;; Keywords: vc, diff\r
-;; Version:  1.4.0\r
+;; Version:  1.4.1\r
 ;; Package-Requires: ((cl-lib "0.2"))\r
 \r
 ;; This file is not part of GNU Emacs.\r
     (define-fringe-bitmap 'diff-hl-bmp-bottom bottom h w 'bottom)\r
     (define-fringe-bitmap 'diff-hl-bmp-single single h w 'top)))\r
 \r
-(when (window-system)\r
-  (define-fringe-bitmap 'diff-hl-bmp-empty [0] 1 1 'center)\r
-  (diff-hl-define-bitmaps))\r
-\r
 (defvar diff-hl-spec-cache (make-hash-table :test 'equal))\r
 \r
 (defun diff-hl-fringe-spec (type pos)\r
@@ -378,6 +374,9 @@ in the source file, or the last line of the hunk above it."
 (defun turn-on-diff-hl-mode ()\r
   "Turn on `diff-hl-mode' or `diff-hl-dir-mode' in a buffer if appropriate."\r
   (when (window-system) ;; No fringes in the console.\r
+    (unless (fringe-bitmap-p 'diff-hl-bmp-empty)\r
+      (diff-hl-define-bitmaps)\r
+      (define-fringe-bitmap 'diff-hl-bmp-empty [0] 1 1 'center))\r
     (cond\r
      (buffer-file-name\r
       (diff-hl-mode 1))\r