summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
Commit message (Collapse)AuthorAgeFilesLines
* Fix python docstring auto-fill (Bug#36056)Noam Postavsky2019-06-221-0/+1
| | | | | | | | | | | * lisp/progmodes/python.el (python-mode): Set fill-indent-according-to-mode locally to t. This lets auto-fill do the right thing when auto-filling inside a docstring. The default was to nil on 2001-11-25 "(fill-indent-according-to-mode): Default to nil" with the comment that it "screws up CC-mode's filling tricks". But presumably it shouldn't be a problem for python-mode. * test/lisp/progmodes/python-tests.el (python-auto-fill-docstring): New test.
* Go back to "Maintainer: emacs-devel@gnu.org"Paul Eggert2019-05-251-0/+1
| | | | | | Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is no special maintainer for a file. Although this wasn't documented it was common practice and removing the lines didn't have consensus.
* Fixes for "Maintainer:" and related linesPaul Eggert2019-05-191-1/+0
| | | | | | Mostly, this just removes "Maintainer: emacs-devel@gnu.org" lines, which are not that useful. It also cleans up and regularizes a few similar lines.
* python.el: Fix close paren indentation to match pep8 (Bug#20742)Tommi Komulainen2019-04-281-3/+9
| | | | | | | | | * lisp/progmodes/python.el (python-indent--calculate-indentation): When opening paren is followed by newline the closing paren should follow the current indentation. Otherwise the closing paren should be aligned with the opening paren. This fixes the latter case. Copyright-paperwork-exempt: yes
* Merge from origin/emacs-26Glenn Morris2019-04-171-9/+10
|\ | | | | | | | | | | | | | | | | a1c53d4 (origin/emacs-26) * admin/admin.el (make-manuals-dist--1): Up... d0f745f Document some compilation-mode faces 23ccba0 Mention the assignment form in "Copyright Assignment" 0f5568e Fix confusing wording in the user manual 70ec392 Fix the MSDOS build when running under CWSDPMI 7a608fc * lisp/progmodes/python.el: Be more careful about temp file r...
| * * lisp/progmodes/python.el: Be more careful about temp file removalStefan Monnier2019-04-141-9/+10
| | | | | | | | | | (python-shell-prompt-detect): Use unwind-protect to try and not leave file behind in case of error.
* | Make python-shell-prompt-block-regexp match IPython promptAndrii Kolomoiets2019-04-161-1/+1
| | | | | | | | | | | | | | | | | | * lisp/progmodes/python.el (python-shell-prompt-block-regexp): Match also IPython's multiline prompt. It allows to correctly disable non-native completions during multiline statement in inferior-python-mode that runs IPython interpreter (Bug#34582). Copyright-paperwork-exempt: yes
* | python.el: don't syntax-propertize single/double quoted stringsStefan Monnier2019-04-091-24/+16
| | | | | | | | | | | | | | * lisp/progmodes/python.el (python-syntax-propertize-function): Only mark triple-quoted strings, let the normal syntax-table handle the rest. (python-syntax-stringify): Adjust accordingly.
* | * lisp/progmodes/python.el (python-rx-constituents): Fix ordering in `or`Stefan Monnier2019-03-131-1/+1
| | | | | | | | | | | | The previous code worked earlier because of a bug in `rx` (which used `regexp-opt` without passing it to `keep-order` argument), but now that `rx` has been fixed the underlying bug here reared its ugly head.
* | Add 'breakpoint' to builtins for PythonEvan Moses2019-03-011-1/+1
| | | | | | | | | | | | | | | | * lisp/progmodes/python.el (python-font-lock-keywords-level-2) (python-font-lock-keywords-maxiumum-decoration): Add 'breakpoint' to the list of builtins, it's new as of Python 3.7. Copyright-paperwork-exempt: yes
* | Fix electric indent bug in python-mode after dedenting colonJoel Rosdahl2019-01-051-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | * list/progmodes/python.el (python-indent-post-self-insert-function): Use markers instead of positions when reindenting statement(s) after inserting electric colon to avoid reindenting too many statements (bug#22663). * test/lisp/progmodes/python-tests.el (python-indent-electric-colon-2): Improve test case to also verify the fix of bug#22663. Copyright-paperwork-exempt: yes
* | Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\| | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Replace insignificant backquotesMichael Heerdegen2018-11-251-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
* | Add 'font-lock-maximum-decoration' levels for PythonCharles A. Roelli2018-07-191-32/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * etc/NEWS: New entry under Python mode. * lisp/progmodes/python.el (python-font-lock-keywords-level-1) (python-font-lock-keywords-level-2) (python-font-lock-keywords-maximum-decoration): New variables based off the incumbent 'python-font-lock-keywords'. (python-font-lock-keywords): Change it to a list of the new symbols, for use in the 'car' of 'font-lock-defaults'. (python-mode): Set the 'car' of 'font-lock-defaults' to the value of 'python-font-lock-keywords', instead of the symbol 'python-font-lock-keywords'.
* | Fix off by one error in python-mode assertion (Bug#30964)Noam Postavsky2018-06-161-1/+1
| | | | | | | | | | | | | | | | | | * lisp/progmodes/python.el (python-nav-end-of-statement): Don't assert that string-start is strictly greater than last-string-end, because the string end is a position outside of the string and may therefore be the same as the following string's start. * test/lisp/progmodes/python-tests.el (python-nav-end-of-statement-2): New test.
* | Obsolete Flymake's flymake-diagnostic-types-alistJoão Távora2018-06-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That varaiable was an association between symbols and properties, effecively duplicating symbol's property lists. It is simpler to just put properties on symbols. Backward compatibility to the old variable has been kept. * doc/misc/flymake.texi (Flymake error types): Don't mention flymake-diagnostic-types-alist. (Flymake error types): Rework section. (Backend functions): Refill a paragraph. (Flymake utility functions): Don't mention flymake-diagnostic-types-alist. (Proc customization variables): Don't mention flymake-diagnostic-types-alist. * etc/NEWS: Mention obsoletion of flymake-diagnostic-types-alist. * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Don't use flymake-diagnostic-types-alist. * lisp/progmodes/flymake.el: Rewrite commentary. (flymake-make-diagnostic, flymake-mode, flymake-goto-next-error) (flymake-goto-prev-error): Don't mention flymake-diagnostic-types-alist in docstring. (flymake-diagnostic-types-alist): Make obsolete. (:error, :warning, :note): Put flymake-category in these symbols. (flymake-error, flymake-warning, flymake-note): Put `flymake-bitmap', not `bitmap' in these symbols. (flymake--lookup-type-property, flymake--highlight-line): Rewrite. Honor flymake-diagnostic-types-alist for backward compatibility. * lisp/progmodes/python.el (python-flymake-msg-alist): Don't mention flymake-diagnostic-types-alist.
* | run-python: Make the buffer running python currentTino Calancha2018-05-151-4/+6
| | | | | | | | | | | | | | | | * lisp/progmodes/python.el (run-python, python-shell-make-comint): Make the buffer running the inferior python process the current buffer (Bug#31398). * test/lisp/progmodes/python-tests.el (python-tests--bug31398): Add test.
* | The tedious game of whack-a-mole with compiler warnings continuesGlenn Morris2018-04-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/abbrev.el (edit-abbrevs-map): * lisp/emacs-lock.el (emacs-lock-from-exiting): * lisp/htmlfontify.el (hfy-optimisations): * lisp/ielm.el (inferior-emacs-lisp-mode-hook) (inferior-emacs-lisp-mode-map): * lisp/isearch.el (isearch-lazy-highlight-word): * lisp/select.el (x-select-enable-clipboard, x-select-enable-primary): * lisp/shell.el (shell-dirtrack-mode): * lisp/skeleton.el (skeleton-transformation, skeleton-filter): * lisp/startup.el (inhibit-splash-screen, inhibit-startup-message): * lisp/window.el (even-window-heights): * lisp/calendar/timeclock.el (timeclock-modeline-display): * lisp/cedet/semantic/db-mode.el (semanticdb-mode-hook) (semanticdb-global-mode): * lisp/emacs-lisp/edebug.el (gud-inhibit-global-bindings): * lisp/emacs-lisp/warnings.el (display-warning-minimum-level) (log-warning-minimum-level): * lisp/erc/erc-dcc.el (erc-dcc-chat-filter-hook): * lisp/gnus/nnspool.el (news-path): * lisp/org/org-agenda.el (org-agenda-search-view-search-words-only) (org-agenda-remove-tags-when-in-prefix) (org-agenda-align-tags-to-column, org-agenda-keymap): * lisp/org/org.el (org-special-ctrl-a) (org-log-state-notes-into-drawer) (org-agenda-multi-occur-extra-files): * lisp/progmodes/flymake-proc.el (flymake-err-line-patterns) (flymake-check-file-limit): * lisp/progmodes/make-mode.el (makefile-query-one-target-method): * lisp/progmodes/octave.el (inferior-octave-startup-hook): * lisp/progmodes/python.el (python-buffer) (python-preoutput-result): * lisp/progmodes/sql.el (sql-dialect): * lisp/textmodes/artist.el (artist-text-renderer): * lisp/textmodes/bibtex.el (bibtex-autokey-name-case-convert) (bibtex-autokey-titleword-case-convert): * lisp/textmodes/flyspell.el (flyspell-generic-check-word-p): * lisp/textmodes/ispell.el (ispell-format-word): * lisp/textmodes/rst.el (rst-preferred-decorations): * lisp/textmodes/sgml-mode.el (sgml-transformation): Move aliases before targets, to silence new compiler warning. * lisp/term/ns-win.el (ns-option-modifier, ns-right-option-modifier): Silence warning.
* | Fix python-shell-send-defun at start of buffer (Bug#30822)nitishch2018-04-081-3/+6
| | | | | | | | | | | | | | * lisp/progmodes/python.el (python-shell-send-defun): Handle the case when we hit the beginning of buffer. Copyright-paperwork-exempt: yes
* | Fix issues turned up by previous python.el changeNoam Postavsky2018-03-011-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See [1] for more discussion. * lisp/progmodes/python.el (python--prettify-symbols-alist): Define the obsolete alias before the variable proper, so that we correctly get the user's settings regardless of which name they set. (python-nav-end-of-statement): Add missing backslash. (python-shell-send-file): Call `expand-file-name' before `file-local-name', the expansion of "~" could be different on remote filenames. (python-mode): Declare prettify-symbols-alist instead of checking if it's bound. Use the non-obsolete python-prettify-symbols-alist name, rather than checking if the obsolete name is bound (it always is too, but the Emacs 24 byte compiler doesn't recognize that define-obsolete-variable-alias defines a variable). [1]: https://lists.gnu.org/archive/html/emacs-devel/2018-02/msg00826.html
* | Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633)Noam Postavsky2018-02-271-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Since python.el is distributed via GNU ELPA, it should be functional in earlier Emacs versions. Also fix some compile warnings. * lisp/progmodes/python.el: Bump version to 0.26.1. Define `prog-first-column' and `file-local-name' also at compile time, as needed. (inferior-python-mode-hook): Declare for the benefit of Emacs 24.3. (python-nav-end-of-statement): Fix format string for assertion error. (python-shell-tramp-refresh-process-environment): Don't `function' quote a symbol which might not be fbound. (python-mode): Only use prettify-symbols settings if they're bound.
* | Merge from origin/emacs-26Glenn Morris2018-02-171-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e5a2933 (origin/emacs-26) lisp/vc/: documentation fixes f21f8e6 Document 'desktop-files-not-to-save' d8917eb Improve documentation of Profiling features b228839 Improve indexing of "performance" in ELisp manual ab67b3e Minor change in Emacs manual's VC chapter c352434 Avoid memory corruption with specpdl overflow + edebug (Bug#3... 593bbda Document comment-fill-column in the manual (Bug#11636) bd4cc8d * doc/emacs/dired.texi (Marks vs Flags): Copyedits. 69107f3 ; Fix doc typos related to indefinite articles aaad1e6 Merge branch 'emacs-26' of git.savannah.gnu.org:/srv/git/emac... 5906418 More fixes for the Emacs manual 9ab3df1 ; Fix doc typos related to indefinite articles 66a4e65 ; Fix doc typos related to indefinite articles 35e5c57 ; Fix doc typos related to indefinite articles
| * ; Fix doc typos related to indefinite articlesGlenn Morris2018-02-161-3/+3
| |
* | * lisp/progmodes/python.el: Bump package version to 0.26.Noam Postavsky2018-02-121-1/+1
| |
* | Fix an infloop in python-nav-beginning-of-statementDmitry Gutov2018-02-121-1/+2
|/ | | | | * lisp/progmodes/python.el (python-nav-beginning-of-statement): Fix an infloop (bug#30277).
* New customization variable for python-mode indentation (Bug#28475)Ross Donaldson2018-01-011-2/+8
| | | | | | | | * lisp/progmodes/python.el (python-indent-def-block-scale): New variable. (python-indent--calculate-indentation): Let it control how many indent levels are inserted for multi-line function signatures. Copyright-paperwork-exempt: yes
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Merge branch 'widen-less' into emacs-26Dmitry Gutov2017-12-211-24/+8
|\
| * Consolidate 'widen' callsDmitry Gutov2017-12-141-24/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/prog-mode.el (prog-indentation-context): Un-document all elements but the first. (prog-widen): Remove. (http://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00321.html) * doc/lispref/text.texi (Mode-Specific Indent): Update. * lisp/progmodes/ruby-mode.el (ruby-calculate-indent): Don't call widen. * lisp/progmodes/python.el (python-indent-guess-indent-offset) (python-info-current-defun): Replace prog-widen with widen; these functions are not called during indentation. (python-indent-context) (python-indent--calculate-indentation) (python-info-dedenter-opening-block-message) (python-info-line-ends-backslash-p) (python-info-beginning-of-backslash) (python-info-continuation-line-p) (python-info-current-defun): Remove 'widen' calls. * lisp/indent.el (indent-according-to-mode) (indent-for-tab-command, indent-region): Move them here. * lisp/textmodes/mhtml-mode.el (mhtml-indent-line): Bind prog-indentation-context to one-element list.
* | Fix some more aliases to user optionsGlenn Morris2017-12-201-20/+20
| | | | | | | | | | | | | | | | | | | | * lisp/cus-edit.el (custom-mode-hook): * lisp/erc/erc.el (erc-default-coding-system): * lisp/progmodes/python.el (python-indent, python-guess-indent) (python-shell-virtualenv-path) (python-shell-completion-module-string-code) (python-shell-completion-pdb-string-code, python-use-skeletons): Define aliases to user options before the options are defined.
* | python.el doc fixesCharles A. Roelli2017-12-171-7/+6
| | | | | | | | | | | | | | * lisp/progmodes/python.el (python-shell-accept-process-output): (python-shell-comint-end-of-output-p): (python-shell-first-prompt-hook): (python-info-beginning-of-backslash): Doc fixes.
* | Add missing :version tags revealed by cusver-checkGlenn Morris2017-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/comint.el (comint-move-point-for-matching-input): * lisp/epa.el (epa-replace-original-text): * lisp/image-dired.el (image-dired-cmd-optipng-program) (image-dired-cmd-optipng-options): * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-use-jump-table): * lisp/gnus/gnus-cloud.el (gnus-cloud-storage-method) (gnus-cloud-interactive): * lisp/net/mailcap.el (mailcap-user-mime-data): * lisp/progmodes/cc-vars.el (c-asymmetry-fontification-flag) (c-noise-macro-names, c-noise-macro-with-parens-names): * lisp/progmodes/flymake.el (flymake-start-on-flymake-mode) (flymake-wrap-around): * lisp/progmodes/grep.el (grep-use-null-filename-separator): * lisp/progmodes/js.el (js-indent-align-list-continuation): * lisp/progmodes/perl-mode.el (perl-flymake-command): * lisp/progmodes/python.el (python-flymake-command) (python-flymake-command-output-pattern, python-flymake-msg-alist): * lisp/progmodes/ruby-mode.el (ruby-flymake-use-rubocop-if-available) (ruby-rubocop-config): * lisp/textmodes/less-css-mode.el (less-css): * lisp/textmodes/tex-mode.el (tex-chktex-program) (tex-chktex-extra-flags): Add missing :version tags.
* | Use forward slashes for python w32 config example (Bug#21656)Noam Postavsky2017-12-031-2/+2
| | | | | | | | | | | | * lisp/progmodes/python.el: Use forward slashes for Windows path example, it doesn't require doubling of slashes which reduces chances of confusion.
* | Disable electric indent for python strings (Bug#29305)Noam Postavsky2017-12-021-1/+5
|/ | | | | * lisp/progmodes/python.el (python-indent-post-self-insert-function): Do nothing when point or beginning of line is in string.
* Support python virtualenv on w32 (Bug#24464)Justin Timmons2017-11-051-5/+10
| | | | | | | | | | | | According to the virtualenv docs only POSIX systems follow the structure "/path/to/venv/bin/", while windows systems use "/path/to/venv/Scripts" for the location of the binary files, most importantly including the python interpreter (see: https://virtualenv.pypa.io/en/stable/userguide/#windows-notes). * lisp/progmodes/python.el (python-shell-calculate-exec-path): Use the "/path/to/venv/Scripts" for `windows-nt' machines. Copyright-paperwork-exempt: yes
* Add a Flymake backend for Python (bug#28808)Lele Gaifax2017-11-051-1/+135
| | | | | | | | | | | | | | | Implement new Flymake backend with related customizable settings. * lisp/progmodes/python.el (python-flymake-command) (python-flymake-command-output-pattern) (python-flymake-msg-alist): New defcustom. (python--flymake-parse-output): New function, able to parse python-flymake-command output accordingly to python-flymake-command-output-pattern. (python-flymake): New function implementing the backend interface using python--flymake-parse-output for the real work. (python-mode): Add python-flymake to flymake-diagnostic-functions.
* Disable python native completion on w32 (Bug#28580)Noam Postavsky2017-10-151-2/+3
| | | | | | * lisp/progmodes/python.el (python-shell-completion-native-disabled-interpreters): For windows-nt systems, put an empty string to match interpreters.
* Make python prettify symbols into a defvar (Bug#28713)Noam Postavsky2017-10-071-2/+6
| | | | | | | * lisp/progmodes/python.el (python-prettify-symbols-alist): New variable. (python--prettify-symbols-alist): Make into obsolete alias for `python-prettify-symbols-alist'.
* Give more helpful messages for python completion setup failuresNoam Postavsky2017-10-021-1/+5
| | | | | | | * lisp/progmodes/python.el (python-shell-completion-native-setup): In case the completion setup failed with some exception, print out the exception type and message. If libedit is detected, raise an exception, since this is known to fail.
* Improve python3-compatibility of fallback completion (Bug#28499)Joerg Behrmann2017-09-251-3/+3
| | | | | | | | * lisp/progmodes/python.el (python-eldoc-setup-code): Use inspect.getfullargspec instead of inspect.getargspec to avoid a deprecation warning on every usage of eldoc in python-mode. Copyright-paperwork-exempt: yes
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-3/+3
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Disable completion while entering python multiline statementsNoam Postavsky2017-08-271-1/+15
| | | | | | | | | | | The "legacy" completion mechanism sends newlines to the running python process to get the list of completions, which confuses things if the user is in the middle of entering a multiline statement (Bug#28051). It's better to disable completion in this case. * lisp/progmodes/python.el (python-shell--block-prompt): New variable. (python-shell-prompt-set-calculated-regexps): Set it. (python-shell-completion-at-point): Return 'ignore' as the completion function when the current prompt is a block prompt.
* Work around w32-python-2.x bug to fix prompt detection (Bug#21376)Noam Postavsky2017-08-201-1/+5
| | | | | | * lisp/progmodes/python.el (python-shell-prompt-detect): Don't put carriage returns into the temporary file when running in unbuffered mode, the w32 build of python 2.7 chokes on them.
* * lisp/progmodes/python.el (auto-mode-alist): Add .pyi. (Bug#27847)Glenn Morris2017-07-051-1/+1
|
* Add watch for password back to inferior python comint filterGlenn Morris2017-06-021-1/+2
| | | | | | | | It was removed along with other items for speed (bug#16875), but doesn't seem to have been causing an issue, and it's useful to have it there (bug#27154). * lisp/progmodes/python.el (inferior-python-mode): Add comint-watch-for-password-prompt to comint-output-filter-functions.
* Comply with pep 8 style guide for backslash in assignment (Bug#24809)Jules Tamagnan2017-05-281-1/+1
| | | | | | | | * lisp/progmodes/python.el (python-indent--calculate-indentation): Increase indent by `python-indent-offset' after `:after-backslash-assignment-continuation'. Copyright-paperwork-exempt: yes
* Protect against an infloop in python-modePhilipp Stephani2017-03-231-3/+13
| | | | | | | | | | | | | | | | | There appears to be an edge case caused by using `syntax-ppss' in a narrowed buffer during JIT lock inside of Python triple-quote strings. Unfortunately it is impossible to reproduce without manually destroying the syntactic information in the Python buffer, but it has been observed in practice. In that case it can happen that the syntax caches get sufficiently out of whack so that there appear to be overlapping strings in the buffer. As Python has no nested strings, this situation is impossible and leads to an infloop in `python-nav-end-of-statement'. Protect against this by checking whether the search for the end of the current string makes progress. * python.el (python-nav-end-of-statement): Protect against infloop. * progmodes/python-tests.el (python-tests--python-nav-end-of-statement--infloop): Add unit test.
* Merge from origin/emacs-25Paul Eggert2017-03-191-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a094732 * etc/PROBLEMS: Say that HP-UX cc doesn't work. 1925dd9 Fix duplicate wording in Emacs manual 6de8429 * lisp/paren.el (show-paren--default, show-paren-function): A... 2d671fd Fix wording in Emacs manual a8766a2 Document how to customize input methods 6eb8995 * lisp/net/eww.el (eww-reload): Doc fix. (Bug#25981) aceac95 Fix warning message about native completion (Bug#25984) a314c1f Clarify documentation of 'raise' and 'height' display specs f366f6e Mention problems with GPaste in PROBLEMS 6e788ef ; etc/PROBLEMS: Explain about the python+libedit problem (Bug... 6406618 Fix doc strings in info.el c1ed152 ; * src/keyboard.c (Fposn_at_point): Fix last change. eed9677 Fix doc string of 'posn-at-point' 0d5957e Documentation fix in elisp reference manual
| * Fix warning message about native completion (Bug#25984)Noam Postavsky2017-03-051-1/+1
| | | | | | | | | | * lisp/progmodes/python.el (python-shell-completion-native-turn-on-maybe): The relevant variable is `python-shell-completion-native-enable'.