| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
* lisp/progmodes/python.el (python-shell-setup-code)
(python-shell-readline-detect): Improve Python code. (Bug#80551)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The custom Pdb class enables native completion in pdb by
wrapping the pdb's native completer. It also makes necessary
function definitions like __PYTHON_EL_* available between pdb
frames, and enables non-native completion/ffap/eldoc
functionalities when debugging inside python modules.
* lisp/progmodes/python.el (python-shell-send-setup-code): Fix
the separator between python-shell-setup-codes.
(python-shell-completion-native-setup): Move common completion
setup code ...
(python-shell-completion-setup-code): ... here.
(python-shell-completion-at-point): Enable native completion for
pdb and respect the delimiter of pdb completer.
(python-shell-pdb-setup-code): New variable.
(python-shell-comint-watch-for-first-prompt-output-filter): Send
setup codes only once.
(python-ffap-module-path, python-eldoc--get-doc-at-point): Stop
sending setup code in every function call.
* test/lisp/progmodes/python-tests.el (python-tests--pdb-1)
(python-shell-pdb-1): New test.
* etc/NEWS: Mention the change. (bug#80182)
|
| |
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el: Since they are included in emacs 29.1,
remove the Package-Requires for seq, project, and flymake.
(require 'project): Remove 'noerror argument.
(python-shell-get-process-name): Remove (featurep 'project).
Use 'project-name'.
(run-python)
(python--import-sources): Remove (featurep 'project). (Bug#80405)
|
| |
|
|
|
|
|
| |
This reverts commit 482748592f61abed6f675e7b62b2d56e4e18a146.
Commit 583a112169f0c964552b94f84ea0c942377a14e6 removed
'project-name-cached' and also resolved bug#80045.
|
| |
|
|
|
|
| |
* etc/NEWS: Announce the change.
* lisp/progmodes/python.el (python-eldoc-function-timeout):
Change the type. (Bug#80045)
|
| |
|
|
|
|
|
|
| |
* lisp/progmodes/python.el
(python-shell-get-project-name): New function.
(python-shell-get-process-name): Use it. (Bug#80045)
Co-authored-by: Liu Hui <liuhui1610@gmail.com>
|
| |
|
|
|
|
| |
This reverts commit 83b4f1ba26844c178e57ecb93ea8db36e8e6fa89.
We concluded that it is better to use 'project-name-cached'.
(Bug#80045)
|
| |
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-ts-mode):
Set 'treesit-sexp-thing-down-list' to 'list' to override
sexp navigation with list navigation (bug#72478).
* lisp/emacs-lisp/lisp.el (up-list): Mention 'up-list-function' in docstring.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'python-shell-get-process' is frequently called from
'python-eldoc--get-doc-at-point' and etc., invoking
'project-current' unless there is a buffer-specific Inferior
Python process. When the buffer is a remote buffer not
belonging to any project and has significant latency,
'project-current' may take a long time. To avoid this,
implement a process cache in 'python-shell-get-process'.
* lisp/progmodes/python.el (python-shell--process-cache)
(python-shell--process-cache-valid): New variables.
(python-shell--invalidate-process-cache): New function.
(python-shell-make-comint): Add a call to the above function.
(python-shell-get-process): Add process cache. (Bug#80045)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, both the definition of __PYTHON_EL_get_completions
and the call to __PYTHON_EL_get_completions were sent to the
inferior Python each time
'python-shell-completion-get-completions' was executed.
However, there is no need to send the definition every time as
long as the definition remains unchanged. We improved this so
that the definition of __PYTHON_EL_get_completions is only sent
during the inferior Python initialization; it is no longer sent
during 'python-shell-completion-get-completions' execution.
* lisp/progmodes/python.el
(python-shell-completion-send-setup-code): New function.
(python-shell-first-prompt-hook): Add the above new function.
(python-shell-completion-get-completions): Omit sending
'python-shell-completion-setup-code'. (Bug#80182)
|
| |
|
|
|
|
| |
* lisp/progmodes/python.el (python-shell-eval-file-setup-code):
For Python 3, use built-in open instead of codecs.open to address the
deprecation of codecs.open in Python 3.14. (Bug#79723)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In 'python-shell-completion-get-completions', since output from the
inferior Python is expected to be in JSON format, commands being echoed
back or warning messages being output caused parsing errors. We
improved this by re-parsing only the last line when a parsing error
occurs, preventing echo-back or warning messages from affecting parsing.
* lisp/progmodes/python.el
(python-shell-completion-get-completions): Improved to re-parse
only the last line when a JSON parse error occurs. (Bug#79723)
|
| | |
|
| |
|
|
|
| |
* lisp/progmodes/python.el (python-indent-guess-indent-offset-verbose):
Fix typo in configuration of safe value function. (Bug#80085)
|
| |
|
|
|
|
| |
* lisp/progmodes/hideshow.el (hs-grok-mode-type): Improve 'hs--set-variable'.
* lisp/progmodes/python.el (python-base-mode, python-ts-mode):
Provide backward-compatibility for older versions.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/hideshow.el: Set default values of buffer-local variables.
(hs-inside-comment-p): Restore.
(hs--set-variable): Rename from 'hs--get-mode-value'.
(hs-grok-mode-type): Rework.
* lisp/nxml/nxml-mode.el:
* lisp/progmodes/f90.el:
* lisp/progmodes/fortran.el:
* lisp/progmodes/icon.el:
* lisp/progmodes/lua-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/verilog-mode.el:
* lisp/progmodes/vhdl-mode.el:
* lisp/textmodes/mhtml-mode.el:
* lisp/textmodes/sgml-mode.el:
* lisp/treesit.el (treesit-major-mode-setup): Rename
'hs-forward-sexp-func' to 'hs-forward-sexp-function',
'hs-adjust-block-beginning' to 'hs-adjust-block-beginning-function',
'hs-find-block-beginning-func' to 'hs-find-block-beginning-function',
'hs-find-next-block-func' to 'hs-find-next-block-function',
'hs-looking-at-block-start-p-func' to 'hs-looking-at-block-start-predicate',
'hs-inside-comment-p-func' to 'hs-inside-comment-predicate'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/emacs/programs.texi (Hideshow):
* etc/NEWS: Fix doc.
* lisp/progmodes/hideshow.el: Update Commentary Header.
(hs-modes-alist): Remove.
(hs--get-mode-value, hs-grok-mode-type): Rework.
* lisp/treesit.el (treesit-major-mode-setup):
* lisp/emacs-lisp/lisp-mode.el:
* lisp/nxml/nxml-mode.el:
* lisp/progmodes/cc-mode.el:
* lisp/progmodes/f90.el:
* lisp/progmodes/fortran.el:
* lisp/progmodes/hideshow.el:
* lisp/progmodes/icon.el:
* lisp/progmodes/js.el:
* lisp/progmodes/lua-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/verilog-mode.el:
* lisp/progmodes/vhdl-mode.el:
* lisp/textmodes/bibtex.el:
* lisp/textmodes/mhtml-mode.el:
* lisp/textmodes/sgml-mode.el:
* lisp/treesit.el: Fix and rework previous changes.
|
| |
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-ts-hs-adjust-block-end-fn):
* lisp/progmodes/hideshow.el (hs-modes-alist)
(hs-adjust-block-end, hs-inside-comment-p-func): Doc fixes.
(bug#79671)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rewrite the format in 'hs-special-modes-alist' to make easier to
exclude some values, add support for settings inheritance
according to current major mode and parents, and support string
hiding for lisp modes.
Bug#79671
* lisp/progmodes/hideshow.el (hs-modes-alist): New variable.
(hs-special-modes-alist): Mark as obsolete.
(hs-forward-sexp-func, hs-adjust-block-beginning)
(hs-find-block-beginning-func, hs-find-next-block-func)
(hs-looking-at-block-start-p-func): Set default values to nil.
(hs-inside-comment-p): Remove function.
(hs-adjust-block-end, hs-treesit-things): New buffer-local
variables.
(hs-block-positions): Minor updates.
(hs--get-mode-value): New function.
(hs-grok-mode-type): Rewrite.
* lisp/progmodes/f90.el (hs-special-modes-alist):
* lisp/progmodes/fortran.el (hs-special-modes-alist):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/lua-mode.el (lua-mode):
* lisp/progmodes/python.el (python-base-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vhdl-mode.el (vhdl-hs-minor-mode): Rewrite
settings.
* lisp/progmodes/python.el (python-ts-hs-adjust-block-end-fn):
New function.
* lisp/treesit.el (treesit-hs-block-end)
(treesit-hs-find-block-beginning, treesit-hs-find-next-block)
(treesit-hs-looking-at-block-start-p): Minor updates.
* doc/emacs/programs.texi (Hideshow):
* etc/NEWS: Document changes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/c-ts-mode.el:
* lisp/progmodes/cmake-ts-mode.el:
* lisp/progmodes/csharp-mode.el:
* lisp/progmodes/dockerfile-ts-mode.el:
* lisp/progmodes/elixir-ts-mode.el:
* lisp/progmodes/go-ts-mode.el:
* lisp/progmodes/heex-ts-mode.el:
* lisp/progmodes/java-ts-mode.el:
* lisp/progmodes/js.el:
* lisp/progmodes/json-ts-mode.el:
* lisp/progmodes/lua-ts-mode.el:
* lisp/progmodes/php-ts-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/ruby-ts-mode.el:
* lisp/progmodes/rust-ts-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/progmodes/typescript-ts-mode.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/markdown-ts-mode.el:
* lisp/textmodes/mhtml-ts-mode.el:
* lisp/textmodes/toml-ts-mode.el:
* lisp/textmodes/yaml-ts-mode.el: In autoload forms replace
'(treesit-available-p)' with (boundp 'treesit-major-mode-remap-alist).
Calling 'treesit-available-p' in loaddefs.el is too early
since the tree-sitter library might not be loaded yet.
Checking if 'treesit-major-mode-remap-alist' is bound is
equivalent to checking if Emacs is compiled with tree-sitter support.
(bug#79622)
|
| |
|
|
|
| |
* lisp/progmodes/python.el (treesit-node-prev-sibling)
(treesit-node-field-name-for-child): Declare.
|
| |
|
|
|
| |
* lisp/progmodes/python.el (python--treesit-fontify-string):
Make sure there's no infloop.
|
| |
|
|
|
| |
* lisp/progmodes/python.el (python--treesit-fontify-string): Use
new algorithm.
|
| |
|
|
|
| |
* lisp/progmodes/python.el (inferior-python-mode): Mention the
correct mode-map in the doc string. (Bug#79386)
|
| |
|
|
|
|
| |
(python-ts-mode): Don't duplicate 'auto-mode-alist' and
'interpreter-mode-alist' settings in Emacs 31 (bug#79180).
Add ts-mode mapping to 'treesit-major-mode-remap-alist'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-shell-local-prefix): New
constant.
(python-shell--convert-file-name-to-send): New function to
add/remove prefix.
(python-shell-send-string, python-shell-send-file): Changed to
use 'python-shell--convert-file-name-to-send'.
(python-pdbtrack-set-tracked-buffer): Changed to add/remove
prefix.
* test/lisp/progmodes/python-tests.el
(python-shell--convert-file-name-to-send-1): New test.
(Bug#79036)
|
| |
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-indent-dedent-line-backspace):
Delete the text in the region if Transient Mark mode is enabled,
the mark is active, and prefix arg is 1. (Bug#48695)
* test/lisp/progmodes/python-tests.el
(python-indent-dedent-line-backspace-4): Add new test.
|
| |
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python--thing-settings):
For the 'sexp' thing use all nodes except top-level
grouping nodes, comments and parens. Add the 'list' thing.
(python-ts-mode): Use setq-local for treesit-thing-settings.
Modify 'forward-sexp-function' and 'treesit-sexp-thing'
after calling 'treesit-major-mode-setup'.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
python--treesit-settings: Fontification based on selectors & code-conventions
- Constructor: Fontified as type, not function-call.
- Typed default parameters
- Fontify kwargs in function calls as property-use. Differentiate from
variable-use (passed in arguments)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/treesit.el (treesit-language-source-alist):
Document the format that uses keywords.
(treesit--install-language-grammar-1): Remove args
'revision', 'source-dir', 'cc', 'c++', 'commit'.
Use 'args' to process the keywords, and use the remaining
list as the previous list of arguments.
(treesit--install-language-grammar-1): Let-bind
'treesit--install-language-grammar-full-clone' and
'treesit--install-language-grammar-blobless' to t
when 'commit' is non-nil (bug#78542).
* lisp/progmodes/c-ts-mode.el:
* lisp/progmodes/cmake-ts-mode.el:
* lisp/progmodes/csharp-mode.el:
* lisp/progmodes/dockerfile-ts-mode.el:
* lisp/progmodes/elixir-ts-mode.el:
* lisp/progmodes/go-ts-mode.el:
* lisp/progmodes/heex-ts-mode.el:
* lisp/progmodes/java-ts-mode.el:
* lisp/progmodes/js.el:
* lisp/progmodes/json-ts-mode.el:
* lisp/progmodes/php-ts-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/ruby-ts-mode.el:
* lisp/progmodes/rust-ts-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/progmodes/typescript-ts-mode.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/html-ts-mode.el:
* lisp/textmodes/markdown-ts-mode.el:
* lisp/textmodes/toml-ts-mode.el:
* lisp/textmodes/yaml-ts-mode.el:
Use the keyword :commit with full hashes instead of tags
in 'treesit-language-source-alist'.
* lisp/treesit-x.el (define-treesit-generic-mode):
Simplify the keyword :copy-queries.
(gitattributes-generic-ts-mode, liquid-generic-ts-mode):
Add keywords :commit and :copy-queries to :source.
* admin/tree-sitter/treesit-admin.el
(treesit-admin--unversioned-treesit-language-source-alist):
Handle :revision and :commit as well.
(treesit-admin--find-latest-compatible-revision):
Process the keywords in the recipe.
|
| |
|
|
|
| |
* lisp/progmodes/python.el (python--thing-settings): New variable.
(python-ts-mode): Setup treesit-thing-settings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/treesit.el (treesit-sexp-thing): New variable to use
instead of 'treesit-sexp-type-regexp'.
(treesit-sexp-thing-down-list): Rename from 'treesit-sexp-type-down-list'.
(treesit-sexp-thing-up-list): Rename from 'treesit-sexp-type-up-list'.
(treesit-forward-sexp, treesit--forward-list-with-default)
(treesit-down-list, treesit-up-list): Update references to the
above variables.
(treesit-cycle-sexp-thing): Rename from 'treesit-cycle-sexp-type'.
* lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode): Update same variables.
* lisp/progmodes/heex-ts-mode.el (heex-ts-mode): Set these variables
instead of calling the function that sets them.
* lisp/progmodes/python.el (python-ts-mode): Check if variables
'treesit-sentence-type-regexp' and 'treesit-sexp-type-regexp' are bound.
https://lists.gnu.org/archive/html/emacs-devel/2025-06/msg00182.html
|
| |
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python--treesit-settings): Use more
specific selectors for constants.
* test/lisp/progmodes/python-tests.el
(python-ts-mode-nested-types-face-1)
(python-ts-mode-union-types-face-1)
(python-ts-mode-union-types-face-2): None is now a constant.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fontification based on selectors & code-conventions:
- Lambda parameters: variable declarations
- For in statements: variable declarations
- Import statements: variable declerations
- Constants: All upper case alphanumerical identifiers
- Types: CamelCase alphanumerical identifiers
- Enums: Enum-values as constants.
* lisp/progmodes/python.el:
(python--treesit-settings): Improve queries.
|
| |
|
|
|
| |
* lisp/progmodes/python.el (python-ts-mode):
Use 'treesit-ensure-installed' when it's fboundp.
|
| |
|
|
|
|
|
|
| |
'comint-filename-completion' may complete the filename at
wrong locations. Users who want proper filename completion
should use specialized completion backends (e.g. Jedi).
* lisp/progmodes/python.el (inferior-python-mode): Remove
'comint-filename-completion' in 'comint-dynamic-complete-functions'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-nav-cache)
(python-nav-cache-tick): New variables.
(python-nav-cache-get, python-nav-cache-set)
(python-nav-with-cache): New functions.
(python-nav-beginning-of-block, python-nav-end-of-block): New
wrapper functions.
(python-nav--beginning-of-block): Renamed from
'python-nav-beginning-of-block'.
(python-nav--end-of-block): Renamed from
'python-nav-end-of-block'. (Bug#77620)
|
| |
|
|
|
|
| |
* lisp/progmodes/python.el (python-info-statement-ends-block-p):
Add a comparison of the indentation of the next statement with
the indentation of the current statement. (Bug#77620)
|
| |
|
|
|
|
|
|
| |
* lisp/progmodes/python.el (python-info-statement-ends-block-p)
(python-info-end-of-block-p): Add consideration of comments.
* test/lisp/progmodes/python-tests.el
(python-info-statement-ends-block-p-3)
(python-info-end-of-block-p-3): New tests.
|
| |
|
|
|
| |
* lisp/progmodes/python.el (python-shell-setup-code): Change the
Python setup code. (Bug#76943)
|
| |
|
|
|
|
| |
* lisp/progmodes/python.el (python-indent-repeat-map): New
keymap for repeating Python indentation commands when using
'repeat-mode' (bug#77417).
|
| |
|
|
|
|
|
|
| |
* lisp/vc/vc.el (vc-diff-restore-buffer):
* lisp/progmodes/python.el (python--do-isort):
* lisp/progmodes/eglot.el (eglot--apply-text-edits):
* lisp/files.el (revert-buffer-insert-file-contents-delicately):
* lisp/json.el (json-pretty-print): Use `replace-region-contents`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add more commands to 'eldoc-add-command-completions' to fix
disappearing ElDoc help in the minibuffer for the following
cases:
- All modes: Added "comment-indent-new-line".
- All modes: Added "delete-char" for handling when the user presses delete.
- Python mode: Added "python-indent-dedent-line-backspace" for handling
when the user presses backspace.
* lisp/emacs-lisp/eldoc.el (eldoc-remove-command-completions):
* lisp/progmodes/python.el (python-base-mode): Add more commands
to 'eldoc-add-command-completions'.
Copyright-paperwork-exempt: yes
|
| |
|
|
| |
* lisp/progmodes/python.el: Bump package version to 0.30.
|
| |
|
|
|
|
| |
* lisp/progmodes/python.el (python--treesit-fontify-string): Don't
call treesit--compute-font-lock-level unless it is
fboundp. (Bug#76873)
|
| |\
| |
| |
| |
| |
| |
| | |
af8017b23f6 Explicitly document read-string return value
cf03c2b6093 Improve docstrings of python.el import management
01bcc6961a6 ; Improve doc strings of Speedbar
bd9c76ab175 Avoid warnings about 'image-scaling-factor' in builds --w...
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Added notes that when adding import statements for a file that
does not belong to a project, it may take some time to find
candidate import statements in the default directory.
* lisp/progmodes/python.el (python-add-import)
(python-fix-imports): Improve docstring. (Bug#74894)
|
| | |
| |
| |
| | |
Run "TZ=UTC0 admin/update-copyright".
|
| | |
| |
| |
| | |
This reverts commit ed57faafc74e0810b492841deccb3cdc77a258ff.
|