aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* ; Minor stylistic fixes found by checkdocStefan Kangas2021-09-161-11/+10
|
* Tweak python-hideshow-forward-sexp-function warning avoidanceLars Ingebrigtsen2021-09-151-2/+1
| | | | | | | * lisp/progmodes/python.el (python-hideshow-forward-sexp-function): Avoid compilation warning in a more standard way. Problem reported in https://thedailywtf.com/articles/the-programmer-s-motto-and-other-comments
* Python shell: rearrange printing of newline before outputAugusto Stoffel2021-09-151-4/+8
| | | | | | | | | | * progmodes/python.el (python-shell-output-filter-in-progress) (python-shell-output-filter-buffer): Move defvars to avoid compiler warnings. (python-shell-eval-setup-code): Don't print a newline in __PYTHON_EL_eval. (python-shell-send-string): Insert newline before output when applicable (bug#50514).
* Keep python.el compatible with older EmacsenAugusto Stoffel2021-09-111-1/+3
| | | | | * progmodes/python.el (python-shell-send-string): Don't assume comint-max-line-length is defined (bug#50503).
* Allow using 'python-shell-send-file' across machinesAugusto Stoffel2021-09-111-15/+30
| | | | | | | | | * progmodes/python.el (python-shell-eval-file-setup-code): Look for a file coding cookie on the Python rather than on the Emacs side, to avoid additional file transfers. (python-shell--save-temp-file): Allow argument to be a buffer. (python-shell-send-file): Address the case where the selected file and the inferior process are on different machines (bug#50516).
* Implement caching for 'python-shell-completion-at-point'Augusto Stoffel2021-09-111-29/+30
| | | | | | | | | | | | | * lisp/progmodes/python.el (python-shell-completion-at-point): cache results, since computing them involves talking with the inferior process and, potentially, network communications (python-shell--capf-cache): new variable, for cache (python-shell-completion-get-completions) (python-shell-completion-native-get-completions): 'import' argument is not needed anymore. (python-shell-completion-native-setup) (python-shell-completion-native-try): pass the setup code synchronously, to avoid printing a message in the shell (bug#50459).
* Revert usage of format-prompt in python.elLars Ingebrigtsen2021-09-101-1/+3
| | | | | | * lisp/progmodes/python.el (python-eldoc-at-point): Revert usage of format-prompt in python.el since this is also an ELPA package (and older Emacs versions doesn't have format-prompt).
* Properly encode all strings sent to Python shellAugusto Stoffel2021-09-101-43/+21
| | | | | | | | | | * lisp/progmodes/python.el: Now depends on Emacs 28. (python-shell-package-enable, python-shell-completion-get-completions) (python-ffap-module-path, python-eldoc--get-doc-at-point): Enconde Python strings using 'python-shell--encode-string' instead of triple quotes. (python-shell-completion-string-code, python-eldoc-string-code) (python-ffap-string-code): Remove defcustoms. (bug#50503).
* ; * lisp/progmodes/python.el (python-shell-send-string): Fix last change.Eli Zaretskii2021-09-091-1/+1
|
* Fix a recent change wrt 'comint-max-line-length'Eli Zaretskii2021-09-091-1/+2
| | | | | | | | | * lisp/progmodes/python.el (python-shell-send-string): Only heed 'comint-max-line-length' for subprocesses with which we communicate via PTYs. (Bug#49822) * lisp/comint.el (comint-max-line-length): Doc fix. Add a value for MS-Windows.
* Better treatment of line length limits for the Python inferiorAugusto Stoffel2021-09-091-47/+51
| | | | | | | | | | | | | | | * lisp/comint.el (comint-max-line-length): New constant reflecting a safe maximum line size that can be sent to an inferior process. * lisp/progmodes/python.el (python-shell-comint-watch-for-first-prompt-output-filter): Send setup code to the inferior process only once and at this stage. (python-shell-eval-setup-code, python-shell-eval-file-setup-code): Move, unchanged, to an earlier point to avoid byte-compiler warnings. (python-shell-send-string-no-output): Revert changes of e32c7d2a8d (python-shell-send-string): Use 'comint-max-line-length' to decide when to resort to temp files. (python-shell-send-string, python-shell-send-file): Don't send setup code each time (bug#49822).
* Don't disable ipython as a native interpreterLars Ingebrigtsen2021-09-081-4/+3
| | | | | | | * lisp/progmodes/python.el (python-shell-completion-native-disabled-interpreters): Remove ipython from list, because it apparently works fine these days (bug#50458).
* Fixes for 'python-shell-send-string' and 'python-shell-send-file'Augusto Stoffel2021-09-051-15/+31
| | | | | | | * lisp/progmodes/python.el (python-shell-send-string): use a temporary file for sufficiently long strings. (python-shell-send-file, python-shell-eval-file-setup-code): Avoid showing "plumbing code" in the traceback (bug#32042).
* Change Python eval to send directly instead of using temporary filesAugusto Stoffel2021-09-031-14/+50
| | | | | | | | | | * lisp/progmodes/python.el (python-shell-eval-setup-code): New const for setting up eval (bug#49822). (python-shell--encode-string): New function. (python-shell-send-string): Use it to send commands directly instead of writing to a temporary file. (python-shell-send-string-no-output): Adjust sending. (python-shell-send-file): Ditto.
* python-shell-interpreter doc string clarificationLars Ingebrigtsen2021-08-271-1/+6
| | | | | * lisp/progmodes/python.el (python-shell-interpreter): Note what to do when using ipython3 (bug#44732).
* Allow evaluating Python code across machinesAugusto Stoffel2021-08-151-1/+2
| | | | | * python.el (python-shell-send-string): Ensure that the temporary file is created in the host running the Python process (bug#50057).
* Add new user option python-forward-sexp-functionLars Ingebrigtsen2021-07-311-9/+9
| | | | | | * lisp/progmodes/python.el (python-forward-sexp-function): New user option (bug#41361). (python-mode): Use it.
* Fix filling of overlong first lines in Python doc stringsDeneb Meketa2021-05-271-1/+6
| | | | | | | * lisp/progmodes/python.el (python-fill-string): Fill overlong first lines correctly (bug#20860). Copyright-paperwork-exempt: yes
* ; Remove some useless commentsStefan Kangas2021-04-161-2/+0
|
* Fix python-shell-switch-to-shell redisplay bugShitikanth Kashyap2021-04-121-1/+2
| | | | | | | * lisp/progmodes/python.el (python-shell-switch-to-shell): Redisplay the switched-to window faster (bug#47679). Copyright-paperwork-exempt: yes
* Remove redundant #' before lambda in progmodes/*.elStefan Kangas2021-04-011-4/+4
| | | | | | | | | | | * lisp/progmodes/cc-styles.el (c-set-offset): * lisp/progmodes/ebnf-yac.el (ebnf-yac-token-table): * lisp/progmodes/ebnf2ps.el (ebnf-format-float, ebnf-map-name): * lisp/progmodes/grep.el (lgrep, rgrep-default-command): * lisp/progmodes/inf-lisp.el: * lisp/progmodes/octave.el (octave-lookfor): * lisp/progmodes/python.el (python-pdbtrack-tracking-finish): Remove redundant #' before lambda.
* Revert "Do interactive mode tagging for python.el navigation functions."Lars Ingebrigtsen2021-02-181-18/+18
| | | | | | This reverts commit 546f552e7b2439b482c7d28222fb88761a9c876a. This is a "core package", so can't use the new syntax.
* Do interactive mode tagging for python.el navigation functions.Doug Davis2021-02-181-18/+18
| | | | | | * lisp/progmodes/python.el (navigation functions): Add python-mode to `interactive' declarations for mode-specific commands (bug#46610). Copyright-paperwork-exempt: yes
* Deactivate region in `C-c C-r' in python-modeLars Ingebrigtsen2021-02-041-1/+2
| | | | | | * lisp/progmodes/python.el (python-shell-send-region): Deactivate mark after executing (bug#28789). This is how this command worked in Emacs 24, apparently.
* Default python-shell-interpreter to python3Glenn Morris2021-01-101-1/+5
| | | | | * lisp/progmodes/python.el (python-shell-interpreter): Default to python3 (bug#45655).
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Make python-mode fontify more assignment statementsDario Gjorgjevski2020-12-211-27/+69
| | | | | | | | * lisp/progmodes/python.el (python-font-lock-assignment-matcher): New function to match assignment statements. (python-rx): Add `assignment-target' and `grouped-assignment-target'. (python-font-lock-keywords-maximum-decoration): Add new matchers (bug#45341).
* Fix narrow-to-defun in python-modeTomas Nordin2020-12-141-4/+11
| | | | | | | * lisp/progmodes/python.el (python-nav--beginning-of-defun): Make narrow-to-defun work better in classes (bug#40563). Copyright-paperwork-exempt: yes
* Prefer setq-local in python.elStefan Kangas2020-12-121-79/+71
| | | | | | | | | | | | | * lisp/progmodes/python.el: Require Emacs 24.2 instead of 24.1. (python-indent-guess-indent-offset) (python-shell-font-lock-with-font-lock-buffer) (python-shell-font-lock-turn-on) (python-shell-font-lock-turn-off, python-shell-font-lock-toggle) (python-shell-comint-watch-for-first-prompt-output-filter) (inferior-python-mode, python-shell-completion-native-turn-off) (python-shell-completion-native-turn-on) (python-pdbtrack-comint-output-filter-function, python-mode): Prefer setq-local.
* * lisp/progmodes/python.el: Bump version.Stefan Kangas2020-12-111-1/+1
|
* Recompute error positions in python-shell-send-regionLars Ingebrigtsen2020-12-031-0/+6
| | | | | * lisp/progmodes/python.el (python-shell-send-region): Recompute line positions when evaluating (bug#22934).
* Remove redundant installation instructionsStefan Kangas2020-11-121-8/+1
| | | | | | | | | | | | | | | | | | | | | | * lisp/net/newsticker.el: * lisp/net/sieve-mode.el: * lisp/play/bubbles.el: * lisp/play/handwrite.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/whitespace.el: Remove redundant installation instructions. These packages are distributed with Emacs and/or GNU ELPA. * lisp/calendar/timeclock.el: * lisp/ehelp.el: * lisp/emacs-lisp/checkdoc.el: * lisp/filesets.el: * lisp/mail/reporter.el: * lisp/net/rfc2104.el: * lisp/net/webjump.el: * lisp/pixel-scroll.el: Remove redundant recommendation to call require before using autoloaded functions. * lisp/tar-mode.el: Remove reference to package uncompress, removed in Emacs 23.
* Fix python-font-lock-keywords-maximum-decoration performance regressionDario Gjorgjevski2020-11-111-11/+8
| | | | | | | * lisp/progmodes/python.el (python-font-lock-keywords-maximum-decoration): `symbol-name' should not be quantified by a `+' as it is redundant and performs very badly (bug#44572).
* Fix font lock of assignments with type hints in PythonDario Gjorgjevski2020-11-111-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/python.el (python-font-lock-keywords-maximum-decoration): Fix regular expressions for font lock of assignments with type hints (bug#44568). The font lock of assignments with type hints in Python is rather bad. Consider the following example: from typing import Mapping, Tuple, Sequence var1: int = 5 var2: Mapping[int, int] = {10: 1024} var3: Mapping[Tuple[int, int], int] = {(2, 5): 32} var4: Sequence[Sequence[int]] = [[1], [1, 2], [1, 2, 3]] var5: Sequence[Mapping[str, Sequence[str]]] = [ { 'red': ['scarlet', 'vermilion', 'ruby'], 'green': ['emerald green', 'aqua'] }, { 'sword': ['cutlass', 'rapier'] } ] As things stand right now, only ‘var1’ would be highlighted. To make things worse, the ‘Mapping’ type hint of ‘var2’ would also be highlighted, which is entirely incorrect. This commit makes all of ‘var1’ through ‘var5’ be highlighted correctly.
* Make the SHOW parameter work again in `run-python'Lars Ingebrigtsen2020-11-091-1/+1
| | | | | * lisp/progmodes/python.el (run-python): Make the SHOW parameter work again after the fix for 31398 (bug#44421).
* Fix misuses of `make-local-variable` on hooksStefan Monnier2020-11-041-2/+2
| | | | | | | | | | | | | | * lisp/vc/smerge-mode.el (smerge-ediff): * lisp/progmodes/python.el (python-pdbtrack-setup-tracking): * lisp/net/tramp-smb.el (tramp-smb-call-winexe): * lisp/net/secrets.el (secrets-mode): * lisp/mail/rmail.el (rmail-variables): * lisp/ielm.el (inferior-emacs-lisp-mode): * lisp/erc/erc-log.el (erc-log-setup-logging): Use `add-hook`. * lisp/eshell/em-unix.el (eshell/diff): * lisp/eshell/em-hist.el (eshell-hist-initialize): Don't `make-local-variable` on hooks.
* Tweak previous python-mode region fixLars Ingebrigtsen2020-10-301-1/+12
| | | | | | * lisp/progmodes/python.el (python-shell-buffer-substring): Tweak the previous fix for bug#39398 to behave somewhat more like it used to.
* Tweak how `C-c C-r' computes the region in python-modeLars Ingebrigtsen2020-10-271-5/+1
| | | | | | * lisp/progmodes/python.el (python-shell-buffer-substring): Don't extend the region to the start of the line (bug#39398), but allow sending the actual region as marked.
* ; Prefer https to http in more URLsStefan Kangas2020-10-241-1/+1
| | | | These were all tested and confirmed working.
* * lisp/progmodes/python.el: Bump version to release the f-string supportStefan Monnier2020-10-191-1/+1
|
* * lisp/progmodes/python.el: Teach f-strings to `font-lock`Stefan Monnier2020-10-161-3/+52
| | | | | (python--f-string-p, python--font-lock-f-strings): New functions. (python-font-lock-keywords-maximum-decoration): Use them.
* Merge from origin/emacs-27Glenn Morris2020-10-021-6/+8
|\ | | | | | | | | | | | | | | | | 78eacf31e8 ; Fix many typos in symbols in docs and comments d5d12707d6 * doc/misc/flymake.texi (Using Flymake): Fix a typo. (Bug... # Conflicts: # lisp/allout.el # lisp/progmodes/ebrowse.el
| * ; Fix many typos in symbols in docs and commentsStefan Kangas2020-10-021-6/+8
| |
* | Make `C-c C-e' in Python buffers workLars Ingebrigtsen2020-10-021-10/+13
| | | | | | | | | | | | | | | | * lisp/progmodes/python.el (python-shell-send-statement): Don't send a cookie, because that leads to the naked expression not being evaled (bug#43450). (python-shell-send-region): Allow not sending a cookie. (python-shell-buffer-substring): Ditto.
* | python-shell-send-defun doesn't find the (whole) definitionPer Starbäck2020-10-021-21/+23
| | | | | | | | | | * lisp/progmodes/python.el (python-shell-send-defun): Fix C-M-x for definitions like @property\ndef bar(): (bug#37828).
* | Fix the defcustom type fix in python.elLars Ingebrigtsen2020-09-251-1/+1
| | | | | | | | | | * lisp/progmodes/python.el (python-pdbtrack-exit-command): Fix defcustom type (bug#30990).
* | Fix some defcustom typesLars Ingebrigtsen2020-09-251-2/+2
| | | | | | | | | | | | | | | | | | | | * lisp/whitespace.el (whitespace-style): * lisp/gnus/message.el (message-screenshot-command): * lisp/progmodes/compile.el (compilation-transform-file-match-alist): * lisp/progmodes/gdb-mi.el (gdb-default-window-configuration-file): * lisp/progmodes/python.el (python-pdbtrack-exit-command): Fix the defcustom types. * lisp/progmodes/sql.el (sql-password-wallet): Fix the value.
* | ; Fix typosStefan Kangas2020-09-211-4/+4
| |
* | Fix slow python-mode inserts when there's a lot of stringsNoam Postavsky2020-09-201-15/+16
| | | | | | | | | | * lisp/progmodes/python.el (python-info-docstring-p): Doing more than two repetitions here doesn't improve indentation (bug#39598).
* | Use `format-prompt' when prompting with default valuesLars Ingebrigtsen2020-09-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/woman.el (woman-file-name): * lisp/wid-edit.el (widget-file-prompt-value) (widget-coding-system-prompt-value): * lisp/w32-fns.el (w32-set-system-coding-system): * lisp/vc/vc.el (vc-print-root-log): * lisp/vc/vc-annotate.el (vc-annotate): * lisp/vc/emerge.el (emerge-read-file-name): * lisp/vc/ediff.el (ediff-directories) (ediff-directory-revisions, ediff-directories3) (ediff-merge-directories, ) (ediff-merge-directories-with-ancestor) (ediff-merge-directory-revisions) (ediff-merge-directory-revisions-with-ancestor) (ediff-merge-revisions, ediff-merge-revisions-with-ancestor) (ediff-revision): * lisp/vc/ediff-util.el (ediff-toggle-regexp-match): * lisp/vc/ediff-mult.el (ediff-filegroup-action): * lisp/vc/add-log.el (prompt-for-change-log-name): * lisp/textmodes/table.el (table-insert-row-column) (table-span-cell, table-split-cell-horizontally) (table-split-cell, table-justify, table-generate-source) (table-insert-sequence, table-capture) (table--read-from-minibuffer, table--query-justification): * lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help): * lisp/textmodes/reftex-ref.el (reftex-goto-label): * lisp/textmodes/refer.el (refer-get-bib-files): * lisp/textmodes/css-mode.el (css-lookup-symbol): * lisp/term.el (serial-read-name, serial-read-speed): * lisp/speedbar.el (speedbar-change-initial-expansion-list): * lisp/simple.el (previous-matching-history-element) (set-variable): * lisp/ses.el (ses-read-cell, ses-set-column-width): * lisp/replace.el (query-replace-read-from) (occur-read-primary-args): * lisp/rect.el (string-rectangle, string-insert-rectangle): * lisp/progmodes/tcl.el (tcl-help-on-word): * lisp/progmodes/sh-script.el (sh-set-shell): * lisp/progmodes/python.el (python-eldoc-at-point): * lisp/progmodes/octave.el (octave-completing-read) (octave-update-function-file-comment, octave-insert-defun): * lisp/progmodes/inf-lisp.el (lisp-symprompt): * lisp/progmodes/cperl-mode.el (cperl-info-on-command) (cperl-perldoc): * lisp/progmodes/compile.el (compilation-find-file): * lisp/net/rcirc.el (rcirc-prompt-for-encryption): * lisp/net/eww.el (eww): * lisp/net/browse-url.el (browse-url-with-browser-kind): * lisp/man.el (man): * lisp/mail/sendmail.el (sendmail-query-user-about-smtp): * lisp/mail/mailalias.el (build-mail-aliases): * lisp/mail/mailabbrev.el (merge-mail-abbrevs) (rebuild-mail-abbrevs): * lisp/locate.el (locate-prompt-for-search-string): * lisp/isearch.el (isearch-occur): * lisp/international/ogonek.el (ogonek-read-encoding) (ogonek-read-prefix): * lisp/international/mule.el (read-buffer-file-coding-system) (set-terminal-coding-system, set-keyboard-coding-system) (set-next-selection-coding-system, recode-region): * lisp/international/mule-cmds.el () (universal-coding-system-argument, search-unencodable-char) (select-safe-coding-system-interactively): * lisp/info.el (Info-search, Info-search-backward, Info-menu): * lisp/info-look.el (info-lookup-interactive-arguments): * lisp/imenu.el (imenu--completion-buffer): * lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode): * lisp/hi-lock.el (hi-lock-unface-buffer) (hi-lock-read-face-name): * lisp/help.el (view-emacs-news, where-is): * lisp/help-fns.el (describe-variable, describe-symbol) (describe-keymap): * lisp/gnus/mm-decode.el (mm-save-part): * lisp/gnus/gnus-sum.el (gnus-summary-browse-url): * lisp/gnus/gnus-group.el (gnus-group--read-bug-ids) (gnus-group-set-current-level): * lisp/frame.el (make-frame-on-monitor) (close-display-connection, select-frame-by-name): * lisp/format.el (format-encode-buffer, format-encode-region): * lisp/files.el (recode-file-name): * lisp/files-x.el (read-file-local-variable) (read-file-local-variable-value, ) (read-file-local-variable-mode): * lisp/ffap.el (ffap-menu-ask): * lisp/faces.el (face-read-string): * lisp/facemenu.el (facemenu-set-charset): * lisp/erc/erc-dcc.el (erc-dcc-do-GET-command): * lisp/emulation/edt-mapper.el (edt-mapper): * lisp/emacs-lisp/trace.el (trace--read-args) (trace-function-foreground, trace-function-background): * lisp/emacs-lisp/smie.el (smie-config-set-indent): * lisp/emacs-lisp/re-builder.el (reb-change-syntax): * lisp/emacs-lisp/package.el (describe-package): * lisp/emacs-lisp/find-func.el (read-library-name) (find-function-read): * lisp/emacs-lisp/ert.el (ert-read-test-name) (ert-run-tests-interactively): * lisp/emacs-lisp/disass.el (disassemble): * lisp/emacs-lisp/debug.el (debug-on-entry) (debug-on-variable-change): * lisp/emacs-lisp/advice.el (ad-read-advised-function) (ad-read-advice-class, ad-read-advice-name, ad-read-regexp): * lisp/dired-x.el (dired--mark-suffix-interactive-spec): * lisp/dired-aux.el (dired-diff): * lisp/cus-edit.el (custom-variable-prompt, customize-mode) (customize-changed-options): * lisp/completion.el (interactive-completion-string-reader): * lisp/calendar/timeclock.el (timeclock-ask-for-project): * lisp/calc/calcalg3.el (calc-get-fit-variables): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-bin.el (calc-word-size): * lisp/bookmark.el (bookmark-set-internal): * lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for prompting (bug#12443).