Giter Club home page Giter Club logo

pymacs's Introduction

Pymacs — Notes

Known translations

DocumentLanguageTranslatorDate
This fileBelorussianPaul Bukhovko
This fileGermanAnastasiya Romanova[2012-04-09]
Pymacs manualRomanianAlexander Ovsov

Pymacs is a powerful tool which, once started from Emacs, allows both-way communication between Emacs Lisp and Python. Pymacs aims Python as an extension language for Emacs rather than the other way around, and this asymmetry is reflected in some design choices. Within Emacs Lisp code, one may load and use Python modules. Python functions may themselves use Emacs services, and handle Emacs Lisp objects kept in Emacs Lisp space.

The Pymacs manual (either in HTML format or PDF format) has installation instructions, a full description of the API, pointers to documented examples, to resources, and to other Pymacs sites or projects. The distribution also includes the Poor’s Python Pre-Processor (pppp) and its manual (either in HTML format or PDF format).

Source files and various distributions are available through https://github.com/pinard/Pymacs/. Please report problems, comments and suggestions to François Pinard.

Notes for 0.25

<<2012-05-07>> [2012-05-07 lun] Hi everybody.

Pymacs 0.25 is now available. You may fetch it as one of:

depending on if you want a tar or zip archive.

The installation process was modified:

  • Python 3 is now supported. This required new installation mechanics, and a Python pre-processor written for the circumstance (named pppp).
  • Pymacs now installs a single Python file instead of a Python module. This does not affect users — except maybe a few who chose to depend on undocumented internals.

The specifications are pretty stable. A few additions occurred:

  • Variable pymacs-python-command may select which Python interpreter to use.
  • A pymacs-auto-restart variable lets the user decide what to do if the Pymacs helper aborts.
  • The Let class got a pops method which pops everything in a single call.
  • A new API function pymacs-autoload serves lazy imports.

There also are miscellaneous changes:

  • Some errors have been corrected, both in the code and in the manual.
  • The Emacs Lisp source has been massaged so to become uploadable in ELPA’s (Emacs Lisp Packages Archives).

XEmacs support seems to be broken, and Jython 2.2 support does not work yet. As I am not much of a user of either, this is kept on ice currently. Interested collaborators and testers, contact me if you feel like pushing in these areas!

Nice thanks to Pymacs contributors. It was much fun working with you all!

Notes for 0.24

Whenever I tag a version -betaN or such, it might not be fully ready for public distribution, this is a welcome defect that ELPA cannot grok such versions. Someone wanting to upload Pymacs nevertheless found his way around the limitation by renaming the version, I guess from 0.24-beta2 to 0.24. Undoubtedly, it would have been polite to check with me first… As beta releases come before real releases, it should really have been 0.23. Anyway, Marmelade now has a Pymacs 0.24. For avoiding any more confusion, I’m skipping 0.24 — such a version does not officially exist.

Notes for 0.23

<<2008-02-15>> [2008-02-15 ven] Hello to everybody, and Emacs users in the Python community.

Here is Pymacs 0.23! There has been a while, so I advise current Pymacs users to switch with caution. All reported bugs have been squashed, if we except one about Emacs quit (C-g) not being obeyed gracefully. A few suggestions have been postponed, to be pondered later.

The manual is now in reST format, and everything Allout is gone. Postscript and PDF files are not anymore part of the distribution, you may find them on the Web site, or use the Makefile if you have needed tools. Examples have been moved out of the manual into a new contrib/ subdirectory, which also holds a few new contributions. The example of a Python back-end for Emacs Gnus has been deleted.

Python 1.5.2 compatibility has been dropped; use Python 2.2 or better. The Pymacs manual explains installation procedure, now simplified. The pymacs-services script is gone, this should ease installing Pymacs on MS Windows. There is also a small, still naive validation suite.

The communication protocol has been revised: more clarity, less magic. Zombie objects are less dreadful by default. The API now supports False and True constants, and Unicode strings (within limits set by Emacs).

Special thanks to those who helped me at creating or testing this release.

Informal notes

<<2012-05-06>> python-mode.el difficulty

[2012-05-07 lun] After I recently acquired a new machine and installed a flurry of software on it, I was saluted with:

pymacs-report-error: Pymacs helper did not start within 30 seconds

