unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40728: 27.0.91; Removed public functions from debugger.el
@ 2020-04-20  8:21 Philipp Stephani
  2020-04-20 15:24 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Philipp Stephani @ 2020-04-20  8:21 UTC (permalink / raw)
  To: 40728


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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40728: 27.0.91; Removed public functions from debugger.el
  2020-04-20  8:21 bug#40728: 27.0.91; Removed public functions from debugger.el Philipp Stephani
@ 2020-04-20 15:24 ` Eli Zaretskii
  2020-04-27 20:54   ` Gemini Lasswell
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2020-04-20 15:24 UTC (permalink / raw)
  To: Philipp Stephani, Gemini Lasswell; +Cc: 40728

> From: Philipp Stephani <p.stephani2@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40728: 27.0.91; Removed public functions from debugger.el
  2020-04-20 15:24 ` Eli Zaretskii
@ 2020-04-27 20:54   ` Gemini Lasswell
  2020-04-28  6:32     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Gemini Lasswell @ 2020-04-27 20:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Philipp Stephani, 40728

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

Eli Zaretskii <eliz@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.


[-- Attachment #2: 0001-Restore-some-public-functions-to-debug.el-Bug-40728.patch --]
[-- Type: text/plain, Size: 3693 bytes --]

From 6e1141592bc259bab9c61f3212351c92d0eb16e7 Mon Sep 17 00:00:00 2001
From: Gemini Lasswell <gazally@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)
+
 \f
 (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)
+
 \f
 ;; When you change this, you may also need to change the number of
 ;; frames that the debugger skips.
-- 
2.23.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#40728: 27.0.91; Removed public functions from debugger.el
  2020-04-27 20:54   ` Gemini Lasswell
@ 2020-04-28  6:32     ` Eli Zaretskii
  2020-04-28  8:26       ` Philipp Stephani
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2020-04-28  6:32 UTC (permalink / raw)
  To: Gemini Lasswell; +Cc: p.stephani2, 40728

> From: Gemini Lasswell <gazally@runbox.com>
> Cc: Philipp Stephani <p.stephani2@gmail.com>,  40728@debbugs.gnu.org
> Date: Mon, 27 Apr 2020 13:54:27 -0700
> 
> Eli Zaretskii <eliz@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40728: 27.0.91; Removed public functions from debugger.el
  2020-04-28  6:32     ` Eli Zaretskii
@ 2020-04-28  8:26       ` Philipp Stephani
  2020-08-24  8:26         ` Stefan Kangas
  0 siblings, 1 reply; 8+ messages in thread
From: Philipp Stephani @ 2020-04-28  8:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Gemini Lasswell, 40728

Am Di., 28. Apr. 2020 um 08:32 Uhr schrieb Eli Zaretskii <eliz@gnu.org>:
>
> > From: Gemini Lasswell <gazally@runbox.com>
> > Cc: Philipp Stephani <p.stephani2@gmail.com>,  40728@debbugs.gnu.org
> > Date: Mon, 27 Apr 2020 13:54:27 -0700
> >
> > Eli Zaretskii <eliz@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40728: 27.0.91; Removed public functions from debugger.el
  2020-04-28  8:26       ` Philipp Stephani
@ 2020-08-24  8:26         ` Stefan Kangas
  2020-10-01 18:04           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2020-08-24  8:26 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: Gemini Lasswell, 40728

Philipp Stephani <p.stephani2@gmail.com> writes:

> Am Di., 28. Apr. 2020 um 08:32 Uhr schrieb Eli Zaretskii <eliz@gnu.org>:
>>
>> > From: Gemini Lasswell <gazally@runbox.com>
>> > Cc: Philipp Stephani <p.stephani2@gmail.com>,  40728@debbugs.gnu.org
>> > Date: Mon, 27 Apr 2020 13:54:27 -0700
>> >
>> > Eli Zaretskii <eliz@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40728: 27.0.91; Removed public functions from debugger.el
  2020-08-24  8:26         ` Stefan Kangas
@ 2020-10-01 18:04           ` Lars Ingebrigtsen
  2020-10-04 18:51             ` Philipp Stephani
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-01 18:04 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Gemini Lasswell, Philipp Stephani, 40728

Stefan Kangas <stefan@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#40728: 27.0.91; Removed public functions from debugger.el
  2020-10-01 18:04           ` Lars Ingebrigtsen
@ 2020-10-04 18:51             ` Philipp Stephani
  0 siblings, 0 replies; 8+ messages in thread
From: Philipp Stephani @ 2020-10-04 18:51 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Gemini Lasswell, Stefan Kangas, 40728

Am Do., 1. Okt. 2020 um 20:04 Uhr schrieb Lars Ingebrigtsen <larsi@gnus.org>:
>
> Stefan Kangas <stefan@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-10-04 18:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-20  8:21 bug#40728: 27.0.91; Removed public functions from debugger.el Philipp Stephani
2020-04-20 15:24 ` Eli Zaretskii
2020-04-27 20:54   ` Gemini Lasswell
2020-04-28  6:32     ` Eli Zaretskii
2020-04-28  8:26       ` Philipp Stephani
2020-08-24  8:26         ` Stefan Kangas
2020-10-01 18:04           ` Lars Ingebrigtsen
2020-10-04 18:51             ` Philipp Stephani

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).