all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: goncholden <goncholden@protonmail.com>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: version> and version>=
Date: Wed, 02 Feb 2022 15:07:26 +0000	[thread overview]
Message-ID: <u7PQfWRy7W2Ew0xW21QvJHO_IgZHO06-x6v5ZlpLhHuW8RfBbP-V0L3XNsDH1xrJkMQcdhEaNYdDOiey1LK6W_-b_GSYumTH2qmeOJ-Djc8=@protonmail.com> (raw)
In-Reply-To: <CAP_d_8WB_dQAY_=Qe+k3NEgo1-mdg_b1zNZuj=R2X4pUNz3bFg@mail.gmail.com>

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Wednesday, February 2nd, 2022 at 3:00 PM, Yuri Khan <yuri.v.khan@gmail.com> wrote:

> On Wed, 2 Feb 2022 at 17:21, goncholden goncholden@protonmail.com wrote:
>
> > > What is the best way to check the version
> > >
> > > (if (version< emacs-version "28.0")
> > >
> > > or
> > >
> > > (< emacs-version 28.0)
>
> A typical case of the XY Problem. You want to solve X, you think Y
>
> will help you, and you ask how to do Y. You will get helpful comments
>
> on how to do Y, but miss out on all the better ways to do X.
>
> > Am working on colouring comments according to whether the background is light or dark.
>
> This is your original X. The solution to that is to look at
>
> (frame-parameter nil 'background-mode), as told in the other thread.
>
> > (frame--current-backround-mode nil)
>
> This is your assumed solution, Y.
>
> In fact, you have another case of XY here. You discover
> ‘frame--current-background-mode’ is not available in Emacs < 28. Your
> actual problem is “how do I know a function is available in my Emacs”.
>
> You assume you need to check the Emacs version, but in fact you should
> check for features, not versions. (fboundp
> 'frame--current-background-mode) will return t if the function is
> available, nil if not.

Correct, the availability problem winded me up a little bit.




  reply	other threads:[~2022-02-02 15:07 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
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 [this message]
  -- 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='u7PQfWRy7W2Ew0xW21QvJHO_IgZHO06-x6v5ZlpLhHuW8RfBbP-V0L3XNsDH1xrJkMQcdhEaNYdDOiey1LK6W_-b_GSYumTH2qmeOJ-Djc8=@protonmail.com' \
    --to=goncholden@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=yuri.v.khan@gmail.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.