Protesilaos Stavrou: 6
Remove needless let form for project detection
Remove needless gensym
Add or reword doc strings to placate the compiler
Fix project.el project string for Emacs 29
Do not pollute the kill-ring for email composition
Add minibuffer histories to all relevant prompts
6 files changed, 47 insertions(+), 26 deletions(-)
---
git-email.el | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/git-email.el b/git-email.el
index 7e4febd..a1dff79 100644
--- a/git-email.el+++ b/git-email.el
@@ -177,9 +177,8 @@ (defcustom git-email-generate-message-buffer
(defcustom git-email-buffer-p-function
#'git-email-buffer-p
- "Function used for determining if a buffer contains an unsent-patch based on the buffer name. The function must take one-argument --- the buffer name."+ "Function to test if buffer has an unsent patch.+The function must take one argument: the buffer's name." :type 'function
:group 'git-email
:package-version '(git-email . "0.3.0"))
@@ -283,10 +282,10 @@ (defvar git-email-subject-regexp
eol)))
(defun git-email--extract-subject ()
- "Extract the subject from the current buffer. git-format-patch-will add a newline in the subject if the subject is too long.-Just using `git-email--extract-header' would result in part of-the subject being cut of. See what I did there? ;-)"+ "Extract the subject from the current buffer.+git-format-patch will add a newline in the subject if the subject+is too long. Just using `git-email--extract-header' would result+in part of the subject being cut of. See what I did there? ;-)" (let ((string (buffer-substring-no-properties (point-min) (point-max))))
(string-match git-email-subject-regexp string)
(string-remove-prefix
@@ -467,15 +466,16 @@ (defun git-email-format-patch (args range keep)
;;;; Misc
(defun git-email-generate-message-buffer-name (_type address _group)
- "Generate a buffer name that looks like this:+ "Generate a buffer name in the form of:\"* git-email unsent patch to *** TO ADDRESS HERE *** *\""
(generate-new-buffer-name
(concat "*git-email unsent patch to " address " *" )))
(defun git-email-buffer-p (name)
- "Check whether a buffer is contains an unsent patch based on its-NAME."+ "Test if NAME buffer has an unsent patch.+The heuristic is to check if the buffer's name includes the+string 'git-email-unsent-patch'." (if (string-match "git-email-unsent-patch" name)
t
nil))
@@ -484,7 +484,7 @@ (defun git-email-buffer-p (name)
;;;; Operate on emails
(defun git-email-message-buffer-greaterp (old new)
- "Compare the number in the buffer name of OLD with NEW"+ "Compare the number in the buffer name of OLD with NEW." (cl-flet ((regexp (name)
(string-to-number
(replace-regexp-in-string ".*<\\([0-9]+\\)>"
@@ -508,6 +508,9 @@ (defun git-email-send-all ()
sorted-buffers)))
(defun git-email--rewrite-header-in-buffer (buffer header value append)
+ "Rewrite BUFFER's HEADER with VALUE.+If APPEND is non-nil, append the VALUE to the existing one+instead of overwriting it." (switch-to-buffer buffer)
(save-excursion
(goto-char (point-min))
@@ -523,6 +526,7 @@ (defun git-email--rewrite-header-in-buffer (buffer header value append)
(insert "\n" (concat (capitalize header) ": " value)))))))
(defun git-email--send-files (files)
+ "Send email for each file in FILES." (dolist (file files)
(run-hooks 'git-email-pre-compose-email-hook)
(let ((message-generate-new-buffers
@@ -532,8 +536,8 @@ (defun git-email--send-files (files)
;;;###autoload
(defun git-email-rewrite-header (header value &optional append)
- "Re-write the value of HEADER to VALUE, if HEADER doesn't exist-yet, just set it to VALUE.+ "Re-write value of HEADER to VALUE.+If HEADER doesn't exist yet, just set it to VALUE.With prefix argument APPEND, append the VALUE to HEADER instead
of overwriting it.
--
2.35.2
--
Protesilaos Stavrou
https://protesilaos.com