unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#61661: 30.0.50; [PATCH] Define 'appt-notification' face
@ 2023-02-20 19:15 Protesilaos Stavrou
  2023-09-04 20:51 ` Stefan Kangas
  0 siblings, 1 reply; 2+ messages in thread
From: Protesilaos Stavrou @ 2023-02-20 19:15 UTC (permalink / raw)
  To: 61661

[-- Attachment #1: Type: text/plain, Size: 638 bytes --]

Dear maintainers,

The appt.el library can show a notification for upcoming appointments on
the mode line.  The face it uses is hardcoded to 'mode-line-emphasis'
which, by default, is a bold weight.

With the attached patch, we have a new face that the user/theme can set
to something easier to spot like bold+red.  Decoupling this indicator
from the generic 'mode-line-emphasis' allows us to add extra styling
only to the notification without affecting other parts of the mode line
that may be using 'mode-line-emphasis'.

What do you think?

All the best,
Protesilaos (or simply "Prot")

-- 
Protesilaos Stavrou
https://protesilaos.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-appt-notification-face.patch --]
[-- Type: text/x-patch, Size: 2050 bytes --]

From 02a8768e4e81b8a645b81cb4864387bf4422bcfe Mon Sep 17 00:00:00 2001
Message-Id: <02a8768e4e81b8a645b81cb4864387bf4422bcfe.1676919809.git.info@protesilaos.com>
From: Protesilaos Stavrou <info@protesilaos.com>
Date: Mon, 20 Feb 2023 21:03:08 +0200
Subject: [PATCH] Add 'appt-notification' face

* etc/NEWS: Announce the new face.
* lisp/calendar/appt.el (appt-notification): Declare the new face.
(appt-check): Implement the new face.
---
 etc/NEWS              | 6 ++++++
 lisp/calendar/appt.el | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index bcce416ebc1..04fe60be493 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -61,6 +61,12 @@ This allows the user to customize the prompt that is appended by
 This is used for displaying the time and date components of
 'display-time-mode'.
 
+---
+** New face 'appt-notification'.
+This is used for the warning message when 'appt-display-mode-line' is
+non-nil.
+
+
 \f
 * Editing Changes in Emacs 30.1
 
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index 49597739446..3c2d7fee24b 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -165,6 +165,12 @@ (defcustom appt-delete-window-function #'appt-delete-window
   :type 'function
   :group 'appt)
 
+(defface appt-notification
+  '((t :inherit mode-line-emphasis))
+  "Face for appointment notification on the modeline.
+Shown when `appt-display-mode-line' is non-nil."
+  :group 'mode-line-faces
+  :version "30.1")
 
 ;;; Internal variables below this point.
 
@@ -406,7 +412,7 @@ (defun appt-check (&optional force)
                          (appt-mode-line (mapcar #'number-to-string
                                                  min-list)
                                          t)
-                         'face 'mode-line-emphasis)
+                         'face 'appt-notification)
                         " ")))
         ;; Reset count to 0 in case we display another appt on the next cycle.
         (setq appt-display-count (if (equal '(0) min-list) 0
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#61661: 30.0.50; [PATCH] Define 'appt-notification' face
  2023-02-20 19:15 bug#61661: 30.0.50; [PATCH] Define 'appt-notification' face Protesilaos Stavrou
@ 2023-09-04 20:51 ` Stefan Kangas
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Kangas @ 2023-09-04 20:51 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 61661-done

Protesilaos Stavrou <info@protesilaos.com> writes:

> The appt.el library can show a notification for upcoming appointments on
> the mode line.  The face it uses is hardcoded to 'mode-line-emphasis'
> which, by default, is a bold weight.
>
> With the attached patch, we have a new face that the user/theme can set
> to something easier to spot like bold+red.  Decoupling this indicator
> from the generic 'mode-line-emphasis' allows us to add extra styling
> only to the notification without affecting other parts of the mode line
> that may be using 'mode-line-emphasis'.
>
> What do you think?

Makes sense to me.  I edited your NEWS message to be more clear, and
installed this on master as commit 367c3f25a16.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-04 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-20 19:15 bug#61661: 30.0.50; [PATCH] Define 'appt-notification' face Protesilaos Stavrou
2023-09-04 20:51 ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).