From c58eacc0d514f12c79259811396ca3a32c4a73b4 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 18 Aug 2024 19:50:19 +0300 Subject: [PATCH] mu4e: whitespace / typo fixes --- mu4e/mu4e-compose.el | 24 ++++++++++++------------ mu4e/mu4e-draft.el | 2 +- mu4e/mu4e-notification.el | 39 +++++++++++++++++++++++++++++++-------- mu4e/mu4e.el | 7 +++++-- 4 files changed, 49 insertions(+), 23 deletions(-) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index f2b6f890..760d2f4f 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -438,18 +438,18 @@ variables ‘message-forward-as-mime’ and ;;;###autoload (defun mu4e-compose-edit() - "Edit an existing draft message." - (interactive) - (let* ((msg (mu4e-message-at-point))) - (unless (member 'draft (mu4e-message-field msg :flags)) - (mu4e-warn "Cannot edit non-draft messages")) - (mu4e--draft - 'edit - (lambda () - (with-current-buffer - (find-file-noselect (mu4e-message-readable-path msg)) - (mu4e--delimit-headers) - (current-buffer)))))) + "Edit an existing draft message." + (interactive) + (let* ((msg (mu4e-message-at-point))) + (unless (member 'draft (mu4e-message-field msg :flags)) + (mu4e-warn "Cannot edit non-draft messages")) + (mu4e--draft + 'edit + (lambda () + (with-current-buffer + (find-file-noselect (mu4e-message-readable-path msg)) + (mu4e--delimit-headers) + (current-buffer)))))) ;;;###autoload (defun mu4e-compose-resend (address) diff --git a/mu4e/mu4e-draft.el b/mu4e/mu4e-draft.el index bae0df8c..cef2033b 100644 --- a/mu4e/mu4e-draft.el +++ b/mu4e/mu4e-draft.el @@ -244,7 +244,7 @@ BASE-NAME is the base filename without any Maildir decoration." (format "%s%s2,DS" base-name mu4e-maildir-info-delimiter)))) (defun mu4e--fcc-path (base-name &optional parent) - "Construct a Fcc: path, based on PARENT and `mu4e-sent-messages-behavior'. + "Construct an Fcc: path, based on PARENT and `mu4e-sent-messages-behavior'. PARENT is either nil or the original message (being replied to/forwarded etc.), and is used to determine the sent folder, diff --git a/mu4e/mu4e-notification.el b/mu4e/mu4e-notification.el index 9ad96384..1d47742f 100644 --- a/mu4e/mu4e-notification.el +++ b/mu4e/mu4e-notification.el @@ -1,6 +1,24 @@ -;;; mu4e-notification.el --- Showing mail notifications -*- lexical-binding: t-*- -;; -;; Copyright (C) 1996-2023 Dirk-Jan C. Binnema +;;; mu4e-notification.el --- Mail notifications -*- lexical-binding: t-*- + +;; Copyright (C) 2023-2024 Dirk-Jan C. Binnema + +;; Author: Dirk-Jan C. Binnema +;; Maintainer: Dirk-Jan C. Binnema + +;; SPDX-License-Identifier: GPL-3.0-or-later + +;; mu4e is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; mu4e is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with mu4e. If not, see . ;;; Commentary: ;;; Generic support for showing new-mail notifications. @@ -10,11 +28,13 @@ (require 'mu4e-query-items) (require 'mu4e-bookmarks) -;; for emacs' built-in desktop notifications to work, we need -;; dbus +;; for Emacs' built-in desktop notifications to work, we need +;; DBus (when (featurep 'dbus) (require 'notifications)) +;;; Options + (defcustom mu4e-notification-filter #'mu4e--default-notification-filter "Function for determining if a notification is to be emitted. @@ -38,6 +58,9 @@ now." :type 'function :group 'mu4e-notification) + +;;; Implementation + (defvar mu4e--notification-id nil "The last notification id, so we can replace it.") @@ -45,8 +68,8 @@ now." "Return t if a notification should be shown. This default implementation does so when the number of unread -messages changed since the last notification and it is greater -than zero." +messages changed since the last notification and is greater than +zero." (when-let* ((fav (mu4e-bookmark-favorite)) (delta-unread (plist-get fav :delta-unread))) (when (and (> delta-unread 0) @@ -57,7 +80,7 @@ than zero." (defun mu4e--default-notification-function (&optional _) "Default function for handling notifications. -The default implementation uses emacs' built-in dbus-notification +The default implementation uses Emacs' built-in DBus-notification support." (when-let* ((fav (mu4e-bookmark-favorite)) (title "mu4e found new mail") diff --git a/mu4e/mu4e.el b/mu4e/mu4e.el index 8efc7b68..621b21d1 100644 --- a/mu4e/mu4e.el +++ b/mu4e/mu4e.el @@ -1,12 +1,14 @@ ;;; mu4e.el --- Mu4e, the mu mail user agent -*- lexical-binding: t -*- -;; Copyright (C) 2011-2023 Dirk-Jan C. Binnema +;; Copyright (C) 2011-2024 Dirk-Jan C. Binnema ;; Author: Dirk-Jan C. Binnema ;; Maintainer: Dirk-Jan C. Binnema + +;; Homepage: https://www.djcbsoftware.nl/code/mu/ ;; Keywords: email -;; This file is not part of GNU Emacs. +;; SPDX-License-Identifier: GPL-3.0-or-later ;; mu4e is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -24,6 +26,7 @@ ;;; Commentary: ;;; Code: + (require 'mu4e-obsolete) (require 'mu4e-vars)