GNU bug report logs - #40728
27.0.91; Removed public functions from debugger.el

Previous Next

Package: emacs;

Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>

Date: Mon, 20 Apr 2020 08:22:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 27.0.91

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40728 in the body.
You can then email your comments to 40728 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#40728; Package emacs. (Mon, 20 Apr 2020 08:22:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philipp Stephani <p.stephani2 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 20 Apr 2020 08:22:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.91; Removed public functions from debugger.el
Date: Mon, 20 Apr 2020 10:21:03 +0200
It looks like the following public functions were deleted from
debugger.el between Emacs 26 and 27: debug-help-follow,
debugger-insert-backtrace, debugger-toggle-locals.  All three were
public (didn't contain a double hyphen) and documented, therefore meant
for general use.  I don't think we should remove such functions (and
break users' workflows that rely on them) without a strong reason.
Please consider restoring these functions for Emacs 27.


In GNU Emacs 27.0.91 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.13)
 of 2020-04-20
Repository revision: a1040861f118881004f59866111f64cd0ae03b7a
Repository branch: emacs-27
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux rodete

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --enable-checking=all --enable-gtk-deprecation-warnings
 --enable-gcc-warnings=warn-only --enable-check-lisp-object-type
 --with-mailutils --without-pop 'CFLAGS=-O0 -g3' LDFLAGS=-g3'

Configured features:
XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY
LIBSELINUX GNUTLS FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS GTK3
X11 XDBE XIM MODULES THREADS PDUMPER GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec epa epg epg-config gnus-util
rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils phst skeleton
derived edmacro kmacro pcase ffap thingatpt url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars mailcap subr-x rx gnutls puny seq
byte-opt gv bytecomp byte-compile cconv dbus xml cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 63123 5515)
 (symbols 48 8435 1)
 (strings 32 22394 1817)
 (string-bytes 1 711568)
 (vectors 16 12506)
 (vector-slots 8 174130 5982)
 (floats 8 25 34)
 (intervals 56 201 0)
 (buffers 1000 12))

-- 
Google Germany GmbH
Erika-Mann-Straße 33
80636 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

