Commit graph

977 commits

Author SHA1 Message Date
Mattias Engdegård
f85280503a Tone down python-mode warning to a simple message (bug#68559)
* lisp/progmodes/python.el
(python-shell-completion-native-turn-on-maybe):
There is no need for an alarming warning when using an inferior Python
without GNU readline; a calm message will do.
2024-02-23 11:09:31 +01:00
kobarity
d575717846 Set tty mode to raw when setting up Inferior Python
* lisp/progmodes/python.el (python-shell-setup-code): New constant.
(python-shell-comint-watch-for-first-prompt-output-filter): Send
`python-shell-setup-code' to the Inferior Python process.
* test/lisp/progmodes/python-tests.el (python-ffap-module-path-1):
Eliminate skipping on Mac. (Bug#68559)
2024-02-21 15:23:59 +01:00
Philip Kaludercic
db195116a4 Add the public API of Compat to the core
* lisp/emacs-lisp/compat.el: Add stub file with minimal definitions,
so that core packages, that haven't been installed from ELPA, can make
use of the public API and use more recent function signatures.
* lisp/progmodes/python.el (compat): Remove 'noerror flag, because
Compat can now be required without the real package being available.
* doc/lispref/package.texi (Forwards-Compatibility): Mention Compat
and link to the manual.
* etc/NEWS: Document change.  (Bug#66554)
2024-02-11 22:50:29 +01:00
Liu Hui
0b9c7148fd Respect the delimiter of completer in Python shell completion
* lisp/progmodes/python.el: (python-shell-completion-setup-code): Fix
the completion code of IPython.  Change the return value to JSON string
and ...
(python-shell-completion-get-completions): ... simplify parsing.
(inferior-python-mode): Update docstring.
(python-shell-readline-completer-delims): New variable indicating the
word delimiters of readline completer.
(python-shell-completion-native-setup): Set the completer delimiter.
(python-shell-completion-native-get-completions): Convert output string
to completions properly.
(python-shell--get-multiline-input)
(python-shell--extra-completion-context)
(python-shell-completion-extra-context): New functions.
(python-shell-completion-at-point): Send text beginning from the line
start if the completion backend does not need word splitting.  Remove
the detection of import statement because it is not needed anymore.
Create proper completion table based on completions returned from
different backends.

* test/lisp/progmodes/python-tests.el (python-tests--completion-module)
(python-tests--completion-parameters)
(python-tests--completion-extra-context): New helper functions.
(python-shell-completion-at-point-jedi-completer)
(python-shell-completion-at-point-ipython): New tests.  (bug#68559)
2024-02-08 14:09:42 +02:00
Jakub Ječmínek
09cdf8a406 Fix syntax highlighting after string literal concat in python-mode
* lisp/progmodes/python.el (python-syntax-stringify): Fix
incorrect font-lock after string literal concatenation.
(Bug#45897)

* test/lisp/progmodes/python-tests.el
(python-font-lock-string-literal-concatenation): New test.

Co-authored-by: kobarity <kobarity@gmail.com>
Copyright-paperwork-exempt: yes
2024-01-27 12:05:48 +02:00
Dmitry Gutov
737d46e04d python--treesit-syntax-propertize: Fix edits in the middle
* lisp/progmodes/python.el (python--treesit-syntax-propertize):
Process the beginning and the end of the triple-quoted string's
delimiters separately.  Among other things, that still works when
the beginning is outside of the propertized region (bug#68445).
2024-01-26 03:00:23 +02:00
Eli Zaretskii
f1736571fa Merge from origin/emacs-29
99efe5c80f Fix count of no-op functions (bug#68375)
0c01f97b73 Wrap @pxref of Abbrevs in parentheses (bug#68375)
70a09325d6 ; Fix last change in widget.texi
63411709a8 ; Fix typos
824cf54951 ; * etc/TODO: Add item to make play-sound non-blocking.
4fadbfe300 Add examples to the Widget manual
1bbb610821 Implement missing functions for custom-icon widget
29af214a75 Fix fontification of cgroup2 in fstab (bug#68367)
2024-01-13 05:36:16 -05:00
kobarity
f2cc8ee2a1 Fix 'python-info-docstring-p' bug in the 2nd line of a buffer
* lisp/progmodes/python.el (python-info-docstring-p): Add
'looking-at-p' check when bobp.
* test/lisp/progmodes/python-tests.el (python-font-lock-operator-1)
(python-font-lock-operator-2): Restoration of ERTs deleted by
mistake.
(python-font-lock-escape-sequence-bytes-newline)
(python-font-lock-escape-sequence-hex-octal)
(python-font-lock-escape-sequence-unicode)
(python-font-lock-raw-escape-sequence): Change 'font-lock-doc-face'
to 'font-lock-string-face' and remove :expected-result :failed.
(python-info-docstring-p-8): New test.  (Bug#68284)
2024-01-13 11:33:19 +02:00
Stefan Kangas
63411709a8 ; Fix typos 2024-01-11 00:32:15 +01:00
Po Lu
ecf08f0621 Merge from savannah/emacs-29
dc4e6b1329 ; Update copyright years in more files
64b3777631 ; Run set-copyright from admin.el
8e1c56ae46 ; Add 2024 to copyright years

# Conflicts:
#	doc/misc/modus-themes.org
#	doc/misc/texinfo.tex
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	etc/themes/modus-operandi-theme.el
#	etc/themes/modus-themes.el
#	etc/themes/modus-vivendi-theme.el
#	lib/alloca.in.h
#	lib/binary-io.h
#	lib/c-ctype.h
#	lib/c-strcasecmp.c
#	lib/c-strncasecmp.c
#	lib/careadlinkat.c
#	lib/cloexec.c
#	lib/close-stream.c
#	lib/diffseq.h
#	lib/dup2.c
#	lib/filemode.h
#	lib/fpending.c
#	lib/fpending.h
#	lib/fsusage.c
#	lib/getgroups.c
#	lib/getloadavg.c
#	lib/gettext.h
#	lib/gettime.c
#	lib/gettimeofday.c
#	lib/group-member.c
#	lib/malloc.c
#	lib/md5-stream.c
#	lib/md5.c
#	lib/md5.h
#	lib/memmem.c
#	lib/memrchr.c
#	lib/nanosleep.c
#	lib/save-cwd.h
#	lib/sha1.c
#	lib/sig2str.c
#	lib/stdlib.in.h
#	lib/strtoimax.c
#	lib/strtol.c
#	lib/strtoll.c
#	lib/time_r.c
#	lib/xalloc-oversized.h
#	lisp/auth-source-pass.el
#	lisp/emacs-lisp/lisp-mnt.el
#	lisp/emacs-lisp/timer.el
#	lisp/info-look.el
#	lisp/jit-lock.el
#	lisp/loadhist.el
#	lisp/mail/rmail.el
#	lisp/net/ntlm.el
#	lisp/net/webjump.el
#	lisp/progmodes/asm-mode.el
#	lisp/progmodes/project.el
#	lisp/progmodes/sh-script.el
#	lisp/textmodes/flyspell.el
#	lisp/textmodes/reftex-toc.el
#	lisp/textmodes/reftex.el
#	lisp/textmodes/tex-mode.el
#	lisp/url/url-gw.el
#	m4/alloca.m4
#	m4/clock_time.m4
#	m4/d-type.m4
#	m4/dirent_h.m4
#	m4/dup2.m4
#	m4/euidaccess.m4
#	m4/fchmodat.m4
#	m4/filemode.m4
#	m4/fsusage.m4
#	m4/getgroups.m4
#	m4/getloadavg.m4
#	m4/getrandom.m4
#	m4/gettime.m4
#	m4/gettimeofday.m4
#	m4/gnulib-common.m4
#	m4/group-member.m4
#	m4/inttypes.m4
#	m4/malloc.m4
#	m4/manywarnings.m4
#	m4/mempcpy.m4
#	m4/memrchr.m4
#	m4/mkostemp.m4
#	m4/mktime.m4
#	m4/nproc.m4
#	m4/nstrftime.m4
#	m4/pathmax.m4
#	m4/pipe2.m4
#	m4/pselect.m4
#	m4/pthread_sigmask.m4
#	m4/readlink.m4
#	m4/realloc.m4
#	m4/sig2str.m4
#	m4/ssize_t.m4
#	m4/stat-time.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/stdio_h.m4
#	m4/stdlib_h.m4
#	m4/stpcpy.m4
#	m4/strnlen.m4
#	m4/strtoimax.m4
#	m4/strtoll.m4
#	m4/time_h.m4
#	m4/timegm.m4
#	m4/timer_time.m4
#	m4/timespec.m4
#	m4/unistd_h.m4
#	m4/warnings.m4
#	nt/configure.bat
#	nt/preprep.c
#	test/lisp/register-tests.el
2024-01-02 10:28:14 +08:00
Po Lu
083e90dd80 Merge from origin/emacs-29
3204825f56 Fix mangled Subject header field when forwarding (Bug#67360)
7591acfe38 Update to Org 9.6.15
240b4594f1 ; * etc/TODO: Add an item about 'Info-hide-note-references'.
01be4fe39d * doc/emacs/custom.texi (Modifier Keys): Fix markup (bug#...
55555a6a0d org-protocol: Minor copy-edits to Commentary
4696869d3d Improve syntax highlighting for python-ts-mode
2024-01-02 10:19:48 +08:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
Denis Zubarev
4696869d3d Improve syntax highlighting for python-ts-mode
Fix fontification of strings inside of f-strings interpolation, e.g. for
f"beg {'nested'}" - 'nested' was not fontified as string.  Do not
override the face of builtin functions (all, bytes etc.) with the
function call face.  Add missing assignment expressions (:= *=).
Fontify built-ins (dict,list,etc.) as types when they are used in type
hints.  Highlight union types (type1|type2).  Highlight base class names
in the class definition.  Fontify class patterns in case statements.
Highlight the second argument as a type in isinstance/issubclass call.
Highlight dotted decorator names.

* lisp/progmodes/python.el (python--treesit-keywords): Add compound
keyword "is not".
(python--treesit-builtin-types): New variable that stores all python
built-in types.
(python--treesit-type-regex): New variable.  Regex matches if text is
either built-in type or text starts with capital letter.
(python--treesit-builtins): Extract built-in types to other variable.
(python--treesit-fontify-string): fix f-string interpolation.  Enable
interpolation highlighting only if string-interpolation is presented
on the enabled levels of treesit-font-lock-feature-list.
(python--treesit-fontify-string-interpolation): Remove function.
(python--treesit-fontify-union-types): Fontify nested union types.
(python--treesit-fontify-union-types-strict): Fontify nested union
types, only if type identifier matches against
python--treesit-type-regex.
(python--treesit-fontify-dotted-decorator): Fontify all parts of
dotted decorator name.
(python--treesit-settings): Change/add rules.  (Bug#67061)

* test/lisp/progmodes/python-tests.el
(python-ts-tests-with-temp-buffer): Function for setting up test
buffer.
(python-ts-mode-compound-keywords-face)
(python-ts-mode-named-assignement-face-1)
(python-ts-mode-assignement-face-2)
(python-ts-mode-nested-types-face-1)
(python-ts-mode-union-types-face-1)
(python-ts-mode-union-types-face-2)
(python-ts-mode-types-face-1)
(python-ts-mode-types-face-2)
(python-ts-mode-types-face-3)
(python-ts-mode-isinstance-type-face-1)
(python-ts-mode-isinstance-type-face-2)
(python-ts-mode-isinstance-type-face-3)
(python-ts-mode-superclass-type-face)
(python-ts-mode-class-patterns-face)
(python-ts-mode-dotted-decorator-face-1)
(python-ts-mode-dotted-decorator-face-2)
(python-ts-mode-builtin-call-face)
(python-ts-mode-interpolation-nested-string)
(python-ts-mode-disabled-string-interpolation)
(python-ts-mode-interpolation-doc-string): Add tests.
2023-12-30 13:15:07 +02:00
Eli Zaretskii
3b7198dc47 Merge from origin/emacs-29
5303152872 Revert "Fix treesit-node-field-name and friends (bug#66674)"
fa0bb88302 ; * src/buffer.c (syms_of_buffer) <default-directory>: Do...
44517037ae ; Fix typo
ccf46acefd ; Fix last change.
c86b039dff ; * etc/DEBUG: Improve advice for debugging native-compil...
9afba605bb Explain status "r" in `epa-list-keys`
6271422196 ; * lisp/dired.el (dired--make-directory-clickable): Refo...
fcbb004489 Fix mouse clicks on directory line in Dired
be8a7155b4 Fix 'split-root-window-right' and 'split-root-window-below'
eb19984c4d Mark icalendar.el as maintained by emacs-devel
03dc914fd3 ; Fix footnotes in ELisp Intro manual
ceacf75395 Fix usage of `setq-default' and offer more suggestions
2701da0eee Fix python-ts-mode triple quote syntax (bug#67262)
683c7c9687 Increment parser timestamp when narrowing changes (bug#67...
8ae42c825e ruby-ts-mode: Fix indentation for string_array closer
9cfa498e0a treesit-major-mode-setup: Use 'treesit--syntax-propertize...
da2e440462 ruby-ts-mode: Fix an out-of-bounds error with heredoc at eob
6ea507296a Correctly refontify changed region in tree-sitter modes (...
2023-12-30 04:51:17 -05:00
Yuan Fu
2701da0eee
Fix python-ts-mode triple quote syntax (bug#67262)
* lisp/progmodes/python.el (python--treesit-syntax-propertize): New function.
(python-ts-mode): Activate python--treesit-syntax-propertize.
2023-12-23 19:08:56 -08:00
Eli Zaretskii
a1d3862c62 Merge from origin/emacs-29
bf4ccb0be0 ; * lisp/term.el (term--xterm-paste): Fix last change.
0d9e2e448d ; * doc/lispref/functions.texi (Function Documentation): ...
791cc5065d Fix shaping of Sinhala text
efcbf0b5ab Add use cases of (fn) documentation facility.
c3331cb365 Fix pasting into terminal-mode on term.el
5be94e2bce Fix opening directory trees from Filesets menu
6b6e770a1f Eglot: Add ruff-lsp as an alternative Python server
ed8a8a5ba1 Fix symbol name in Multisession Variables examples
400ef15bdc js-ts-mode: Fix font-lock rules conflict
c165247c30 Add indentation rules for bracketless statements in js-ts...
7f1bd69cd1 Fix c-ts-mode bracketless indentation for BSD style (bug#...
e23068cb9a Add missing indent rules in c-ts-mode (bug#66152)
d2c4b926ac Fix treesit-default-defun-skipper (bug#66711)
9874561f39 Fix treesit-node-field-name and friends (bug#66674)
eace9e1122 python-ts-mode: Highlight default parameters
23c06c7c30 Update to Org 9.6.13
2023-12-16 09:17:51 -05:00
Maciej Kalandyk
eace9e1122 python-ts-mode: Highlight default parameters
* lisp/progmodes/python.el (python--treesit-settings):
Highlight default parameters (bug#67703).
2023-12-11 01:34:41 +02:00
Po Lu
1737ffd3a8 Merge from savannah/emacs-29
1978b603bc Make python-ts-mode's syntax-highlighting more standardized
99658346d1 ; Improve documentation of desktop.el in user manual
f7dc020212 Fix "Text is read-only" on backspacing initial Calc input
662d54775d Add a doc string to simple.el (bug#67355)
5a5e36d2aa ; Improve function documentation tips
86016d8ecd Mention "visual line" in user manual
4bb65ed77a ; * doc/lispref/minibuf.texi (Programmed Completion): Imp...
dfb3dcb404 Allow listing Emoji from a read-only buffer

# Conflicts:
#	lisp/calc/calc.el
#	lisp/international/emoji.el
2023-11-24 08:44:34 +08:00
Po Lu
9db8c349f0 Merge from savannah/emacs-29
d72a4ed65c Fix 'with-sqlite-transaction' when BODY fails
a7b3c92373 ; * doc/emacs/cmdargs.texi (Initial Options): Fix last ch...
fd76a80864 ; Mention that -x and --script ignore file-locals
e0469ddb9d ; * doc/emacs/search.texi (Special Isearch): More accurat...
e521669fb3 Fix wording in ELisp Intro manual
da946ca692 Add missing python-ts-mode keyword (bug#67015)
0128495afd Fix string-pixel-width with global setting of display-lin...

# Conflicts:
#	etc/NEWS
2023-11-24 08:38:03 +08:00
Dmitry Gutov
1978b603bc Make python-ts-mode's syntax-highlighting more standardized
This was brought up in a Reddit discussion.

* lisp/progmodes/python.el (python--treesit-fontify-variable):
Use font-lock-variable-use-face (since it applies to references).
(python-ts-mode): Move 'property' from 3rd to 4th
treesit-font-lock-level.
2023-11-24 00:00:32 +02:00
Yuan Fu
da946ca692
Add missing python-ts-mode keyword (bug#67015)
* lisp/progmodes/python.el (python--treesit-keywords): Add "not in".
2023-11-18 11:01:46 -08:00
Stefan Kangas
820deac94b ; Add missing GNU ELPA :core package statements
* lisp/bind-key.el:
* lisp/emacs-lisp/map.el:
* lisp/erc/erc.el:
* lisp/external-completion.el:
* lisp/net/ntlm.el:
* lisp/net/soap-client.el:
* lisp/progmodes/python.el:
* lisp/svg.el:
* lisp/use-package/use-package.el: Add GNU ELPA :core package
statements.
2023-10-01 00:09:05 +02:00
Stefan Kangas
b8c05636ca ; Fix typo 2023-08-08 19:08:56 +02:00
Stefan Kangas
10e4be740d Open Pipfile and flake8 config files in conf-mode
* lisp/progmodes/python.el (auto-mode-alist): Open Pipfile and flake8
configuration files in conf-mode.
2023-08-08 19:03:11 +02:00
Stefan Kangas
60e5f21218 Add ruff and flake8 to python-check-command
* lisp/progmodes/python.el (python-check-command): Add ruff and
flake8.
2023-08-04 14:21:26 +02:00
Matthias Meulien
3c041e3e96 Custom var python-interpreter-args (bug#64397)
* lisp/progmodes/python.el (python-interpreter): Mention
new variable in documentation.
(python-interpreter-args): New custom variable.
(python-shell-interpreter, python-shell-interpreter-args)
(python-shell-interpreter-interactive-arg): Improve
documentation.
(python--list-imports, python--do-isort)
(python-fix-imports): Make process use customisable
arguments.
2023-07-20 19:00:46 +03:00
Matthias Meulien
a047fb8494 Fix "Improve Python imports management commands"
* lisp/progmodes/python.el (python--list-imports): Prefer to
use an exit status >1.
(python--list-imports-check-status): New function to check
status of Python script.
(python--do-isort): Fix wrong status check introduced with
6295d7abdd.  (Bug#64406)
2023-07-15 11:24:34 +03:00
Matthias Meulien
6295d7abdd Improve Python imports management commands
* lisp/progmodes/python.el (python--list-imports): Handle import
errors.
(python--do-isort): Specialize error message.  (Bug#64406)
2023-07-06 10:27:14 +03:00
kobarity
9c2cbfa49d Fix Python indentation of continuation lines within parens
* lisp/progmodes/python.el (python-indent-context): Add a new indent
context `:inside-paren-continuation-line'.
(python-indent--calculate-indentation): Use the new indent context.
* test/lisp/progmodes/python-tests.el (python-indent-pep8-2)
(python-indent-pep8-3)
(python-indent-inside-paren-1)
(python-indent-inside-paren-2)
(python-indent-inside-paren-3)
(python-indent-inside-paren-6)
(python-indent-after-backslash-2): Change to use the new indent
context.
(python-indent-inside-paren-8)
(python-indent-inside-paren-9): New tests. (Bug#63959)
2023-06-24 15:11:39 +03:00
Eli Zaretskii
d1ddd1d5d9 Merge from origin/emacs-29
84d2da003e ; Fix example in the Flymake manual
0a1459f1d9 * doc/misc/calc.texi (Advanced Math Functions): Correct c...
92faf1f564 Consider 'dired-kill-when-opening-new-dired-buffer' in mo...
bafe71a69f ; Fix use-package.texi markup
018e4ca6c5 ; * doc/misc/calc.texi (Advanced Math Functions): Fix las...
1952dbd4c5 Fix Gamma function definition in calc.texi
f73f82d7e8 Fix subscripts in the Calc manual
70fc7c41ef Improve documentation of 'declare' forms
c835758238 ; * src/lread.c (bytecode_from_rev_list): Avoid C++ comment.
2847857496 Improve tree-sitter docs
0e9307eb2b Fix some Texinfo markup in manuals
8dc08333ee Fix bol/bos anchors in tree-sitter :match regexps
8225ade615 ; * src/xdisp.c (syms_of_xdisp) <display-line-numbers>: F...
1f0527a312 ; Fix last change in tex-mode.el
4da479920e * lisp/subr.el (with-restriction): Tweak indent rule
36aa9bd818 ; Fix previous change
aaeaf608d8 Fix setting region in the minibuffer
1383efe01d Fix setting $DBUS_SESSION_BUS_ADDRESS after Emacs has sta...
bdb0bc2b4e Fix tex-mode display-buffer issues
90047c38ce Add test for when 'completion-auto-help' is 'visible'
2c623e4feb Avoid errors in 'apropos-documentation' after 'eval-buffer'
dd3b98121c ; * doc/emacs/indent.texi (Indentation Commands): Fix las...
904edf1f07 Mention indent-rigidly in the Emacs manual
2023-06-17 05:02:55 -04:00
Basil L. Contovounesios
8dc08333ee Fix bol/bos anchors in tree-sitter :match regexps
Further regexp fixes to follow separately (bug#64019#29).

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
* lisp/progmodes/cmake-ts-mode.el
(cmake-ts-mode--font-lock-settings):
* lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings):
* lisp/progmodes/js.el (js--treesit-font-lock-settings):
* lisp/progmodes/python.el (python--treesit-settings):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
* lisp/progmodes/sh-script.el (sh-mode--treesit-settings):
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings):
* test/src/treesit-tests.el (treesit-query-api): Anchor :match
regexps at beginning/end of string, not line.
2023-06-13 14:35:14 +01:00
Eli Zaretskii
970f94a2dd Merge from origin/emacs-29
ede3535051 ; Fix last change
8ec786349e Fix apostrophe handling in rust-ts-mode and go-ts-mode (B...
0eba9cf651 * test/infra/Dockerfile.emba (emacs-base): Install also g...
4897c98b6c Fix 'python-util-clone-local-variables'
6b2c8dc905 Revert "Enhance Python font-lock to support multilines"
348e4504c6 Fix typo in calc.texi
03663b8798 Update to Transient v0.4.1
dc7acb1aaf Avoid errors in 'delete-forward-char' deleting static com...
2f94f6de9d Make VS-15 and VS-16 compositions work correctly
753f8aa1f1 Fix project-name for vc-aware backend in non-file buffers
17c7915ab9 ; Fix 'package-install-upgrade-built-in' check for packag...
e252ce26ea Add type_predicate 'is' as keyword in typescript-ts-mode ...
0a354d6578 Fix infloop in info-look.el
83b22139e4 Fix several todo-mode.el item editing bugs (bug#63811)
ed4cd3eddf dockerfile-ts-mode: Prevent empty categories in imenu (Bu...
2e20e318da Brush up doc strings and terminology in plstore.el
372bc1278c Add internal documentation on plstore.el
23a14e7b90 Add compact_constructor_declaration font-locking to java-...
500abc4dc3 * lisp/tmm.el (tmm-completion-delete-prompt): Add more ch...
afc1f32935 Allow to disable the DWIMish behavior of 'x' in package menu
08104c0150 Allow dired to invoke secondary browser
a3063f0bc8 Add a binding for enriched-toggle-markup
d8ba28fa39 Fix order of tmm-menubar when 'tmm-mid-prompt' is nil

# Conflicts:
#	etc/NEWS
2023-06-03 05:50:58 -04:00
Eli Zaretskii
4897c98b6c Fix 'python-util-clone-local-variables'
* lisp/progmodes/python.el (python-util-clone-local-variables):
Avoid signaling an error when a local variable is unbound.
Patch by Ernesto Alfonso <erjoalgo@gmail.com>.  (Bug#63818)
2023-06-03 10:20:08 +03:00
kobarity
6b2c8dc905 Revert "Enhance Python font-lock to support multilines"
This reverts commit 4915ca5dd4.

We have found that there are performance issues when editing a large
file.  The issue can be reproduced as follows:

1. emacs -Q
2. Open large Python file (e.g. turtle.py in Python)
3. Near the top of the buffer, enter open paren and some characters.

The above commit extends the region to be font-locked using
`python-nav-end-of-statement'.  However, if there are unbalanced
parens, it may move point to the end of the buffer.  This causes
almost the entire buffer to be font-locked, which is not acceptable
for large files.
2023-06-03 10:09:33 +03:00
Eli Zaretskii
e78318ad2e Merge from origin/emacs-29
aa5158630e Use 'font-lock-extend-region-functions' in python-mode
b7b82ecb2b Fix python-info-docstring-p
f42de74ebe ; * src/lread.c (read0, skip_lazy_string): Fix commentary...
b6b384023a Fix cancellation of Wdired
916c2a19bd Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
f535c0e49d Handle #@00 in new reader in a compatible way (bug#63722)
40a758f5ce ; Minor fixes in documentation of recently-changed VC com...
c0d7447e9d ; * etc/NEWS: Describe the Cairo XCB option.  (Bug#63589)
4205268675 Don't mark selection request events
9f5249d5c8 Disable cairo-xcb support by default
e5f42706ce * lisp/progmodes/project.el: Move :safe from defcustom to...
3afe4a42e9 * lisp/vc/vc-annotate.el (vc-annotate-mode-menu): Quote v...
b62a2b08b8 Add vc-create/switch/print-branch to menu and update docu...
d292d28229 Fix rare crashes in 'try_window_reusing_current_matrix'
709d902002 Make last Tramp change less invasive
a72a1f24fc ; Fix last change.
5c6517a115 ; * lisp/menu-bar.el (popup-menu): Doc fix.
212884f2bf ; Fix last change.
1b9812af80 ; * etc/PROBLEMS: Document problem with GnuPG 2.4.1.  (Bu...
765edc204d ; Support SQLite3 extensions on macOS
5aadb87d6f Fix 'use-dialog-box-p' and friends

# Conflicts:
#	etc/NEWS
2023-05-26 07:04:03 -04:00
Eli Zaretskii
eacee3e536 Merge from origin/emacs-29
6f6071c526 Avoid duplicate load-path entry when generating package a...
117b29c6f6 ; Improve documentation of Isearch command properties
a347b26cba Disable loading SQLite3 extensions when SQLite3 version i...
fe22bf503f ; * lisp/progmodes/project.el (project-switch-use-entire-...
64dbbde3b7 Fix visiting HTML files encoded in iso-2022 variants
5c95239aca ; Fix markup of some treesit vars in Elisp manual.
6ad041939b Support 'isearch-allow-scroll' in 'pixel-scroll-precision...
ecccdc07a0 shr: allow moving between adjacent anchors
504ef25ef3 ; * etc/NEWS: Fix typos.
d6fb868cdd Fix multihop file name expansion in Tramp
dd3e4e14fd Remove obsolete information from Gnus manual
2a5c946f87 Preserve mark in comint-history-isearch
6b60c8142e Fix systemd unit completion for old versions of systemd
8c56557cd9 Fix Skeletons menu-bar menu in Python modes
58eb38cfb4 ; * etc/NEWS: missing definite article
cf40362869 ; * etc/NEWS: PGTK cannot switch to -new automatically (b...
ead3a2abbf Fix loading SQLite extensions
a6bddd1765 ; * etc/NEWS: Fix typos.
f49fe936ab * etc/NEWS: Note dotimes loop variable scoping change (bu...
cec9333dc5 Fix c-ts-mode--top-level-declarator
f571e8f1bb Improve c-ts-mode font-lock for function names (bug#63390)
42a28ffdc2 * lisp/tab-bar.el: Don't use 'minibuffer-selected-window'...
8e61d23f71 Split windows horizontally in places that use split to cr...
459d08c7fe Fix tree-sitter test (bug#63481)
3bc5efb87e ; * lisp/emacs-lisp/benchmark.el (benchmark-progn): Fix d...

# Conflicts:
#	etc/NEWS
2023-05-26 07:03:07 -04:00
kobarity
aa5158630e Use 'font-lock-extend-region-functions' in python-mode
* lisp/progmodes/python.el (python-font-lock-extend-region): Change
arguments and return value for 'font-lock-extend-region-functions'.
(python-mode): Change from
'font-lock-extend-after-change-region-function' to
'font-lock-extend-region-functions'.  (Bug#63622)
2023-05-26 12:59:43 +03:00
kobarity
b7b82ecb2b Fix python-info-docstring-p
* lisp/progmodes/python.el (python-info-docstring-p): Stop using
python-rx string-delimiter.

* test/lisp/progmodes/python-tests.el
(python-font-lock-escape-sequence-bytes-newline)
(python-font-lock-escape-sequence-hex-octal)
(python-font-lock-escape-sequence-unicode)
(python-font-lock-raw-escape-sequence): Mark as expected failures
until another bug in 'python-info-docstring-p' is corrected.
(python-info-docstring-p-7): New test.  (Bug#63622)
2023-05-26 12:57:30 +03:00
Eli Zaretskii
8c56557cd9 Fix Skeletons menu-bar menu in Python modes
* lisp/progmodes/python.el (python-mode, python-ts-mode): Call
'python-skeleton-add-menu-items' here, not in 'python-base-mode',
since the "Python" menu is not yet set up in the latter.
(Bug#63598)
2023-05-20 17:56:40 +03:00
Basil L. Contovounesios
d1404d3a11 Simplify python.el completion-predicate
* lisp/progmodes/python.el:
(python-skeleton-define): Use command-modes as a shorthand for
completion-predicate (bug#63552).
(python--completion-predicate, python-shell--completion-predicate):
Remove accordingly; no longer used.
(python-define-auxiliary-skeleton): Prefer function-put over put.
2023-05-18 13:10:09 +01:00
Eli Zaretskii
f518543aa4 Merge from origin/emacs-29
f8d9e40d2c Attempt to fix redisplay problems on macOS
4daa6f7049 ; * lisp/simple.el (async-shell-command): Add commentary ...
dc1a437d46 Clarify misleading comment in isearch.el
af3b0dc53f Improve documentation of package-menu commands
d879847cd4 Fix M-x completion-predicate under python-ts-mode
1e57b2b4c7 * Account for `byte-compile-warnings' during native compi...
b5bfd808c6 Avoid duplicate VC packages in 'package-selected-packages'
c18f9f155f * lisp/tab-bar.el (tab-bar-new-tab-to): Set 'window-side'...
33485fe8f7 ; Better warning message when loading tree-sitter fails
95a724abaa Update to Org 9.6.6
c665ca79ff ; * admin/make-tarball.txt: Minor copyedits.
3aef46e466 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ...
229af8e4b3 ; * lisp/progmodes/csharp-mode.el (csharp-ts-mode--defun-...
2023-05-18 07:49:49 -04:00
Basil L. Contovounesios
d879847cd4 Fix M-x completion-predicate under python-ts-mode
* lisp/progmodes/python.el (python--completion-predicate)
(python-shell--completion-predicate): Filter M-x completion based on
python-base-mode instead of python-mode.  This allows for
python-ts-mode as well (bug#63552).
2023-05-17 15:14:09 +01:00
Mattias Engdegård
aa135e09b6 Declare cl-delete to have important-return-value (bug#61730)
* lisp/emacs-lisp/cl-macs.el: Set property on `cl-delete`.
* lisp/progmodes/python.el (python-shell--add-to-path-with-priority):
Prevent warning by cleaner code.
2023-05-01 17:22:02 +02:00
kobarity
3badd2358d Improve docstring of python-indent-def-block-scale
* lisp/progmodes/python.el (python-indent-def-block-scale): Improve
docstring.  (Bug#62696)
2023-04-22 12:30:25 +03:00
kobarity
711e8bc717 Add a new user option in Python mode to improve the indentation
* lisp/progmodes/python.el (python-indent-block-paren-deeper): New
user option.
(python-indent-context): Add a new context :inside-paren-from-block.
(python-indent--calculate-indentation): Modify according to
`python-indent-block-paren-deeper' and :inside-paren-from-block.
* test/lisp/progmodes/python-tests.el
(python-indent-inside-paren-block-1)
(python-indent-inside-paren-block-2)
(python-indent-inside-paren-block-3)
(python-indent-inside-paren-block-4): New tests.
(python-indent-inside-paren-5, python-indent-dedenters-8): Modify
according to the new context.
* etc/NEWS: Document the new user option.  (Bug#62696)
2023-04-22 12:28:37 +03:00
kobarity
8f42db010d Improve indenting "case" in Python
* lisp/progmodes/python.el (python-info-dedenter-statement-p): Do not
consider the first "case" in the block as dedenter.
* test/lisp/progmodes/python-tests.el
(python-info-dedenter-opening-block-positions-7)
(python-info-dedenter-statement-p-6): New tests. (Bug#62092)
2023-03-26 05:03:07 +03:00
kobarity
5cf1de683b Fix python-fill-paragraph problems on filling strings (bug#62142)
* lisp/progmodes/python.el (python-syntax--context-compiler-macro)
(python-syntax-context): Add single-quoted-string and
triple-quoted-string as TYPE argument.
(python-info-triple-quoted-string-p): New helper function.
(python-fill-paragraph)
(python-fill-string): Use it.
* test/lisp/progmodes/python-tests.el (python-syntax-context-1)
(python-fill-paragraph-single-quoted-string-1)
(python-fill-paragraph-single-quoted-string-2)
(python-fill-paragraph-triple-quoted-string-1)
(python-info-triple-quoted-string-p-1)
(python-info-triple-quoted-string-p-2)
(python-info-triple-quoted-string-p-3): New tests.
2023-03-16 16:59:06 +02:00
kobarity
c0cf69f7a1 Make "case" keyword a dedenter in Python
* lisp/progmodes/python.el (python-rx): Add "case" to dedenter.
(python-info-dedenter-opening-block-positions): Add "case" to pairs.
* test/lisp/progmodes/python-tests.el (python-indent-dedenters-9):
New test.
2023-03-11 15:18:47 +02:00
Dmitry Gutov
29228e24f2 python-info-dedenter-opening-block-positions: Fix to support "bare" match
* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions): Make the check
stricter.  Require that block starts only at indentation.

* test/lisp/progmodes/python-tests.el
(python-indent-after-bare-match): Another test (bug#62031).
2023-03-09 17:31:21 +02:00
kobarity
6fe9075ff3 Revert workaround introduced in Bug#56271
* lisp/progmodes/python.el (python-nav-end-of-statement)
(python-nav-end-of-block): Revert workaround introduced in Bug#56271
as the bug is fixedin Bug#58780.
2023-03-09 12:14:15 +02:00