From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: 31395511: =?utf-8?Q?=22Don=E2=80=99t?= attempt to modify constant strings" Date: Thu, 04 Jun 2020 07:26:03 +0000 Message-ID: <87d06f5m2c.fsf@gmail.com> References: <871rmvn7ge.fsf@gmail.com> <87lfl36abx.fsf@gmail.com> <1abe5965-b48e-6dee-1516-c5c233f09d01@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="48863"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , emacs-devel To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 04 09:26:43 2020 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 1jgkGw-000Cd5-Sf for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Jun 2020 09:26:42 +0200 Original-Received: from localhost ([::1]:50130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgkGv-0005wu-Ve for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Jun 2020 03:26:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgkGU-0005YE-E0 for emacs-devel@gnu.org; Thu, 04 Jun 2020 03:26:14 -0400 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:40480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgkGT-0001CK-Ek for emacs-devel@gnu.org; Thu, 04 Jun 2020 03:26:14 -0400 Original-Received: by mail-wr1-x432.google.com with SMTP id h5so4889987wrc.7 for ; Thu, 04 Jun 2020 00:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=ZTYdov0g/OEqZOQA7FaSZ5HdoWx9HkOlxqqSs4suZ/c=; b=EfkeZkk54zDh0IomeSpkEaJYbJgy3SZNt+VduiDb5YDRf7S1b4tlAlPMclR3J0QOFm DhAgAwJ1FTHtmt8F2Ufh+YyQcvtNi11kB/9c7urUBTs+O4dzpFism/rjN+JqPrfE21Dk XLi7PqSqPd7zwBibwT87u/HSiG0iJz3KOCf95mj32cDkzDa5xUbOn6GobLOGVuHFF3nY CPXshRm1vqHTJKLG6s3+wol/K1nKp4CjPcFUJhMgbCzepiHeEfOndkDb+eng9SrEuvUl aB75d7Rsy28Xtm+IzbMNMXwaA4DEFf7HU/O6NXQjk8PkN0FTIKs5PYFT0qmYPSOQvtBd Wblw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=ZTYdov0g/OEqZOQA7FaSZ5HdoWx9HkOlxqqSs4suZ/c=; b=j7cS3UvBkz994dxAfur93CkmM3XzfId8MzG8yUEZYoBejFnUREIsh18razH7sQ6QfW ywDbdOMvWYtYWzY2Kz+HJ78AOTM4ovt/No1danCLEMo5M2pyaVisguiHnGpQDI9MdlWT U+pvL0w+pzGQ4aX1XbgJiRljedkTVg3y6cc0WwN9FVgQeEnO1Eko1RIM8zdARcFDF/kc 1uTlSFl/icDW0uGb75m2pEfTs4JiGqs+mZCpLSLFnTih8I9CjG/grRsWMNXA+xP79PJ1 5uJ+DFuKgu2/0Zj2kIfCbC+Ile9a0uAxGETeBs3iCR3xzF0eZDm93fJalJ4xWc79WUpw C71w== X-Gm-Message-State: AOAM533sQ5Urw8mbfjPBiMBDyALRmHEnwjS3N909axdZmZbA9vC4dmaf wFquh4i9Qmy31L6MrXGDmcK0G0iVPJg= X-Google-Smtp-Source: ABdhPJxN3HNW05SK8vXPiWnhX4zGLvp4IcOzThpEfcV/v8gpe2G52kYFpVieR8ZgBFBRvYC7bjvhXg== X-Received: by 2002:adf:ef50:: with SMTP id c16mr2920154wrp.161.1591255571426; Thu, 04 Jun 2020 00:26:11 -0700 (PDT) Original-Received: from chametz (tor-exit-4.all.de. [212.21.66.6]) by smtp.gmail.com with ESMTPSA id i74sm6667153wri.49.2020.06.04.00.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 00:26:10 -0700 (PDT) In-Reply-To: (Paul Eggert's message of "Wed, 3 Jun 2020 18:19:54 -0700") Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=pipcet@gmail.com; helo=mail-wr1-x432.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:251845 Archived-At: Paul Eggert writes: > On 6/3/20 5:43 PM, Paul Eggert wrote: >> On 6/3/20 4:48 PM, Jo=C3=A3o T=C3=A1vora wrote: >>> I think I'd rather this previous behavior were retained, or at least >>> achievable by request. >> It's tricky, as make-text-button in emacs-27 (and earlier) modifies >> its string >> argument, which is buggy because string constants are not always unique. > On second thought, I'll work on coming up with a better workaround for the > problem along the lines I suggested in my previous message: > make-text-button can > copy the button label string only if the string's not mutable. I hope > this helps > with SLY (as I hope SLY is not trying to modify string literals...). It is. I'm not sure the copy-sequence-unless-mutable semantics really make sense, though, as that might make bugs such as this one even harder to find. I think we should add a new function with clean semantics, and throw an error in the old function if the string isn't "mutable", whatever that means in this context. (I guess I can't modify the string contents or add text properties, but can I modify existing properties? What about cons cells deep within the properties? If they're recursively immutable, what about markers and other objects that change state behind your back?) > In the > meantime I've reverted the change by installing the attached patch; this = means > the bug I mentioned in my previous message remains unfixed. I'm still surprised my patch fixed the problem here (for some buttons, at least, for others there are a few more places that do the same thing...) but not for Jo=C3=A3o. Maybe we're looking at a more complicated bug, or maybe we haven't tested with the same kind of button (I entered an unbound symbol and got the restart options, and those were buttons with my patch but plain text without).