From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64536: 30.0.50; Make cl-print put buttons on ellipses Date: Sat, 12 Aug 2023 01:23:03 -0400 Message-ID: References: <87msyyt3oo.fsf@localhost> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30039"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Gemini Lasswell , 64536@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 12 07:24:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qUh6w-0007bc-Gv for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Aug 2023 07:24:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUh6d-0007F7-CA; Sat, 12 Aug 2023 01:24:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qUh6Y-0007Ep-GI for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 01:24:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qUh6Y-0008NR-89 for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 01:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUh6Y-0000bL-30 for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 01:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Aug 2023 05:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64536 X-GNU-PR-Package: emacs Original-Received: via spool by 64536-submit@debbugs.gnu.org id=B64536.16918177952259 (code B ref 64536); Sat, 12 Aug 2023 05:24:02 +0000 Original-Received: (at 64536) by debbugs.gnu.org; 12 Aug 2023 05:23:15 +0000 Original-Received: from localhost ([127.0.0.1]:48425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUh5n-0000aM-Cg for submit@debbugs.gnu.org; Sat, 12 Aug 2023 01:23:15 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:21535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUh5j-0000a8-ME for 64536@debbugs.gnu.org; Sat, 12 Aug 2023 01:23:13 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DA68180796; Sat, 12 Aug 2023 01:23:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1691817784; bh=ogTuxMTJFHJBeKQHzlJJ+wAqKMQstaW+lSBG7l0Mi1Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kLI1Dl+7pWhM69N8bdBvn6kOS7vpbJXY0NcY5aalgWaWVQ6/raDFjTStJe/ke2wA5 ++TyJpLGhOid5lrq5yoZmYK4bidh6jKGjg7BkCT9lj8CWTtUUHGreK3708YQJxm/FF OssDiHAqVv/cTaxruJlJYSW+Lc0jp2udMymqbu5wfXEJkPh9Wezo6JgtmoYeL1O+E7 SDiP8PrR+y0qc2pjBNm3bsaW9oC0RSiewgxjDCDJvG/7QG5fxMOkqP8oamroAfzMrK wstOPJs9LREOQbfjX+flEqyJdGbrG+xg+o8hdMcGUnvDpHEZCg54JwwkSiBvqpp/ty 5CXyVFqu3Z2xw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 765048065C; Sat, 12 Aug 2023 01:23:04 -0400 (EDT) Original-Received: from pastel (69-165-141-248.dsl.teksavvy.com [69.165.141.248]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4B39D120248; Sat, 12 Aug 2023 01:23:04 -0400 (EDT) In-Reply-To: <87msyyt3oo.fsf@localhost> (Ihor Radchenko's message of "Fri, 11 Aug 2023 07:53:59 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267246 Archived-At: >> -;; Define button type used for ...'s. >> -;; Set skip property so you don't have to TAB through 100 of them to >> -;; get to the next function name. >> -(define-button-type 'backtrace-ellipsis >> - 'skip t 'action #'backtrace-expand-ellipsis >> - 'help-echo "mouse-2, RET: expand this ellipsis") > > Isn't this a breaking change? > I just got inspector.el broken because it uses 'backtrace-ellipsis > button type. Apparently it's a breaking change, indeed. Hmm... we could re-add it, but with the new `cl-print.el` your code should simply not use `backtrace-ellipsis` at all because `cl-print.el` did it for you already. IOW, I think a patch like the one below my sig is the better option. > At least, I'd expect to see the removal documented in NEWS. How 'bout: The code that allowed "..." to be expanded in the "*Backtrace*" buffer should now work anywhere the data is generated by 'cl-print'. +*** The 'backtrace-ellipsis' button is replaced by 'cl-print-ellipsis'. + *** hash-tables' contents can be expanded via the ellipsis. +*** Modes can control the expansion via 'cl-print-expand-ellipsis-function'. + ** Modeline elements can now be right-aligned. Anything following the symbol 'mode-line-format-right-align' in 'mode-line-format' will be right-aligned. Exactly where it is -- Stefan diff --git a/inspector.el b/inspector.el index fa9b1cc778..e00209f2be 100644 --- a/inspector.el +++ b/inspector.el @@ -1,6 +1,6 @@ ;;; inspector.el --- Tool for inspection of Emacs Lisp objects -*- lexical-binding: t -*- -;; Copyright (C) 2021-2022 Free Software Foundation, Inc. +;; Copyright (C) 2021-2023 Free Software Foundation, Inc. ;; Author: Mariano Montone ;; URL: https://github.com/mmontone/emacs-inspector @@ -243,13 +243,14 @@ LIMIT controls the truncation." (put-text-property (point-min) (point) 'inspector-form (gensym)) ;; Make buttons from all the "..."s. Since there might be many of ;; them, use text property buttons. - (goto-char (point-min)) - (while (< (point) (point-max)) - (let ((end (next-single-property-change (point) 'cl-print-ellipsis - nil (point-max)))) - (when (get-text-property (point) 'cl-print-ellipsis) - (make-text-button (point) end :type 'backtrace-ellipsis)) - (goto-char end))) + (unless (boundp 'cl-print-expand-ellipsis-function) ;Emacs-30 + (goto-char (point-min)) + (while (< (point) (point-max)) + (let ((end (next-single-property-change (point) 'cl-print-ellipsis + nil (point-max)))) + (when (get-text-property (point) 'cl-print-ellipsis) + (make-text-button (point) end :type 'backtrace-ellipsis)) + (goto-char end)))) (buffer-string))) (cl-defgeneric inspector--face-for-object (object)