From 12fa36b6b635bc428d88fde4d3bbc930b0f7bfcc Mon Sep 17 00:00:00 2001 From: yoctocell Date: Thu, 7 Jan 2021 09:10:22 +0100 Subject: Dont' colorize revision Let the user specify the 'git log' command to run, this wont really play well with the current colorization regex. * git-email.el (git-email-revision-command): (git-email--get-revision): --- git-email.el | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'git-email.el') diff --git a/git-email.el b/git-email.el index e3a08e1..ad75a8d 100644 --- a/git-email.el +++ b/git-email.el @@ -119,6 +119,12 @@ variable." :type 'int :group 'git-email) +(defcustom git-email-revision-command + "git log --no-color --pretty='format:%h %d %d' --abbrev-commit -n " + "Command to run to get a list of revisions." + :type 'string + :group 'git-email) + (defface git-email-revision-face '((t :inherit font-lock-comment-face)) "Face used for the revision when selecting from the minibuffer.") @@ -254,24 +260,9 @@ them into the message buffer." (revs (butlast (split-string (shell-command-to-string (concat - "git log --no-color --date=short " - "--pretty='format:%h %d %s'" - " --abbrev-commit -n " + git-email-revision-command (int-to-string git-email-revision-limit))) "\n"))) - ;; Colorize - (colored-revs - (mapcar (lambda (rev) - (concat - (propertize - (replace-regexp-in-string "\\([a-f0-9]+\\) .*$" - "\\1" rev) - 'face 'git-email-revision-face) - (propertize - (replace-regexp-in-string "[a-f0-9]+ \\(.*$\\)" - "\\1" rev) - 'face 'default))) - revs)) ;; Sort the candidates correctly. ;; See https://emacs.stackexchange.com/a/41808. (sorted-revs @@ -280,7 +271,7 @@ them into the message buffer." '(metadata (display-sort-function . identity) (cycle-sort-function . identity)) (complete-with-action - action colored-revs string pred))))) + action revs string pred))))) (substring (completing-read "Revision: " sorted-revs) 0 7))) ;;;###autoload @@ -313,7 +304,6 @@ arguments in `git-email-format-patch-default-args' will be used." (git-email--compose-email file) (run-hooks 'git-email-post-compose-email-hook)))) - ;;;; Operate on emails (defun git-email-send-all () "Send all unsent emails." -- cgit v1.2.3