From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#36187: 27.0.50; M-x timer-list fails for functions with multi-line string representations Date: Thu, 13 Jun 2019 07:17:17 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000000738df058b2f54ad" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="80342"; mail-complaints-to="usenet@blaine.gmane.org" To: 36187@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 13 09:18:23 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hbK05-000Kh0-3I for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jun 2019 09:18:21 +0200 Original-Received: from localhost ([::1]:37388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbK03-0006j7-NH for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jun 2019 03:18:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47708) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbJzn-0006j1-Tc for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 03:18:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbJzm-0008LF-Hl for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 03:18:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49111) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbJzm-0008Kx-DY for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 03:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hbJzm-0004e9-68 for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 03:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jun 2019 07:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36187 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156041027817849 (code B ref -1); Thu, 13 Jun 2019 07:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Jun 2019 07:17:58 +0000 Original-Received: from localhost ([127.0.0.1]:34422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbJzi-0004dp-Ci for submit@debbugs.gnu.org; Thu, 13 Jun 2019 03:17:58 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbJzg-0004de-Uq for submit@debbugs.gnu.org; Thu, 13 Jun 2019 03:17:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47656) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbJzf-0006il-Ob for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 03:17:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbJze-0008EH-Fa for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 03:17:55 -0400 Original-Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:45194) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbJze-0008Do-9f for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2019 03:17:54 -0400 Original-Received: by mail-oi1-x243.google.com with SMTP id m206so13638380oib.12 for ; Thu, 13 Jun 2019 00:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=IzTn9d9/uJFnC4XJOBhaOZ2FmdLiNurtBm/b9e7JGKQ=; b=c4Oru8xaCWDF0fTFIWyWLm3IuIgmuYbFJLqzUKHMWW/xZrq7tohOmpqa8ZoKLWALK/ fdIHjMdaWChyrVJKWNHI+tiKryxbeELqi8YOxJx17IV4pRxSl8i9fDwhbsuXUI3sDyd+ OG1qrZtMvPEOHpSWsTcihNEMWERNigm/fKJSe8wIzJbQaHAyGXckohNhtlmfgljF0tFW iJE434Y2xhn4Y9vG2oMwfqsGM66hunRPknQ3WPtynJgqq//UUxn4KKS2bq3og5O/ogEu izjH3HNBwJzxEyhiFFpx62ObIcvX4O2KZ3G9GHqwwp21qzOMLMVcEyxlQVfung16JEhN rCiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IzTn9d9/uJFnC4XJOBhaOZ2FmdLiNurtBm/b9e7JGKQ=; b=CD4BSRNQsHBZxuQIbOgdlllegHMle0aYWyCGoomrPQC60WQNtLWGFEOqkj8GyvgSSb PzYEw54RzMngiFZ/mt7gNzahHfTqAiYJ4flzQd46bRnkmPYgv4ikG43bZGyZAARery+k qz7b5ih7QD59F5ybWMzAFt2tgr0GBCxhKe+/gFvoPOwY/Ti4YwQXNCA3+hyi24P4NrIQ xAurNbR+BF7XN3ppFxTrRpZRuYEvJa+VPxXpClLMdaBlDxgHWrMPHCuNLClOiNIO7Z5B 3XmYv/0D6t3q0ikPmE+61zfzNrmm7cBx7GPg7tKd/3tnocOjKtp/223UgFPQ6JnjHjVc bGLQ== X-Gm-Message-State: APjAAAWZBzTaKUGSjXlBxqRUl/t0ttt8oBv8/DIfFae9LDyh98SyrDLU qENiQbVOuDTi92EBkkhRMFFflQE8Niu5i5/royI5uBQRi+4= X-Google-Smtp-Source: APXvYqwfGPLjeYACMy264GGd0X8Pr03WX53r8k9cE4GxB1gt+vP59dyWzbKSMUxi+i0ikv7rzT2oUMbHtOZEGUfeXcw= X-Received: by 2002:aca:dcd7:: with SMTP id t206mr2121568oig.30.1560410273025; Thu, 13 Jun 2019 00:17:53 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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: 209.51.188.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:160478 Archived-At: --0000000000000738df058b2f54ad Content-Type: text/plain; charset="UTF-8" The timer list fails to deal with functions that cl-prin1-to-string represents in multiple lines, such as those containing newlines in strings. (This happens for process sentinels, as well as for closures with the right bound variables). Evaluate in *scratch*: (run-with-timer 0 1 (lambda () (message "tick\ntock"))) Then run M-x timer-list and attempt to cancel the new timer; doing so on the first line of the representation fails, on the second line of the representation the cancellation succeeds but leaves the timer list in a broken state. The attached one-liner patch fixes things. * timer-list.el (list-timers): bind `print-escape-newlines' to avoid newlines in printed representation. --- lisp/emacs-lisp/timer-list.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/timer-list.el b/lisp/emacs-lisp/timer-list.el index 55aa56b72e..adfc225022 100644 --- a/lisp/emacs-lisp/timer-list.el +++ b/lisp/emacs-lisp/timer-list.el @@ -59,7 +59,8 @@ list-timers (format "%s" repeat)))) ;; Function. (let ((cl-print-compiled 'static) - (cl-print-compiled-button nil)) + (cl-print-compiled-button nil) + (print-escape-newlines t)) (cl-prin1-to-string (aref timer 5))))) (put-text-property (line-beginning-position) (1+ (line-beginning-position)) --0000000000000738df058b2f54ad Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Escape-newlines-when-printing-functions-in-timer-lis.patch" Content-Disposition: attachment; filename="0001-Escape-newlines-when-printing-functions-in-timer-lis.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jwubvdp60 RnJvbSA2OTZiYzE4MWI1NWRmMmJhYzEwNmE5N2ZiNWVjOGNmOTAyZjgwYmNkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaXAgQ2V0IDxwaXBjZXRAZ21haWwuY29tPgpEYXRlOiBUaHUs IDEzIEp1biAyMDE5IDA3OjEzOjA4ICswMDAwClN1YmplY3Q6IFtQQVRDSF0gRXNjYXBlIG5ld2xp bmVzIHdoZW4gcHJpbnRpbmcgZnVuY3Rpb25zIGluIHRpbWVyIGxpc3QuCgoqIHRpbWVyLWxpc3Qu ZWwgKGxpc3QtdGltZXJzKTogYmluZCBgcHJpbnQtZXNjYXBlLW5ld2xpbmVzJyB0byBhdm9pZAog IG5ld2xpbmVzIGluIHByaW50ZWQgcmVwcmVzZW50YXRpb24uCi0tLQogbGlzcC9lbWFjcy1saXNw L3RpbWVyLWxpc3QuZWwgfCAzICsrLQogMSBmaWxlIGNoYW5nZWQsIDIgaW5zZXJ0aW9ucygrKSwg MSBkZWxldGlvbigtKQoKZGlmZiAtLWdpdCBhL2xpc3AvZW1hY3MtbGlzcC90aW1lci1saXN0LmVs IGIvbGlzcC9lbWFjcy1saXNwL3RpbWVyLWxpc3QuZWwKaW5kZXggNTVhYTU2YjcyZS4uYWRmYzIy NTAyMiAxMDA2NDQKLS0tIGEvbGlzcC9lbWFjcy1saXNwL3RpbWVyLWxpc3QuZWwKKysrIGIvbGlz cC9lbWFjcy1saXNwL3RpbWVyLWxpc3QuZWwKQEAgLTU5LDcgKzU5LDggQEAgbGlzdC10aW1lcnMK ICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZvcm1hdCAiJXMiIHJlcGVhdCkpKSkKICAgICAg ICAgICAgICAgICAgICAgICA7OyBGdW5jdGlvbi4KICAgICAgICAgICAgICAgICAgICAgICAobGV0 ICgoY2wtcHJpbnQtY29tcGlsZWQgJ3N0YXRpYykKLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoY2wtcHJpbnQtY29tcGlsZWQtYnV0dG9uIG5pbCkpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKGNsLXByaW50LWNvbXBpbGVkLWJ1dHRvbiBuaWwpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKHByaW50LWVzY2FwZS1uZXdsaW5lcyB0KSkKICAgICAgICAgICAgICAgICAgICAg ICAgIChjbC1wcmluMS10by1zdHJpbmcgKGFyZWYgdGltZXIgNSkpKSkpCiAgICAgICAocHV0LXRl eHQtcHJvcGVydHkgKGxpbmUtYmVnaW5uaW5nLXBvc2l0aW9uKQogICAgICAgICAgICAgICAgICAg ICAgICAgICgxKyAobGluZS1iZWdpbm5pbmctcG9zaXRpb24pKQotLSAKMi4yMC4xCgo= --0000000000000738df058b2f54ad--