2

I have been reading about the different Python packages available for Emacs for some time. However, I have never been able to find the official documentation of either package.

From what I understand, python-mode seems is hosted at launchpad, but the repository does not have a wiki nor a document explaining the features, etc. On the other hand, python.el comes with recent versions of Emacs, but I can't find a documentation walkthrough its features anywhere.

Also, do both of them support step-by-step debugging through ipdb ipython? Where can I find more information on this matter?

1
  • Read the commentaries of both libraries. You can find these in a special comment section right at the beginning of these files. At least for Emacs' built-in python.el this commentary is quite comprehensive and explains all features of the mode. Commented Jun 17, 2013 at 7:49

2 Answers 2

3

Comments following ;;; Commentary is a good starting point, as @lunaryorn suggested. If you need setup read this part first.

But I think just start using it when your setup is done (for python.el, there is nothing to do if you use Emacs 24.3) is the best way to go through the features.

This is because Emacs is self-documenting editor. You can read all document about Emacs in Emacs. In Python buffer, use <f1> b (or C-h instead of <f1>) to see a list of command you can use (this is the list of features). Each command is linked to the docstring of the command. You can also open a menu using "Ctrl + Right Click" to see a list of command you can use in the buffer. The document of python-mode function, which can be opened by <f1> f python-mode RET, may be another good starting point. If you want to see documentation of some keybind, type <f1> k KEY-BIND. There are more useful help commands. See <f1> <f1> for more info. These techniques are not specific to python-mode, so you can use them for python.el and python-mode.el.

Re ipdb: python.el (and I guess python-mode.el also) can do it. There is code snippet in ;;; Commentary that you can use in Emacs configuration.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks @tkf! When you mentioned ;;; Commentary which file are you referring to? I am using the latest stable release of Emacs, but I could not find python.el in my Emacs installation (I only found python.elc and python.el.gz under /path/to/emacs/share/emacs/24.3/lisp/progmodes)
I mean python.el.gz. Usually bundled libraries have source code in *.el.gz files, to save disk space. BTW, easiest way to visit the file is to open <f1> f python-mode RET and click the link to the file.
@tkf As python.el provides 'python --which is good, as python-mode.el provides 'python-mode-- probably it's useful to write "python mode" when reffering to python.el's, while "python-mode" otherwise. Just an idea.
What I meant by python-mode is a major mode. Both python.el and python-mode.el define a function called python-mode. So I think there is no confusion.
2

https://blueprints.launchpad.net/python-mode/+documentation

This offers some basic FAQs meanwhile.

python-mode.el is designed to support ipdb and all other debuggers right from the spot. Configuration as explained at top of python.el isn't needed, as these stuff is implemented. Most commands are self-explaining. Every command has a documentation string, which users will find useful for some features like py-expression. Also the return values are reported there.

To get an overview which commands exist, the menu is a good starting point.

http://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html

python-mode.el lists commands alongside with its explanations in directory "doc".

Read the comments as suggested. Afterwards maybe employ outline-mode or hs-minor-mode to take a tour of the symbols.

Finally: M-x py- TAB, resp. M-x python- TAB lists the implemented commands. Once the name is known, call it's docu Ctrl-h f

Both modes should work with IPython/ipdb.

Seem several howto's at the net.

Maybe consult this

http://gremu.net/blog/2010/using-ipythons-debugger-pdb-replacement/

Please file a bug-report if you can't make it work.

As for with python-mode.el:

https://bugs.launchpad.net/python-mode

As for python.el : M-x report-emacs-bug RET

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.