From 2e006908657ede8590b3fa5544fb05ffec061fc6 Mon Sep 17 00:00:00 2001 From: mattkae Date: Mon, 28 Nov 2022 08:18:55 -0500 Subject: Copy all function --- lisp/general.el | 7 +++++++ lisp/vc-annotate-lens-mode.el | 20 +++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/general.el b/lisp/general.el index f9fb573..29cf9d6 100644 --- a/lisp/general.el +++ b/lisp/general.el @@ -298,5 +298,12 @@ (drag-stuff-global-mode) (drag-stuff-define-keys) +;; Copy the entire buffer. +(defun my-copy-all () + "Copy entire buffer to clipboard." + (interactive) + (clipboard-kill-ring-save (point-min) (point-max))) + + (provide 'general) ;;; general.el ends here diff --git a/lisp/vc-annotate-lens-mode.el b/lisp/vc-annotate-lens-mode.el index 00f674e..830f568 100644 --- a/lisp/vc-annotate-lens-mode.el +++ b/lisp/vc-annotate-lens-mode.el @@ -6,10 +6,23 @@ "Holds the cursor position from the last run of post-command-hooks.")) (defun do-stuff-if-moved-post-command () - (interactive) + "Show version control history of the current line in a flash." (unless (equal (line-number-at-pos) vc-annotate-lens-cursor-position) - (vc-region-history line-number-at-pos) - (message "%s" vc-annotate-lens-cursor-position)) + (remove-overlays) + (overlay-put (make-overlay (point-at-eol) (+ 3 (point-at-eol))) 'display "Hello world\n") + (let* ((lfrom (line-number-at-pos (point) t)) + (lto (line-number-at-pos (1- (point)) t)) + (file buffer-file-name) + (backend (vc-backend file)) + (buf (get-buffer-create "*VC_LENS*"))) + + (vc-call region-history (buffer-file-name) buf lfrom lto) + (with-current-buffer buf + (save-restriction + (widen) + (buffer-substring-no-properties (point-min) (point-max)))) + ) + ) (setq vc-annotate-lens-cursor-position (line-number-at-pos))) (define-minor-mode vc-annotate-lens-mode @@ -22,3 +35,4 @@ (provide 'vc-annotate-lens-mode) ;;; vc-annotate-lens-mode.el ends here. + -- cgit v1.2.1