Skip to content

Commit

Permalink
docs: minor documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jan 13, 2024
1 parent 569f10b commit 3e9cfb2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
5 changes: 2 additions & 3 deletions core/me-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,10 @@ EXT-REGEXP. When it runs, this function provides a feature named
(hook-name (intern (format "minemacs-first%s-file-hook" (if filetype (format "-%s" filetype) ""))))
(feature-name (intern (format "minemacs-first%s-file" (if filetype (format "-%s" filetype) ""))))
(hook-docs (format "This hook will be run after opening the first %s file (files that matches \"%s\").
Executed before `after-find-file', it runs all hooks in `%s' and provide the `%s' feature."
Executed before `find-file-noselect', it runs all hooks in `%s' and provide the `%s' feature."
filetype ext-regexp hook-name feature-name)))
`(progn
(+log! "Setting up hook `%s' -- function `%s' -- feature `%s'."
',hook-name ',fn-name ',feature-name)
(+log! "Setting up hook `%s' -- function `%s' -- feature `%s'." ',hook-name ',fn-name ',feature-name)
(defcustom ,hook-name nil ,hook-docs :group 'minemacs-core :type 'hook)
(defun ,fn-name (&optional filename &rest _)
(when (and
Expand Down
7 changes: 4 additions & 3 deletions modules/extras/me-mu4e-extras.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
;; Some of these functions are adapted from Doom Emacs

(defun +mu4e-view-select-attachment ()
"Use completing-read to select a single attachment.
"Use `completing-read' to select a single attachment.
Acts like a singular `mu4e-view-save-attachments', without the saving."
(if-let ((parts (delq nil (mapcar
(lambda (part)
Expand Down Expand Up @@ -267,7 +267,7 @@ If SKIP-HEADERS is set, do not show include message headers."
mu4e-attachment-dir)))
;; `gnus-article-browse-html-parts' will try to display the text/html part
;; of the message, but as `+save-as-pdf' is used as browse-url function,
;; it will be called with the proper argumets.
;; it will be called with the proper arguments.
(unless (gnus-article-browse-html-parts parts header)
;; If the mail doesn't contain a text/html part, we save the plain-text message
;; and then we explicitly use `+save-as-pdf' to save it.
Expand All @@ -278,6 +278,7 @@ If SKIP-HEADERS is set, do not show include message headers."
(mm-destroy-parts parts)))))

(defun +mu4e-extras-locks-setup ()
"Setup locks for mu4e's server."
(advice-add 'mu4e--server-kill :after (defun +mu4e--unlock:after-a (&rest _) (+unlock 'mu)))
(advice-add 'mu4e--server-start :after (defun +mu4e--lock:after-a (&rest _) (+lock 'mu))))

Expand All @@ -288,7 +289,7 @@ If SKIP-HEADERS is set, do not show include message headers."

;; Register actions
(add-to-list 'mu4e-view-actions '("pdf" . +mu4e-view-save-mail-as-pdf))
(add-to-list 'mu4e-view-actions '("all attachements save" . +mu4e-view-save-all-attachments))
(add-to-list 'mu4e-view-actions '("all attachments save" . +mu4e-view-save-all-attachments))
(add-to-list 'mu4e-view-actions '("Save message" . +mu4e-save-message-at-point)))


Expand Down
9 changes: 6 additions & 3 deletions modules/extras/me-mu4e-ui.el
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ integer OFFSET."
(replace-regexp-in-string "\t\\*" (format "\t%s" +mu4e-main-bullet) str))

(defun +mu4e--get-string-width (str)
"Return the width in pixels of a string in the current
window's default font. If the font is mono-spaced, this
will also be the width of all other printable characters."
"Return the width in pixels of STR in the current window's default font.
If the font is mono-spaced, this will also be the width of all other printable
characters."
(let ((window (selected-window))
(remapping face-remapping-alist))
(with-temp-buffer
Expand All @@ -133,6 +133,7 @@ will also be the width of all other printable characters."
(concat (propertize " " 'display `(space . (:width ,space-factor))) icon)))

(defun +mu4e--ui-setup ()
"Tweak UI elements."
;; Add a column to display what email account the email belongs to,
;; and an account color stripe column
(defvar +mu4e-header--maildir-colors nil)
Expand Down Expand Up @@ -228,13 +229,15 @@ will also be the width of all other printable characters."
(advice-add 'mu4e--main-action :override #'+mu4e--main-action-prettier:override-a))

(defun +mu4e-ui-setup ()
"Apply UI setup."
(if (display-graphic-p)
(+mu4e--ui-setup)
(+hook-once! 'server-after-make-frame-hook
(when (display-graphic-p)
(+mu4e--ui-setup)))))

(defun +mu4e-ui-modeline-tweaks ()
"Apply UI tweaks based on `nerd-icons'."
(with-eval-after-load 'nerd-icons
(setq mu4e-modeline-all-clear `("C:" . ,(format "%s " (nerd-icons-octicon "nf-oct-read")))
mu4e-modeline-all-read `("R:" . ,(format "%s " (nerd-icons-octicon "nf-oct-check")))
Expand Down
2 changes: 1 addition & 1 deletion modules/me-email.el
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"p" #'org-msg-preview)
(org-msg-mode 1)

;; HACK: When adding multiple attachements, I likely need it to remember the directory of the last added attachement.
;; HACK: When adding multiple attachments, I likely need it to remember the directory of the last added attachment.
(advice-add
'org-msg-attach-attach :after
(defun +org-msg-attach-attach--save-default-directory:after-a (file &rest _)
Expand Down

0 comments on commit 3e9cfb2

Please sign in to comment.