emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs.py: catch all errors in eargs()


From: Stefan Monnier
Subject: Re: emacs.py: catch all errors in eargs()
Date: Wed, 30 Aug 2006 17:11:10 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> The following patch ensures that _emacs_out sentinel is *always*
> printed, regardless of what "name" could be. This is necessary for
> proper handling of eldoc-mode in python.el

> Current code hangs emacs on my machine when I enable eldoc-mode and put
> point over non-function like "print".

Thanks, I'll lok at it.  But this is large enough with previous
contributions that I'm beginning to feel like I should need until your legal
paperwork comes in before committing it.

> BTW, shouldn't it *always* be possible to interrupt emacs by C-g? In my

Yes.

> case even C-g doesn't work, I have to kill emacs... I assume

Looks like a bug in python.el where we fail to re-enable C-g before doing
the accept-process-output (C-g is disabled by inhibit-quit when running
timers and such).  I installed the patch below which should fix it.


        Stefan


Index: python.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/python.el,v
retrieving revision 1.45
diff -u -u -b -r1.45 python.el
--- python.el   28 Aug 2006 21:58:27 -0000      1.45
+++ python.el   30 Aug 2006 21:09:30 -0000
@@ -1599,6 +1599,8 @@
 instance.  Assumes an inferior Python is running."
   (let ((symbol (with-syntax-table python-dotty-syntax-table
                  (current-word))))
+    ;; This is run from timers, so inhibit-quit tends to be set.
+    (with-local-quit
     ;; First try the symbol we're on.
     (or (and symbol
             (python-send-receive (format "emacs.eargs(%S, %s)"
@@ -1616,7 +1618,7 @@
                      (python-send-receive
                       (format "emacs.eargs(%S, %s)"
                               (buffer-substring-no-properties (point) point)
-                              python-imports)))))))))))
+                                 python-imports))))))))))))
 
 ;;;; Info-look functionality.
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]