From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: version> and version>= Date: Wed, 2 Feb 2022 22:00:59 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21208"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs , Stefan Monnier To: goncholden Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 02 17:29:31 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFIVe-0005Ki-Fq for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Feb 2022 17:29:30 +0100 Original-Received: from localhost ([::1]:45568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFIVc-0000BZ-SH for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Feb 2022 11:29:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFH9p-0003tv-N3 for help-gnu-emacs@gnu.org; Wed, 02 Feb 2022 10:02:54 -0500 Original-Received: from [2607:f8b0:4864:20::929] (port=37867 helo=mail-ua1-x929.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFH9i-0003zE-IA for help-gnu-emacs@gnu.org; Wed, 02 Feb 2022 10:02:50 -0500 Original-Received: by mail-ua1-x929.google.com with SMTP id b16so19639462uaq.4 for ; Wed, 02 Feb 2022 07:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nfH9xv/4jAKuosKrlfbkh9kJvThLxmYxjvqguUAjyEo=; b=RjmKn9N2Yl8XsOYQBXvFrl2ic6t/+rDaDjmaRrR9YR2hBrY71Aqmii3HufeO0o5Fcj Arm2BlxFbMGp9s/r0UcinJ7+HvzzmV2tjjyUJz6bhJkIuPiVH/g15CrZcO43jF2iAdiq dZQAkMKZfNIxJGCbjDDQq3Oa/wi7E3FGdHyZs9Gj4FIwrgkf869ctrO1dMiZSSkuXx8F TbWwxYj/jTPWENYwEi97Whglrgn5t2ZTkesPyqG1TArHDN1xDgx7L70UraETaT5lMxYk 1XAcZ0v3J2HDDhwn84VvPD3a9Jn2JK1ESLLRvbNspvdn50Z8LJBaWNmCjslBL6WvykHk QXPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nfH9xv/4jAKuosKrlfbkh9kJvThLxmYxjvqguUAjyEo=; b=q8YMPrz4SJdNa7imMUtljnb7vysi5dulNLKIlMgAlosaG7See+KtJVo7f4H39vBQWK xTJJwiBwBGZW+QNUv2NSMwGzWKb0lCPp3i0QMixNmyoQJEiZhwm9VFjCipN7DKaCdThg riRQfNWRdL6S9uU4umVSFs28zyOU/LJKVdcioeSyI1O+YlTmOYY+hQUofn/vXdqa9Omn 2ehDJrD3Yh+IX28dZGKfXbdOi+QmEV2v27ixK9CH5f21G0pOTMBi1EFmRx9mkauSGI9T 6VkxBySBPUqU9HZdTMGRldYYeyJs8wEZwiPTF7A5euffQfoRjDtYPpdKFSSqzkEQcrhB 2G6A== X-Gm-Message-State: AOAM531F7SRpRTN2fI0+g0WJ+aLPY79XoekoB47CRBGzB6NfXXHW5xL9 aMs3M9TBQyqg/JS7S5JwLrpfKDEPdVWrafxO2Tc= X-Google-Smtp-Source: ABdhPJwWScDaFMbemRUW24L0ZjGv8hlEmmdQIhzhbBrLZus3CHsh07cC8wxBYSv2wJwxfLCTm8WuyC/2WvYDzP7qX1M= X-Received: by 2002:ab0:372a:: with SMTP id s10mr11960379uag.86.1643814070620; Wed, 02 Feb 2022 07:01:10 -0800 (PST) In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::929 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::929; envelope-from=yurivkhan@gmail.com; helo=mail-ua1-x929.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135666 Archived-At: On Wed, 2 Feb 2022 at 17:21, goncholden 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 l= ight 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 =E2=80=98frame--current-background-mode=E2=80=99 is not available in Emacs = < 28. Your actual problem is =E2=80=9Chow do I know a function is available in my Emac= s=E2=80=9D. 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.