From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Xiyue Deng Newsgroups: gmane.emacs.bugs Subject: bug#67669: 29.1; Drop text suggesting using `and' to replace `if' Date: Thu, 07 Dec 2023 01:08:51 -0800 Message-ID: <87r0jytm58.fsf@debian-hx90.lan> References: <87v89buhpl.fsf@debian-hx90.lan> <83sf4e34s8.fsf@gnu.org> 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="39881"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67669@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 07 10:09:57 2023 Return-path: Envelope-to: geb-bug-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 1rBAOL-000AB3-9j for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Dec 2023 10:09:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBAOF-0003vf-3O; Thu, 07 Dec 2023 04:09:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBAOD-0003vR-Ja for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 04:09:49 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBAOD-00013W-BI for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 04:09:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBAOP-0000xl-Id for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 04:10:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Xiyue Deng Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Dec 2023 09:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67669 X-GNU-PR-Package: emacs Original-Received: via spool by 67669-submit@debbugs.gnu.org id=B67669.17019401543636 (code B ref 67669); Thu, 07 Dec 2023 09:10:01 +0000 Original-Received: (at 67669) by debbugs.gnu.org; 7 Dec 2023 09:09:14 +0000 Original-Received: from localhost ([127.0.0.1]:41002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBANd-0000wa-Jl for submit@debbugs.gnu.org; Thu, 07 Dec 2023 04:09:13 -0500 Original-Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:60767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBANb-0000wN-4S for 67669@debbugs.gnu.org; Thu, 07 Dec 2023 04:09:11 -0500 Original-Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1d0ccda19eeso5321175ad.1 for <67669@debbugs.gnu.org>; Thu, 07 Dec 2023 01:08:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701940132; x=1702544932; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=udmtP8zKtlo62OYbuhPQvFgz5d1tgIHaUM7TYhWz0LY=; b=cmY9Y6NIc/sy9wXvdGhbo8dPpDfinNg4InoZRaHMKvJsrKjf30zrE7wcDBhPQ8zz3e JexSzK1gLzXyw2uJf5EUMtv845Jl0bJdPKXTzyE4qy5t44dg1fl+oWdZLFjeRgqSOxl9 kHVcrAzxLalWiAZF371P9GRmHQwVGn8QKqQ4PCIaTniIwkZielTFIWpTbAh6w/ia2rgA LBusmSjXnrXrC//lGsq62SzBAX9hpk1Ymgy6bcsdPKdHabDh7MJUQwP1vp8vaF0wBoKD DFkrr2c9p/iPnkLFKnNxqsJcih91Pkh9HC5S42zD5bRew+34pjF0/Il/Ri0FW0gAMHen wwsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701940132; x=1702544932; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=udmtP8zKtlo62OYbuhPQvFgz5d1tgIHaUM7TYhWz0LY=; b=H3a8Uivao5AORqwsZjdtgNUK4fudyA+6sETjT22oIBQux2BhnDOv93MMFQr/+sq65+ u+lycACknBuXj+uSuuyAuZLEy8R6hk/1/xVLhdzqRpLgDPTE2qvifWd6wHGYfdoERMG+ x6CIQykSdl8+DROIQvZFRpySoqa8K46MxfQV2ZXtVe3yGFaYvfrx7QJJdjNlcknr1TRh 6QC+00CHwV6+sL4CuECnPue3ddUONhw/XkLPV8SOZddcl/eh3RarqC26YTYLEd9124le I8UxVayCFwb+QTQWTN7+PRYitdQv1iQuSGF61Oaxr1+M7qxu0Q/sAIoF18zS2qPLiA4a tC8A== X-Gm-Message-State: AOJu0YyqSNI/OEfa7TNW73Po5wm9rxPkTKHQZKlkxuKGm2VhWyFlyB7x rxMZlI40RoxCLbknmIxTrRbEyiogaESrLA== X-Google-Smtp-Source: AGHT+IGAwzsNvM/NEch6ZWZvp+dLla000peLZ8PtTaZGVJ9sRmCLYRpSk1FlJ3apDat5bNp7bkYiXg== X-Received: by 2002:a17:903:2304:b0:1d0:8b01:9454 with SMTP id d4-20020a170903230400b001d08b019454mr2322289plh.119.1701940132346; Thu, 07 Dec 2023 01:08:52 -0800 (PST) Original-Received: from debian-hx90 (2603-8000-a400-0cdc-93f0-c81c-5fa0-c77c.res6.spectrum.com. [2603:8000:a400:cdc:93f0:c81c:5fa0:c77c]) by smtp.gmail.com with ESMTPSA id y16-20020a17090322d000b001d1c96a0c63sm852460plg.274.2023.12.07.01.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 01:08:52 -0800 (PST) In-Reply-To: <83sf4e34s8.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 07 Dec 2023 08:28:23 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275655 Archived-At: Hi Eli, Eli Zaretskii writes: >> From: Xiyue Deng >> Date: Wed, 06 Dec 2023 13:47:02 -0800 >>=20 >>=20 >> In section "the `kill-new' function" - the third last paragraph to be >> precise - there are some texts in parentheses that discusses potentially >> using an `and' to replace the `if' statement being discussed. It looks >> like to be referring to an earlier version of the code example[1] before >> using the version from Emacs 22. Meanwhile, it looks like relying on >> the side effect of `and' to emulate an `if' may not be a good idea >> nowadays. So is it OK to drop this advice? > > AFAIU, the relevant fragment is: > > The expression looks like this: > > (if interprogram-cut-function > (funcall interprogram-cut-function string (not replace)))) > > If an =E2=80=98interprogram-cut-function=E2=80=99 exists, then Emacs= executes > =E2=80=98funcall=E2=80=99, which in turn calls its first argument as a = function and > passes the remaining arguments to it. (Incidentally, as far as I can > see, this =E2=80=98if=E2=80=99 expression could be replaced by an =E2= =80=98and=E2=80=99 expression > similar to the one in the first part of the function.) > > I don't see anything wrong here. Can you elaborate on why you think > the text in parentheses is inaccurate or incorrect or unclear? Sorry I wasn't very clear. I was referring to the part "... could be replaced by an =E2=80=98and=E2=80=99 expression similar to _the one in the = first part of the function_." But when I tried to search for `and' in the example code of that section I found no `and' usage at all, which confused me a bit. It was not until I looked at the texi source that I noticed that the original example code did use `and' which I linked in my first email, and it was later replace by the current one from Emacs 22 which no longer used `and'. Thus I would consider the text in the parentheses you quoted to be obsolete. And of course as I mentioned in the previous email, IMHO it is probably not a good advice to use `and' to emulate `if'. > > Thanks. --=20 Xiyue Deng