From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#31586: 27.0.50; `frame-title-format' doesn't save match data Date: Sun, 27 May 2018 18:40:43 -0700 (PDT) Message-ID: <50fbc85d-ea7e-485d-82d3-476f63bd8a32@default> References: <838t8583yz.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527471546 13109 195.159.176.226 (28 May 2018 01:39:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 28 May 2018 01:39:06 +0000 (UTC) Cc: p.stephani2@gmail.com, 31586@debbugs.gnu.org To: Stefan Monnier , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 28 03:39:02 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fN77l-0003Gt-Gd for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 May 2018 03:39:01 +0200 Original-Received: from localhost ([::1]:53811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fN79q-000519-Vk for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 May 2018 21:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fN79k-000510-Gf for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 21:41:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fN79i-0007q1-SQ for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 21:41:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43491) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fN79i-0007po-O9 for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 21:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fN79i-0005MZ-D2 for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 21:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 May 2018 01:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31586 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31586-submit@debbugs.gnu.org id=B31586.152747165820597 (code B ref 31586); Mon, 28 May 2018 01:41:02 +0000 Original-Received: (at 31586) by debbugs.gnu.org; 28 May 2018 01:40:58 +0000 Original-Received: from localhost ([127.0.0.1]:51388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fN79e-0005M9-9D for submit@debbugs.gnu.org; Sun, 27 May 2018 21:40:58 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:43026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fN79c-0005Lx-RK for 31586@debbugs.gnu.org; Sun, 27 May 2018 21:40:57 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4S1epYD104317; Mon, 28 May 2018 01:40:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=38keVWrRK/cXN3wVOPQzEfmWwXQ+NKNzNdKeCVH8JdE=; b=XTAGbBpzpOjU6i6aMb/20qahJMAnSjBreN/1cL5xMH/rTeqSB0/WQDtsHNT+uLdjkNy5 4UPVyde0r5X/GtOLjDhoBE4i7KR0sLb0Ig0ii/tn5QhmSpzcI9ivXH8qTnCLTWOPH7PF 5YQLpTtHKoGeOK5gyI9sqMJt2AppwInn2kosX3X3d9SiYbvPYhlC23+DVZBd4UrT3cZ4 vUSq1rrcXmB6Ox1qUgvpYfHbHxEWo7GiwR0DmshGIRUj07KDY50q8QTHE4W+Wm+r3II7 Y1/Y8f5QpDrIH5wwwhwjgtzILrP5loSZ8/IUnWsImt8UBlsm5B4fM3lAIFa9jMiQFSKu 2A== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2j7084unjk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 May 2018 01:40:50 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4S1elKD011742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 May 2018 01:40:48 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4S1ejaX003961; Mon, 28 May 2018 01:40:47 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4690.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8906 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805280019 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146620 Archived-At: > >> Elisp code > >> should never presume that the match-data is preserved across something > >> like sit-for, read-char, or any other function which can run process > >> filters, redisplay, timers, or contains a yield-point. > > Is this practical? We have any number of hooks, advices, and other > > means to make arbitrary Lisp run almost off any function call. Given > > that redisplay can be entered by such Lisp by calling 'redisplay' or > > 'message' or one of the other functions you mentioned, your suggestion > > would mean we need to save-match-data around any call to any > > function. That would make our code very cluttered, indeed. >=20 > That's how we've lived so far, except that the need for save-match-data > is not around "any" call, but only around "any call except for <...>" > where <...> is the set of "primitive enough" functions. The main > problem so far is that this set is not formally defined (and also that > the byte-compiler doesn't warn you if you use a function outside of this > set without wrapping with save-match-data), but other than that it works > well in practice, because in 99% there is *very* little code executed > between a regexp match and the use of the match-data. Would it make sense to "formalize" this a bit, by having an explicit such list of the functions (those "primitive enough" to never, or perhaps hardly ever, need wrapping with `s-m-d')? Even if such a list were not consulted by any code (and it could be, presumably, for some control somewhere), it might at least help developers and users by letting them know what the story is. Just a thought.