From unknown Thu Aug 14 18:38:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#64536 <64536@debbugs.gnu.org> To: bug#64536 <64536@debbugs.gnu.org> Subject: Status: 30.0.50; Make cl-print put buttons on ellipses Reply-To: bug#64536 <64536@debbugs.gnu.org> Date: Fri, 15 Aug 2025 01:38:10 +0000 retitle 64536 30.0.50; Make cl-print put buttons on ellipses reassign 64536 emacs submitter 64536 Stefan Monnier severity 64536 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 09 00:43:11 2023 Received: (at submit) by debbugs.gnu.org; 9 Jul 2023 04:43:11 +0000 Received: from localhost ([127.0.0.1]:45535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIMGM-0003xr-4m for submit@debbugs.gnu.org; Sun, 09 Jul 2023 00:43:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:51100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIMGI-0003xi-68 for submit@debbugs.gnu.org; Sun, 09 Jul 2023 00:43:07 -0400 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 1qIMGG-0003gn-1L for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2023 00:43:04 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIMGD-0006wy-7e for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2023 00:43:03 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B27AE4402F0 for ; Sun, 9 Jul 2023 00:42:56 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 10F2B44031F for ; Sun, 9 Jul 2023 00:42:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688877773; bh=A9vhHRVRjvzxi4DNvFAMM10F9SDf89wUf3t1/g0cR8Y=; h=From:To:Subject:Date:From; b=cgVfOF7CdQxcahw4mKNITshvOHxm8jARZYgIeUmabTsQpPdSScoeXgju4LC/Mks1n eoNFYVjysquHNWD9XFnPY114nVkTppxvH8/h9tU/Y9Bk+RH7jFzL1Kj22UlZhvyiGx szAlC1auiXvE4fOnoxRZuIbPmueCuRnq9k+0px38fowD3N7o9428SCdG903PPwJRYu nrOXeQgKCG/VAlxE1//fq00Azneufl6gt62PS2am2MXqtyIOr7pOvPHcJFxO3zi4Tr GIicycxQ/YumjK7A8sGaceXkjbBKIeEQ97NQOEU/uJzLhUDWyufONtnXXI+dfUiwn5 TonnNwWOW+yKw== Received: from pastel (unknown [24.140.234.50]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D61581201E3 for ; Sun, 9 Jul 2023 00:42:52 -0400 (EDT) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: 30.0.50; Make cl-print put buttons on ellipses X-Debbugs-Cc: Gemini Lasswell Date: Sun, 09 Jul 2023 00:42:41 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.592 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Package: Emacs Version: 30.0.50 Currently, in *Backtrace* we have a nice behavior for cl-printed objects where they're truncated by default to a manageable size but we can click on the "..." to expand them when needed. The patch below moves most of that functionality to `cl-print.el` such that it can be enjoyed "everywhere". I think the patch is almost ready for `master` (beside the usual etc/NEWS bit and checking whether the manual needs to be updated) but would welcome other people's opinions. Stefan --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=cl-print-ellipses.patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/button.el b/lisp/button.el index f043073ea86..002064fbea0 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -123,7 +123,7 @@ define-button-type =20 In addition, the keyword argument :supertype may be used to specify a `button-type' from which NAME inherits its default property values -(however, the inheritance happens only when NAME is defined; subsequent +\(however, the inheritance happens only when NAME is defined; subsequent changes to a supertype are not reflected in its subtypes)." (declare (indent defun)) (let ((catsym (make-symbol (concat (symbol-name name) "-button"))) diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el index 57912c854b0..4c6d9596b3f 100644 --- a/lisp/emacs-lisp/backtrace.el +++ b/lisp/emacs-lisp/backtrace.el @@ -135,8 +135,7 @@ backtrace--pop-to-buffer-pos ;; Font Locking support =20 (defconst backtrace--font-lock-keywords - '((backtrace--match-ellipsis-in-string - (1 'button prepend))) + '() "Expressions to fontify in Backtrace mode. Fontify these in addition to the expressions Emacs Lisp mode fontifies.") @@ -154,16 +153,6 @@ backtrace-font-lock-keywords-2 backtrace--font-lock-keywords) "Gaudy level highlighting for Backtrace mode.") =20 -(defun backtrace--match-ellipsis-in-string (bound) - ;; Fontify ellipses within strings as buttons. - ;; This is necessary because ellipses are text property buttons - ;; instead of overlay buttons, which is done because there could - ;; be a large number of them. - (when (re-search-forward "\\(\\.\\.\\.\\)\"" bound t) - (and (get-text-property (- (point) 2) 'cl-print-ellipsis) - (get-text-property (- (point) 3) 'cl-print-ellipsis) - (get-text-property (- (point) 4) 'cl-print-ellipsis)))) - ;;; Xref support =20 (defun backtrace--xref-backend () 'elisp) @@ -425,11 +414,11 @@ backtrace--set-locals-visible-overlay =20 (defun backtrace--change-button-skip (beg end value) "Change the skip property on all buttons between BEG and END. -Set it to VALUE unless the button is a `backtrace-ellipsis' button." +Set it to VALUE unless the button is a `cl-print-ellipsis' button." (let ((inhibit-read-only t)) (setq beg (next-button beg)) (while (and beg (< beg end)) - (unless (eq (button-type beg) 'backtrace-ellipsis) + (unless (memq (button-type beg) '(backtrace-ellipsis cl-print-ellips= is)) (button-put beg 'skip value)) (setq beg (next-button beg))))) =20 @@ -497,33 +486,15 @@ backtrace--set-feature `(backtrace-index ,index backtrace-view ,view)) (goto-char min))) =20 -(defun backtrace-expand-ellipsis (button) - "Expand display of the elided form at BUTTON." - (goto-char (button-start button)) - (unless (get-text-property (point) 'cl-print-ellipsis) - (if (and (> (point) (point-min)) - (get-text-property (1- (point)) 'cl-print-ellipsis)) - (backward-char) - (user-error "No ellipsis to expand here"))) - (let* ((end (next-single-property-change (point) 'cl-print-ellipsis)) - (begin (previous-single-property-change end 'cl-print-ellipsis)) - (value (get-text-property begin 'cl-print-ellipsis)) - (props (backtrace-get-text-properties begin)) +(defun backtrace--expand-ellipsis (orig-fun begin end val _length &rest ar= gs) + "Wrapper to expand an ellipsis. +For use on `cl-print-expand-ellipsis-function'." + (let* ((props (backtrace-get-text-properties begin)) (inhibit-read-only t)) (backtrace--with-output-variables (backtrace-get-view) - (delete-region begin end) - (insert (cl-print-to-string-with-limit #'cl-print-expand-ellipsis va= lue - backtrace-line-length)) - (setq end (point)) - (goto-char begin) - (while (< (point) end) - (let ((next (next-single-property-change (point) 'cl-print-ellipsis - nil end))) - (when (get-text-property (point) 'cl-print-ellipsis) - (make-text-button (point) next :type 'backtrace-ellipsis)) - (goto-char next))) - (goto-char begin) - (add-text-properties begin end props)))) + (let ((end (apply orig-fun begin end val backtrace-line-length args)= )) + (add-text-properties begin end props) + end)))) =20 (defun backtrace-expand-ellipses (&optional no-limit) "Expand display of all \"...\"s in the backtrace frame at point. @@ -696,13 +667,6 @@ backtrace-print (recenter window-line))) (goto-char (point-min))))) =20 -;; 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") - (defun backtrace-print-to-string (obj &optional limit) "Return a printed representation of OBJ formatted for backtraces. Attempt to get the length of the returned string under LIMIT @@ -719,15 +683,6 @@ backtrace--print-to-string (insert (cl-print-to-string-with-limit #'backtrace--print sexp limit)) ;; Add a unique backtrace-form property. (put-text-property (point-min) (point) 'backtrace-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))) (buffer-string))) =20 (defun backtrace-print-frame (frame view) @@ -918,6 +873,8 @@ backtrace-mode (setq-local filter-buffer-substring-function #'backtrace--filter-visible) (setq-local indent-line-function 'lisp-indent-line) (setq-local indent-region-function 'lisp-indent-region) + (add-function :around (local 'cl-print-expand-ellipsis-function) + #'backtrace--expand-ellipsis) (add-hook 'xref-backend-functions #'backtrace--xref-backend nil t)) =20 (put 'backtrace-mode 'mode-class 'special) diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index 9578d556421..4d64249255a 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el @@ -54,9 +54,12 @@ cl-print-object (prin1 object stream)) =20 (cl-defgeneric cl-print-object-contents (_object _start _stream) - "Dispatcher to print the contents of OBJECT on STREAM. -Print the contents starting with the item at START, without -delimiters." + "Dispatcher to print partial contents of OBJECT on STREAM. +This is used when replacing an ellipsis with the contents it +represents. OBJECT is the object that has been partially printed +and START represents the place at which the contents where +replaced with an ellipsis. +Print the contents hidden by the ellipsis to STREAM." ;; Every cl-print-object method which can print an ellipsis should ;; have a matching cl-print-object-contents method to expand an ;; ellipsis. @@ -65,7 +68,7 @@ cl-print-object-contents (cl-defmethod cl-print-object ((object cons) stream) (if (and cl-print--depth (natnump print-level) (> cl-print--depth print-level)) - (cl-print-insert-ellipsis object 0 stream) + (cl-print-insert-ellipsis object nil stream) (let ((car (pop object))) (if (and print-quoted (memq car '(\, quote function \` \,@ \,.)) @@ -107,7 +110,7 @@ cl-print-object-contents (cl-defmethod cl-print-object ((object vector) stream) (if (and cl-print--depth (natnump print-level) (> cl-print--depth print-level)) - (cl-print-insert-ellipsis object 0 stream) + (cl-print-insert-ellipsis object nil stream) (princ "[" stream) (cl-print--vector-contents object 0 stream) (princ "]" stream))) @@ -129,6 +132,8 @@ cl-print-object-contents (cl-print--vector-contents object start stream)) ;FIXME: =CE=B7-redex! =20 (cl-defmethod cl-print-object ((object hash-table) stream) + ;; FIXME: Make it possible to see the contents, like `prin1' does, + ;; e.g. using ellipsis. Make sure `cl-fill' can pretty print the result! (princ "#" so that pp.el gives better resu= lts. @@ -212,7 +220,7 @@ cl-print-object (cl-defmethod cl-print-object ((object cl-structure-object) stream) (if (and cl-print--depth (natnump print-level) (> cl-print--depth print-level)) - (cl-print-insert-ellipsis object 0 stream) + (cl-print-insert-ellipsis object nil stream) (princ "#s(" stream) (princ (cl--struct-class-name (cl-find-class (type-of object))) stream) (cl-print--struct-contents object 0 stream) @@ -250,7 +258,7 @@ cl-print-object cl-print--depth (natnump print-level) (> cl-print--depth print-level)) - (cl-print-insert-ellipsis object 0 stream) + (cl-print-insert-ellipsis object nil stream) ;; Print all or part of the string (when has-properties (princ "#(" stream)) @@ -325,6 +333,7 @@ cl-print-object-contents (cl-defmethod cl-print-object :around (object stream) ;; FIXME: Only put such an :around method on types where it's relevant. (let ((cl-print--depth (if cl-print--depth (1+ cl-print--depth) 1))) + ;; FIXME: Handle print-depth here once and forall? (cond (print-circle (let ((n (gethash object cl-print--number-table))) @@ -401,10 +410,53 @@ cl-print--preprocess (cl-print--find-sharing object print-number-table))) print-number-table)) =20 +(define-button-type 'cl-print-ellipsis + 'skip t 'action #'cl-print-expand-ellipsis + 'help-echo "mouse-2, RET: expand this ellipsis") + +(defvar cl-print-expand-ellipsis-function + #'cl-print--default-expand-ellipsis + "Function to tweak the way ellipses are expanded. +The function is called with 3 arguments, BEG, END, and FUNC. +BEG and END delimit the ellipsis that will be replaced. +FUNC is the function that will do the expansion. +It should be called with a single argument specifying the desired +limit of the expansion's length, as used in `cl-print-to-string-with-limit= '. +FUNC will return the position of the end of the newly printed text.") + +(defun cl-print--default-expand-ellipsis (begin end value line-length) + (delete-region begin end) + (insert (cl-print-to-string-with-limit + #'cl-print--expand-ellipsis value line-length)) + (point)) + + +(defun cl-print-expand-ellipsis (&optional button) + "Expand display of the elided form at BUTTON. +BUTTON can also be a buffer position or nil (to mean point)." + (interactive) + (goto-char (cond + ((null button) (point)) + (t (button-start button)))) + (unless (get-text-property (point) 'cl-print-ellipsis) + (if (and (> (point) (point-min)) + (get-text-property (1- (point)) 'cl-print-ellipsis)) + (backward-char) + (user-error "No ellipsis to expand here"))) + (let* ((end (next-single-property-change (point) 'cl-print-ellipsis)) + (begin (previous-single-property-change end 'cl-print-ellipsis)) + (value (get-text-property begin 'cl-print-ellipsis))) + ;; FIXME: Rather than `t' (i.e. reuse the print-length/level unchanged= ), + ;; I think it would make sense to increase the level by 1 and to + ;; double the length at each expansion step. + (funcall cl-print-expand-ellipsis-function + begin end value t) + (goto-char begin))) + (defun cl-print-insert-ellipsis (object start stream) "Print \"...\" to STREAM with the `cl-print-ellipsis' text property. Save state in the text property in order to print the elided part -of OBJECT later. START should be 0 if the whole OBJECT is being +of OBJECT later. START should be nil if the whole OBJECT is being elided, otherwise it should be an index or other pointer into the internals of OBJECT which can be passed to `cl-print-object-contents' at a future time." @@ -423,11 +475,12 @@ cl-print-propertize-ellipsis `cl-print-insert-ellipsis'." (let ((value (list object start cl-print--number-table cl-print--currently-printing))) + ;; FIXME: Make it into a button! (with-current-buffer stream - (put-text-property beg end 'cl-print-ellipsis value stream)))) + (put-text-property beg end 'cl-print-ellipsis value stream) + (make-text-button beg end :type 'cl-print-ellipsis)))) =20 -;;;###autoload -(defun cl-print-expand-ellipsis (value stream) +(defun cl-print--expand-ellipsis (value stream) "Print the expansion of an ellipsis to STREAM. VALUE should be the value of the `cl-print-ellipsis' text property which was attached to the ellipsis by `cl-prin1'." @@ -439,7 +492,7 @@ cl-print-expand-ellipsis (cl-print--currently-printing (nth 3 value))) (when (eq object (car cl-print--currently-printing)) (pop cl-print--currently-printing)) - (if (equal start 0) + (if (memq start '(0 nil)) (cl-print-object object stream) (cl-print-object-contents object start stream)))) =20 @@ -474,22 +527,26 @@ cl-print-to-string-with-limit the arguments VALUE and STREAM and which should respect `print-length' and `print-level'. LIMIT may be nil or zero in which case PRINT-FUNCTION will be called with `print-level' and -`print-length' bound to nil. +`print-length' bound to nil, and it can also be t in which case +PRINT-FUNCTION will be called with the current values of `print-level' +and `print-length'. + =20 Use this function with `cl-prin1' to print an object, -abbreviating it with ellipses to fit within a size limit. Use -this function with `cl-prin1-expand-ellipsis' to expand an -ellipsis, abbreviating the expansion to stay within a size -limit." - (setq limit (and (natnump limit) - (not (zerop limit)) - limit)) +abbreviating it with ellipses to fit within a size limit." + (setq limit (and (not (eq limit 0)) limit)) ;; Since this is used by the debugger when stack space may be ;; limited, if you increase print-level here, add more depth in ;; call_debugger (bug#31919). - (let* ((print-length (when limit (min limit 50))) - (print-level (when limit (min 8 (truncate (log limit))))) - (delta-length (when limit + (let* ((print-length (cond + ((null limit) nil) + ((eq limit t) print-length) + (t (min limit 50)))) + (print-level (cond + ((null limit) nil) + ((eq limit t) print-level) + (t (min 8 (truncate (log limit)))))) + (delta-length (when (natnump limit) (max 1 (truncate (/ print-length print-level)))))) (with-temp-buffer (catch 'done @@ -499,7 +556,7 @@ cl-print-to-string-with-limit (let ((result (- (point-max) (point-min)))) ;; Stop when either print-level is too low or the value is ;; successfully printed in the space allowed. - (when (or (not limit) (< result limit) (<=3D print-level 2)) + (when (or (not (natnump limit)) (< result limit) (<=3D print-l= evel 2)) (throw 'done (buffer-string))) (let* ((ratio (/ result limit)) (delta-level (max 1 (min (- print-level 2) ratio)))) diff --git a/test/lisp/emacs-lisp/cl-print-tests.el b/test/lisp/emacs-lisp/= cl-print-tests.el index af94dae310c..37d354afe18 100644 --- a/test/lisp/emacs-lisp/cl-print-tests.el +++ b/test/lisp/emacs-lisp/cl-print-tests.el @@ -113,7 +113,7 @@ cl-print-tests-check-ellipsis-expansion (should pos) (setq value (get-text-property pos 'cl-print-ellipsis result)) (should (equal expected result)) - (should (equal expanded (with-output-to-string (cl-print-expand-ellips= is + (should (equal expanded (with-output-to-string (cl-print--expand-ellip= sis value nil)))))) =20 (defun cl-print-tests-check-ellipsis-expansion-rx (obj expected expanded) @@ -122,7 +122,7 @@ cl-print-tests-check-ellipsis-expansion-rx (value (get-text-property pos 'cl-print-ellipsis result))) (should (string-match expected result)) (should (string-match expanded (with-output-to-string - (cl-print-expand-ellipsis value nil))= )))) + (cl-print--expand-ellipsis value nil)= ))))) =20 (ert-deftest cl-print-tests-print-to-string-with-limit () (let* ((thing10 (make-list 10 'a)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 13 19:01:39 2023 Received: (at 64536-done) by debbugs.gnu.org; 13 Jul 2023 23:01:39 +0000 Received: from localhost ([127.0.0.1]:41038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qK5Ja-0001ek-SL for submit@debbugs.gnu.org; Thu, 13 Jul 2023 19:01:39 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qK5JV-0001eU-Nv for 64536-done@debbugs.gnu.org; Thu, 13 Jul 2023 19:01:37 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 371A81000C3; Thu, 13 Jul 2023 19:01:28 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 29CA810009E; Thu, 13 Jul 2023 19:01:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1689289287; bh=t2sKPGre4GMrHVwBfNrfDp08exp/caMHSYI/4F0Twmo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ne4B6APd2e0DbFsAqka1/ACUe8ofDqxE4uZnySRwhI3kzTy+sJN/5wsN1UfAf6BVb FNJE6HUfB9fWHQ6HzgPls0RwRcTZvTARrHclsbM/SJOmOftFJjJc9AIcqaFQ41odZE Ie0ru7mzaTdq7TPwAJcYMJeflJgqT57CjyoNlxnBW4zzDTrneFBzYk0IEwEuD37bYy G2gVjFurUXOBuamCc+/1L8E3jUD9AQYY55+v4KI5RPAZ8hDnXUxslVzAYkm1yqO4ly SvYohyrttAIyom5y0uFJ0zMEAROOD1uiMgma5pVdzsNqKOMZ382rvWQrPKeT2akg3b UBdhk+NUo8nog== Received: from pastel (unknown [104.247.239.133]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0741E1200FC; Thu, 13 Jul 2023 19:01:27 -0400 (EDT) From: Stefan Monnier To: 64536-done@debbugs.gnu.org Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: (Stefan Monnier's message of "Sun, 09 Jul 2023 00:42:41 -0400") Message-ID: References: Date: Thu, 13 Jul 2023 19:01:26 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.112 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64536-done Cc: Gemini Lasswell X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Currently, in *Backtrace* we have a nice behavior for cl-printed objects > where they're truncated by default to a manageable size but we can click > on the "..." to expand them when needed. > > The patch below moves most of that functionality to `cl-print.el` such > that it can be enjoyed "everywhere". Pushed to `master`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 11 03:53:42 2023 Received: (at 64536) by debbugs.gnu.org; 11 Aug 2023 07:53:42 +0000 Received: from localhost ([127.0.0.1]:44811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUMxq-0001TN-79 for submit@debbugs.gnu.org; Fri, 11 Aug 2023 03:53:42 -0400 Received: from mout02.posteo.de ([185.67.36.66]:56769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUMxn-0001T9-SV for 64536@debbugs.gnu.org; Fri, 11 Aug 2023 03:53:41 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 772A9240101 for <64536@debbugs.gnu.org>; Fri, 11 Aug 2023 09:53:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1691740413; bh=9cmddAPQ7yxO3I8sjNUqUASQ3JEM8LG6DjlnXhzRjRg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=CT/j+owMXd23Fio+GtjuSWgf6jKmrVSTjdL+L7RZ29SqOYvaaYJcHzD7S2AnzYvSq dYdvF6XPMl+cxialbv5STcJRe4aq57rtNT2BSVQsb+PlRjWcFTHt/7J4vIAcGeaOXV Lc0jypEQ+VffI0bi5QAKi3K/rC5lwarO0U38ldqOil1Ezdx2e0wyclt6Cg4TE/q3MJ m4JrA17y7IJMucxYWFJnf/i3i5+/IJX5xN+Gtm555+yY7wtEqby7QZN4r80l9gs881 zzUKPFAimXWZ5bIMBmB8BxHZn0HF6yo9u9RjeUAk36DrpEqXlfLg5zNFCXxfoc9nRr ajfjNqQPE9HvA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RMbdS3HbQz9rxL; Fri, 11 Aug 2023 09:53:31 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: References: Date: Fri, 11 Aug 2023 07:53:59 +0000 Message-ID: <87msyyt3oo.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 64536 Cc: Gemini Lasswell , 64536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > -;; 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. At least, I'd expect to see the removal documented in NEWS. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 12 01:23:15 2023 Received: (at 64536) by debbugs.gnu.org; 12 Aug 2023 05:23:15 +0000 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 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 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== 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) 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) From: Stefan Monnier To: Ihor Radchenko Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: <87msyyt3oo.fsf@localhost> (Ihor Radchenko's message of "Fri, 11 Aug 2023 07:53:59 +0000") Message-ID: References: <87msyyt3oo.fsf@localhost> Date: Sat, 12 Aug 2023 01:23:03 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.025 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64536 Cc: Gemini Lasswell , 64536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> -;; 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) From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 12 04:39:43 2023 Received: (at 64536) by debbugs.gnu.org; 12 Aug 2023 08:39:43 +0000 Received: from localhost ([127.0.0.1]:48677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUk9u-0007Dn-Sr for submit@debbugs.gnu.org; Sat, 12 Aug 2023 04:39:43 -0400 Received: from mout01.posteo.de ([185.67.36.65]:48737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUk9q-0007DM-Eb for 64536@debbugs.gnu.org; Sat, 12 Aug 2023 04:39:41 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 6732424002B for <64536@debbugs.gnu.org>; Sat, 12 Aug 2023 10:39:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1691829572; bh=i2OS9p/Gzrc0QgwrXQ1Avr2iqT412FhdPObLNDypols=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=KAt1cwiPBXXXaqFgrOoqgNW3sgk5MD7B+SuqbAMYaMztaUYLaXdiFeMMlB6b+6BA3 YqGwSMmDBlZQsFNIChqetmJjJrEg6F1f+U4sUG+7JtDFDm1qAaE/KEEgEmMh9FgyQu kk5hGm9zFVsXwEEwUz2H3hKtcPbc0FO5BiHZjScFPTN3I0X68A3Gwa6unpTP5x0G0d t94PM94U8cSR+HlCxxB9kMn1W6EaHKskZ5WB447yQes6+e6e0omhBOb6QnwtrTP+4h jQJ+iTUHvFF8OWmMkfifdQxMcaaGHv0z7U32sByOCJyeceBoh+kn40bf64IFXba+2s AckjnL1jalE2w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RNDc345gJz6txk; Sat, 12 Aug 2023 10:39:31 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: References: <87msyyt3oo.fsf@localhost> Date: Sat, 12 Aug 2023 08:39:57 +0000 Message-ID: <87sf8o3b8i.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 64536 Cc: Gemini Lasswell , 64536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) Stefan Monnier writes: > 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. Sure. Thanks for the patch! I will let inspector.el author know about it. However, other users of `backtrace-ellipsis' button may be affected if they used it for different purposes. May it be possible to create an obsolete alias for this button type? >> 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'. Looks reasonable. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 12 14:17:17 2023 Received: (at 64536) by debbugs.gnu.org; 12 Aug 2023 18:17:17 +0000 Received: from localhost ([127.0.0.1]:57308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUtAr-0004RA-By for submit@debbugs.gnu.org; Sat, 12 Aug 2023 14:17:17 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUtAo-0004Qu-RJ for 64536@debbugs.gnu.org; Sat, 12 Aug 2023 14:17:15 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id EC38180625; Sat, 12 Aug 2023 14:17:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1691864223; bh=N+WtNtsHCnPiOkTsa1VYF7lMRI7odVLtwN35nDkfY1w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dpEm+Ge3XRrqlcW0EwW5HcuHGc34cw3MFCB9hh6yWbPt4+T1s2vAT/BUZcE9Wh8dq r2W8I/x0WKbN/d1u85RV8y4BoqBI3ZBcC2qj6nmTBpUmGo9u7BEiD0PLab1TzzwUAr U7eJvedqraYIL4NLpwIWSLQCwKEJsDJxELMklo0GfoCKrCrMBDXdUFMc0Rj0KGfwVI eS/i2FqPQFT9CLXRP6oYCZMiu3xuxxTJh8Vx1weVZbeKRWBWCMSonIe3W96afb4d2a l/v5eeBXHHnXT+RgNVqbXl7jyeVe+2QKnIlwYvsvcOaHnW8zXcx4R7oOlFNvJcTD2B b8gDfl62AN2Rw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9D9F7801D6; Sat, 12 Aug 2023 14:17:03 -0400 (EDT) Received: from pastel (69-165-141-248.dsl.teksavvy.com [69.165.141.248]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 713CB12026C; Sat, 12 Aug 2023 14:17:03 -0400 (EDT) From: Stefan Monnier To: Ihor Radchenko Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: <87sf8o3b8i.fsf@localhost> (Ihor Radchenko's message of "Sat, 12 Aug 2023 08:39:57 +0000") Message-ID: References: <87msyyt3oo.fsf@localhost> <87sf8o3b8i.fsf@localhost> Date: Sat, 12 Aug 2023 14:17:02 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64536 Cc: Gemini Lasswell , 64536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > However, other users of `backtrace-ellipsis' button may be affected if > they used it for different purposes. That's also what I thought at first, but the case of `inspect.el` made me realize that it's likely that just letting them use `backtrace-ellipsis` button is often not the right solution anyway. > May it be possible to create an obsolete alias for this button type? And I don't think we have such aliases. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 13 05:26:26 2023 Received: (at 64536) by debbugs.gnu.org; 13 Aug 2023 09:26:26 +0000 Received: from localhost ([127.0.0.1]:58227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qV7Mg-0004ym-0T for submit@debbugs.gnu.org; Sun, 13 Aug 2023 05:26:26 -0400 Received: from mout01.posteo.de ([185.67.36.65]:60671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qV7Mc-0004yW-K9 for 64536@debbugs.gnu.org; Sun, 13 Aug 2023 05:26:24 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 13C3D240028 for <64536@debbugs.gnu.org>; Sun, 13 Aug 2023 11:26:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1691918777; bh=yR68ooC/hAAE9IakBwO3eTrdhfGmQ4uqaGTrcRNZ3jU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=BxQ+BCxA59YekvRmootKCp/6c5FalCzItdVVyvIsjNsRWEIjFWMh14fKOqXdRqlpo Pxe8HB22YOspUu/Iggad2PXCL5Glle0TyzBlD2pKNGevYB1Us008C6AZ5hUbbaJSn8 AfMhm04mcF355y5AhBPrx0O41lLTXxcaUsSS+M4na9/nepjF89V54onPFDZRo9NsFj b9QMM/tR/YtpnVEZteNd5Wtfe/PNxnTs+LmY2MPvLX+GfRnj0LmyR4x0lg0S8qliT0 uJJZn2Eo+PE8JejKTyi4n3NGwuX5PAWsNx/+VHqsUmXCT5itrXh5ctmbsRPHgnRrwD cRl3IFZZDscHg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RNsbW5Ddfz6twr; Sun, 13 Aug 2023 11:26:15 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: References: <87msyyt3oo.fsf@localhost> <87sf8o3b8i.fsf@localhost> Date: Sun, 13 Aug 2023 09:26:41 +0000 Message-ID: <87v8djjnse.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64536 Cc: Gemini Lasswell , 64536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >> However, other users of `backtrace-ellipsis' button may be affected if >> they used it for different purposes. > > That's also what I thought at first, but the case of `inspect.el` made > me realize that it's likely that just letting them use > `backtrace-ellipsis` button is often not the right solution anyway. I am pretty sure that some uses of `backtrace-ellipsis' have nothing to do with printing Elisp values. At least, there is no reason why they should be limited to. >> May it be possible to create an obsolete alias for this button type? > > And I don't think we have such aliases. May it be added? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 13 12:02:24 2023 Received: (at 64536) by debbugs.gnu.org; 13 Aug 2023 16:02:24 +0000 Received: from localhost ([127.0.0.1]:60124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVDXs-0005Sc-4J for submit@debbugs.gnu.org; Sun, 13 Aug 2023 12:02:24 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVDXq-0005SN-3q for 64536@debbugs.gnu.org; Sun, 13 Aug 2023 12:02:23 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BE490441CFE; Sun, 13 Aug 2023 12:02:15 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1691942534; bh=9nTw1ks0jb8VYm3aCpba9BUAEcLly/FO/Zt3GSlWzTA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=a1o1IKEpl6C4Bwui33XO6JW3ytSLmE/jQAy0+IO1EQMr9FR9FgPb5+p8KITvA1kXV 4U+WP1D4tis7Y7jQ+8W1LUlH/6Fqc2zWO250USfLqpvYwDGcKeJVa38xmI30mo656W uJCEkZQG4a7Bx3wrrxq1hOHt8QBSgWqfvHEPkQoRnKw4DeBgbUzsonZyxDaAi9NP2Q G3GVRYpGp3tEwlcDP3kx+xAI2wIu4pRR7O0r2SaV6fvwjtX/si7hciUDwpO8YA6qqr glsuH5d+t2gKZJR+lfKPV307ti4qnw4rXKOUjbUA4Bv836vrgyhKXuWbQesgwLwzP1 9GY/fKjKufSKg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 599FD441CDA; Sun, 13 Aug 2023 12:02:14 -0400 (EDT) Received: from pastel (unknown [45.72.228.154]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 302481202FD; Sun, 13 Aug 2023 12:02:14 -0400 (EDT) From: Stefan Monnier To: Ihor Radchenko Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: <87v8djjnse.fsf@localhost> (Ihor Radchenko's message of "Sun, 13 Aug 2023 09:26:41 +0000") Message-ID: References: <87msyyt3oo.fsf@localhost> <87sf8o3b8i.fsf@localhost> <87v8djjnse.fsf@localhost> Date: Sun, 13 Aug 2023 12:02:13 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.039 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64536 Cc: Gemini Lasswell , 64536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> That's also what I thought at first, but the case of `inspect.el` made >> me realize that it's likely that just letting them use >> `backtrace-ellipsis` button is often not the right solution anyway. > I am pretty sure that some uses of `backtrace-ellipsis' have nothing to > do with printing Elisp values. Could you expand on what makes you think so? I grepped for it in Melpa and couldn't find any use of it at all, FWIW. > At least, there is no reason why they should be limited to. It was rather tightly integrated with `cl-print`, tho: the button called `backtrace-expand-ellipsis` which itself looked for a `cl-print-ellipsis` text-property and called `cl-print-to-string-with-limit` and `cl-print-expand-ellipsis` on it. >>> May it be possible to create an obsolete alias for this button type? >> And I don't think we have such aliases. > May it be added? Patch welcome (especially if it comes together with some kind of obsolescence mechanism). Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 14 07:01:07 2023 Received: (at 64536) by debbugs.gnu.org; 14 Aug 2023 11:01:07 +0000 Received: from localhost ([127.0.0.1]:32998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVVJo-0002FX-1n for submit@debbugs.gnu.org; Mon, 14 Aug 2023 07:01:07 -0400 Received: from mout02.posteo.de ([185.67.36.66]:36253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVVJl-0002Ej-Of for 64536@debbugs.gnu.org; Mon, 14 Aug 2023 07:01:02 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B975E240104 for <64536@debbugs.gnu.org>; Mon, 14 Aug 2023 13:00:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692010855; bh=UAcX58KEhwlolTec52FdDXJ1LTfNBsjp4wW18BHjqFo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=L/v/Jp+Fc1wWfAJalsyYOCPfd0yue/XeA1JdudpPBM6ydBnLL18A+hgJAJWG5Nohi B92SqL/1jtPnJvY0Yw7od7i2kI+3lFBnfThrCpGBfo/Tw9lZOGw27aCYoY3E/DKKSl M+c++Trt226yb6EOFSh5FuWIfEbXGs7p4NZvZ4MFCXYjWsAz5dyiYXDPrsFC403OkO YIMrlCHP0vyNz4H8MDXpepccBhnAlx9jy91YAkVjgpDVSrdokettmDeUv6TuUkM8W3 wBuzJkI1SSyWTBIg8WulnWNJcEUIs5UZ7qKjGD4/ilciSHoaZQ+fcGsATYXsRie4bx TLjqq7KhATvfw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RPWfG5z4gz6txV; Mon, 14 Aug 2023 13:00:54 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: References: <87msyyt3oo.fsf@localhost> <87sf8o3b8i.fsf@localhost> <87v8djjnse.fsf@localhost> Date: Mon, 14 Aug 2023 11:01:20 +0000 Message-ID: <87ttt1q45b.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64536 Cc: Gemini Lasswell , 64536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >> I am pretty sure that some uses of `backtrace-ellipsis' have nothing to >> do with printing Elisp values. > > Could you expand on what makes you think so? Theoretical backward-compatibility considerations. > I grepped for it in Melpa and couldn't find any use of it at all, FWIW. You are right. I also searched in https://github.com/search?q=backtrace-ellipsis+language%3A%22Emacs+Lisp%22&type=code&l=Emacs+Lisp&p=1 And found nothing apart from Emacs forks and inspector.el. So, it should likely be safe to remove this button. >> At least, there is no reason why they should be limited to. > > It was rather tightly integrated with `cl-print`, tho: > the button called `backtrace-expand-ellipsis` which itself looked for > a `cl-print-ellipsis` text-property and called > `cl-print-to-string-with-limit` and `cl-print-expand-ellipsis` on it. I see. Another +1 to silent removal. I thought that is it less specialized (given that its name is public). >>>> May it be possible to create an obsolete alias for this button type? >>> And I don't think we have such aliases. >> May it be added? > > Patch welcome (especially if it comes together with some kind of > obsolescence mechanism). I am not sure if this can be done on byte compiler level. For runtime, after skimming through button.el, it looks like `button-category-symbol' might be used to throw a warning when obsolete button type is being used. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 14 10:07:29 2023 Received: (at 64536) by debbugs.gnu.org; 14 Aug 2023 14:07:30 +0000 Received: from localhost ([127.0.0.1]:34096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVYED-0006Tq-JI for submit@debbugs.gnu.org; Mon, 14 Aug 2023 10:07:29 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVYEB-0006Ta-Po for 64536@debbugs.gnu.org; Mon, 14 Aug 2023 10:07:28 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0A8961000EF; Mon, 14 Aug 2023 10:07:22 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1692022037; bh=b2tN+rpp7WAPcngt8y8p1ZG5zA7llo3SuOzxLQkk468=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CLWq7SAS9ty3gAggCdXOpKCCFcNaW7G11p30YYtYSFi+lukdsPUXLlDPkCGvPXPkS ZuTtjlzWlhOMYcJsQsj2uDqEMthhIdJxhGSnMzfE8Dqv93VPiIJvSw8a8Qiy/iIe1G 4KzarbnQ7/muIzg6c8n9lmqBGuqI8P9e0tvdLZghR8pzYqp1wtO2IO9XNjmJX205h1 s7l6A16xhI0wzJTLJOUMRw+eoq4UX8siJX07E6Jen2eDA6ee/extnYbIQenXtNkULW srWMpz161GFiWm8tAirLOMIJlseNDDmygDlDtG/BVrBTzdHtb9SgxGJU7CPkrWPX5S sSPzoF4wYe8Qg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0174E1000AD; Mon, 14 Aug 2023 10:07:17 -0400 (EDT) Received: from pastel (unknown [45.72.228.154]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D0B1D12032D; Mon, 14 Aug 2023 10:07:16 -0400 (EDT) From: Stefan Monnier To: Ihor Radchenko Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: <87ttt1q45b.fsf@localhost> (Ihor Radchenko's message of "Mon, 14 Aug 2023 11:01:20 +0000") Message-ID: References: <87msyyt3oo.fsf@localhost> <87sf8o3b8i.fsf@localhost> <87v8djjnse.fsf@localhost> <87ttt1q45b.fsf@localhost> Date: Mon, 14 Aug 2023 10:07:14 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.163 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64536 Cc: Gemini Lasswell , 64536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >>>>> May it be possible to create an obsolete alias for this button type? >>>> And I don't think we have such aliases. >>> May it be added? >> Patch welcome (especially if it comes together with some kind of >> obsolescence mechanism). > I am not sure if this can be done on byte compiler level. Not sure either. A compiler-macro placed on `make-text-button` and `make-button` could look for a `:type` arg and check its obsolescence, but I don't know how effective it would be. > For runtime, after skimming through button.el, it looks like > `button-category-symbol' might be used to throw a warning when obsolete > button type is being used. Runtime check are easier and more reliable, indeed, but also more annoying and directed at the wrong person :-( Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 14 11:15:27 2023 Received: (at 64536) by debbugs.gnu.org; 14 Aug 2023 15:15:27 +0000 Received: from localhost ([127.0.0.1]:34194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVZHy-0000zY-5u for submit@debbugs.gnu.org; Mon, 14 Aug 2023 11:15:27 -0400 Received: from mout01.posteo.de ([185.67.36.65]:44815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVZHs-0000Sg-A0 for 64536@debbugs.gnu.org; Mon, 14 Aug 2023 11:15:25 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 8AD8924002B for <64536@debbugs.gnu.org>; Mon, 14 Aug 2023 17:15:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692026114; bh=D767ygp2vVBemUt0k7Z/j1UDS4bxHraUOt7rltDtIAQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=oRusFZKOgn/2AmGjlLzT9PChKDx4d07IbikrgDgSmgpPn8fXb/Rw/N++5W5AA5R27 k5IMMeF3rWL6x7UG9Wiidml0zzNuawcAlVFb+QCkjqRySL9LjbIcuMb0vwRlczGni/ YIDeUzF7clZwyrCSiVUBKUKStxpxCfmsP6HVChdR2Ulo1cvjjCnMOhpl2yQq4CxHWQ crKPsmWNn+NB6HwmR13HhVonkt1Jv3LjvjNLyGvUxDpTMukgBaRZ9vJbsWlbjq67+r JwEHB2/eTSJXeE4R5Et6sRVeQrjGqxwMIc0wGGGlB5jJ2War2xQ+MbE5kfuRY+3mtf hZNBlyw4o2GCA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RPdHj5dkKz9rxD; Mon, 14 Aug 2023 17:15:13 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Subject: Re: bug#64536: 30.0.50; Make cl-print put buttons on ellipses In-Reply-To: References: <87msyyt3oo.fsf@localhost> <87sf8o3b8i.fsf@localhost> <87v8djjnse.fsf@localhost> <87ttt1q45b.fsf@localhost> Date: Mon, 14 Aug 2023 15:15:40 +0000 Message-ID: <874jl1psdf.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64536 Cc: Gemini Lasswell , 64536@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >> I am not sure if this can be done on byte compiler level. > > Not sure either. A compiler-macro placed on `make-text-button` and > `make-button` could look for a `:type` arg and check its obsolescence, > but I don't know how effective it would be. Maybe not that bad. Of course, it will miss :type values not known at compile time, but it is the same issue even with ordinary obsolete variables/functions that are used not by their literal name. >> For runtime, after skimming through button.el, it looks like >> `button-category-symbol' might be used to throw a warning when obsolete >> button type is being used. > > Runtime check are easier and more reliable, indeed, but also more > annoying and directed at the wrong person :-( Makes sense. Although, they can be useful for maintainers if such checks can be enabled explicitly, by flipping a variable. We used such approach for org-element--cache-self-verify. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From unknown Thu Aug 14 18:38:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 12 Sep 2023 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator