unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13163: 24.3.50; Unloading edebug renders Emacs unusable
@ 2012-12-12 22:29 Stephen Berman
  2012-12-13  2:36 ` Juanma Barranquero
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Berman @ 2012-12-12 22:29 UTC (permalink / raw)
  To: 13163

In GNU Emacs 24.3.50.6 (x86_64-suse-linux-gnu, GTK+ Version 3.4.4)
 of 2012-12-03 on rosalinde
Bzr revision: 111073 dmantipov@yandex.ru-20121203080602-hwv4fug7bvt2red7
Windowing system distributor `The X.Org Foundation', version 11.0.11203000
System Description:	openSUSE 12.2 (x86_64)

Configured using:
 `configure '--without-toolkit-scroll-bars' 'CFLAGS=-g3 -O0''

0. emacs -Q
1. Instrument a defun for Edebug, e.g. type `C-u C-M-x' on find-files in
   lisp/files.el. 
3. Type `M-x unload-feature RET edebug RET'.
=> Emacs becomes effectively unusable: typing e.g. `M-x', `C-n', `C-p',
   `C-x b', `C-h f', `C-h v', etc. raises either of the errors "Error in
   post-command-hook (global-font-lock-mode-check-buffers):
   (void-function edebug--called-interactively-skip)" or
   "run-hook-with-args-until-success: Symbol's function definition is
   void: edebug--called-interactively-skip".  (However, some commands
   still work, e.g `C-h e', `C-x s', `C-x 2', `C-x C-c' -- at least with
   -Q; but when I hit this bug in a session started with my init-file,
   at least `C-x C-c' failed, and I had to kill Emacs externally.)

I suspect this bug was introduced by this change:

revno: 110955
committer: Stefan Monnier <monnier@iro.umontreal.ca>
branch nick: trunk
timestamp: Mon 2012-11-19 23:24:09 -0500
message:
  Make called-interactively-p work for edebug or advised code.
  * lisp/subr.el (called-interactively-p-functions): New var.
  (internal--called-interactively-p--get-frame): New macro.
  (called-interactively-p, interactive-p): Rewrite in Lisp.
  * lisp/emacs-lisp/nadvice.el (advice--called-interactively-skip): New fun.
  (called-interactively-p-functions): Use it.
  * lisp/emacs-lisp/edebug.el (edebug--called-interactively-skip): New fun.
  (called-interactively-p-functions): Use it.
  * lisp/allout.el (allout-called-interactively-p): Don't assume
  called-interactively-p is a subr.
  * src/eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
  (syms_of_eval): Remove corresponding defsubr.
  * src/bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
  * test/automated/advice-tests.el (advice-tests--data): Remove.
  (advice-tests): Move the tests directly here instead.
  Add called-interactively-p tests.

The bug does not happen with my trunk build from revision 110951 (my
last build prior to the above change) but it does happen with my trunk
builds from later revisions than the above.





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

* bug#13163: 24.3.50; Unloading edebug renders Emacs unusable
  2012-12-12 22:29 bug#13163: 24.3.50; Unloading edebug renders Emacs unusable Stephen Berman
@ 2012-12-13  2:36 ` Juanma Barranquero
  2012-12-13  9:09   ` Stephen Berman
  0 siblings, 1 reply; 4+ messages in thread
From: Juanma Barranquero @ 2012-12-13  2:36 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 13163

[-- 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


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

* bug#13163: 24.3.50; Unloading edebug renders Emacs unusable
  2012-12-13  2:36 ` Juanma Barranquero
@ 2012-12-13  9:09   ` Stephen Berman
  2012-12-13  9:48     ` Juanma Barranquero
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Berman @ 2012-12-13  9:09 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 13163

On Thu, 13 Dec 2012 03:36:54 +0100 Juanma Barranquero <lekktu@gmail.com> wrote:

> 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.

The patch fixes the bug; thanks.

Steve Berman





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

* bug#13163: 24.3.50; Unloading edebug renders Emacs unusable
  2012-12-13  9:09   ` Stephen Berman
@ 2012-12-13  9:48     ` Juanma Barranquero
  0 siblings, 0 replies; 4+ messages in thread
From: Juanma Barranquero @ 2012-12-13  9:48 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 13163-done

> The patch fixes the bug; thanks.

Thanks, installed as revno:111217.





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

end of thread, other threads:[~2012-12-13  9:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 22:29 bug#13163: 24.3.50; Unloading edebug renders Emacs unusable Stephen Berman
2012-12-13  2:36 ` Juanma Barranquero
2012-12-13  9:09   ` Stephen Berman
2012-12-13  9:48     ` Juanma Barranquero

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).