From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Lisp files that load cl-lib in problematical ways Date: Wed, 25 Oct 2023 10:07:45 +0200 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2281"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: rms@gnu.org, Eli Zaretskii , acm@muc.de, emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 25 10:08:38 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 1qvYwP-0000Or-Pc for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Oct 2023 10:08:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvYvl-0007D9-PT; Wed, 25 Oct 2023 04:07:58 -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 1qvYvh-0007CG-FW for emacs-devel@gnu.org; Wed, 25 Oct 2023 04:07:54 -0400 Original-Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvYvd-0003aU-Hn; Wed, 25 Oct 2023 04:07:50 -0400 Original-Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9c5b313b3ffso757436766b.0; Wed, 25 Oct 2023 01:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698221266; x=1698826066; darn=gnu.org; h=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=ePA79kdHHRfTkNzdmRvGiqlNPCM/EjgUp3Md8N1T5wk=; b=e+yjDWCaIELpzyyeGysMnt2T3mlfRu9OQmBO6F977bQ9TU0J3XrbyFvX1E7ld1p9Gu hNRJF/bzzXkkb7hxnY3Fsp2oAqrcmxQcalk2+zyRclazDOD5l7KunUOg89cY7rSQyVVH zodKwQMWfa2NvQXn/BrsgUs57+iGQ+recF7VbaRgl3+g37KGMOTCAff96l6ckrl7Sl5p cGWasHvNLkeSwGeKC9h+sZB11WqrM18KWI/RQkMU5u7X9QyWiHWuOdgVd0BSJdMqK+yp 3/dqH+L6gd0XP2tLZyb979mQn/3DdKJ5ynl5MAY+N/MpjuitJb+Ip1Ir98WUGdTQ9xMP hlEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698221266; x=1698826066; h=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=ePA79kdHHRfTkNzdmRvGiqlNPCM/EjgUp3Md8N1T5wk=; b=fJm3YEJrNH8q0GgNHFlrmtljk0x9wcoFKSBtLqAYzKTr/NxvAjGJ61P7DaiXs0YVkK DzWsSmEn3rmmhex509x61TgZP/LgfLO0pne1GJjw3+5f86ufV3tWsDB8VvENq4JCk7KQ K0iyF0pW52vesqZFUK3W8KrWsBX0tPSw/B2lGRyCaKSoXnYybsC2XI6tFhsYdvip3SP/ iZeQBZJmF0OIQ5y+dQeMruLxAu1rhRIMIJNHLA0RYcrLhan4Kn0lF8kC4pWFN2d0wnIu QMWAAlPEj8wqFopSsG/M16/vegLz9ynMZxItnvraEjHXD0J0oB7Kj5LZ1BS0Zu3l85WJ PlrA== X-Gm-Message-State: AOJu0YyCD0kzAnuCVdeBQlA7/dZSTpIUnDh5uSapA4LSC+/AKqBozXB4 n5+8Zsykxm798m9VSVqFHF98ATjKy5qTBA== X-Google-Smtp-Source: AGHT+IEp1eatuRzvIjqtPfoCIaD4mVnYtrbjArZSqU5o7ZE/XLQGhda3zheyzTnmOJoyHK/3pEriOQ== X-Received: by 2002:a17:906:c14c:b0:9ae:3e72:7c72 with SMTP id dp12-20020a170906c14c00b009ae3e727c72mr10273636ejc.58.1698221266484; Wed, 25 Oct 2023 01:07:46 -0700 (PDT) Original-Received: from Pro.fritz.box (p4fe3a69d.dip0.t-ipconnect.de. [79.227.166.157]) by smtp.gmail.com with ESMTPSA id i26-20020a17090671da00b0098e34446464sm9478466ejk.25.2023.10.25.01.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 01:07:46 -0700 (PDT) In-Reply-To: (Stefan Kangas's message of "Wed, 25 Oct 2023 00:57:29 -0700") Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:311830 Archived-At: Stefan Kangas writes: > Richard Stallman writes: > >> 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 `cl-pushnew' docstring explains: > > Add X to the list stored in PLACE unless X is already in the list. > >> The two ecxpressions have two different kinds of complexity. > > The only difference I see is that new version is harder to read, and > more prone to bugs (as you have to write the same code twice). > > I'd suggest avoiding these types of changes. +1