diff options
author | Xinglu Chen <public@yoctocell.xyz> | 2021-04-03 14:32:02 +0200 |
---|---|---|
committer | Xinglu Chen <public@yoctocell.xyz> | 2021-04-03 14:33:11 +0200 |
commit | e02b1a318cbcba26b9f5d7159ed2d694daf49cca (patch) | |
tree | 30228353a58bc4949eea958227d9d5be3c73a4e2 | |
parent | 44e07c7ff663836e9d1f66958c39dea8c9c284ee (diff) |
Untabify all files.
Spaces >> tabs.
* git-email.el: Untabify.
* git-email-gnus.el: Likewise.
* git-email-magit.el: Likewise.
* git-email-notmuch.el: Likewise.
-rw-r--r-- | git-email-gnus.el | 2 | ||||
-rw-r--r-- | git-email-magit.el | 4 | ||||
-rw-r--r-- | git-email-notmuch.el | 4 | ||||
-rw-r--r-- | git-email.el | 104 |
4 files changed, 57 insertions, 57 deletions
diff --git a/git-email-gnus.el b/git-email-gnus.el index f66529f..ad2bcb5 100644 --- a/git-email-gnus.el +++ b/git-email-gnus.el @@ -42,7 +42,7 @@ from Lisp, enable the mode if ARG is omitted or nil." :init-value nil (if git-email-gnus-mode (progn - (setq git-email-compose-email-function 'gnus-msg-mail)) + (setq git-email-compose-email-function 'gnus-msg-mail)) (setq git-email-compose-email-function 'message-mail))) (provide 'git-email-gnus) diff --git a/git-email-magit.el b/git-email-magit.el index 4ca080a..1f6404e 100644 --- a/git-email-magit.el +++ b/git-email-magit.el @@ -39,8 +39,8 @@ (interactive (let ((args (transient-args 'magit-patch-create))) (list (mapconcat #'identity - (seq-filter #'stringp args) - " ")))) + (seq-filter #'stringp args) + " ")))) ;; For some reason, `git-email-format-patch' gets called before ;; `magit-log-select' has retunred anything, leading to an error. (if commit diff --git a/git-email-notmuch.el b/git-email-notmuch.el index 6cea752..1d29a35 100644 --- a/git-email-notmuch.el +++ b/git-email-notmuch.el @@ -42,8 +42,8 @@ from Lisp, enable the mode if ARG is omitted or nil." :init-value nil (if git-email-notmuch-mode (progn - (setq git-email-compose-email-function 'notmuch-mua-mail) - (setq git-email-send-email-function 'notmuch-mua-send-and-exit)) + (setq git-email-compose-email-function 'notmuch-mua-mail) + (setq git-email-send-email-function 'notmuch-mua-send-and-exit)) (setq git-email-compose-email-function 'message-mail) (setq git-email-send-email-function 'message-send-and-exit))) diff --git a/git-email.el b/git-email.el index 3d3d71b..f83f8a4 100644 --- a/git-email.el +++ b/git-email.el @@ -168,8 +168,8 @@ If none of the functions return non-nil value, (defun git-email--check-file (file) "Check if FILE is a patch." (if (and (file-readable-p file) - (or (string-match-p "\\.patch$" file) - (string-match-p "\\.diff$" file))) + (or (string-match-p "\\.patch$" file) + (string-match-p "\\.diff$" file))) file (error "Not a valid patch!"))) @@ -178,32 +178,32 @@ If none of the functions return non-nil value, If no marks are found, return the filename at point." (when (eq major-mode 'dired-mode) (delq nil - (mapcar - (lambda (f) (if (file-directory-p f) nil f)) - (dired-map-over-marks (dired-get-filename) nil))))) + (mapcar + (lambda (f) (if (file-directory-p f) nil f)) + (dired-map-over-marks (dired-get-filename) nil))))) (defun git-email--vc-dir-files () "Return list of filenames for marked files in `vc-dir'. If no marks are found, return the filename at point." (when (eq major-mode 'vc-dir) (let* ((marked-files (nreverse (vc-dir-marked-files))) - (files (if marked-files - marked-files - (list (vc-dir-current-file))))) + (files (if marked-files + marked-files + (list (vc-dir-current-file))))) files))) (defun git-email--ibuffer-files () "Return list of filenames for marked files in `ibuffer'." (when (eq major-mode 'ibuffer-mode) (let ((marked-files (nreverse - (mapcar (lambda (b) (buffer-file-name b)) - (ibuffer-get-marked-buffers))))) + (mapcar (lambda (b) (buffer-file-name b)) + (ibuffer-get-marked-buffers))))) marked-files))) (defun git-email--minibuffer-file () "Prompt for a file to send as a patch." (list (car (find-file-read-args "Find patch: " - (confirm-nonexistent-file-or-buffer))))) + (confirm-nonexistent-file-or-buffer))))) (defun git-email--get-files () "Return list of filenames for marked files in `vc-dir'. @@ -244,8 +244,8 @@ If the header is not found, return an empty string." (with-temp-buffer (insert-file-contents patch-file) (mapcar (lambda (header) - `(,header . ,(git-email--extract-header header))) - git-email-headers))) + `(,header . ,(git-email--extract-header header))) + git-email-headers))) (defun git-email--extract-diff (patch-file) "Extract the diff from PATCH-FILE." @@ -265,8 +265,8 @@ If the header is not found, return an empty string." (delay-mode-hooks (diff-mode)) (font-lock-default-function #'diff-mode) (font-lock-default-fontify-region (point-min) - (point-max) - nil) + (point-max) + nil) (buffer-string))) (defun git-email--fontify-using-faces (text) @@ -275,7 +275,7 @@ If the header is not found, return an empty string." (next (gensym))) (while (setq next (next-single-property-change pos 'face text)) (put-text-property pos next 'font-lock-face - (get-text-property pos 'face text) text) + (get-text-property pos 'face text) text) (setq pos next)) (add-text-properties 0 (length text) '(fontified t) text) text)) @@ -327,15 +327,15 @@ them into the message buffer." ;; Insert diff at the beginning of the body (goto-char (point-min)) (let ((body (or (re-search-forward - "^<#part \\(encrypt\\|sign\\)=.*mime>$" - nil t) - (re-search-forward (regexp-quote mail-header-separator) nil t)))) + "^<#part \\(encrypt\\|sign\\)=.*mime>$" + nil t) + (re-search-forward (regexp-quote mail-header-separator) nil t)))) (save-excursion - (insert (git-email--fontify-using-faces - (git-email--fontify-diff diff))))) + (insert (git-email--fontify-using-faces + (git-email--fontify-diff diff))))) ;; Jump to subject or 'to' address if they are emtpy (when (or (re-search-backward "\\*\\*\\* TO ADDRESS HERE \\*\\*\\*" nil t) - (re-search-backward "\\*\\*\\* SUBJECT HERE \\*\\*\\*" nil t)) + (re-search-backward "\\*\\*\\* SUBJECT HERE \\*\\*\\*" nil t)) (kill-line)))) @@ -345,22 +345,22 @@ them into the message buffer." (interactive) (let* ((default-directory (run-hook-with-args-until-success 'git-email-get-current-project-functions)) - ;; Last element is an empty string - (revs (split-string - (shell-command-to-string - (concat - git-email-revision-command - (int-to-string git-email-revision-limit))) - "\n")) - ;; Sort the candidates correctly. - ;; See https://emacs.stackexchange.com/a/41808. - (sorted-revs - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action - action revs string pred))))) + ;; Last element is an empty string + (revs (split-string + (shell-command-to-string + (concat + git-email-revision-command + (int-to-string git-email-revision-limit))) + "\n")) + ;; Sort the candidates correctly. + ;; See https://emacs.stackexchange.com/a/41808. + (sorted-revs + (lambda (string pred action) + (if (eq action 'metadata) + '(metadata (display-sort-function . identity) + (cycle-sort-function . identity)) + (complete-with-action + action revs string pred))))) (git-email--parse-revision (completing-read "Revision: " sorted-revs)))) (defun git-email--parse-revision (rev) @@ -388,22 +388,22 @@ With prefix argument KEEP, keep the generated patches. The default behavior is to delete them after sending the message." (interactive (list (apply #'concat (mapcar - (lambda (a) (concat a " ")) - (completing-read-multiple - "Args: " git-email-format-patch-extra-args - nil nil git-email-format-patch-default-args))) - (or (run-hook-with-args-until-success + (lambda (a) (concat a " ")) + (completing-read-multiple + "Args: " git-email-format-patch-extra-args + nil nil git-email-format-patch-default-args))) + (or (run-hook-with-args-until-success 'git-email-get-revision-functions) - (git-email--minibuffer-get-revision)) - current-prefix-arg)) + (git-email--minibuffer-get-revision)) + current-prefix-arg)) ;; List of patches generated, the last element is an empty string ;; so remove it. Reverse the list so we edit the cover letter first. (let ((files (nreverse (butlast - (split-string - (shell-command-to-string - (format "git format-patch %s %s" - args range)) - "\n"))))) + (split-string + (shell-command-to-string + (format "git format-patch %s %s" + args range)) + "\n"))))) (dolist (file files) (run-hooks 'git-email-pre-compose-email-hook) (git-email--compose-email file) @@ -420,8 +420,8 @@ default behavior is to delete them after sending the message." ;; the ordering from getting messed up. (let ((buffers (sort (message-buffers) #'string-greaterp))) (mapc (lambda (b) (switch-to-buffer b) - (funcall git-email-send-email-function)) - buffers))) + (funcall git-email-send-email-function)) + buffers))) ;;;###autoload (defun git-email-send-email (files) |