]> code.delx.au - gnu-emacs-elpa/blobdiff - diff-hl.el
Add diff-hl-mark-hunk
[gnu-emacs-elpa] / 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)