The problem turns out to come from python-mode.el (a development copy), which insists on providing and using its own older copy of Pymacs. The problem shows in the Pymacs communication buffer: a failed attempt at importing Pymacs/__init__.py. Indeed, this file does not exist anymore. Pymacs now stands as a single file on the Python side, not as a module. This yields confusion at run time. The problem vanishes if I comment out python-mode.el initialization, or more simply (thanks holmboe) if py-load-pymacs-p is set to nil. I’ll talk to Andreas Röhler about this.

<<2012-05-07>> Using packagers

[2012-05-07 lun] Gleb Peregud suggests on GitHub that we prepare an ELPA/Marmalade package for Pymacs. There is also a Python side to be addressed, and I’ve been lucky enough to recently meet Éric Araujo, the distutils2 / packaging maintainer. The time might be proper to push a bit on the idea on getting Pymacs on installers.

I saved a few notes on Emacs Packaging. After having pondering them, I’ll follow Gleb’s advice, at least to get started and experiment. Emacs packagers do not care about Python, and Python packagers ignore Emacs Lisp installation problems. The pre-processing step in Pymacs is another source of concern. In a word, I’ll save the bottle of champagne for some later time! ☺

There is some complexity in installers, both on Emacs and Python sides. It’s quite amusing: proponents of either side want an installer, and dismiss as trivial the problem of installing the other side. Emacs users tell me: Set PYTHONPATH approprietely and forget about it. Python users tell me: Just put pymacs.el somewhere it will work, or ask the user. My feeling is that to do nicely implies both an Emacs installer and a Python installer. There is difference of perspective as well: for users, simplicity means both; for the maintainer, simplicity means neither ☺.

pymacs's People

Contributors

bravegnu avatar leoliu avatar pinard avatar schmir avatar tarsius avatar tkf avatar yesudeep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pymacs's Issues

A serious bug: return a form that eval'd to a string in place of a string

While returning a list of strings from python, I see one element like this:

