]> code.delx.au - gnu-emacs-elpa/commitdiff
Add diff-hl-mark-hunk
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 23 Jan 2016 08:22:27 +0000 (11:22 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 23 Jan 2016 08:22:27 +0000 (11:22 +0300)
#63

diff-hl.el

index b8407884e384b5ec9fc617eb27f2d495b7b84912..63c2cde18ba999cbc5949c9c8217f56a53b61f6f 100644 (file)
@@ -445,6 +445,14 @@ in the source file, or the last line of the hunk above it."
   (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)