From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Lisp files that load cl-lib in problematical ways Date: Wed, 25 Oct 2023 15:23:43 +0300 Message-ID: <83jzraki0g.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14493"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 25 14:24:01 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 1qvcvZ-0003Vt-3Z for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Oct 2023 14:24:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvcvG-0003yt-L0; Wed, 25 Oct 2023 08:23:42 -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 1qvcvF-0003yQ-KZ for emacs-devel@gnu.org; Wed, 25 Oct 2023 08:23:41 -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 1qvcvF-00027r-BH; Wed, 25 Oct 2023 08:23:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=43FK2rP1R1gse0ZT3eO0A57awnXDQ7OniOvCHClEdLM=; b=H73KCJMC4QpF gf186kMO7CmAaoaQDlmIybj4s1UOG36/9RH6I9V9SeaBb6L9osSePqvEjZH0MDfAHqxR50jHHVpyW QzPTfzJzWYjqFzyy2es1zPKOMl/3zblg7HO4pxGBW2peso2ZpjDASFoB4XprUDKAzARA9kr7HwuB5 jL5m8nCRNkcTebGf3bsKZ+MH69WNAlXdY56i8+RnaNym2ORLHqhR5O/Z62yKDZE+1vkbuGdJyXwAP t6enW0AmFG0gmuRauKRrtpHQuOrPPPuFbgBOm4OwpMI8dob7JHbHB8PqV/4G0YqIZA1nsrJ/EiPO7 xHib/lgyGaInDfkZNjxD4w==; In-Reply-To: (message from Richard Stallman on Tue, 24 Oct 2023 22:47:23 -0400) 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:311836 Archived-At: > From: Richard Stallman > Cc: acm@muc.de, emacs-devel@gnu.org > Date: Tue, 24 Oct 2023 22:47:23 -0400 > > > 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))) If someone wants to work on such rewrites, I'm not sure I will object, provided that the result is clean, tested, and is not horribly complicated. But personally, I see no need for investing any effort in such rewrites, since there's nothing wrong with this code and nothing wrong with loading cl-lib when its facilities are put to a good use.