News and announcements

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-hide-region
  py-show-region
  py-hide-statement
  py-show-statement
  py-hide-block
  py-show-block
  py-hide-clause
  py-show-clause
  py-hide-block-or-clause
  py-show-block-or-clause
  py-hide-def
  py-show-def
  py-hide-class
  py-show-class
  py-hide-expression
  py-show-expression
  py-hide-partial-expression
  py-show-partial-expression
  py-hide-line
  py-show-line
  py-hide-top-level
  py-show-top-level

- `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
  py-python2-command
  py-python3-command
  py-ipython-command

  py-python-command-args
  py-python2-command-args
  py-python3-command-args
  py-ipython-command-args

- info-lookup-symbol made working with Python
  patched python-info.el available at
  https://bitbucket.org/andreas_roehler/pydoc-info
  See also INSTALL-INFO-FILES

- `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
  `py-split-window-on-execute-function'
  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
 -py-set-nil-docstring-style
 -py-set-pep-257-nn-docstring-style
 -py-set-pep-257-docstring-style
 -py-set-django-docstring-style
 -py-set-symmetric-docstring-style
 -py-set-onetwo-docstring-style

- 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-execute-statement-dedicated
  py-execute-block-dedicated
  py-execute-clause-dedicated
  py-execute-block-or-clause-dedicated
  py-execute-def-dedicated
  py-execute-class-dedicated
  py-execute-region-dedicated
  py-execute-buffer-dedicated
  py-execute-expression-dedicated
  py-execute-partial-expression-dedicated
  py-execute-line-dedicated
  py-execute-top-level-dedicated

- `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-block-p
  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-comment-fill-column'

`py-font-lock-keywords' renamed `python-font-lock-keywords',
  lp:1314921

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
 -toggle-py-nil-docstring-style
 -py-nil-docstring-style-on
 -py-nil-docstring-style-off
 -toggle-py-onetwo-docstring-style
 -py-onetwo-docstring-style-on
 -py-onetwo-docstring-style-off
 -toggle-py-pep-257-docstring-style
 -py-pep-257-docstring-style-on
 -py-pep-257-docstring-style-off
 -toggle-py-pep-257-nn-docstring-style
 -py-pep-257-nn-docstring-style-on
 -py-pep-257-nn-docstring-style-off
 -toggle-py-symmetric-docstring-style
 -py-symmetric-docstring-style-on
 -py-symmetric-docstring-style-off
 -toggle-py-django-docstring-style
 -py-django-docstring-style-on
 -py-django-docstring-style-off
  Some commands not so useful made common functions, like
 -py-statement-opens-block-p
 -py-statement-opens-clause-p ...

Dropped booleans:
`py-start-run-py-shell',
`py-start-run-ipython-shell',
`py-pylint-offer-current-p'
`py-paragraph-fill-docstring-p'
`py-enforce-output-buffer-p'
`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:
  py-beginning-of-block-current-column
  "Reach the beginning of block which starts at current column "

  py-beginning-of-top-level
  py-beginning-of-top-level
  py-end-of-top-level
  py-mark-top-level
  py-copy-top-level
  py-delete-top-level
  py-kill-top-level
  py-execute-top-level
  py-top-level-form-p
  py-comment-top-level
  py-beginning-of-top-level-p

- `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:
  `py-delete-comments-in-def-or-class'
  `py-delete-comments-in-class'
  `py-delete-comments-in-block'
  `py-delete-comments-in-region'

- 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 &&
              baz):
          bar()

  Default lines up with first element:

  def foo():
      if (foo &&
          baz):
          bar()

- `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
  mystring[0:1]
  -------------^
  ==>
  mystring[]
  ---------^
  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.org, 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.

python-mode.el-6.1.1

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

New in version 6.1.1
---------------------

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

- 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:
  toggle-py-underscore-word-syntax-p
  py-underscore-word-syntax-p-on
  py-underscore-word-syntax-p-off

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

python-mode.el-6.1.0

Written for python-mode.el by Andreas Roehler on 2012-12-05

New in version 6.1.0
---------------------

- py-up
  Go to beginning one level above of compound statement or definition at point.
- py-down
  Go to beginning one level below of compound statement or definition at point.

- Customizable output directory
  After checking for a remote shell, the following variables are consulted:

  py-use-current-dir-when-execute-p, default t
  When `t', current directory is used by Python-shell for output of `py-execute-buffer' and related commands

  py-fileless-buffer-use-default-directory-p, default t
  When `py-use-current-dir-when-execute-p' is non-nil and no buffer-file exists, value of `default-directory' sets current working directory of Python output shell"

  py-keep-shell-dir-when-execute-p, default nil
  Don't change Python shell's current working directory when sending code.

  `py-execute-directory', default nil

  If nothing was set so far, $VIRTUAL_ENV and $HOME are queried.

- Set of commands calling Python3.3

- fill docstrings according to style, commands
  py-fill-string-django
  py-fill-string-onetwo
  py-fill-string-pep-257
  py-fill-string-pep-257-nn
  py-fill-string-symmetric

  Customizable variable `py-fill-docstring-style' provides default value
  used by `py-fill-string', `py-fill-paragraph'

  DJANGO:

      \"\"\"
      Process foo, return bar.
      \"\"\"

      \"\"\"
      Process foo, return bar.

      If processing fails throw ProcessingError.
      \"\"\"

  ONETWO:

      \"\"\"Process foo, return bar.\"\"\"

      \"\"\"
      Process foo, return bar.

      If processing fails throw ProcessingError.

      \"\"\"

  PEP-257:

      \"\"\"Process foo, return bar.\"\"\"

      \"\"\"Process foo, return bar.

      If processing fails throw ProcessingError.

      \"\"\"

  PEP-257-NN:

      \"\"\"Process foo, return bar.\"\"\"

      \"\"\"Process foo, return bar.

      If processing fails throw ProcessingError.
      \"\"\"

  SYMMETRIC:

      \"\"\"Process foo, return bar.\"\"\"

      \"\"\"
      Process foo, return bar.

      If processing fails throw ProcessingError.
      \"\"\""

  Built upon code seen at python.el, thanks Fabian

- `py-down-statement', `py-up-statement'

- toggle-py-split-windows-on-execute-p
- py-split-windows-on-execute-p-off
- py-split-windows-on-execute-p-on

- toggle-py-switch-buffers-on-execute-p
- py-switch-buffers-on-execute-p-on
- py-switch-buffers-on-execute-p-off

- `py-shell-switch-buffers-on-execute-p' renamed `py-switch-buffers-on-execute-p'

15 of 21 results

Announcements