[IPython-user] Hate "working on region in file blah blah" when using python-mode.el

Bo Peng ben.bob at gmail.com
Sat Dec 11 01:45:57 CST 2004


These messages are totally meaningless. Why cannot it be the code
actually being executed? I have modified python-mode.el

==> insert the following line 
  (setq text-to-be-executed (concat
          (mapconcat 'identity (split-string (buffer-string) "\n")  "\n... " )
          "\n")
        )
===> before this. (line 1700?)
        (write-region (point-min) (point-max) file nil 'nomsg))
      (if (not py-file-queue)
          (py-execute-file proc file)

===> and change 
       (msg (format "## working on region in file %s...\n" filename))
===> to (line 1303?)
        (msg text-to-be-executed)

so that when I execute a region
a=5
print a

I get in python buffer

>>> a=5
... print a
5
>>> 

As a matter of fact, S-mode (for R or S-plus), matlab-mode all work in
this way and I see no reason why we should tolerate "working on region
in ..." any more.

Bo




More information about the IPython-user mailing list