mu4e-helpers: cosmetics

Whitespace etc. fixes
This commit is contained in:
Dirk-Jan C. Binnema
2024-09-03 19:37:39 +03:00
parent e9ca3ad9f6
commit b9cf667be9

View File

@ -34,7 +34,7 @@
(require 'mu4e-window) (require 'mu4e-window)
(require 'mu4e-config) (require 'mu4e-config)
;;; Customization ;;; Customization
(defcustom mu4e-debug nil (defcustom mu4e-debug nil
@ -46,7 +46,7 @@
"Function to be used to receive user-input during completion. "Function to be used to receive user-input during completion.
Suggested possible values are: Suggested possible values are:
* `completing-read': emacs built-in completion method * `completing-read': Emacs' built-in completion method
* `ido-completing-read': dynamic completion within the minibuffer. * `ido-completing-read': dynamic completion within the minibuffer.
The function is used in two contexts - The function is used in two contexts -
@ -109,8 +109,6 @@ marked as read-only, or non-nil otherwise."
function) function)
:group 'mu4e-view) :group 'mu4e-view)
(defun mu4e-select-other-view () (defun mu4e-select-other-view ()
"Switch between headers view and message view." "Switch between headers view and message view."
(interactive) (interactive)
@ -121,14 +119,12 @@ marked as read-only, or non-nil otherwise."
((mu4e-current-buffer-type-p 'headers) ((mu4e-current-buffer-type-p 'headers)
(mu4e-get-view-buffer)) (mu4e-get-view-buffer))
(t (mu4e-error (t (mu4e-error
"This window is neither the headers nor the view window.")))) "This window is neither the headers nor the view window"))))
(other-win (and other-buf (get-buffer-window other-buf)))) (other-win (and other-buf (get-buffer-window other-buf))))
(if (window-live-p other-win) (if (window-live-p other-win)
(select-window other-win) (select-window other-win)
(mu4e-message "No window to switch to")))) (mu4e-message "No window to switch to"))))
;;; Messages, warnings and errors ;;; Messages, warnings and errors
(defun mu4e-format (frm &rest args) (defun mu4e-format (frm &rest args)
"Create [mu4e]-prefixed string based on format FRM and ARGS." "Create [mu4e]-prefixed string based on format FRM and ARGS."
@ -248,7 +244,7 @@ Return the matching choice value (cdr of the cell)."
"Read and return one of CHOICES, prompting for PROMPT. "Read and return one of CHOICES, prompting for PROMPT.
PROMPT describes a multiple-choice question to the user. CHOICES PROMPT describes a multiple-choice question to the user. CHOICES
is an alist of the fiorm is an alist of the form
( ( <display-string> ( <shortcut> . <value> )) ( ( <display-string> ( <shortcut> . <value> ))
... ) ... )
Any input that is not one of CHOICES is ignored. This is mu4e's Any input that is not one of CHOICES is ignored. This is mu4e's
@ -324,7 +320,6 @@ Function returns the value (cdr) of the matching cell."
(characterp (plist-get item :key))) (characterp (plist-get item :key)))
lst)) lst))
;;; Logging / debugging ;;; Logging / debugging
(defconst mu4e--log-max-size 1000000 (defconst mu4e--log-max-size 1000000
@ -400,8 +395,6 @@ log-buffer. See `mu4e-show-log'."
(mu4e-warn "No debug log available")) (mu4e-warn "No debug log available"))
(display-buffer buf))) (display-buffer buf)))
;;; Flags ;;; Flags
;; Converting flags->string and vice-versa ;; Converting flags->string and vice-versa
@ -450,7 +443,6 @@ http://cr.yp.to/proto/maildir.html."
(_ nil)))) (_ nil))))
str)))) str))))
;;; Misc ;;; Misc
(defun mu4e-copy-thing-at-point () (defun mu4e-copy-thing-at-point ()
"Copy e-mail address or URL at point to the kill ring. "Copy e-mail address or URL at point to the kill ring.
@ -528,7 +520,7 @@ Or go to the top level if there is none."
('mu4e-view-mode "(mu4e)Message view") ('mu4e-view-mode "(mu4e)Message view")
(_ "mu4e")))) (_ "mu4e"))))
;;; bookmarks ;;; bookmarks
(defun mu4e--make-bookmark-record () (defun mu4e--make-bookmark-record ()
"Create a bookmark for the message at point." "Create a bookmark for the message at point."
@ -553,14 +545,12 @@ Or go to the top level if there is none."
(when-let ((msgid (bookmark-prop-get bookmark 'message-id))) (when-let ((msgid (bookmark-prop-get bookmark 'message-id)))
(mu4e-view-message-with-message-id msgid))) (mu4e-view-message-with-message-id msgid)))
;;; Macros ;;; Macros
(defmacro mu4e-setq-if-nil (var val) (defmacro mu4e-setq-if-nil (var val)
"Set VAR to VAL if VAR is nil." "Set VAR to VAL if VAR is nil."
`(unless ,var (setq ,var ,val))) `(unless ,var (setq ,var ,val)))
;;; Misc ;;; Misc
(defun mu4e-join-paths (directory &rest components) (defun mu4e-join-paths (directory &rest components)
"Append COMPONENTS to DIRECTORY and return the resulting string. "Append COMPONENTS to DIRECTORY and return the resulting string.