From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#31586: 27.0.50; `frame-title-format' doesn't save match data Date: Sun, 27 May 2018 19:20:52 +0300 Message-ID: <838t8583yz.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1527438012 30738 195.159.176.226 (27 May 2018 16:20:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 May 2018 16:20:12 +0000 (UTC) Cc: p.stephani2@gmail.com, 31586@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 27 18:20:08 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 1fMyOt-0007sR-Es for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 May 2018 18:20:07 +0200 Original-Received: from localhost ([::1]:52596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMyR0-000725-Bm for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 May 2018 12:22:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMyQp-000715-3H for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 12:22:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMyQk-00074x-Dw for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 12:22:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMyQk-00074n-9g for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 12:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fMyQk-0003Y5-4J for bug-gnu-emacs@gnu.org; Sun, 27 May 2018 12:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 May 2018 16:22: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.152743807513573 (code B ref 31586); Sun, 27 May 2018 16:22:02 +0000 Original-Received: (at 31586) by debbugs.gnu.org; 27 May 2018 16:21:15 +0000 Original-Received: from localhost ([127.0.0.1]:51113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMyPz-0003Wr-6H for submit@debbugs.gnu.org; Sun, 27 May 2018 12:21:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMyPw-0003Wb-LU for 31586@debbugs.gnu.org; Sun, 27 May 2018 12:21:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMyPm-0006WC-Ry for 31586@debbugs.gnu.org; Sun, 27 May 2018 12:21:07 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMyPm-0006W1-OF; Sun, 27 May 2018 12:21:02 -0400 Original-Received: from [176.228.60.248] (port=2448 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fMyPl-0004cd-SF; Sun, 27 May 2018 12:21:02 -0400 In-reply-to: (message from Stefan Monnier on Sat, 26 May 2018 16:58:56 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:146596 Archived-At: > From: Stefan Monnier > Date: Sat, 26 May 2018 16:58:56 -0400 > Cc: 31586@debbugs.gnu.org > > > perform-replace: Args out of range: #, 0, 1 > > > > Backtrace: > > > > Debugger entered--Lisp error: (args-out-of-range # 0 1) > > buffer-substring-no-properties(0 1) > > perform-replace("a" "b" t nil nil nil nil nil nil nil nil) > > query-replace("a" "b" nil nil nil nil nil) > > funcall-interactively(query-replace "a" "b" nil nil nil nil nil) > > call-interactively(query-replace nil nil) > > command-execute(query-replace) > > FWIW, I think this qualifies as a bug in query-replace: 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. My POV is that using :eval is intrinsically tricky, and whoever does that should take the necessary precautions.