From 0b769b12398e731717b490425f8d5024137d53d3 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 2 Jul 2012 01:27:25 +0400 Subject: [PATCH] Update comments, assign version --- README.md | 9 ++++++--- diff-hl.el | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6e82c3ad0..9a0909aa3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ About ===== -`diff-hl-mode` provides IDE-like highlighting on the fringe to the left of the -changed buffer lines, compared to current HEAD. +`diff-hl-mode` provides IDE-like highlighting of `vc-diff` results on the left +fringe of the current buffer. -Since it uses the corresponding VC diff command, it's only accurate when a +Additionally, it defines and binds `diff-hl-diff-goto-hunk` and +`diff-hl-revert-hunk`, to `C-x v =` and `C-x v n` respectively. + +Since it uses the corresponding VC diff command, it's only accurate when the buffer is in saved state. Tested with Git, Mercurial, and Bazaar. May work with other VC backends, too. diff --git a/diff-hl.el b/diff-hl.el index 85429d99b..76973ab47 100644 --- a/diff-hl.el +++ b/diff-hl.el @@ -1,7 +1,9 @@ ;;; diff-hl.el --- VC diff fringe highlighting -*- lexical-binding: t -*- ;; Author: Dmitry Gutov +;; URL: https://github.com/dgutov/diff-hl ;; Keywords: vc, diff +;; Version: 1.0 ;; This file is not part of GNU Emacs. @@ -18,6 +20,15 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + +;; `diff-hl-mode' provides IDE-like highlighting of `vc-diff' results +;; on the left fringe of the current buffer. +;; +;; For full description, see README.md or the home page. + +;;; Code: + (require 'diff-mode) (require 'vc) (eval-when-compile @@ -188,7 +199,7 @@ (diff-hl-update)))) (defun diff-hl-diff-goto-hunk () - "Open diff buffer and skip to the line corresponding to current." + "Run VC diff command and go to the line corresponding to current." (interactive) (vc-buffer-sync) (let* ((line (line-number-at-pos)) @@ -220,6 +231,7 @@ in the source file, or the last line of the hunk above it." (decf to-go)))))))))) (defun diff-hl-revert-hunk () + "Revert the diff hunk with changes at or above the point." (interactive) (vc-buffer-sync) (let ((diff-buffer (generate-new-buffer-name "*diff-hl*")) @@ -281,3 +293,5 @@ in the source file, or the last line of the hunk above it." turn-on-diff-hl-mode) (provide 'diff-hl) + +;;; diff-hl.el ends here -- 2.39.2