Andreas Röhler | 11 Jan 08:51 2016

Refined formatting in docstring

Hi  Barry, hi all,

there was a question WRT formatting of docstring,

which points to this

Just FYI, cheers,

Andreas Röhler | 29 Oct 08:00 2015

Fwd: bug#21778: 24.5; python mode: fill-paragraph with raw docstring ignores python-fill-docstring-style

Hi Barry,

assume this affects python-mode.el also (?)



-------- Original Message -------- Subject: Resent-Date: Resent-From: Resent-CC: Date: From: To:
bug#21778: 24.5; python mode: fill-paragraph with raw docstring ignores python-fill-docstring-style
Wed, 28 Oct 2015 19:44:01 +0000
John Palmieri <jhpalmieri64 <at>>
bug-gnu-emacs <at>
Wed, 28 Oct 2015 12:16:20 -0700
John Palmieri <jhpalmieri64 <at>>
21778 <at>

To recreate the bug, in Python mode, type

def f():
    This is the docstring for my function.

    It's a raw docstring because I want to type \t here, and maybe \n,
    for example in LaTeX code like \tau or \nu.

    More docstring here.

Now with the cursor in the first sentence of the docstring, running fill-paragraph ignores the setting of python-fill-docstring-style, I think because Emacs doesn't detect that r""" is the start of the  docstring. Similarly, running fill-paragraph in the last sentence behaves badly. Also similarly, I think that it should be valid to begin a docstring with b""" or u""" (and possibly some combination of b, r, u, before """, although I'm not sure), and these also don't behave correctly.

In GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)
 of 2015-04-10 on
Windowing system distributor `Apple', version 10.3.1348
Configured using:
 `configure --with-ns '--enable-locallisppath=/Library/Application

Important settings:
  value of $LANG: C
  locale-coding-system: utf-8-unix

Major mode: Outline

Minor modes in effect:
  goto-address-mode: t
  TeX-PDF-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t
  view-mode: t

Python-mode mailing list
Python-mode <at>
Andreas Röhler | 5 Oct 09:52 2015

python-mode.el 6.2.1 released

Hi guys,

gladly announcing release 6.2.1

Something new comes with it:

- Handles PEP 492 async coroutines

- Logic of py-indent-region WRT lp:1426903
   In case first line accepts an indent,
   keep the remaining lines' relative.
   Otherwise lines in region get outmost indent,
   same with optional argument

- Commands
   - py-match-paren
     If at a beginning, jump to end and vice versa.
     Matches lists, block, statement, string and comment

   - ipython2.7
   - ipython3

   - py-beginning-of-for-block
   - py-beginning-of-for-block-bol
   - py-end-of-statement-bol
   - py-end-of-top-level-bol

   - py-flycheck-mode - toggle `flycheck-mode' from menu "Checks"

   - py-execute-section - execute arbitrary chunks of code
   - py-execute-section-python
   - py-execute-section-python2
   - py-execute-section-python3
   - py-execute-section-ipython
   - py-execute-section-ipython2.7
   - py-execute-section-ipython3
   - py-execute-section-jython

   - py-sectionize-region
   - py-backward-section
   - py-forward-section

   - py-narrow-to-block
   - py-narrow-to-block-or-clause
   - py-narrow-to-class
   - py-narrow-to-clause
   - py-narrow-to-def
   - py-narrow-to-def-or-class
   - py-narrow-to-statement

- New helper functions, like
   - py--end-of-block-bol-p
   - py--end-of-clause-bol-p

   Functions in a boolean sense just stating if being at an end or
   start no longer a command. Renamed as interanal
   functions with prefix `py--' now.

- TAB-indent from column zero: go to outmost first, lp:1375122
- (I)Python-shell setup made more reliable

New customizables:

- py-imenu-max-items, default is 99
   Sets `imenu-max-items'

- py-python-edit-version, default is ""
   When not empty, fontify according to Python version specified.

- py-pdb-executable, default is nil
   Indicate PATH/TO/pdb.

- py-update-gud-pdb-history-p, default is t
   If pdb should provide suggestions WRT file and pdb-path.

- py-split-window-on-execute-threshold, default is 3
   Don't split when max number of displayed windows is reached.

- py-beginning-of-commented-section --> py-beginning-of-comments
- py-narrow-to-defun --> py-narrow-to-def



Andreas Röhler | 21 Jul 13:16 2015

before 6.2.1

Hi Barry, hi all,

in current trunk `interactive-p' is  replaced by 
`called-interactively-p', just to reduce compiler warnings.

`called-interactively-p' seems introduced only with 22.1, older Emacsen 
will be broken.

