From: goncholden <goncholden@protonmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: version> and version>=
Date: Wed, 02 Feb 2022 10:21:15 +0000 [thread overview]
Message-ID: <pWWtk8EmUCC8ObsJMsf4yyXyeSlGMk9-dzR1EbkvuESpcxX-HAZehes8YOjfWWny8fUTXEtVQvmKsZ80E5MiHmVuLrG3CqakdeTr8zOZW5A=@protonmail.com> (raw)
In-Reply-To: <jwvsft2gca5.fsf-monnier+emacs@gnu.org>
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, February 2nd, 2022 at 3:47 AM, Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> What is the best way to check the version
>
> (if (version< emacs-version "28.0")
>
> or
>
> (< emacs-version 28.0)
(< emacs-major-version 28)
Stefan
Am working on colouring comments according to whether the background is light or dark.
But I am encountering
if: Wrong type argument: number-or-marker-p, "27.2"
Code:
(defvar annotation-chroma
'( (dark . ((low . "#8300E0") (mid . "#AA33FF") (high . "#C370FF")))
(light . ((low . "#C16BFF") (mid . "#AA33FF") (high . "#8000DB"))) )
"Colour contrast for comments, indigo on dark and light background.")
(defun annotation-typeface (chroma)
"Set the foreground colour for comments."
(let* ( (colors annotation-chroma)
(levels
(if (>= emacs-version 28.0)
(alist-get (frame--current-backround-mode nil) colors)
(message "GonCholden"))) )
(face-remap-add-relative 'font-lock-comment-face
`(:foreground ,(alist-get chroma levels)))
(message "annotation: %s contrast" chroma)) )
next prev parent reply other threads:[~2022-02-02 10:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 18:01 version> and version>= goncholden
2022-02-01 23:20 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-02-02 3:47 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-02-02 10:21 ` goncholden [this message]
2022-02-02 13:38 ` Tassilo Horn
2022-02-02 13:48 ` goncholden
2022-02-02 13:52 ` Tassilo Horn
2022-02-02 14:14 ` goncholden
2022-02-02 14:23 ` Tassilo Horn
2022-02-02 14:15 ` Tassilo Horn
2022-02-02 14:27 ` goncholden
2022-02-02 14:30 ` Tassilo Horn
2022-02-02 14:51 ` Eli Zaretskii
2022-02-02 15:00 ` Yuri Khan
2022-02-02 15:07 ` goncholden
-- strict thread matches above, loose matches on Subject: below --
2022-02-01 14:50 goncholden via Users list for the GNU Emacs text editor
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='pWWtk8EmUCC8ObsJMsf4yyXyeSlGMk9-dzR1EbkvuESpcxX-HAZehes8YOjfWWny8fUTXEtVQvmKsZ80E5MiHmVuLrG3CqakdeTr8zOZW5A=@protonmail.com' \
--to=goncholden@protonmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.
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).