(decode-coding-string "/Applications/Microsoft Office 2011/Office/\345\212\240\350\275\275\351\241\271/Solver.app" 'utf-8)

This is completely wrong.

It seems the solution is to return `("str1" "str2" ,(decode-coding-string "str3" 'utf-8) ...)

Warning:variable assignment to constant `enable-multibyte-characters'

i use ubuntu, and i try to lots of times install pymacs, but failed. The message is
''Compiling file /usr/share/emacs/site-lisp/Pymacs/pymacs.el at Tue Aug 21 23:42:08 2012
Entering directory /usr/share/emacs/site-lisp/Pymacs/' pymacs.el:82:13:Warning: variable assignment to constantenable-multibyte-characters' ".

Respect debug-on-error for error reporting

At the moment, pymacs returns a full backtrace for error. The backtrace is usually mutli-line and causes the minibuffer to enlarge, which is visually disturbing. In the following patch pymacs is made to respect debug-on-error.

leoliu@af0d659

pppp does not appear to be working

So I'm trying to get freex working with Emacs 24. When I run it I get this error: Pymacs helper did not start within 30 seconds and in the *Pymacs* buffer I see:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/Elliot/.emacs.d/el-get/pymacs/Pymacs.py", line 40, in <module>
    if PYTHON3:
NameError: name 'PYTHON3' is not defined

Process pymacs exited abnormally with code 1

This seems to be because pppp is not substituting the preprocessor symbols with any value. I tried running make -k prepare but didn't see any suspicious output. Any idea of what is happening?

My setup is: Windows 8, Cygwin Emacs24 & Cygwin Python.

latest Pymacs cannot load ropemacs

My Pymacs of 2011-12-15 loads ropemacs nicely. I just installed the latest Pymacs and ran:

(pymacs-load "ropemacs" "rope-")

after this, ropemacs-local-keymap is still undefined.

Any idea what might break it? Thanks.

Unable to call a python method imported as a handle

The Pymacs 0.25 manual has the following snippet in Section 3.4.2

(pymacs-exec "import re")
(setq matcher (pymacs-eval "re.compile('PATTERN').match"))
(pymacs-call matcher "PATTERN123")

In Emacs24.2 on Ubuntu 12.04 (32-bit) with Python 2.7.3, the first two statements execute fine, but the third one throws the following error:

pymacs-report-error: Python: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Pymacs.py", line 268, in loop
    value = eval(text)
  File "<string>", line 1
    (lambda (&rest arguments) (pymacs-apply (quote (pymacs-python . 5)) arguments))(".")

I don't know a lot of Elisp, but the lambda statement itself evaluates without any errors with C-x C-e, so I don't know what's going wrong. Please help?

pymacs fails with AttributeError: 'NoProject' object has no attribute 'address'

I am running Fedora Core 15 with python 2.7.1 and GNU Emacs 23.3.1. I've also tried the same with emacs 24 built from source with same results. I am running rope from:

https://github.com/gabrielelanaro/emacs-for-python

Reproduce as follows:

open emacs with python file
select 3 lines of method
rope/refactor/method
enter .ropeproject as directory
enter dog as method name
confirm

get the following output:

pymacs-report-error: Python: Traceback (most recent call last):
File "/home/watson/.emacs.d/python-libs/Pymacs/pymacs.py", line 250, in loop
value = eval(text)
File "", line 1, in
File "/home/watson/.emacs.d/python-libs/ropemode/decorators.py", line 53, in newfunc
return func(_args, *_kwds)
File "/home/watson/.emacs.d/python-libs/ropemode/interface.py", line 52, in do_refactor
refactoring(self, self.env).show(initial_asking=initial_asking)
File "/home/watson/.emacs.d/python-libs/ropemode/refactor.py", line 45, in show
self._perform(changes)
File "/home/watson/.emacs.d/python-libs/ropemode/refactor.py", line 94, in _perform
interrupts=False)
File "/home/watson/.emacs.d/python-libs/ropemode/refactor.py", line 469, in runtask
return RunTask(env, command, name, interrupts)()
File "/home/watson/.emacs.d/python-libs/ropemode/refactor.py", line 489, in call
result = self.task(handle)
File "/home/watson/.emacs.d/python-libs/ropemode/refactor.py", line 90, in perform
self.project.do(changes, task_handle=handle)
File "/home/watson/.emacs.d/python-libs/rope/base/project.py", line 72, in do
self.history.do(changes, task_handle=task_handle)
File "/home/watson/.emacs.d/python-libs/rope/base/history.py", line 39, in do
if self._is_change_interesting(changes):
File "/home/watson/.emacs.d/python-libs/rope/base/history.py", line 50, in _is_change_interesting
if not self.project.is_ignored(resource):
File "/home/watson/.emacs.d/python-libs/rope/base/project.py", line 198, in is_ignored
return self.ignored.does_match(resource)
File "/home/watson/.emacs.d/python-libs/rope/base/resources.py", line 199, in does_match
path = os.path.join(resource.project.address,
AttributeError: 'NoProject' object has no attribute 'address'

unicode handling

I ran into unicode problems this morning. I need to pass a file with unicode chars (Chinese in my case), and Pymacs cannot handle it.

I apply this patch and it is working.

--- pymacs.el2  2012-02-23 04:28:52.000000000 +0800
+++ pymacs.el   2012-02-26 12:10:55.000000000 +0800
@@ -506,7 +506,7 @@
                                  (split-string (prin1-to-string text) "\n")
                                  "\\n"))
                (when multibyte
-                 (princ ".encode('ISO-8859-1').decode('UTF-8')")))
+                 (princ ".decode('UTF-8')")))
              (setq done t)))
           ((symbolp expression)
            (let ((name (symbol-name expression)))

i.e. it removes the .encode('ISO-8859-1') bit.

My question is why encode it with ISO-8859-1 when the multibyte text has been previously decoded as utf-8 in emacs like this:

(encode-coding-string expression 'utf-8)

Isn't this contradictory?

FYI I made virtualenv wrapper for Emacs Lisp. It could help Pymacs installation problems.

I made virtualenv wrapper for Emacs Lisp to help installation of Emacs packages relying on Python modules: python-environment.el. I think it would help Pymacs installation.

You can just define a command like the following so that user can just do M-x pymacs-make-env to setup Python side of Pymacs.

(defun pymacs-make-env ()
  (interactive)
  (python-environment-run '("pip" "install" "Pymacs")))

I am requesting for comment before fixing the API. If you are interested, please come in: tkf/emacs-python-environment#1

sys.exc_info used as a property

sys.exc_info is a function, but is used as a property.

*** Pymacs/Pymacs.py.in
--- #<buffer Pymacs.py.in>
***************
*** 233,239 ****
                      action = 'raise'
                      if lisp.debug_on_error.value() is None:
                          value = traceback.format_exception_only(
!                             sys.exc_info[0], sys.exc_info[1])
                          value = ''.join(value).rstrip()
                      else:
                          value = traceback.format_exc()
--- 233,239 ----
                      action = 'raise'
                      if lisp.debug_on_error.value() is None:
                          value = traceback.format_exception_only(
!                             sys.exc_info()[0], sys.exc_info()[1])
                          value = ''.join(value).rstrip()
                      else:
                          value = traceback.format_exc()

Diff finished.  Sun Nov  4 11:54:48 2012

Pymacs caused large slowdown of emacs

When I used pymacs it slowed down significantly, even in c++-mode (on rather new processor moving a cursor from line to line took seconds, etc.).

My code from .emacs.d/init.el:

(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)
(pymacs-load "ropemacs" "rope-")
(setq ropemacs-enable-autoimport t)

(The problem diappeard after commenting out this section).

Byte compile warning 'interactive-p' on Emacs 24.1

Here is error.

pymacs.el:196:21:Warning: 'interactive-p' is an obsolete function (as of
23.2); use 'called-interactively-p' instead.

In pymacs-exec:
pymacs.el:206:21:Warning: 'interactive-p' is an obsolete function (as of
23.2); use 'called-interactively-p' instead.

pymacs-load-history

I remembered when first tried out pymacs I was asked this question: Killing the Pymacs helper might create zombie objects. To be honest even today I have only vague idea what it is.

So I just started using something in this patch: https://gist.github.com/2576300 and find it to be useful. It turns out it will capture most important things users care about. I haven't tested it thoroughly but posted here so that I can have input from other than myself.

Thanks.
Leo

Fix for python3.2

Hi,

I think you should add an if statement for the config scripts when python3 is specified:

  1. in pymac.el remove the lines (str objects are UTF-8 by default):
    (when multibyte
    (princ ".decode('UTF-8')"))
  2. in Pymacs.py modify to (sys.exc_type and value are removed):
    value = traceback.format_exception_only(sys.exc_info()[0],
    sys.exc_info()[1])

MAC OS X pymacs in emacs executing ERROR

Steps I have done:

  1. copy pymacs.el.in in .emacs.d folder
  2. rename it to pymacs.el
  3. add it to emacs config:
    (defun load-ropemacs ()
    "Load pymacs and ropemacs"
    (interactive)
    (require 'pymacs)
    (pymacs-load "ropemacs" "rope-")
    ;; Automatically save project python buffers before refactorings
    (setq ropemacs-confirm-saving 'nil)
    )
    (global-set-key "\C-xpl" 'load-ropemacs)

After hitting "C-x p l" I have ERR:
Debugger entered--Lisp error: (void-variable @DEFADVICE_OK@)
(if @DEFADVICE_OK@ (progn (progn (ad-add-advice (quote documentation) (quote (pymacs-ad-documentation nil t (advice lambda nil (let* ... ...)))) (quote around) (quote nil)) (ad-activate (quote documentation) nil) (quote documentation))))
eval-buffer(#<buffer load> nil "/Users/../.emacs.d/packs/pymacs.el" nil t) ; Reading at buffer position 11290
load-with-code-conversion("/Users/../.emacs.d/packs/pymacs.el" "/Users/../.emacs.d/packs/pymacs.el" nil t)
require(pymacs)
load-ropemacs()
call-interactively(load-ropemacs nil nil)
command-execute(load-ropemacs)

Is there any way to install pymacs from Pypi

when i search using pip(pip search pymacs), it shows that pymacs is fine in Pypi, but I can't install it through python pip.

% pip install pymacs
Downloading/unpacking pymacs
Could not find any downloads that satisfy the requirement pymacs
No distributions at all found for pymacs

I have searched a similar post related to Pypi, jdunck/python-unicodecsv#4.

and, pypi says:

"
Package Authors

To submit a package use "python setup.py upload" (full tutorial). The index also hosts documentation. You may submit packages using SSH or the web form. You must register.
"

so maybe only the author can register and upload a package to Pypi?

thanks for this package.

"make check" fails on OS X Leopard

Looks like 2.6-ism has crept in. "make check" fails on OS X Leopard (Python 2.5.1) with the following:

/tmp/Pymacs-0.24-beta2 387 % make check
make check
rm -f tests/debug-protocol tests/debug-signals
python p4 -C p4config.py pymacs.el.in Pymacs tests
cd tests && \
  EMACS="emacs" PYTHON="python" \
  PYMACS_OPTIONS="-d debug-protocol -s debug-signals" \
  python pytest -f t 
  File "pytest", line 417
    traceback.print_exception(*exception, file=tracing)
                                         ^
SyntaxError: invalid syntax
make: *** [check] Error 1
/tmp/Pymacs-0.24-beta2 388 % 

That line should read "traceback.print_exception(exception[0], exception[1], exception[2], file=tracing)"

After fixing that in pytest.in, I get the following error:

/tmp/Pymacs-0.24-beta2 398 % make check
rm -f tests/debug-protocol tests/debug-signals
python p4 -C p4config.py pymacs.el.in Pymacs tests
cd tests && \
      EMACS="emacs" PYTHON="python" \
      PYMACS_OPTIONS="-d debug-protocol -s debug-signals" \
      python pytest -f t 
./t01_p4_works.py ·····························································
   62 ············ (73)
./t10_pyfile_loads.py · (1)
./t11_pyfile_works.py ·························································
   58 ··································· (92)
./t20_helper_loads.py E (1)
./t21_helper_works.py ···············································
Summary: one FAILED test, 213 good in 0.25 seconds.
Traceback (most recent call last):
  File "pytest", line 513, in <module>
    main(*sys.argv[1:])
  File "pytest", line 174, in main
    self.handle_module(file_name, module)
  File "pytest", line 325, in handle_module
    module.teardown_module(module)
  File "./t21_helper_works.py", line 13, in teardown_module
    setup.stop_python()
  File "./setup.py", line 207, in stop_python
    Python.services.process.kill()
AttributeError: 'Popen' object has no attribute 'kill'
Protocol error: `>' expected.

make: *** [check] Error 1
/tmp/Pymacs-0.24-beta2 399 % Protocol error: `>' expected.

make check fails under Windows

The command make check fails under Windows, due to the DOS-style line endings. For example, the first error received is:

Summary: one FAILED test, 166 good in 0.25 seconds.
Traceback (most recent call last):
  File "pytest", line 513, in <module>
    main(*sys.argv[1:])
  File "pytest", line 174, in main
    self.handle_module(file_name, module)
  File "pytest", line 323, in handle_module
    generator, None)
  File "pytest", line 356, in handle_function
    arguments[0], arguments[1:], instance)
  File "pytest", line 369, in launch_test
    self.delayed_setup_module[0](self.delayed_setup_module[1])
  File ".\t21_helper_works.py", line 10, in setup_module
    setup.start_python()
  File ".\setup.py", line 205, in start_python
    Python.services = Python()
  File ".\setup.py", line 141, in __init__
    assert text == '(version "0.25")\n', repr(text)
AssertionError: '(version "0.25")\r'
PProtocol error: `>' expected.
rotocol error: `>' expected.    

In this particular case, setup.py.in can be changed on Line 140 and Line 141 from:

text = self.receive()
assert text == '(version "@VERSION@")\n', repr(text)

to

text = self.receive().rstrip()
assert text == '(version "@VERSION@")', repr(text)

since the line termination characters are not relevant for these checks. This change will at least enable the further downstream tests to run, since many of them also fail to run under Windows.

Any idea what would be causing Pymacs to be slow on Snow Leopard OSX?

I haven't tried compiling my own version of Python yet, although I'm close to doing so, but it seems like using ropemacs with pymacs is very slow. There are numerous people who use ropemacs for autocompletion but I cannot do so. It's just too painfully slow.

Possibly this is a problem with rope but there is at least one more person with this issue:
http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/ca15f5d465a9da23

I'm not sure how to test what is going on or where the slowdown is. My hunch is that it is rope and simply something on OSX is slowing rope down.

Write homebrew formula

Pymacs is in macports, but not homebrew.
Do you have any qualms about it being included in homebrew?

I suspect they will say it belongs in pypi, and after reading the snippet in your README, I really don't know. I think whatever enables people to use Pymacs is better.

Minor fix to pymacs-terminate-services

I accidentally killed the Pymacs and after that pymacs behaved weirdly. It seems the following patch is needed for pymacs to clean up properly.

diff --git a/pymacs.el.in b/pymacs.el.in
index 0c14fd81..97fa4b40 100644
--- a/pymacs.el.in
+++ b/pymacs.el.in
@@ -685,7 +685,7 @@ Killing the Pymacs helper might create zombie objects.  Kill? "))
            (remove-hook 'post-gc-hook 'pymacs-schedule-gc))
           ((pymacs-timerp pymacs-gc-timer)
            (pymacs-cancel-timer pymacs-gc-timer)))
-    (when pymacs-transit-buffer
+    (when (buffer-live-p pymacs-transit-buffer)
       (kill-buffer pymacs-transit-buffer))
     (setq pymacs-gc-inhibit nil
           pymacs-gc-timer nil

make check fails on MacOS 10.6.6 with emacs 24.0.50 from bzr trunk

Hello,
I'm attempting to set up Pymacs on my Mac OS 10.6.6 machine and ran make check before attempting an install. make check gets stuck when running t31_elfile_works.py

I am running emacs 24.0.50 compiled locally from a clone of the bzr trunk. The version info of the tip is:
revno: 103416
revision-id: [email protected]

The output I receive when running make check is:
aal-i5-mbp:Pymacs lotia$ make check
rm -f tests/debug-protocol tests/debug-signals
python pppp -C ppppconfig.py pymacs.el.in Pymacs tests
cd tests &&
EMACS="emacs" PYTHON="python"
PYMACS_OPTIONS="-d debug-protocol -s debug-signals"
python pytest -f t
./t01_pppp_works.py ···························································
60 ·············· (73)
./t10_pyfile_loads.py · (1)
./t11_pyfile_works.py ·························································
58 ··································· (92)
./t20_helper_loads.py · (1)
./t21_helper_works.py ··············································· (47)
./t30_elfile_loads.py · (1)
./t31_elfile_works.py ·························································
58 ·····························

it stops at the same point each time.

I'm new to Python so I'm afraid this issue report isn't accompanied with a patch.

Specified program for new process is a directory

I have managed to follow the Pymacs installation instructions up to 2.5. It seems that my installation went fine, however, when I try M-x pymacs-eval with repr(2L**111) or M-x pymacs-load with os RET RET, I always end up getting a message saying 'Specified program for new process is a directory'. I am using Emacs 24.1.1 on Windows 7, along with Python 2.7.
Any help would be appreciated.

Issue of "pymacs-report-error: Pymacs helper did not start within 30 seconds"

hi Pinard,

I met the issue described as title.
You have provided 2 solutions for that:

  1. comment out python-mode.el (Q: I can't find out where to comment the "python-mode")
  2. set py-load-pymacs-p to nil (Q: put it in the init.el file? or?)

But I'm the newbies of emac(don't know the lisp) and I got above questions.
May I seek your help about that?

Many thanks.
Nickle

Unable to package for Melpa; small change necessary

Salut François -- I help manage Melpa, an ELPA repository containing snapshot elisp packages built directly from developers' source repos. Happily, Melpa is becoming extremely popular.

I'd love to add a Melpa recipe for Pymacs, but it's currently not possible due to the naming of pymacs.el.in. Would you consider renaming it to pymacs.el? It looks like you could create a git-ignored "dist" directory, then instruct pppp to output the pre-processed source files there.

Very much hoping that we can figure out how to get Pymacs into Melpa! :-)

-Steve

Set Python interpreter in Makefile via environment variable

I looked through the README to find out how I would go about installing Pymacs for Python 3, but couldn't find anything there. So I had a look through the Makefile and it had a PYTHON variable, so I thought fine. Then I thought that the pppp command probably does some fancy things regarding which version should be used so I had a look through ppppconfig.py and right there it was, a way to set the PYTHON environment variable.

So my suggestion is to allow the Makefile to read settings from the environment.

$ diff -uw Makefile.orig Makefile
--- Makefile.orig   2011-12-27 00:34:08.000000000 +0100
+++ Makefile    2011-12-27 00:27:18.000000000 +0100
@@ -3,7 +3,7 @@
 # François Pinard <[email protected]>, 2001.

 EMACS = emacs
-PYTHON = python
+PYTHON ?= python
 RST2LATEX = rst2latex

 PYSETUP = $(PYTHON) setup.py

Error (setting-constant enable-multibyte-characters) when loading pymacs

Hi,

I just started to configure pymacs, rope, ropemacs and when emacs executes (pymacs-load "ropemacs", "rope-") it stops with an error.
Here is te section that produces the error:

;; pymacs rope ropemacs
(add-to-list 'load-path "~/.emacs.d/vendor/pymacs")
(setenv "PYMACS_PYTHON" "~/.emacs.d/vendor/python/usr/bin/python")

(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)

(require 'pymacs)

;; Load ropemacs, which depends on Pymacs (see above).

(pymacs-load "ropemacs" "rope-")
(setq ropemacs-enable-autoimport t)

And here the backtrace:

Debugger entered--Lisp error: (setting-constant enable-multibyte-characters)
  pymacs-set-buffer-multibyte(nil)
  pymacs-start-services()
  pymacs-serve-until-reply("eval" (pymacs-print-for-apply (quote "pymacs_load_helper") (quote ("ropemacs" "rope-"))))
  pymacs-call("pymacs_load_helper" "ropemacs" "rope-")
  pymacs-load("ropemacs" "rope-")
  eval-buffer(#<buffer  *load*<2>> nil "/home/jcn/.emacs.d/oggers/python.el" nil t)  ; Reading at buffer position 1891
  load-with-code-conversion("/home/jcn/.emacs.d/oggers/python.el" "/home/jcn/.emacs.d/oggers/python.el" nil nil)
  load("~/.emacs.d/oggers/python")
  eval-buffer(#<buffer  *load*> nil "/home/jcn/.emacs.d/init.el" nil t)  ; Reading at buffer position 574
  load-with-code-conversion("/home/jcn/.emacs.d/init.el" "/home/jcn/.emacs.d/init.el" t t)
  load("/home/jcn/.emacs.d/init" t t)
  #[0 "�\205\262

I'm using emacs 24.0.90.1.

Thanks.

How to install pymacs on windows

C:\Users\tree\Desktop\Pymacs [master]> make -v
GNU Make 3.82
Built for x86_64-w64-mingw32
This program is built by Equation Solution http://www.Equation.com
for Windows.
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
C:\Users\tree\Desktop\Pymacs [master]>

C:\Users\tree\Desktop\Pymacs [master]> make
python pppp -C ppppconfig.py Pymacs.py.in pppp.rst.in pymacs.el.in pymacs.rst.in contrib tests
Traceback (most recent call last):
File "pppp", line 425, in
main(sys.argv[1:])
File "pppp", line 127, in main
self.transform_all_files(argument)
File "pppp", line 244, in transform_all_files
input, open(input), open(output, 'w').write)
File "pppp", line 330, in transform_file
self.each_substituded_line(lines)):
File "pppp", line 412, in each_substituded_line
for line in lines:
UnicodeDecodeError: 'gbk' codec can't decode byte 0x94 in position 119: illegal multibyte sequence
make: *
* [prepare] Error 1
C:\Users\tree\Desktop\Pymacs [master]>

Build wrong python expression out of lisp expression with utf-8 encoded content in emacs buffer.

In pymacs.el.in,pymacs defun pymacs-print-for-eval function to build python expression out of lisp expression,however,when using ropemacs,it will try to get emacs buffer content using (buffer-string),while the buffer content is encoded in utf-8,then the folloing code in pyemacs.el.in:

(when multibyte
(princ ".encode('ISO-8859-1').decode('UTF-8')")))

will lead an error in pyemacs' python side,because we try to encode an utf-8 encoded string。

It seams that we'd better to handle carefully by dectecting buffer charset?

__init__.py missing from beta2

Hi,

When I tried to install from beta2, pip gave the following error:

package init file 'Pymacs/__init__.py' not found (or not a regular file)

and (Aqua|E)macs would complain:

error: Pymacs helper did not start within 30 seconds

I then installed successfully from beta1.

Cheers,

Pedro

Pymacs Lisp version computability problem

I have installed rope, ropemacs, ropemode and Pymacs. and my .emacs.el is:

(require 'pymacs)
(pymacs-load "ropemacs" "rope-")

when I start emacs --debug-init this error occur:

Debugger entered--Lisp error: (error "Pymacs Lisp version is 0.23, Python is 0.24-beta2")
signal(error ("Pymacs Lisp version is 0.23, Python is 0.24-beta2"))
pymacs-report-error("Pymacs Lisp version is 0.23, Python is %s" "0.24-beta2")
pymacs-start-services()
pymacs-serve-until-reply("eval" (pymacs-print-for-apply (quote "pymacs_load_helper") (quote ("ropemacs" "rope-"))))
pymacs-call("pymacs_load_helper" "ropemacs" "rope-")
pymacs-load("ropemacs" "rope-")
eval-buffer(#<buffer load> nil "/home/milad/.emacs.el" nil t) ; Reading at buffer position 769
load-with-code-conversion("/home/milad/.emacs.el" "/home/milad/.emacs.el" t t)
load("~/.emacs" t t)
#[nil "^H\205\264^@ \306=\203^Q^@\307^H\310Q\2027^@ \311=\2033^@\312\307\313\314#\203#^@\315\2027^@\312\307\313\316#\203$
command-line()
normal-top-level()

Installation problems on Lion and Mountain Lion

I normally run Python from a virtualenv and have had no problems with packages. However, with Pymacs, I've tried installing using easy_install and pip and neither way installs in a way that can be found by the Python interpreter.

Most packages work fine through pip and for this I would do,

pip install git+https://github.com/pinard/Pymacs.git

This installs the file Pymacs-0.25-py2.7.egg-info into my lib/python2.7/site-packages directory but there is no corresponding egg. OK, maybe something with pip.

So then I try:

easy_install https://github.com/pinard/Pymacs/tarball/master

This actually installs the egg Pymacs-0.25-py2.7.egg but then I find,

$ python -c "import Pymacs"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named Pymacs

Even if i manually set my PYTHONPATH it still doesn't work properly.

installation doesn't work for python 2.7

I tried to run make (or make install) but nothing happened (nothing got built). BTW I can install Pymacs 0.24beta2.

~/Downloads/pinard-Pymacs-8b435ce$ make
python pppp -C ppppconfig.py Pymacs.py.in pppp.rst.in pymacs.el.in pymacs.rst.in contrib tests
python setup.py --quiet build
~/Downloads/pinard-Pymacs-8b435ce$ ls
contrib ppppconfig.py pymacs.el.in pymacs.rst.in setup.py
COPYING pppp.rst Pymacs.py pymacs.wpr tests
Makefile pppp.rst.in Pymacs.py.in README.md THANKS
pppp pymacs.el pymacs.rst setup.cfg TODO

Pymacs in marmalade is different

I installed pymacs0.25 emacs part form marmalade-repo.org by package.el and python part by zipball downloaded from https://github.com/pinard/Pymacs/zipball/v0.25 , but it did not work and the error was "TypeError: pymacs_load_helper() takes exactly 2 arguments (3 given)". I compared pymacs.el between marmalade and github, there were some differents, especifically the function pymacs-load who caused the error. Then I reinstalled emacs part by zipball, it works!

Is there something wrong my installation or marmalade version?

I work with emacs24.2.1 on windows7.

make install doesn't work for Python 3.4.1

# make install
python pppp -C ppppconfig.py Pymacs.py.in pppp.rst.in pymacs.el.in pymacs.rst.in contrib tests
Traceback (most recent call last):
  File "pppp", line 425, in <module>
    main(*sys.argv[1:])
  File "pppp", line 83, in main
    exec(compile(open(value).read(), value, 'exec'), self.context)
  File "ppppconfig.py", line 17, in <module>
    VERSION = get_version()
  File "ppppconfig.py", line 11, in get_version
    for line in open('setup.cfg'):
  File "/home/aalvesne/coding/python/virtualenv/tmp-5defa29666f51f4/lib/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 53: ordinal not in range(128)
Makefile:26: recipe for target 'prepare' failed
make: *** [prepare] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.