branch: externals/diff-hl
commit ba905d86b4c7654ba14f443d00ac03f807f23118
Author: Dmitry Gutov <dgu...@yandex.ru>
Commit: Dmitry Gutov <dgu...@yandex.ru>

    Drop compatibility with Emacs < 25
    
    And a number of compatibility shims with it.
---
 README.md          |  3 +--
 diff-hl-flydiff.el | 40 +---------------------------------------
 diff-hl.el         |  4 ++--
 3 files changed, 4 insertions(+), 43 deletions(-)

diff --git a/README.md b/README.md
index 13c63d3..277e9c5 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,6 @@ The package also contains auxiliary modes:
   recent one. Also, you could use `diff-hl-set-reference-rev` to set
   it to any revision, see its docstring for details.
 * `diff-hl-flydiff-mode` implements highlighting changes on the fly.
-  It requires Emacs 24.4 or newer.
 * `diff-hl-show-hunk-mouse-mode` makes fringe and margin react to
   mouse clicks to show the curresponding hunk. That's the alternative
   to using the `diff-hl-show-hunk` family of commands.
@@ -57,7 +56,7 @@ diff-hl-margin-mode
 Requirements
 =====
 
-Emacs 24.3+.
+Emacs 25.1+.
 
 Notes
 =====
diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el
index 51ba0af..ac3430b 100644
--- a/diff-hl-flydiff.el
+++ b/diff-hl-flydiff.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015-2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author:   Jonathan Hayase <python...@gmail.com>
 ;; URL:      https://github.com/dgutov/diff-hl
@@ -27,8 +27,6 @@
 
 (require 'diff-hl)
 (require 'diff)
-(unless (require 'nadvice nil t)
-  (error "`diff-hl-flydiff-mode' requires Emacs 24.4 or newer"))
 
 (defgroup diff-hl-flydiff nil
   "Highlight changes on the fly"
@@ -42,42 +40,6 @@
 (defvar diff-hl-flydiff-timer nil)
 (make-variable-buffer-local 'diff-hl-flydiff-modified-tick)
 
-(defun diff-hl-flydiff/vc-git--symbolic-ref (file)
-  (or
-   (vc-file-getprop file 'vc-git-symbolic-ref)
-   (let* (process-file-side-effects
-          (str (vc-git--run-command-string nil "symbolic-ref" "HEAD")))
-     (vc-file-setprop file 'vc-git-symbolic-ref
-                      (if str
-                          (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str)
-                              (match-string 2 str)
-                            str))))))
-
-(defun diff-hl-flydiff/vc-git-working-revision (_file)
-  "Git-specific version of `vc-working-revision'."
-  (let (process-file-side-effects)
-    (vc-git--rev-parse "HEAD")))
-
-(defun diff-hl-flydiff/vc-git-mode-line-string (file)
-  "Return a string for `vc-mode-line' to put in the mode line for FILE."
-  (let* ((rev (vc-working-revision file))
-         (disp-rev (or (diff-hl-flydiff/vc-git--symbolic-ref file)
-                       (substring rev 0 7)))
-         (def-ml (vc-default-mode-line-string 'Git file))
-         (help-echo (get-text-property 0 'help-echo def-ml))
-         (face   (get-text-property 0 'face def-ml)))
-    (propertize (replace-regexp-in-string (concat rev "\\'") disp-rev def-ml t 
t)
-                'face face
-                'help-echo (concat help-echo "\nCurrent revision: " rev))))
-
-;; Polyfill concrete revisions for vc-git-working-revision in Emacs 24.4, 24.5
-(when (version<= emacs-version "25.0")
-  (with-eval-after-load 'vc-git
-    (advice-add 'vc-git-working-revision :override
-                #'diff-hl-flydiff/vc-git-working-revision)
-    (advice-add 'vc-git-mode-line-string :override
-                #'diff-hl-flydiff/vc-git-mode-line-string)))
-
 (defun diff-hl-flydiff-buffer-with-head (file &optional _backend)
   "View the differences between FILE and its associated file in HEAD revision.
 This requires the external program `diff' to be in your
diff --git a/diff-hl.el b/diff-hl.el
index 7cb2f6d..17e6381 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -1,12 +1,12 @@
 ;;; diff-hl.el --- Highlight uncommitted changes using VC -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 2012-2020  Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021  Free Software Foundation, Inc.
 
 ;; Author:   Dmitry Gutov <dgu...@yandex.ru>
 ;; URL:      https://github.com/dgutov/diff-hl
 ;; Keywords: vc, diff
 ;; Version:  1.8.8
-;; Package-Requires: ((cl-lib "0.2") (emacs "24.3"))
+;; Package-Requires: ((cl-lib "0.2") (emacs "25.1"))
 
 ;; This file is part of GNU Emacs.
 

Reply via email to