emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: OS X python.el completion issue


From: Steven Huwig
Subject: Re: OS X python.el completion issue
Date: Mon, 28 Mar 2005 21:15:41 -0500


On Mar 28, 2005, at 1:28 PM, Stefan Monnier wrote:

I installed a slightly different patch (halfway between yours and mine).
Can you try it?

Almost there, just that compare-strings seems to have confusing semantics.
This patch against the latest CVS works for me.

--- lisp/progmodes/python.el    28 Mar 2005 14:36:24 -0000      1.26
+++ lisp/progmodes/python.el    29 Mar 2005 02:13:57 -0000
@@ -1126,9 +1126,9 @@
          "")
        ((string-match ".*\n" s)
         s)
- ((or (eq t (compare-strings s nil nil "_emacs_ok\n" nil (length s)))
-            (eq t (compare-strings s nil nil "_emacs_out " nil
- (min (length "_emacs_out ") (length s)))))
+    ((let ((end (min (length "_emacs_out ") (length s))))
+ (or (eq t (compare-strings s nil nil "_emacs_ok\n" nil (length s)))
+           (eq t (compare-strings s nil end "_emacs_out " nil end))))
         (setq python-preoutput-leftover s)
         "")
         (t s)))


Your code special-cased the case when the emacs_out line is cut, but what is
really happenning is that we may receive Python's output in chunks of
arbitrary sizes: from one-byte at a time to several lines at a time
(depending on many different factors), so the problem exists for all kinds
of output.


I love it when a plan comes together. :)


Thanks,
Steven Huwig





reply via email to

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