From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#63251: 28.2; vhdl-mode contribution Date: Sun, 7 May 2023 18:22:56 +0200 Message-ID: References: <564BC9FB-248F-4973-9D8C-C1DA7D3D60C6@gmail.com> <0E7DAFC0-0F1E-48B7-AC2F-D84D081C05C9@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) 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="12516"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Reto Zimmermann , Eli Zaretskii , "63251@debbugs.gnu.org" <63251@debbugs.gnu.org> To: Cyril Arnould Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 07 18:24:20 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 1pvhBM-000344-HF for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 May 2023 18:24:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvhB5-00055p-6k; Sun, 07 May 2023 12:24:03 -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 1pvhB4-00055f-F7 for bug-gnu-emacs@gnu.org; Sun, 07 May 2023 12:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pvhB4-0001jJ-76 for bug-gnu-emacs@gnu.org; Sun, 07 May 2023 12:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvhB4-0004bc-2o for bug-gnu-emacs@gnu.org; Sun, 07 May 2023 12:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 May 2023 16:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63251 X-GNU-PR-Package: emacs Original-Received: via spool by 63251-submit@debbugs.gnu.org id=B63251.168347658617609 (code B ref 63251); Sun, 07 May 2023 16:24:02 +0000 Original-Received: (at 63251) by debbugs.gnu.org; 7 May 2023 16:23:06 +0000 Original-Received: from localhost ([127.0.0.1]:38284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvhA9-0004Zv-KI for submit@debbugs.gnu.org; Sun, 07 May 2023 12:23:05 -0400 Original-Received: from mail-lf1-f49.google.com ([209.85.167.49]:46139) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvhA8-0004ZC-GL for 63251@debbugs.gnu.org; Sun, 07 May 2023 12:23:04 -0400 Original-Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-4eed764a10cso4021098e87.0 for <63251@debbugs.gnu.org>; Sun, 07 May 2023 09:23:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683476578; x=1686068578; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=WlC48tDM4pNEeH/gX5J50a0OknifAnXn3WUv7wKH+mI=; b=ARWNux4ItuKCdLuo2Kk87p7blhgXbFJc7pyplfuL2Q1DOTY7wDKmsM4GxuP8r4wFWS gL+D6SWx530TN9tvnqT3jnkuPR7exVsGC0WikHB3mac4/gLJhk4luj+LenqaqVM89wee UJ7z2QkbZFwhcj+PO9BIWekCmdRsIhge8BzUjI9ICcg8j3+P5tP9WrsUuHAq0oxVN6md ejzj1IBf9dffhDk9WggCeE7bcnxZFMuUvcQmcFOdWdto57Hc5mj5MSFYwSnLq5SRubaI DqATwAM7xsRBtYMqvPpmpPgYNSu8M4s2fl6pz4CUO3aryPM0H8OR+lKjWf3jfQ7wzdbN Eznw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683476578; x=1686068578; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WlC48tDM4pNEeH/gX5J50a0OknifAnXn3WUv7wKH+mI=; b=LGmRhdXgK7jZ3UZn2GoHuenYRiBktDIkJWe6G8002XeBnJUa0ABoo8CAptHxgWHmtc 5BMbRotLB6/vlOsooL8C6DfRClQ7ey276xM5MKpRlqu2NFXuSkZ0Pb1NvFmNbQ2r2hBn cDRM8bokCpguHM0QAxS3G4Z1JZ4eqMWhXMZBDdCmJEM2O4QBaQrjIFuFh1a0DgzBi2Xr 9E7G+Ylmxn42q6X0aELuqMF3Z6AbzOlcBcEhBYQVeUUlIPRmheSr8HaMNEDvxy6DAdfP oTKbWszgg+Ds85APOZgXVzdX2DIv/cuSR9u1pM/lxeJsIfQHSw+oErY32cjdQnWuJK0b Zqmw== X-Gm-Message-State: AC+VfDy4eax1bIuQKo8i3Goce6kr5cqLGhdaxvMYLKo1ebPfGZxLzc2C VRsGUJQuocblHRTY+mOWgXA= X-Google-Smtp-Source: ACHHUZ5ar4+rjU/z5vleaLyxVGlceWIT6p0eEnpnX16uuZXxDlQp8s7H1VRDOtsY03dP3I8AdQvrcQ== X-Received: by 2002:a19:a40f:0:b0:4f1:4051:d77b with SMTP id q15-20020a19a40f000000b004f14051d77bmr2149134lfc.60.1683476577791; Sun, 07 May 2023 09:22:57 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id z9-20020ac25de9000000b004eff6c7bc08sm1010843lfq.75.2023.05.07.09.22.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 May 2023 09:22:57 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.15) 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:261266 Archived-At: 7 maj 2023 kl. 17.40 skrev Cyril Arnould : > I had tried (cons =E2=80=A6) instead of (sexp =E2=80=A6), but that = just resulted in > the customization menu breaking again if one of the compilers was set > to a dotted list. Why would they be set to a dotted list? Can you give an example? I tried (cons :tag "Warning and Info" (natnum :tag "Warning subexp index") (natnum :tag "Info subexp index = ")) instead of the (sexp ...) and it seems to work alright. > > Think of what happens if later code performs an in-place change of = that nil you added. > =20 > I am by no means an expert when it comes to elisp, I don=E2=80=99t = know what > kind of problems this could cause. What I meant was that the code (let ((tmp-alist vhdl-compiler-alist)) (while tmp-alist (setcdr (nthcdr 3 (nth 11 (car tmp-alist))) '(2 . nil)) (setq tmp-alist (cdr tmp-alist)))) modifies the existing list structure instead of creating a new one based = on the old. This can lead to surprises if parts of the structure being = mutated is shared with structure elsewhere. Now this code probably does = work, but it's a bit brittle, and it takes some work for the reader to = understand that it's OK. Contrast it to something like (untested!) (setq vhdl-compiler-alist (mapcar (lambda (entry) ;; Add a `2' to the end of the list that is element = #11. (append (take 11 entry) (append (nth 11 entry) (list 2)) (nthcdr 12 entry))) vhdl-compiler-alist)) where there is no mutation of the list structure, nor any sharing of a = program constant whose accidental mutation might have very confusing = consequences. (`take` is new in Emacs 29 but you can work around it by = using `butlast` instead if the code needs to work with older Emacs = versions.)