5 votes

How can I make python-mode correctly indent python's match statement?

There is support for this in melpa python-mode but in my case the emacs was loading the builtin python mode which does not support the match statement. You can tell that you are loading the builtin ...
geckos's user avatar
  • 151
3 votes

Emacs 28 crashing when using triple quotes for docstrings

For others who have run into this in Emacs 28, and have spent hours frustrated by it, as I did, the problem is a known bug and is fixed in emacs 29. Follow this guide here: https://github.com/emacs-...
Marc Cenedella's user avatar
2 votes
Accepted

Org mode babel hangs with python C-c C-c

This is still an issue for Emacs 29.1 using Org Mode 9.6 (at least with MacOS). Evaluation of a Python source block hangs when using an unnamed session and a Python process named *Python* is already ...
D. Gillis's user avatar
  • 496
2 votes
Accepted

set the correct major mode for script files based on interpreter

Such a functionality is already built into Emacs. Interpreters are mapped to modes with the variable interpreter-mode-alist. It contains by default ("python[0-9.]*" . python-mode) and many ...
jmg's user avatar
  • 203
2 votes
Accepted

OSC 8 links not working in the Comint mode

What is the value of comint-output-filter-functions? Note the specific wording of the Changelog entry: *** Support for OSC escape sequences. Adding the new function 'comint-osc-process-output' to '...
db48x's user avatar
  • 18.1k
2 votes
Accepted

Why doesn't the ##* outline work with Python?

python-mode sets outline-heading-end-regexp to ":[^\n]*\n" which makes the heading stretch to the next colon. (setq-local outline-heading-end-regexp "\n") should make the heading ...
David Smith's user avatar
2 votes
Accepted

use output of python code block from other python code block

The default :results header is value. So, org gets the value by wrapping the code in a function definition in the language of the source block. Code should execute like a function and return a value. ...
Saravana's user avatar
  • 2,071
1 vote

fill-region fails as fill-forward-paragraph complains about argument type

I found the problem, without fully understanding the reason. I renamed paragraph-start and paragraph-end to doctring-paragraph-start and docstring-paragraph-end. Apparently, defining the variables ...
olivaw's user avatar
  • 151
1 vote
Accepted

Defining custom Python skeletons

If you look at the python skeleton commands, you will find their names use a single dash after the 'namespace'. Using your print-debug definition example, the created python-skeleton--print-debug has ...
dalanicolai's user avatar
  • 7,815
1 vote
Accepted

Org Babel: Possible to get Python shell with session?

Babel evaluation of python code blocks is peculiar: using :session foo and :results output behaves most closely to what you would expect (assuming you don't expect too much...). The evaluation buffer ...
NickD's user avatar
  • 29.8k
1 vote
Accepted

In Python buffer erase large output

You should be able to use comint-clear-buffer ("C-c M-o") to remove everything. There is also comint-kill-region that should properly deal with the read-only prompts, at least according to ...
Brad Howes's user avatar
1 vote
Accepted

No output in Python inferior buffer after C-c C-c

First, the code under if __name__ == "__main__": function is only executed when running python as a program (see here for example). Second, as far as I remember, when using python-shell-send-...
dalanicolai's user avatar
  • 7,815
1 vote
Accepted

Why does adding a return value to my Python code stop it from printing?

When you uncomment the return and try to export, there is an error: the error message is added to the *Org-babel Error Output* buffer and a diagnostic with the exit code (but not the error message(s)) ...
NickD's user avatar
  • 29.8k
1 vote

python-shell-completion-complete-or-indent (Tab, in an inferior python mode shell) completes "__PYTHON_EL_eval_file"

I found the following workaround. I wish I better understood where this problem stems from though. (defun my-python-completion-filter (completions) "Filter out the unwanted '__PYTHON_EL' from ...
guibor's user avatar
  • 121
1 vote

__PYTHON_EL_eval_file prints in interpreter when sending python file from buffer using C-x C-l

This is a hack, but it worked for me: (defun python-comint-filter (output) (let* ((regexp "^.*__PYTHON_EL_\\(.*\\)\\(.*\\)[[:space:]]*$") (lines (split-string output "\n"...
guibor's user avatar
  • 121
1 vote
Accepted

macos org-babel python with session output give __PYTHON_EL_eval

I just ran into the same issue, and I bugged someone much smarter than me about it -- her conclusion after some debugging was that it seems like this basically boils down to the Python that comes with ...
Elle Najt's user avatar
  • 126
1 vote

How can I make python-mode correctly indent python's match statement?

I followed the answer given by Levin Magruder. I am using Emacs 26.3. I found that, in my copy of python.el, there was only one block which corresponded with what Levin's answer showed. So, here is ...
bjkeefe's user avatar
  • 11
1 vote

Is there a package for semantic refactoring

To answer my own question years later: support for LSP via eglot takes care of most of my problems.
Alex Petrosyan's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible