From 691a845019b2a28265ed2ef898757a885af4836c Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 3 Feb 2013 20:50:09 +0400 Subject: [PATCH] Defer (window-system) check until a buffer is opened Fixes #2 --- diff-hl.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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)) -- 2.39.2