Is this a concern?


Andreas Röhler | 28 Jun 11:28 2015

Re: C-M-f, C-M-b

Am 26.06.2015 um 20:24 schrieb Barry Warsaw:
> On Jun 25, 2015, at 06:44 PM, Andreas Röhler wrote:
>> the equivalent of what forward-sexp in Emacs Lisp is --or should be-- is
>> py-forward-expression.
>> What about setting C-M-f to it? Resp. C-M-b
> Seems reasonable I think.
> -Barry


Keys will be set if py-sexp-use-expression-p is non-nil, default is nil.


Python-mode mailing list
Python-mode <at>
Andreas Röhler | 25 Jun 18:44 2015

C-M-f, C-M-b

Hi Barry, hi all,

the equivalent of what forward-sexp in Emacs Lisp is --or should be-- is 

What about setting C-M-f to it? Resp. C-M-b

If inside an expression C-M-f should to to its end.
 From end to next end same level if existing - or level up, or next 
top-level-form, or nil at EOB

Any opinion?


Yuri D'Elia | 20 Jun 12:48 2015

Evaluating code blocks

Hi everyone,

I'd like some advice about using python-mode with a python subprocess.
I always preferred to use emacs+file+external process as opposed to use
an ipython's notebook-like interface: it's just more convenient,
especially when debugging existing code.

I often use the same setup when doing some analysis, and this is when an
inotebook-like interface is more convenient for evaluation: I'd like to
evaluate code not line-by-line, or by defun, but by my custom-defined
blocks. I realized I was continuously selecting a region, and using
py-send-region over and over.

Right now I narrow to the region I'm editing, and use py-send-buffer
instead. It's ok-eish, but narrow/widen narrow/widen, while less common,
is still inconvenient.

I've seen people using org-mode for this kind of setup instead. Which
might be ok, but I'd like to know what other choices I could have as well.

I was thinking of defining a custom region using comments, and defining
my own py-send-custom-block using comment markers as boundaries. Surely,
something like this must already exists.
Barry Warsaw | 13 Mar 22:16 2015

Re: Displaying symbols in customization buffer

On Mar 13, 2015, at 07:54 PM, Andreas Röhler wrote:

>Currently it looks strange - see attachment.

Agreed, but what can python-mode do about that?  It's just the way Emacs'
customize feature works.


Python-mode mailing list
Python-mode <at>
Andreas Röhler | 13 Mar 15:51 2015

Displaying symbols in customization buffer

Hi Barry, hi all,

currently most of symbols in customization buffer get splitted, resulting parts are capitalized.

Would prefer to display it with real name, which permits searching it.

Any opinion about that?


andrea crotti | 31 Jan 21:58 2015


Hi guys, I just reinstalled everything from scratch and loading
python-mode gives me this error below..
The file in fact does not exist anywhere so not sure how it was
working before, any idea where it should be?

Debugger entered--Lisp error: (file-error "Cannot open load file" "no
such file or directory" "python-components-switches")
  eval-buffer(#<buffer  *load*≥ nil
nil t)  ; Reading at buffer position 90348
nil nil)
  call-interactively(load-library record nil)
  command-execute(load-library record)
  execute-extended-command(nil "load-library")
  call-interactively(execute-extended-command nil nil)
andrea crotti | 7 Jan 11:46 2015

Python help buffer

Hi guys,

I have a problem with Emacs 25 that does not happen with Emacs 24.4.
More specifically with:
- GNU Emacs (x86_64-apple-darwin13.4.0, NS appkit-1265.21
Version 10.9.5 (Build 13F34)) of 2014-11-15 on
- Python mode: 6.1.3

So in short with Emacs 25 the *Python Help* buffer keeps coming up,
whenever the cursor stays for more than a second on something.

I digged a bit and it seems to come from the "py-help-at-point"
function, can't understand why it does not happen with Emacs 24.4.

I thought it was related to Eldoc but that's also disabled so it's not
the case, and I can't find any variable to customize to disable that
once for all..
I guess it's just something changed in Emacs 25 but can't find out what :/
Any idea?

Doing a "(defun py-help-at-point nil)" works of course but it's not the
desired solution since it's still useful sometimes.

Thanks a lot