emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/agitate cbe4eed8b2 23/67: Add agitate-log-edit-emoji-co


From: ELPA Syncer
Subject: [elpa] externals/agitate cbe4eed8b2 23/67: Add agitate-log-edit-emoji-commit command+option
Date: Wed, 28 Sep 2022 16:57:27 -0400 (EDT)

branch: externals/agitate
commit cbe4eed8b2fecd895ff2dc931563c352d44f2116
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add agitate-log-edit-emoji-commit command+option
---
 agitate.el | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/agitate.el b/agitate.el
index 30b5064e11..6a41f3e0eb 100644
--- a/agitate.el
+++ b/agitate.el
@@ -41,6 +41,23 @@
   :group 'diff
   :group 'vc)
 
+;; Inspired by <https://gitmoji.dev/>, though I think most of those
+;; are superfluous.  Less is more.  THIS IS NOT an implementation of
+;; gitmoji.
+(defcustom agitate-log-edit-emoji-collection
+  '(":art: Refine"
+    ":bug: Fix"
+    ":memo: Document"
+    ":rocket: Update"
+    ":skull: Delete"
+    ":sparkles: Add")
+  "Completion candidates for `agitate-log-edit-emoji-commit'.
+It is recommended to use the :EMOJI: notation, as it works even
+in terminals that cannot output unicode.  Relevant applications
+will render those as their corresponding graphical emoji."
+  :type '(repeat string)
+  :group 'agitate)
+
 ;;;; Commands for diffs
 
 (defvar-local agitate--refine-diff-state nil
@@ -198,6 +215,22 @@ file extension.  Else omit it."
   (interactive "P" log-edit-mode)
   (insert (format "%s: " (agitate--log-edit-extract-file 
with-file-extension))))
 
+(defvar agitate--log-edit-emoji-commit-history nil
+  "Minibuffer history of `agitate-log-edit-emoji-commit'.")
+
+;;;###autoload
+(defun agitate-log-edit-emoji-commit (emoji-commit)
+  "Insert EMOJI-COMMIT message at point.
+When called interactively, prompt for EMOJI-COMMIT among the
+`agitate-log-edit-emoji-collection'."
+  (interactive
+   (list
+    (completing-read
+     "Select type of commit+emoji: "
+     agitate-log-edit-emoji-collection nil t nil
+     'agitate--log-edit-emoji-commit-history)))
+  (insert emoji-commit))
+
 ;;;; Commands for vc-git (Git backend for the Version Control framework)
 
 ;;;###autoload



reply via email to

[Prev in Thread] Current Thread [Next in Thread]