emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Review face for export dispatcher highlighted keys
@ 2020-10-12 10:05 Protesilaos Stavrou
  2020-10-24 11:45 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Protesilaos Stavrou @ 2020-10-12 10:05 UTC (permalink / raw)
  To: emacs-orgmode

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

The export dispatcher's active keys are highlighted using the
'org-warning' face.  That face is applied in various contexts, including
the agenda.

Users who have difficulty reading the active keys of the export
dispatcher are therefore forced to modify 'org-warning' throughout their
setup, even though their problem is present only while viewing the
dispatch UI (because highlighted keys are one or a few characters long).

The attached patch is an attempt to address this issue by creating a new
face that is specifically designed for the dispatch UI.

For the background+foreground combinations, the selected values conform
with the highest accessibility standard for colour contrast (WCAG AAA,
else a minimum contrast ratio of 7:1).  I limited my options to what
'M-x list-colors-display' provides.

Best regards,
Protesilaos

-- 
Protesilaos Stavrou
protesilaos.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Review-face-for-export-dispatcher-highlighted-keys.patch --]
[-- Type: text/x-patch, Size: 2104 bytes --]

From 317eecf00b8c7d7112706b2438796f2aa4c48ecd Mon Sep 17 00:00:00 2001
From: Protesilaos Stavrou <info@protesilaos.com>
Date: Mon, 12 Oct 2020 12:41:31 +0300
Subject: [PATCH] Review face for export dispatcher highlighted keys

* lisp/org-faces.el (org-dispatcher-highlight): Define new face.

* lisp/ox.el (org-export--dispatch-ui): Apply org-dispatcher-highlight
face.

The intent is to decouple the dispatcher's interface from the generic
org-warning face.  The dispatcher's active keys are thus made easier
to tell apart, without interfering with other applications of
org-warning.
---
 lisp/org-faces.el | 14 ++++++++++++++
 lisp/ox.el        |  2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index c0556b8bb..94b283ad6 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -45,6 +45,20 @@ The foreground color of this face should be equal to the background
 color of the frame."
   :group 'org-faces)
 
+(defface org-dispatcher-highlight
+  '((default :weight bold)
+    (((class color) (min-colors 88) (background dark))
+     :background "gray20" :foreground "gold1")
+    (((class color) (min-colors 88) (background light))
+     :background "SlateGray1" :foreground "DarkBlue")
+    (((class color) (min-colors 16) (background dark))
+     :foreground "yellow")
+    (((class color) (min-colors 16) (background light))
+     :foreground "blue")
+    (t :inverse-video t))
+  "Face for highlighted keys in the dispatcher."
+  :group 'org-faces)
+
 (defface org-level-1 '((t :inherit outline-1))
   "Face used for level 1 headlines."
   :group 'org-faces)
diff --git a/lisp/ox.el b/lisp/ox.el
index 6dd2cd4a0..5ffd66816 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -6706,7 +6706,7 @@ back to standard interface."
 	    ;; on the first key, if any.  A nil value means KEY will
 	    ;; only be activated at first level.
 	    (if (or (eq access-key t) (eq access-key first-key))
-		(propertize key 'face 'org-warning)
+		(propertize key 'face 'org-dispatcher-highlight)
 	      key)))
 	 (fontify-value
 	  (lambda (value)
-- 
2.28.0


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

* Re: [PATCH] Review face for export dispatcher highlighted keys
  2020-10-12 10:05 [PATCH] Review face for export dispatcher highlighted keys Protesilaos Stavrou
@ 2020-10-24 11:45 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2020-10-24 11:45 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: emacs-orgmode

Hi Protesilaos,

Protesilaos Stavrou <info@protesilaos.com> writes:

> The export dispatcher's active keys are highlighted using the
> 'org-warning' face.  That face is applied in various contexts, including
> the agenda.
>
> Users who have difficulty reading the active keys of the export
> dispatcher are therefore forced to modify 'org-warning' throughout their
> setup, even though their problem is present only while viewing the
> dispatch UI (because highlighted keys are one or a few characters long).
>
> The attached patch is an attempt to address this issue by creating a new
> face that is specifically designed for the dispatch UI.

Applied, thanks a lot!

-- 
 Bastien


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

end of thread, other threads:[~2020-10-24 11:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-12 10:05 [PATCH] Review face for export dispatcher highlighted keys Protesilaos Stavrou
2020-10-24 11:45 ` Bastien

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).