[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate 417539dc73 03/67: Add agitate-log-edit-insert-f
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate 417539dc73 03/67: Add agitate-log-edit-insert-file-name command |
Date: |
Wed, 28 Sep 2022 16:57:25 -0400 (EDT) |
branch: externals/agitate
commit 417539dc73ad7b0aa848826ce276dd21692858df
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add agitate-log-edit-insert-file-name command
---
agitate.el | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/agitate.el b/agitate.el
index 35877a9102..bb68c6cbf9 100644
--- a/agitate.el
+++ b/agitate.el
@@ -31,9 +31,36 @@
;;; Code:
+(require 'log-edit)
+
(defgroup agitate ()
"Work-in-progress."
:group 'vc)
+;;;; Commands for log-edit (commit messages)
+
+(defun agitate--log-edit-extract-file (with-file-extension)
+ "Return file from `log-edit-files' without or WITH-FILE-EXTENSION."
+ (when-let* ((files (log-edit-files))
+ (file (if (length> files 1)
+ (completing-read "Derive shortname from: " files nil t)
+ (car files)))
+ (name (file-name-nondirectory file)))
+ (if with-file-extension
+ file
+ (file-name-sans-extension file))))
+
+;;;###autoload
+(defun agitate-log-edit-insert-file-name (&optional with-file-extension)
+ "Insert at point file name sans directory from `log-edit-files'.
+
+If multiple files are involved, prompt with completion for one
+among them.
+
+With optional prefix argument WITH-FILE-EXTENSION, include the
+file extension. Else omit it."
+ (interactive "P" log-edit-mode)
+ (insert (format "%s: " (agitate--log-edit-extract-file
with-file-extension))))
+
(provide 'agitate)
;;; agitate.el ends here
- [elpa] branch externals/agitate created (now f736eb51a7), ELPA Syncer, 2022/09/28
- [elpa] externals/agitate a3ee8251d4 01/67: Start recording file history, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 93b2674f70 07/67: Add agitate-diff-refine-cycle command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 16a2ea1cfe 13/67: Simplify agitate-diff-refine-cycle messages, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 6604612c32 05/67: Add agitate-git-grep command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 0ee85a971b 11/67: Add agitate-diff-buffer-or-file command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate d6aaced969 10/67: Actually depend on Emacs 27.1, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate e7b6acb8f7 12/67: Limit agitate-diff-refine-cycle to diff-mode, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 43027aefb9 16/67: Add agitate-diff-narrow-dwim command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 4baa368ffd 02/67: Depend on Emacs 29, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 417539dc73 03/67: Add agitate-log-edit-insert-file-name command,
ELPA Syncer <=
- [elpa] externals/agitate 1f35cecc20 17/67: Add agitate-diff-kill-dwim prototype, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 839892328b 28/67: Add missing backronym, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 4ed8d553ba 22/67: Record TODO for vc-git-push replacements, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate bb94713469 40/67: Fix formatting of inline code in the manual, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 475b75a91a 26/67: Add skeleton of README.org, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate cbe4eed8b2 23/67: Add agitate-log-edit-emoji-commit command+option, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate c54fe94ac1 55/67: Add agitate-vc-git-prompt-format-patch-single cmd, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 6c89d23954 47/67: Remove agitate-diff-kill-dwim (doesn't work), ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 91e685d0fb 37/67: Add dir-locals.el, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate a5ee057fd5 65/67: Add sample configuration to the manual, ELPA Syncer, 2022/09/28