diff options
| author | mattkae <mattkae@protonmail.com> | 2022-11-28 08:18:55 -0500 | 
|---|---|---|
| committer | mattkae <mattkae@protonmail.com> | 2022-11-28 08:18:55 -0500 | 
| commit | 2e006908657ede8590b3fa5544fb05ffec061fc6 (patch) | |
| tree | 38476af663e2c0bcfac174e1ba343a48c217bb76 | |
| parent | 355bab6730c5a20ee45f323507c217e37b157a4d (diff) | |
Copy all function
| -rw-r--r-- | lisp/general.el | 7 | ||||
| -rw-r--r-- | lisp/vc-annotate-lens-mode.el | 20 | 
2 files changed, 24 insertions, 3 deletions
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. +  | 
