unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 13163@debbugs.gnu.org
Subject: bug#13163: 24.3.50; Unloading edebug renders Emacs unusable
Date: Thu, 13 Dec 2012 03:36:54 +0100	[thread overview]
Message-ID: <CAAeL0ST045PUURVVOOBVmuNuCG_dPigMQk8fbD7KyW+TDXHKJA@mail.gmail.com> (raw)
In-Reply-To: <87r4mux5tq.fsf@rosalinde.fritz.box>

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

On Wed, Dec 12, 2012 at 11:29 PM, Stephen Berman <stephen.berman@gmx.net> wrote:

> 3. Type `M-x unload-feature RET edebug RET'.
> => Emacs becomes effectively unusable:

Please, try the attached patch and report back any remaining trouble.

TIA,

  Juanma

[-- Attachment #2: edebug.patch --]
[-- Type: application/octet-stream, Size: 1620 bytes --]

=== modified file 'lisp/emacs-lisp/edebug.el'
--- lisp/emacs-lisp/edebug.el	2012-11-20 04:24:09 +0000
+++ lisp/emacs-lisp/edebug.el	2012-12-13 02:33:30 +0000
@@ -4258,12 +4258,13 @@
 ;;; Autoloading of Edebug accessories
 
 ;; edebug-cl-read and cl-read are available from liberte@cs.uiuc.edu
+(defun edebug--require-cl-read ()
+  (require 'edebug-cl-read))
+
 (if (featurep 'cl-read)
-    (add-hook 'edebug-setup-hook
-	      (function (lambda () (require 'edebug-cl-read))))
+    (add-hook 'edebug-setup-hook #'edebug--require-cl-read)
   ;; The following causes edebug-cl-read to be loaded when you load cl-read.el.
-  (add-hook 'cl-read-load-hooks
-	    (function (lambda () (require 'edebug-cl-read)))))
+  (add-hook 'cl-read-load-hooks #'edebug--require-cl-read))
 
 \f
 ;;; Finalize Loading
@@ -4289,6 +4290,24 @@
 ;; Install edebug read and eval functions.
 (edebug-install-read-eval-functions)
 
+(defun edebug-unload-function ()
+  "Unload the Edebug source level debugger."
+  (when edebug-active
+    (unwind-protect
+        (abort-recursive-edit)
+      (setq edebug-active nil)
+      (edebug-unload-function)))
+  (save-current-buffer
+    (dolist (buffer (buffer-list))
+      (set-buffer buffer)
+      (when (eq major-mode 'edebug-mode) (emacs-lisp-mode))))
+  (remove-hook 'called-interactively-p-functions
+               'edebug--called-interactively-skip)
+  (remove-hook 'cl-read-load-hooks 'edebug--require-cl-read)
+  (edebug-uninstall-read-eval-functions)
+  ;; continue standard unloading
+  nil)
+
 (provide 'edebug)
 
 ;;; edebug.el ends here


  reply	other threads:[~2012-12-13  2:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 22:29 bug#13163: 24.3.50; Unloading edebug renders Emacs unusable Stephen Berman
2012-12-13  2:36 ` Juanma Barranquero [this message]
2012-12-13  9:09   ` Stephen Berman
2012-12-13  9:48     ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAeL0ST045PUURVVOOBVmuNuCG_dPigMQk8fbD7KyW+TDXHKJA@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=13163@debbugs.gnu.org \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).