-;;; diff-hl.el --- Highlight uncommitted changes -*- lexical-binding: t -*-
+;;; diff-hl.el --- Highlight uncommitted changes using VC -*- lexical-binding: t -*-
-;; Copyright (C) 2012-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
;; Author: Dmitry Gutov <dgutov@yandex.ru>
;; URL: https://github.com/dgutov/diff-hl
;; Keywords: vc, diff
-;; Version: 1.8.0
+;; Version: 1.8.2
;; Package-Requires: ((cl-lib "0.2"))
;; This file is part of GNU Emacs.
(with-current-buffer ,buffer
(save-buffer))
(message "Hunk reverted"))))
- (quit-windows-on diff-buffer))))
+ (quit-windows-on diff-buffer t))))
(defun diff-hl-hunk-overlay-at (pos)
(cl-loop for o in (overlays-in pos (1+ pos))
(interactive)
(diff-hl-next-hunk t))
+(defun diff-hl-mark-hunk ()
+ (interactive)
+ (let ((hunk (diff-hl-hunk-overlay-at (point))))
+ (unless hunk
+ (error "No hunk at point"))
+ (goto-char (overlay-start hunk))
+ (push-mark (overlay-end hunk) nil t)))
+
(defvar diff-hl-command-map
(let ((map (make-sparse-keymap)))
(define-key map "n" 'diff-hl-revert-hunk)