[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate 50251c7eff 64/67: Add agitate-log-view-kill-rev
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate 50251c7eff 64/67: Add agitate-log-view-kill-revision-expanded cmd |
Date: |
Wed, 28 Sep 2022 16:57:30 -0400 (EDT) |
branch: externals/agitate
commit 50251c7eff001212ebf57a11ee73ff0fb80166c6
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add agitate-log-view-kill-revision-expanded cmd
---
README.org | 4 ++++
agitate.el | 31 +++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/README.org b/README.org
index 74d4b68371..9f8655ac48 100644
--- a/README.org
+++ b/README.org
@@ -144,6 +144,10 @@ commits" are documented here:
<https://www.conventionalcommits.org/en/v1.0.0/>.
several lines), the revision is the one pertinent to the text at
point.
+#+findex: agitate-log-view-kill-revision-expanded
++ ~agitate-log-view-kill-revision-expanded~ :: PROTOTYPE. Append to
+ ~kill-ring~ expanded message of log-view revision at point.
+
** Extras for vc-git
:PROPERTIES:
:CUSTOM_ID: h:f1a1f462-b6db-415a-b8e6-ba23788cb6e3
diff --git a/agitate.el b/agitate.el
index 51f2f3df8c..730e0efa7e 100644
--- a/agitate.el
+++ b/agitate.el
@@ -230,6 +230,37 @@ to the text at point."
(kill-new (format "%s" revision))
(message "Copied: %s" revision)))
+(defun agitate--log-view-revision-expanded-bounds (&optional back)
+ "Return position of expanded log-view message.
+With optional BACK, find the beginning, else the end."
+ (let ((motion (if back
+ (list 're-search-backward 'log-view-msg-prev 1)
+ (list 're-search-forward 'log-view-msg-next -1))))
+ (save-excursion
+ (funcall (nth 0 motion) log-view-message-re nil t)
+ (forward-line (nth 2 motion))
+ (point))))
+
+ ;; TODO 2022-09-28: Maybe have a do-what-I-mean behaviour to expand
+ ;; the entry if necessary? Or maybe expand it to get the message
+ ;; and then contract it again? Keeping it simple seems appropriate,
+ ;; but we will see how this evolves.
+
+;;;###autoload
+(defun agitate-log-view-kill-revision-expanded ()
+ "PROTOTYPE Append to `kill-ring' expanded message of log-view revision at
point."
+ (interactive nil log-view-mode)
+ (let ((pos (point)))
+ ;; TODO 2022-09-28: Also test when we are on the line of the
+ ;; revision, with the expanded entry right below.
+ (when (log-view-inside-comment-p pos)
+ (kill-new
+ (buffer-substring-no-properties
+ (agitate--log-view-revision-expanded-bounds :back)
+ (agitate--log-view-revision-expanded-bounds)))
+ (message "Copied message of `%s' revision"
+ (cadr (log-view-current-entry pos t))))))
+
;;;; Commands for vc-git (Git backend for the Version Control framework)
(defun agitate--vc-git-get-hash-from-string (string)
- [elpa] externals/agitate f9dd3b3f91 41/67: Add agitate-vc-git-kill-commit-message command, (continued)
- [elpa] externals/agitate f9dd3b3f91 41/67: Add agitate-vc-git-kill-commit-message command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate ca4b65bf85 36/67: Add gitignore, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 0b80819820 62/67: Refine regexp for git hash extraction, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 45eb3b6c5d 54/67: Declare agitate-vc-git-show as interactive-only, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 912161bfc1 27/67: Add doclicense.texi which is used in the manual, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 6eb66ed1cc 44/67: Add helper to extract commit hash, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 8bb7652cac 43/67: Rename to agitate-vc-git-grep, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 496eba8497 52/67: Add agitate-vc-git-show prototype, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 1e998e1466 59/67: Rename helper for single commit command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate de2094a2f5 53/67: Placate the compiler, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 50251c7eff 64/67: Add agitate-log-view-kill-revision-expanded cmd,
ELPA Syncer <=
- [elpa] externals/agitate 60dea993b9 25/67: Add COPYING GNU General Public License, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate a2173cf82c 39/67: Implement conventional commits; refine emoji commits, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate acaa1868d0 30/67: Move log-view section further down, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 2b8a593a5d 38/67: Add missing backronym from README.md, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 52c9968e5f 19/67: Refine agitate-vc-git-push doc string, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate b7a51e04d2 18/67: Adjust indentation, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate f29bc8e32a 21/67: Reorder some functions, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 3185f2becd 50/67: Clarify word in agitate-vc-git-grep doc string, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 8459e26050 45/67: Add helper prompt for commit log completion, ELPA Syncer, 2022/09/28