If you received this communication by mistake, please don’t forward it to
anyone else (it may contain confidential or privileged information), please
erase all copies of it, including all attachments, and please let the sender
know it went to the wrong person.  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40728; Package emacs. (Mon, 20 Apr 2020 15:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 40728 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Gemini Lasswell <gazally <at> runbox.com>
Cc: 40728 <at> debbugs.gnu.org
Subject: Re: bug#40728: 27.0.91; Removed public functions from debugger.el
Date: Mon, 20 Apr 2020 18:24:13 +0300
> From: Philipp Stephani <p.stephani2 <at> gmail.com>
> Date: Mon, 20 Apr 2020 10:21:03 +0200
> 
> 
> It looks like the following public functions were deleted from
> debugger.el between Emacs 26 and 27: debug-help-follow,
> debugger-insert-backtrace, debugger-toggle-locals.  All three were
> public (didn't contain a double hyphen) and documented, therefore meant
> for general use.  I don't think we should remove such functions (and
> break users' workflows that rely on them) without a strong reason.
> Please consider restoring these functions for Emacs 27.

Gemini, could you please write replacements for the functions you
removed, or defalias them to some equivalent replacements?  I agree
that public functions should not be removed, not without deprecating
them first (if indeed they don't make sense).

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40728; Package emacs. (Mon, 27 Apr 2020 20:56:01 GMT) Full text and rfc822 format available.

Message #11 received at 40728 <at> debbugs.gnu.org (full text, mbox):

From: Gemini Lasswell <gazally <at> runbox.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>, 40728 <at> debbugs.gnu.org
Subject: Re: bug#40728: 27.0.91; Removed public functions from debugger.el
Date: Mon, 27 Apr 2020 13:54:27 -0700
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> Gemini, could you please write replacements for the functions you
> removed, or defalias them to some equivalent replacements?  I agree
> that public functions should not be removed, not without deprecating
> them first (if indeed they don't make sense).

Here is a patch to bring those functions back.

[0001-Restore-some-public-functions-to-debug.el-Bug-40728.patch (text/plain, inline)]
From 6e1141592bc259bab9c61f3212351c92d0eb16e7 Mon Sep 17 00:00:00 2001
From: Gemini Lasswell <gazally <at> runbox.com>
Date: Sun, 26 Apr 2020 10:14:38 -0700
Subject: [PATCH] Restore some public functions to debug.el (Bug#40728)

In "Add backtrace-mode and use it in the debugger, ERT and Edebug", on
19 June 2018, three public functions in debug.el were removed.
Restore them so as not to break users' workflows.  Since
backtrace-mode now provides the functionality that used to come from
the buttons created by debugger-insert-backtrace, it is now obsolete.

* lisp/emacs-lisp/debug.el (debugger-insert-backtrace): New function.
Mark it as obsolete.
(debugger-toggle-locals, debug-help-follow): New aliases.

* lisp/emacs-lisp/backtrace.el (backtrace--to-string): New function.
(backtrace-to-string): Use it.  Fix whitespace.
---
 lisp/emacs-lisp/backtrace.el | 11 +++++++----
 lisp/emacs-lisp/debug.el     | 15 +++++++++++++++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index 37dad8db16..5874ba72fc 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -922,11 +922,15 @@ backtrace
   (princ (backtrace-to-string (backtrace-get-frames 'backtrace)))
   nil)
 
-(defun backtrace-to-string(&optional frames)
+(defun backtrace-to-string (&optional frames)
   "Format FRAMES, a list of `backtrace-frame' objects, for output.
 Return the result as a string.  If FRAMES is nil, use all
 function calls currently active."
-  (unless frames (setq frames (backtrace-get-frames 'backtrace-to-string)))
+  (substring-no-properties
+   (backtrace--to-string
+    (or frames (backtrace-get-frames 'backtrace-to-string)))))
+
+(defun backtrace--to-string (frames)
   (let ((backtrace-fontify nil))
     (with-temp-buffer
       (backtrace-mode)
@@ -934,8 +938,7 @@ backtrace-to-string
             backtrace-frames frames
             backtrace-print-function #'cl-prin1)
       (backtrace-print)
-      (substring-no-properties (filter-buffer-substring (point-min)
-                                                        (point-max))))))
+      (filter-buffer-substring (point-min) (point-max)))))
 
 (provide 'backtrace)
 
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index ed28997292..14957eae0f 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -320,6 +320,17 @@ debugger--print
      (message "Error in debug printer: %S" err)
      (prin1 obj stream))))
 
+(make-obsolete 'debugger-insert-backtrace
+               "use a `backtrace-mode' buffer or `backtrace-to-string'."
+               "Emacs 27.1")
+
+(defun debugger-insert-backtrace (frames do-xrefs)
+  "Format and insert the backtrace FRAMES at point.
+Make functions into cross-reference buttons if DO-XREFS is non-nil."
+  (insert (if do-xrefs
+              (backtrace--to-string frames)
+            (backtrace-to-string frames))))
+
 (defun debugger-setup-buffer (args)
   "Initialize the `*Backtrace*' buffer for entry to the debugger.
 That buffer should be current already and in debugger-mode."
@@ -527,6 +538,8 @@ debugger-eval-expression
           (let ((str (eval-expression-print-format val)))
             (if str (princ str t))))))))
 
+(defalias 'debugger-toggle-locals 'backtrace-toggle-locals)
+
 
 (defvar debugger-mode-map
   (let ((map (make-keymap)))
@@ -621,6 +634,8 @@ debugger-record-expression
 	     (buffer-substring (line-beginning-position 0)
 			       (line-end-position 0)))))
 
+(defalias 'debug-help-follow 'backtrace-help-follow-symbol)
+
 
 ;; When you change this, you may also need to change the number of
 ;; frames that the debugger skips.
-- 
2.23.1


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40728; Package emacs. (Tue, 28 Apr 2020 06:33:02 GMT) Full text and rfc822 format available.

Message #14 received at 40728 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gemini Lasswell <gazally <at> runbox.com>
Cc: p.stephani2 <at> gmail.com, 40728 <at> debbugs.gnu.org
Subject: Re: bug#40728: 27.0.91; Removed public functions from debugger.el
Date: Tue, 28 Apr 2020 09:32:20 +0300
> From: Gemini Lasswell <gazally <at> runbox.com>
> Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,  40728 <at> debbugs.gnu.org
> Date: Mon, 27 Apr 2020 13:54:27 -0700
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Gemini, could you please write replacements for the functions you
> > removed, or defalias them to some equivalent replacements?  I agree
> > that public functions should not be removed, not without deprecating
> > them first (if indeed they don't make sense).
> 
> Here is a patch to bring those functions back.

Thanks!

Philipp, any comments?  If not, I'd like to install this on the
release branch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40728; Package emacs. (Tue, 28 Apr 2020 08:27:01 GMT) Full text and rfc822 format available.

Message #17 received at 40728 <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Gemini Lasswell <gazally <at> runbox.com>, 40728 <at> debbugs.gnu.org
Subject: Re: bug#40728: 27.0.91; Removed public functions from debugger.el
Date: Tue, 28 Apr 2020 10:26:22 +0200
Am Di., 28. Apr. 2020 um 08:32 Uhr schrieb Eli Zaretskii <eliz <at> gnu.org>:
>
> > From: Gemini Lasswell <gazally <at> runbox.com>
> > Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,  40728 <at> debbugs.gnu.org
> > Date: Mon, 27 Apr 2020 13:54:27 -0700
> >
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >
> > > Gemini, could you please write replacements for the functions you
> > > removed, or defalias them to some equivalent replacements?  I agree
> > > that public functions should not be removed, not without deprecating
> > > them first (if indeed they don't make sense).
> >
> > Here is a patch to bring those functions back.
>
> Thanks!
>
> Philipp, any comments?  If not, I'd like to install this on the
> release branch.

I haven't tested the patch in detail, but it looks fine, thanks.
I guess you want to use `define-obsolete-function-alias' instead of
`defalias' to mark the aliases as obsolete as well.
The commit message should contain a magic string such as "Don't merge
to master" to prevent reinstating the functions in Emacs 28.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40728; Package emacs. (Mon, 24 Aug 2020 08:27:02 GMT) Full text and rfc822 format available.

Message #20 received at 40728 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: Gemini Lasswell <gazally <at> runbox.com>, Eli Zaretskii <eliz <at> gnu.org>,
 40728 <at> debbugs.gnu.org
Subject: Re: bug#40728: 27.0.91; Removed public functions from debugger.el
Date: Mon, 24 Aug 2020 04:26:26 -0400
Philipp Stephani <p.stephani2 <at> gmail.com> writes:

> Am Di., 28. Apr. 2020 um 08:32 Uhr schrieb Eli Zaretskii <eliz <at> gnu.org>:
>>
>> > From: Gemini Lasswell <gazally <at> runbox.com>
>> > Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,  40728 <at> debbugs.gnu.org
>> > Date: Mon, 27 Apr 2020 13:54:27 -0700
>> >
>> > Eli Zaretskii <eliz <at> gnu.org> writes:
>> >
>> > > Gemini, could you please write replacements for the functions you
>> > > removed, or defalias them to some equivalent replacements?  I agree
>> > > that public functions should not be removed, not without deprecating
>> > > them first (if indeed they don't make sense).
>> >
>> > Here is a patch to bring those functions back.
>>
>> Thanks!
>>
>> Philipp, any comments?  If not, I'd like to install this on the
>> release branch.
>
> I haven't tested the patch in detail, but it looks fine, thanks.
> I guess you want to use `define-obsolete-function-alias' instead of
> `defalias' to mark the aliases as obsolete as well.
> The commit message should contain a magic string such as "Don't merge
> to master" to prevent reinstating the functions in Emacs 28.

It seems like the patch here was never installed on the release branch.

Should it be?

Best regards,
Stefan Kangas




Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 12:41:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40728; Package emacs. (Thu, 01 Oct 2020 18:05:01 GMT) Full text and rfc822 format available.

Message #25 received at 40728 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Gemini Lasswell <gazally <at> runbox.com>,
 Philipp Stephani <p.stephani2 <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 40728 <at> debbugs.gnu.org
Subject: Re: bug#40728: 27.0.91; Removed public functions from debugger.el
Date: Thu, 01 Oct 2020 20:04:17 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

>> I haven't tested the patch in detail, but it looks fine, thanks.
>> I guess you want to use `define-obsolete-function-alias' instead of
>> `defalias' to mark the aliases as obsolete as well.
>> The commit message should contain a magic string such as "Don't merge
>> to master" to prevent reinstating the functions in Emacs 28.

I applied the patch now, but I forgot about this bit...  but...  I think
they should be merged to Emacs 28?  They shouldn't disappear again
between Emacs 27 and Emacs 28.

I've made the aliases obsolete, though.

> It seems like the patch here was never installed on the release branch.

Done now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 01 Oct 2020 18:05:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 40728 <at> debbugs.gnu.org and Philipp Stephani <p.stephani2 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 01 Oct 2020 18:05:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40728; Package emacs. (Sun, 04 Oct 2020 18:52:02 GMT) Full text and rfc822 format available.

Message #32 received at 40728 <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Gemini Lasswell <gazally <at> runbox.com>, Eli Zaretskii <eliz <at> gnu.org>,
 Stefan Kangas <stefan <at> marxist.se>, 40728 <at> debbugs.gnu.org
Subject: Re: bug#40728: 27.0.91; Removed public functions from debugger.el
Date: Sun, 4 Oct 2020 20:51:06 +0200
Am Do., 1. Okt. 2020 um 20:04 Uhr schrieb Lars Ingebrigtsen <larsi <at> gnus.org>:
>
> Stefan Kangas <stefan <at> marxist.se> writes:
>
> >> I haven't tested the patch in detail, but it looks fine, thanks.
> >> I guess you want to use `define-obsolete-function-alias' instead of
> >> `defalias' to mark the aliases as obsolete as well.
> >> The commit message should contain a magic string such as "Don't merge
> >> to master" to prevent reinstating the functions in Emacs 28.
>
> I applied the patch now, but I forgot about this bit...  but...  I think
> they should be merged to Emacs 28?  They shouldn't disappear again
> between Emacs 27 and Emacs 28.
>
> I've made the aliases obsolete, though.
>
> > It seems like the patch here was never installed on the release branch.
>
> Done now.

Unfortunately I think this is now too late. Emacs 27.1 has been
released, the incompatible change has been made, and package authors
will need to cope with it.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 02 Nov 2020 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 147 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.