From: Dmitry Gutov Date: Sun, 3 Feb 2013 16:50:09 +0000 (+0400) Subject: Defer (window-system) check until a buffer is opened X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/691a845019b2a28265ed2ef898757a885af4836c?hp=f58bfee02c22756f42600557d455a3d4a2f1cb97 Defer (window-system) check until a buffer is opened Fixes #2 --- diff --git a/diff-hl.el b/diff-hl.el index 8ca16791c..93bf299de 100644 --- a/diff-hl.el +++ b/diff-hl.el @@ -3,7 +3,7 @@ ;; Author: Dmitry Gutov ;; URL: https://github.com/dgutov/diff-hl ;; Keywords: vc, diff -;; Version: 1.4.0 +;; Version: 1.4.1 ;; Package-Requires: ((cl-lib "0.2")) ;; This file is not part of GNU Emacs. @@ -108,10 +108,6 @@ (define-fringe-bitmap 'diff-hl-bmp-bottom bottom h w 'bottom) (define-fringe-bitmap 'diff-hl-bmp-single single h w 'top))) -(when (window-system) - (define-fringe-bitmap 'diff-hl-bmp-empty [0] 1 1 'center) - (diff-hl-define-bitmaps)) - (defvar diff-hl-spec-cache (make-hash-table :test 'equal)) (defun diff-hl-fringe-spec (type pos) @@ -378,6 +374,9 @@ in the source file, or the last line of the hunk above it." (defun turn-on-diff-hl-mode () "Turn on `diff-hl-mode' or `diff-hl-dir-mode' in a buffer if appropriate." (when (window-system) ;; No fringes in the console. + (unless (fringe-bitmap-p 'diff-hl-bmp-empty) + (diff-hl-define-bitmaps) + (define-fringe-bitmap 'diff-hl-bmp-empty [0] 1 1 'center)) (cond (buffer-file-name (diff-hl-mode 1))