From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Protesilaos Stavrou <info@protesilaos.com>
Cc: 47845@debbugs.gnu.org
Subject: bug#47845: 28.0.50; [PATCH] Update modus-themes to version 1.3.1
Date: Sat, 17 Apr 2021 22:04:16 +0100 [thread overview]
Message-ID: <87lf9gei7j.fsf@tcd.ie> (raw)
In-Reply-To: <87czuseu57.fsf@protesilaos.com> (Protesilaos Stavrou's message of "Sat, 17 Apr 2021 19:46:28 +0300")
Protesilaos Stavrou <info@protesilaos.com> writes:
> I have just published a new tagged release for the modus-themes and
> would like to sync the changes with Emacs. Note that I now have commit
> access to emacs.git, though I would prefer if someone could review the
> attached patch
Thanks, LGTM apart from some minor comments below. (Feel free to
address them in a separate patch.)
> (is there some other way to conduct such reviews?).
Sending patches to bug-gnu-emacs is the preferred way AFAIK.
> +value of =45000= will suffice, contrary to the default =30000=. Though for
> +the ~accented-moody~ value mentioned above, that should be raised up to
> +=70000=. Do not set it too high, because it has the adverse effect of
> +always overriding the default colors (which has been carefully designed
^^^
have
> +to be highly accessible).
> +There are cases where we need to change the buffer-local attributes of a
> +face. This might be because we have our own minor mode that re-uses a
> +face for a particular purpose, such as a line selection tool that
> +activates ~hl-line-mode~, but we wish to keep distinct it from other
^^^^^^^^^^^
it distinct
> +#+begin_src emacs-lisp
> +(defvar my-rainbow-region-colors
> + (modus-themes-with-colors
> + `((red . ,red-subtle-bg)
> + (green . ,green-subtle-bg)
> + (yellow . ,yellow-subtle-bg)
> + (blue . ,blue-subtle-bg)
> + (magenta . ,magenta-subtle-bg)
> + (cyan . ,cyan-subtle-bg)))
> + "Sample list of color values for `my-rainbow-region'.")
> +
> +(defun my-rainbow-region (color)
> + "Remap buffer-local attribute of `region' using COLOR."
> + (interactive
> + (list
> + (completing-read "Pick a color: "
> + (mapcar #'car my-rainbow-region-colors))))
If the cars of my-rainbow-region-colors are symbols, you can pass the
alist to completing-read directly. Conversely, completing-read isn't
documented as accepting a flat list of symbols.
> + (dolist (cons palette)
> + (setq name (color-saturate-name (cdr cons) percent))
> + (setq name (format "%s" name))
> + (setq cons `(,(car cons) . ,name))
> + (push cons colors))
Texinfo doesn't like tab characters in general, so this indentation (and
any other occurrences of tabs) should be untabified.
> +The idea is to assign that function to a hook that gets called when
> +~pdf-tools~ renders the document: ~pdf-tools-enabled-hook~. This is enough
> +when you only use one theme. However it has the downside of setting the
> +background color value only at render time. In other words, the face
> +remapping function does not get evaluated anew whenever the theme
> +changes, such upon invoking {{{kbd(M-x modus-themes-toggle)}}}.
^^^^^
such as
> +(defun my-pdf-tools-midnight-mode-toggle ()
> + (when (eq major-mode 'pdf-view-mode)
Nit: maybe (derived-mode-p 'pdf-view-mode) instead?
--
Basil
next prev parent reply other threads:[~2021-04-17 21:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-17 16:46 bug#47845: 28.0.50; [PATCH] Update modus-themes to version 1.3.1 Protesilaos Stavrou
2021-04-17 21:04 ` Basil L. Contovounesios [this message]
2021-04-18 3:35 ` Protesilaos Stavrou
2021-04-18 16:43 ` Stefan Kangas
2021-04-18 17:08 ` Protesilaos Stavrou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lf9gei7j.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=47845@debbugs.gnu.org \
--cc=info@protesilaos.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).