News and announcements


Written for python-mode.el by Andreas Roehler on 2015-10-02

- Handle 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

New in version 6.2.0

Written for python-mode.el by Andreas Roehler on 2014-11-28

- Support for large output
  new commands py-fast-process, py-fast-...
  Fixes: large output makes Emacs freeze, lp:1253907

  Python code now might be processed by an
  - interactive Python shell (DEFAULT)
  - non-interactive Python (`py-fast-process-p', if large output)

  Both processes might run in
  - session, i.e. start from possible previous state (DEFAULT)
  - dedicated, (`py-dedicated-process-p', run in separate process)

- TAB bound to `py-indent-or-complete', completes at EOL.
  Calls to `tab-to-tab-stop' removed, as these would conflict.
  Use `C-q TAB' to insert a literally TAB-character.

- py-fast-complete
  Complete word before point, if any, use `py-fast-process'

- `py-shell-complete-or-indent'
  In shell: complete or indent depending on the context.
  If cursor is at current-indentation and further indent
  seems reasonable, indent. Otherwise try to complete.

- Python specific hide-show

- `py-shell' uses new `py-shell-mode', `py-shell-mode-map'
  M-x describe-mode RET mentions edit available commands
  Menu "Py-Shell"

- Improved customization of Python2, Python3, IPython executables
  receive defaults depending from system
  py-python-command - defaults to python2


- info-lookup-symbol made working with Python
  patched python-info.el available at

- `py-backward-same-level'
  While `py-up' will go upward from beginning of block, this travels
  same level, but goes up if no element left in level. If callled
  from inside a string or list, go to its beginning.

- `py-kill-shell-unconditional'
  With optional argument SHELL, otherwise kill default
  (I)Python shell.

- py-info-lookup-symbol ()
  Calls `info-lookup-symbol'. Sends help if stuff is missing.

- py-toggle-split-window-function
  If window is splitted vertically or horizontally.
  Sets customizable variable
  Also in menu Python/Customize/Switches/Display/Which split windows

- py-symbol-at-point
  Return the Python symbol under cursor

- py-report-comint-variable-setting
  Display Py-shell' comint-mode variables of interest.

- variables-state
  Diplays state of python-mode variables in an org-mode buffer

- py-kill-buffer-unconditional
  Kill buffer unconditional; kill also any buffer-process.

Setting docstring style simplified; a style is all needed.
  New commands

- new indent feature/behavior, lp:1280982
  If an empty line was dedented deliberatly, this is
  honored by next lines indent

- py-object-reference-face
  commonly "self" or "cls", inherits default face

- py-error
  In case of error, list messages from Python process

- `py-split-windows-on-execute-p' renamed `py-split-window-on-execute'
  Not a boolean any more, new option 'just-two: When code is send to
  interpreter, split screen into source-code buffer and current
  --maybe reused-- py-shell. When set to `t' --default--, python-mode
  will keep existing windows and split only if needed. Alternatively
  if a multitude of python-shells/buffers should be visible, open them
  manually and set `py-keep-windows-configuration' to `t'.

  If `always' split according to settings of `split-height-threshold', `split-width-threshold'; with `t' keep just two windows

- For completeness some commands user might expect

- `py-unload-python-el'
  Normally commands delivered by python.el are usable alongside with
  python-mode.el. Some old version of python.el might write skeletons into
  python-mode-abbrev-table, which is removed that way.

Internally used functions preferably are prefixed `py--':
  py--statement-opens-clause-p ...

New variable `py-ipython-command' - (PATH-TO)-IPython

Boolean `py-set-fill-column-p' renamed `py-auto-fill-mode'
 Fill according to `py-docstring-fill-column' and

`py-font-lock-keywords' renamed `python-font-lock-keywords',

New booleans
- py-fast-process-p
  If `t', stuff is executed through `py-fast-...'-
  commands, suitable for large output. Result arrives
  in py-fast-output-buffer, which is not in comint-mode

- py-shell-manage-windows-p
  If `t', open output buffers, split windows according to settings of
  `py-split-window-on-execute' and `py-switch-buffers-on-execute-p'.

Removed commands
  Some commands not so useful made common functions, like
 -py-statement-opens-clause-p ...

Dropped booleans:
`py-cleanup-temporary', as redundant WRT `py-debug-p'

New in version 6.1.3

Written for python-mode.el by Andreas Roehler on 2014-01-28

- PEP8 indent-alternatives when closing a list implemented

Boolean `py-close-at-start-column-p', default is nil

my_list = [
    1, 2, 3,
    4, 5, 6,
result = some_function_that_takes_arguments(
    'a', 'b', 'c',
    'd', 'e', 'f',

When non-nil, it will be lined up under the first character of the line that starts the multi-line construct, as in:

my_list = [
    1, 2, 3,
    4, 5, 6,

result = some_function_that_takes_arguments(
    'a', 'b', 'c',
    'd', 'e', 'f',

- Keys C-M-a, C-M-e usable for all top-level form, lp:1191078

  Boolean `py-defun-use-top-level-p'
  If non-nil, beginning- end-of-defun forms will use
  `py-beginning-of-top-level', `py-end-of-top-level',
  mark-defun marks top-level form at point etc.

Keys C-M-a, C-M-e usable for all top-level form, lp:1191078

- New commands:
  "Reach the beginning of block which starts at current column "


- `minor-block' commands added
  A minor block is started by a `for', `if', `try' or `with',
  while block covers also `def' or `class'

- variable `py-keep-windows-configuration', default is nil
  Setting `py-keep-windows-configuration' to `t' will
  restore windows-configuration regardless of
  `py-switch-buffers-on-execute-p' and
  `py-split-windows-on-execute-p' settings. However, if
  an error occurs, it's displayed.

  To suppres window-changes due to error-signaling
  also, set `py-keep-windows-configuration' onto 'force

- boolean empty-line-closes-p, default is nil
  When non-nil, dedent after empty line following block
  If non-nil, a C-j from empty line would dedent.

  if True:
      print("Part of the if-statement")

  print("Not part of the if-statement")

- boolean py-debug-p, default is nil
  When non-nil, keep resp. store information useful for
  debugging. Temporary files are not deleted. Other
  functions might implement some logging etc.

- heuristic exit
  new var `py-max-specpdl-size', default is `max-specpdl-size'
  py-end-of-statement will error if number of
  `py-max-specpdl-size' loops is completed, thus avoiding
  a hang from a possibly eternal loop.

- `py-statement' no longer refferred to `py-copy-statement'
  Same with block, def, expression etc. `py-statement' made
  own command, which returns statement, a string.

- boolean `py-max-help-buffer-p', default is nil
  If "*Python-Help*"-buffer be the only visible.

Updated on 2014-01-28.

New in version 6.1.2

Written for python-mode.el by Andreas Roehler on 2013-09-02

- simplified menu

- `py-execute-...'-commands return result as string
  Controlled by boolean `py-store-result-p', Default is nil
  When non-nil, put resulting string of `py-execute-...' into kill-ring, so it might be yanked.

- commands deleting all commented lines:

- boolean `py-indent-paren-spanned-multilines-p, default is nil
  If non-nil, indents elements of list a value of `py-indent-offset' to first element:
  def foo():
      if (foo &&

  Default lines up with first element:

  def foo():
      if (foo &&

- `py-output-buffer' made customizable
  See boolean `py-enforce-output-buffer-p'

- exceptions following executed regions made point to source

- command `py-empty-out-list-backward'
  Deletes all elements from list before point
  With when cursor after
  In result cursor is insided emptied delimited form."

- `py-minor-expression' reconsidered, numeric args dropped
  grasps keyword-arguments

- boolean `py-electric-kill-backward-p', default is nil.
  If behind a delimited form of braces, brackets or parentheses,
  `py-electric-backspace' runs `py-empty-out-list-backward'

- py-flakes8-run, flakes8 API

- customizable `py-backslashed-lines-indent-offset'

- boolean `py-pylint-offer-current-p'
  If current buffers file should be offered for check.
  Otherwise `py-pylint-run' looks up filename from history

- boolean `py-prompt-on-changed-p'
  When called interactively, ask for save before a
  changed buffer is sent to interpreter.

- customizable `py-closing-list-space'
  Number of chars, closing parenthesis outdent from opening

- customizable `py-uncomment-indents-p'
  When non-nil, after uncomment indent lines.

- boolean `py-load-skeletons-p'
  If skeleton definitions should be loaded

- boolean `py-if-name-main-permission-p'
  Allows execution of code inside blocks started by
  if __name__== '__main__'

- boolean `py-highlight-error-source-p', default is nil
  When py-execute-... commands raise an error, respective code in source-buffer will be highlighted.

- `py-remove-overlays-at-point', command
  Remove overlays as set when `py-highlight-error-source-p' is non-nil.

- `py-which-def-or-class', command, now used `which-function-mode'

- unused variable `py-backspace-function' removed

- Bundled third-party-stuff removed as reported conflicting at emacs-mirror, lp:1153998
  affects autopair.el, smart-operator.el
  Kept menu switches resp. commands will issue a warning

- dropped `py-paragraph-fill-docstring-p'; just `fill-paragraph' should DTRT

- `py-set-pager-cat-p', default is nil
   If non-nil, $PAGER is set to 'cat'

- in directory doc customizable variables are listed:, variables-python-mode.rst

Caveat: Please save buffer before C-c C-c, otherwise a bug shows up.
Bug is fixed in current trunk.

Updated on 2013-11-19.


Written for python-mode.el by Andreas Roehler on 2013-02-23

New in version 6.1.1

- comment-related commands:
  py-comment-block, py-comment-clause,
  py-comment-block-or-clause, py-comment-def,
  py-comment-class, py-comment-def-or-class,

- boolean `py-set-fill-column-p'
  If `t', enables use Python specific `fill-column' according to
  `py-docstring-fill-column', default is 72
  and `py-comment-fill-column, default is 79

- boolean `py-tab-shifts-region-p'
  when `t', TAB will indent/cycle the region, not just the current line.

- boolean `py-tab-indents-region-p'
  when `t', when first TAB doesn't shift, `indent-region' is called

- command from RET customizable via `py-return-key':
  `py-newline-and-indent', `newline' or `py-newline-and-dedent'

- boolean `py-use-font-lock-doc-face-p', default is nil
  If non-nil, documention strings get `font-lock-doc-face'

- boolean `py-newline-delete-trailing-whitespace-p'
  Delete trailing whitespace maybe left by `py-newline-and-indent'

- `py-electric-comment-p' new default nil

- py-up minor API change
  If inside a delimited form --string or list-- go to it's beginning
  If not at beginning of a statement or block, go to it's beginning
  If at beginning of a statement or block, go to beginning one level above of c

- py-down minor API change:
  Go to beginning of one level below of compound statement or definition at point.
  If no statement or block below, but a delimited form --string or list-- go to it's beginning.
  Repeated call from there will behave like down-list.

- commands make underscore syntax changes easier:

- py-update-imports removed
  Do not maintain a static variable containing needed imports
  Determine imports on the fly rather, as it might change
  the very moment

- variable `py-fill-docstring-style' renamed `py-docstring-style'

15 of 22 results