From: Don Armstrong Date: Fri, 19 Jan 2018 19:02:54 +0000 (-0800) Subject: diminish message mode and fix attach file command X-Git-Url: https://git.donarmstrong.com/?p=lib.git;a=commitdiff_plain;h=d24f0ba2be8f6de37973799038be84bbb9f5ebfc diminish message mode and fix attach file command --- diff --git a/emacs_el/configuration/don-configuration.org b/emacs_el/configuration/don-configuration.org index 372501d..48f7dc8 100644 --- a/emacs_el/configuration/don-configuration.org +++ b/emacs_el/configuration/don-configuration.org @@ -1079,44 +1079,44 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori #+BEGIN_SRC emacs-lisp (use-package message :ensure f - :diminish "✉" - :mode "muttng-[a-z0-9]+-[0-9]+-" - :mode "mutt-[a-z0-9]+-[0-9]+-" + :diminish (message "✉") + :mode ("muttng-[a-z0-9]+-[0-9]+-" . message-mode) + :mode ("mutt-[a-z0-9]+-[0-9]+-" . message-mode) :hook 'my/message-mode-settings :hook 'turn-on-flyspell :bind (:map message-mode-map - ("C-c C-a" . my/post-attach-file)) - :config + ("C-c C-a" . my/post-attach-file)) + :delight (message-mode "✉") + :config (defun my/message-mode-settings () (font-lock-add-keywords nil - '(("^[ \t]*>[ \t]*>[ \t]*>.*$" - (0 'message-multiply-quoted-text-face)) - ("^[ \t]*>[ \t]*>.*$" - (0 'message-double-quoted-text-face)))) + '(("^[ \t]*>[ \t]*>[ \t]*>.*$" + (0 'message-multiply-quoted-text-face)) + ("^[ \t]*>[ \t]*>.*$" + (0 'message-double-quoted-text-face)))) ) (defun my/post-attach-file () "Prompt for an attachment." (interactive) - (let ((file (read-file-name "Attach file: " nil nil t nil)) - (description (string-read "Description: "))) - (my/header-attach-file file description))) + (let ((file (read-file-name "Attach file: " nil nil t nil))) + (my/header-attach-file file ""))) (defun my/header-attach-file (file description) "Attach a FILE to the current message (works with Mutt). Argument DESCRIPTION MIME description." (interactive "fAttach file: \nsDescription: ") (when (> (length file) 0) - (save-excursion - (save-match-data - (save-restriction - (widen) - (goto-char (point-min)) - (search-forward-regexp "^$") - (insert (concat "Attach: " (replace-regexp-in-string "\\([[:space:]\\]\\)" "\\\\\\1" (file-truename file)) " " - description "\n")) - (message (concat "Attached '" file "'.")) - (setq post-has-attachment t)))))) + (save-excursion + (save-match-data + (save-restriction + (widen) + (goto-char (point-min)) + (search-forward-regexp "^$") + (insert (concat "Attach: " (replace-regexp-in-string "\\([[:space:]\\]\\)" "\\\\\\1" (file-truename file)) " " + description "\n")) + (message (concat "Attached '" file "'.")) + (setq post-has-attachment t)))))) (setq mail-yank-prefix "> ") )