From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Lisp files that load cl-lib in problematical ways Date: Tue, 24 Oct 2023 22:47:23 -0400 Message-ID: References: <87il8betof.fsf@dataswamp.org> <83fs3dgxv8.fsf@gnu.org> <835y38qvlg.fsf@gnu.org> <87bkcx6eci.fsf@dataswamp.org> <83ttqnm4ti.fsf@gnu.org> <831qdlpoye.fsf@gnu.org> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39618"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 25 04:47:48 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qvTvv-000A5c-V8 for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Oct 2023 04:47:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvTvg-00043Y-UK; Tue, 24 Oct 2023 22:47:32 -0400 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 1qvTvb-00040j-2M for emacs-devel@gnu.org; Tue, 24 Oct 2023 22:47:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvTvZ-0007hu-4n; Tue, 24 Oct 2023 22:47:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=62BzGkAf0Lc5wV4PjAySU6G81oSepWUaT8qGZAJNl68=; b=BelmtP8pn3CZ JSHOP2LNO4oAvNUm2uMIA0Fy5YRbUcpz2cHw64dMe3kxOFYXzoRp2XKHwMPyumtLvgbr/mafeDT0r OonjxwnmcRDjrOXhAFRAamQaSSTgiwAFGQSKCf9L9n1+PXq2IaRcwpiM9nK0YcyR3Zb53hS4IyhDd NF40UQ7L+B71+d56FPfi4BhnPm21iF+gfJk58lHQSAvdxcoqKsxvdbPbkSU4UCsM1Rcys8SK/Hvq9 3NG3WaSRMP3MLvTmPbtdxY3sQ6tqqsYpyu7aWGMlFVj58DJxd/UGROCARAD0Slmf6J3BTuQKr7Tfe eTw03cuXCTUil9GRzSG25g==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qvTvX-0005Rd-8w; Tue, 24 Oct 2023 22:47:23 -0400 In-Reply-To: <831qdlpoye.fsf@gnu.org> (message from Eli Zaretskii on Mon, 23 Oct 2023 14:18:01 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311824 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > It would not have helped to define cl-pushnew on cl-macs, because > cl-pushnew calls cl-adjoin, which is a function defined on cl-lib. So > basically cl-pushnew is a (rather thin) wrapper around cl-adjoin, and > thus it is correctly defined on the same file where cl-adjoin is > defined. That is a good point -- for that particular solution I proposed. But if we let ourselves be a little more flexible, how about this solution: install this (while (string-match "\\W" abbrev pos) (or (memq (aref abbrev (match-beginning 0)) badchars) (push (aref abbrev (match-beginning 0)) badchars)) (setq pos (1+ pos))) instead of the current code: (while (string-match "\\W" abbrev pos) (cl-pushnew (aref abbrev (match-beginning 0)) badchars) (setq pos (1+ pos))) A CL fan might say the latter is simpler, but for me, who isn't sure just how to use cl-pushnew, the former seems conceptually simpler. The two ecxpressions have two different kinds of complexity. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)