From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: master f51f963: Fix some side-effecting uses of make-text-button Date: Fri, 05 Jun 2020 14:50:55 +0100 Message-ID: <87v9k5mxj4.fsf@tcd.ie> References: <20200604223056.17078.81265@vcs0.savannah.gnu.org> <20200604223058.1850020A26@vcs0.savannah.gnu.org> <87eeqtiy4x.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="27231"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 05 15:51:59 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 1jhClL-0006yO-JK for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Jun 2020 15:51:59 +0200 Original-Received: from localhost ([::1]:53132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhClK-00011Q-KZ for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Jun 2020 09:51:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhCkP-0008W4-HZ for emacs-devel@gnu.org; Fri, 05 Jun 2020 09:51:01 -0400 Original-Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:42552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhCkN-0001bQ-QX for emacs-devel@gnu.org; Fri, 05 Jun 2020 09:51:01 -0400 Original-Received: by mail-wr1-x42e.google.com with SMTP id p5so9829444wrw.9 for ; Fri, 05 Jun 2020 06:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=71vzecniERI7ajcwp2dW2hwGPIvtEz7KY/7bTWTszQk=; b=VknHtY5kdo91cw1T8/tRcV6WhSkJIWGk36Qd6wlLBEYA8uI5/Yzc7Tmnr+4jv+RuXT GRu1O4y0ycOiFGolTWmzW+sd8TmuN3siPuHgkfj8yBjfdSOguOJlK6YavBQykwvIvc0e dbik+nW3zqOC1HWrwLHbCY3Uno609DgUEvCax7EkIVcVtHYJHau4W120XmzLbZ1I7ze7 ZRSYreh4Cd7PW1D4cJ+BGKgFXrvyxDtBtabDJYTYLUSnKD0ZU4GwwfLH278BfhmBXDbU mb3Ed7cM4kKcHu8KFu5sgL7dP3IJgKMSjjhLJ2PAtlW9UehLe0d613U+tOAk4+9TmVih QhDw== 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; bh=71vzecniERI7ajcwp2dW2hwGPIvtEz7KY/7bTWTszQk=; b=S3VrK7iaxsJeuhAnH8f5KfxYZud9HYEe9FCCXft5u6osVmX0ZAN2nny7N8GUE8Lx8i qBUJhOlNcIYY+RTOSFPyaOv67d7xUaY8ajvKUB4BPJDiISYs7vTWBawMnMYLlbK6qxk1 NuQesC5g6mGoms9UNHzUQvMz/Xv1QwunmLYmNG5Is2bm+vwxBo2nOfbmJaUm1o9MBNCK UGHQIhnhHlZYnvrR/SmfUFp31hg6jA8C0V7zNepp6arBse/cEfQqM74i/suFDnHUUnIA qKlqcXcfdZLQeeHZ7aQTWoC+XuPAobaqhCuqHj2YqOyxygvbZdgTPU1je/eHRslLi9br xbyg== X-Gm-Message-State: AOAM531Xusg64gvEczcZmobS6Zm5CDcSrarEpD+hsNLUkgvA+qXEqGBC WMtkgskob8oLNZTDohVfVZ5QcA== X-Google-Smtp-Source: ABdhPJyHQ844d4/E5lyo8AP6GoS1NkedcM5O/aHIoAUg8c3Hv5RlNwurDngqY8atL9wmqmGndzLa9Q== X-Received: by 2002:a5d:4e87:: with SMTP id e7mr9238527wru.427.1591365057662; Fri, 05 Jun 2020 06:50:57 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:1f68:7ff5:120d:64e]) by smtp.gmail.com with ESMTPSA id v66sm8055871wme.13.2020.06.05.06.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 06:50:56 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Fri, 05 Jun 2020 09:02:54 -0400") Received-SPF: none client-ip=2a00:1450:4864:20::42e; envelope-from=contovob@tcd.ie; helo=mail-wr1-x42e.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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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:251896 Archived-At: Stefan Monnier writes: >> As Paul said, not quite - it has historically modified its first >> argument by placing properties on it. If you look at the line preceding >> this diff hunk you'll see a call to copy-sequence. >> >> My reasons for making this particular change are: >> 0. Since Emacs 24.4, make-text-button has returned its modified first >> argument, so callers can use the value returned by make-text-button >> instead of calling it only for its side effects. >> 1. This has now been reverted again, but for the last month, >> make-text-button returned a modified _copy_ of its argument, which >> meant that its side effects could no longer be relied upon. >> >> Either way, relying on its return value rather than its side effects >> seems like the best style to stick with for now. > > So, IIUC `make-text-button` should ideally work functionally, but for > historical reasons it works by side-effect. What's the long term plan? > Do we plan to live with the current side-effecting behavior, or do we > plan to move to the "pure" functional behavior? > > If we could detect when a string-button is "used" (i.e. displayed or > inserted into a buffer), then we could detect the use of the old > side-effecting style (by checking if the string passed as argument had > already been displayed/inserted elsewhere) and emit a good warning. AFAIK all relevant future plans are being discussed in this thread: https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00117.html For almost a month make-text-button was pure wrt strings, but that's now been reverted again for backward compatibility and until a new decision is reached. -- Basil