Commit graph

12723 commits

Author SHA1 Message Date
Stefan Kangas
0cff855690 Bump python.el requirement to Emacs 29.1
* lisp/progmodes/python.el: Require Emacs 26.3, flymake 1.0 and
project 0.1.  (Bug#75526)
2025-03-02 18:49:37 +01:00
Stefan Kangas
eff5a3e43b Bump python.el requirement to Emacs 26.3
* lisp/progmodes/python.el: Require Emacs 26.3, flymake 1.0 and
project 0.1.  (Bug#75526)
2025-03-02 05:40:27 +01:00
Dmitry Gutov
625ed68aea Fix the use of xref-window-local-history together with Xref buffer
* lisp/progmodes/xref.el (xref--push-markers): Temporarily
restore the selected window as well, using the value from the
new argument (bug#76565).  Update both callers.
2025-03-02 05:22:56 +02:00
Eli Zaretskii
2095d0fcc6 Merge from origin/emacs-30
0460177451 ; * lisp/progmodes/java-ts-mode.el (treesit-node-end): De...
8481170eb2 Fix 'M-q' in 'makefile-mode'
44a770b871 ; Improve documentation of 'rmail-movemail-program'

# Conflicts:
#	lisp/progmodes/java-ts-mode.el
2025-03-01 10:02:41 -05:00
Eli Zaretskii
da584ad6fb Merge from origin/emacs-30
b531bbf73e Fix go-ts-mode const_spec highlighting (Bug#76330)
bd1d6761f4 ; Document what happens when 'display' and 'invisible' pr...
526eeedf88 keymaps.texi: Move "Changing Key Bindings" section up
7ec6531c7b keymaps.texi: Move "Key Sequences" section down
8b80401127 Improve process-get/process-put docstrings
73c646b777 Merge branch 'emacs-30' of git.sv.gnu.org:/srv/git/emacs ...
0af5c57499 Fix recent change in diff-no-select
c8cec840d7 Prevent rare freeze on Android 4.2 through 4.4
2025-03-01 10:01:54 -05:00
Eli Zaretskii
095ba1b674 Merge from origin/emacs-30
62b3d3136f Fix fns-tests-collate-strings failure with musl
840c682458 ; (completion-preview-complete): Fix bug#76606
fa42626a6a ; Fix indentation in cl.texi example
7ff806da49 ; Fix my last commit
2025-03-01 10:01:52 -05:00
Eli Zaretskii
6c411de542 Merge from origin/emacs-30
f88dc0f2f9 ; Fix documentation of 'buffer-text-pixel-size'
734986349f ; Minor Android documentation improvements
a90da89903 ; Fix up emacs-lisp-mode docstring
58c7acb555 ; Fix completion-fail-discreetly docstring typo.
02c830ba22 Fix ert-font-lock macro signatures
0c6b8643ae Fix a typo in 'window_text_pixel_size'
8a8c25eacc ; Add Rudolf Schlatte to authors.el
94c0ea39a5 * doc/misc/efaq.texi (New in Emacs 30): Fix typo.  (Bug#7...
0be5f9115e ; * etc/images/README (Files): Add an entry for last-page...
63adf9dcf5 ; Reflow some cl-lib docstrings
99253f7970 ; * etc/TODO: New section "Make it easier to contribute".

# Conflicts:
#	lisp/emacs-lisp/cl-macs.el
2025-03-01 10:01:09 -05:00
Eli Zaretskii
612b6df608 Merge from origin/emacs-30
563b6f9451 Constant highlighting no longer captures Java annotations
e15dcb2db5 Improve wording of lsh docstring
0cc651acdd ; * admin/check-doc-strings: Add note for future developm...
3c9b1c3cd1 Don't document deleted xwidget functions
9e9b78dda9 ; Improve lsh and ash documented argument names
2025-03-01 09:59:08 -05:00
Eli Zaretskii
0460177451 ; * lisp/progmodes/java-ts-mode.el (treesit-node-end): Declare. 2025-03-01 16:42:50 +02:00
Eli Zaretskii
8481170eb2 Fix 'M-q' in 'makefile-mode'
* lisp/progmodes/make-mode.el (makefile-mode-map): Bind 'M-q' to
'fill-paragraph', as 'prog-mode's default binding is not
appropriate for Makefile's syntax.  (Bug#76641)
2025-03-01 16:04:52 +02:00
john muhl
3998dea566 ; Cleanup sexp things in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Remove some
nonsensical entries from 'treesit-thing-settings'.
* test/lisp/progmodes/lua-ts-mode-resources/movement.erts:
Add missing tests for 'backward-sexp'.  (Bug#76534)
2025-03-01 14:59:56 +02:00
Randy Taylor
b531bbf73e Fix go-ts-mode const_spec highlighting (Bug#76330)
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Handle multiple const_spec identifiers.
* test/lisp/progmodes/go-ts-mode-resources/font-lock.go:
Add test case.
2025-03-01 14:12:30 +02:00
Stefan Kangas
c0ca272bd7 grep: Signal error if unable to access directory
* lisp/progmodes/grep.el (lgrep, rgrep): grep: Signal error if unable to
access directory, instead of just trying to use default-directory,
because that level of DWIMishness is confusing.  (Bug#71078)
2025-03-01 03:24:48 +01:00
Stefan Kangas
7ff806da49 ; Fix my last commit 2025-02-26 18:32:31 +01:00
Stefan Kangas
8c16583491 ; Whitespace fixes to silence git hooks 2025-02-26 18:11:22 +01:00
Stefan Kangas
b4d1061b82 Make define-global-minor-mode alias obsolete
* lisp/emacs-lisp/easy-mmode.el (define-global-minor-mode): Make alias
for old name obsolete, just in time for its 20th anniversary.
* test/lisp/emacs-lisp/lisp-mode-tests.el (test-font-lock-keywords):
* lisp/progmodes/subword.el (global-subword-mode)
(global-superword-mode): Don't use above obsolete name.
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression)
(lisp-fdefs): Remove syntax highlighting for obsolete name.
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Add comment mentioning the obsolete status of above alias.
* doc/lispref/loading.texi (Autoload): Don't document obsolete name.
2025-02-26 06:37:52 +01:00
john muhl
8bc933b64e ; Cleanup sexp things in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Remove some
nonsensical entries from 'treesit-thing-settings'.
* test/lisp/progmodes/lua-ts-mode-resources/movement.erts:
Add missing tests for 'backward-sexp'.  (Bug#76534)
2025-02-26 04:52:15 +01:00
Stefan Kangas
a90da89903 ; Fix up emacs-lisp-mode docstring
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode, lisp-interaction-mode):
Fix up docstring slightly by removing redundant and misplaced word
"Commands", and prefix list with dashes.
2025-02-26 03:34:14 +01:00
Stefan Kangas
d1d85e0f35 Prefer incf to cl-incf in progmodes/*.el
* lisp/progmodes/bug-reference.el (bug-reference--overlay-bounds):
* lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset):
* lisp/progmodes/compile.el (compilation--note-type):
* lisp/progmodes/ebrowse.el (ebrowse-files-table)
(ebrowse-fill-member-table, ebrowse-find-pattern)
(ebrowse-draw-member-short-fn, ebrowse-gather-statistics):
* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--electric-pair-string-delimiter):
* lisp/progmodes/gdb-mi.el (gdb-thread-list-handler-custom):
* lisp/progmodes/grep.el (grep-filter):
* lisp/progmodes/hideif.el (hif-backward-comment, hif-__COUNTER__)
(hif-token-concatenation, hif-find-define):
* lisp/progmodes/js.el (js--pstate-is-toplevel-defun)
(js-beginning-of-defun, js-end-of-defun, js--pitems-to-imenu)
(js--imenu-to-flat, js-ts--syntax-propertize):
* lisp/progmodes/tcl.el (tcl--syntax-of-quote):
* lisp/progmodes/typescript-ts-mode.el
(tsx-ts--syntax-propertize-captures): Prefer incf to cl-incf.
2025-02-25 08:28:30 +01:00
Stefan Kangas
60b071e224 Make cl-gensym obsolete in favor of built-in gensym
* lisp/emacs-lisp/cl-macs.el (cl-gensym): Declare function
obsolete in favor of gensym, added in Emacs 26.1.  The only reason
for its existence is that it allows an integer argument, but
that's not really useful, so it's better to remove this complexity.
Ref: https://lists.gnu.org/r/emacs-devel/2017-09/msg00313.html
* doc/misc/cl.texi (Symbols, Creating Symbols, Efficiency Concerns)
(Obsolete Setf Customization): Don't document above obsolete function.
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause):
* lisp/emacs-lisp/edebug.el (edebug-make-form-wrapper):
* lisp/obsolete/cl.el (cl--function-convert, lexical-let):
* lisp/obsolete/thumbs.el (thumbs-temp-file):
* lisp/progmodes/eglot.el (eglot--lambda)
(eglot--when-live-buffer, eglot--when-buffer-window)
(eglot--collecting-xrefs, eglot--glob-parse):
* lisp/progmodes/flymake.el (flymake--run-backend):
* test/lisp/emacs-lisp/package-tests.el (with-package-test):
* test/lisp/progmodes/eglot-tests.el (eglot--guessing-contact):
* test/lisp/progmodes/elisp-mode-tests.el
(elisp-shorthand-read-buffer, elisp-shorthand-read-from-string): Prefer
plain gensym to cl-gensym in files that can depend on Emacs 26.1.
* lisp/jsonrpc.el (jsonrpc-lambda, jsonrpc-request): Prefer gensym to
cl-gensym only when defined, as this file supports Emacs 25.1
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-lib-test-gensym): Simplify
test as 'should' no longer uses cl-gensym.
2025-02-25 01:25:15 +01:00
João Távora
7bb53815d2 Eglot: add out-of-box support for neocmakelsp
* lisp/progmodes/eglot.el (eglot-server-programs): Add
neocmakelsp.
2025-02-24 23:38:15 +00:00
João Távora
e4c911adea Eglot: use eglot-advertise-cancellation in more situations
The async requests frequently issued by ElDoc are a significant
source of request pile-up on the server side (for some servers).

With this change, Eglot will issue additional LSP
$/cancelRequest notifications for in-flight requests of certain
kinds in the pre-command hook.

This required a small change to the 'jsonrpc-async-request'
entrypoint.

This feature is experimental.

* lisp/jsonrpc.el (jsonrpc-async-request): No longer returns nil.

* lisp/progmodes/eglot.el (eglot--inflight-async-requests): New variable.
(eglot--cancel-inflight-async-requests): New function.
(eglot--async-request): New function.
(eglot--pre-command-hook): Call eglot--cancel-inflight-async-requests.
(eglot-signature-eldoc-function, eglot-hover-eldoc-function)
(eglot-highlight-eldoc-function, eglot-code-action-suggestion):
Use eglot--async-request.
2025-02-24 23:38:15 +00:00
Vincenzo Pupillo
563b6f9451 Constant highlighting no longer captures Java annotations
* lisp/progmodes/java-ts-mode.el
(java-ts-mode--fontify-constant): New function.
(java-ts-mode--font-lock-settings): Use it.
2025-02-23 20:48:13 +01:00
Jostein Kjønigsen
2044f6d959 Improve fontification of docker-files
Add support for fontifying the following grammar-elements:
- image-declarations (image-name, image-tag & image alias)
- strings in more general terms
- string-expansion statements
- treat path-values as strings
- identifiers names for ENV and ARG statements
- argument values for ENV and ARG statements
* lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode)
(dockerfile-ts-mode--font-lock-settings): Improve fontification.
(Bug#76481)
2025-02-23 01:03:00 +01:00
Stefan Kangas
9d7d4db7eb Prefer decf to cl-decf
* lisp/auth-source-pass.el (auth-source-pass--find-match-many):
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-month, decoded-time--alter-day):
* lisp/dired.el (dired--move-to-next-line):
* lisp/dom.el (dom-pp):
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
* lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit):
* lisp/emacs-lisp/cl-seq.el (cl-fill, cl-replace, cl-substitute):
* lisp/emacs-lisp/comp-cstr.el (comp--range-union)
(comp--range-intersection):
* lisp/emacs-lisp/comp.el (comp-vec-prepend, comp--emit-narg-prologue):
* lisp/emacs-lisp/edebug.el (edebug--strip-instrumentation):
* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy):
* lisp/emacs-lisp/pp.el (pp--format-definition):
* lisp/emacs-lisp/smie.el (smie-config--guess-1):
* lisp/eshell/esh-io.el (eshell-close-handle, eshell-set-output-handle):
* lisp/gnus/gnus-async.el (gnus-async-prefetch-article):
* lisp/gnus/gnus-group.el (gnus-group-mark-group)
(gnus-group-yank-group):
* lisp/gnus/gnus-salt.el (gnus-tree-forward-line):
* lisp/gnus/gnus-score.el (gnus-decay-scores):
* lisp/gnus/gnus-srvr.el (gnus-browse-toggle-subscription-at-point):
* lisp/gnus/gnus-sum.el (gnus-build-sparse-threads, gnus-parent-headers)
(gnus-update-marks, gnus-summary-work-articles)
(gnus-summary-refer-parent-article, gnus-summary-next-thread)
(gnus-read-header, gnus-summary-insert-new-articles):
* lisp/gnus/gnus-topic.el (gnus-topic-forward-topic):
* lisp/gnus/gnus.el (gnus-short-group-name):
* lisp/gnus/message.el (message-remove-first-header)
(message-shorten-references, message-insert-screenshot):
* lisp/gnus/mm-url.el (mm-url-insert):
* lisp/gnus/nnselect.el (nnselect-push-info):
* lisp/ibuffer.el (ibuffer-backward-line, ibuffer-forward-line)
(ibuffer-map-lines):
* lisp/icomplete.el (icomplete--render-vertical):
* lisp/image/image-dired-external.el (image-dired-create-thumb-1):
* lisp/image/image-dired.el (image-dired-delete-char):
* lisp/mail/ietf-drums-date.el (ietf-drums-date--tokenize-string):
* lisp/mh-e/mh-utils.el (mh-sub-folders-parse):
* lisp/minibuffer.el (minibuffer-completion-help):
* lisp/mpc.el (mpc-cmd-move, mpc-songpointer-refresh-hairy):
* lisp/net/eww.el (eww-process-text-input):
* lisp/net/pop3.el (pop3-wait-for-messages, pop3-uidl-stat)
(pop3-uidl-dele):
* lisp/net/shr-color.el (shr-color-hue-to-rgb):
* lisp/play/5x5.el (5x5-up, 5x5-left):
* lisp/play/decipher.el (decipher-read-alphabet, decipher--digram-total)
(decipher-analyze-buffer):
* lisp/play/hanoi.el (hanoi-insert-ring, hanoi-move-ring):
* lisp/profiler.el (profiler-format-number)
(profiler-calltree-build-unified):
* lisp/progmodes/antlr-mode.el (antlr-next-rule, antlr-indent-line):
* lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset):
* lisp/progmodes/ebrowse.el
(ebrowse-cyclic-display-next/previous-member-list):
* lisp/progmodes/hideif.el (hif-backward-comment):
* lisp/progmodes/js.el (js-beginning-of-defun, js-end-of-defun)
(js-ts--syntax-propertize):
* lisp/progmodes/typescript-ts-mode.el
(tsx-ts--syntax-propertize-captures):
* lisp/rect.el (rectangle--*-char):
* lisp/term.el (term-emulate-terminal):
* lisp/textmodes/reftex-cite.el (reftex-do-citation):
* lisp/textmodes/reftex-index.el (reftex-index-next-phrase):
* lisp/textmodes/reftex-parse.el (reftex-init-section-numbers):
* lisp/textmodes/reftex-sel.el (reftex-select-unmark):
* lisp/textmodes/reftex.el (reftex-silence-toc-markers):
* lisp/treesit.el (treesit-navigate-thing):
* lisp/vc/diff-mode.el (diff-sanity-check-context-hunk-half,
(diff-sanity-check-hunk):
* lisp/vc/pcvs-util.el (cvs-first):
* lisp/vc/smerge-mode.el (smerge-get-current):
* lisp/vc/vc-hg.el (vc-hg--glob-to-pcre):
* test/lisp/net/socks-tests.el
(socks-tests-perform-hello-world-http-request):
* test/src/buffer-tests.el (test-overlay-randomly): Prefer decf to
cl-defc in all code where we can.
2025-02-23 00:38:22 +01:00
Stefan Kangas
702cb123fa ; Fix typos 2025-02-22 14:48:29 +01:00
Jostein Kjønigsen
ecddc8227d Fix identation in csharp-mode.el
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules): Fix
indentation for using statements and multiline lambdas.  (Bug#75883)
Patch based on bug report by Dino Chiesa <dpchiesa@hotmail.com>.
2025-02-21 17:54:29 +01:00
kobarity
4509662236 Add python-ts-mode to ffap-alist
* lisp/progmodes/python.el (ffap-alist): Add
python-ts-mode.  (Bug#76364)
2025-02-19 03:07:34 +01:00
Liu Hui
db8af88222 Disable PyREPL in Python shell
The new default REPL (PyREPL) in Python 3.13 is incompatible
with Python shell and displays a warning message when reverting
to the old basic REPL.

* lisp/progmodes/python.el
(python-shell--calculate-process-environment): Use the basic
REPL.  (Bug#76205)
2025-02-18 20:04:17 +01:00
kobarity
a75f4449fa Improve completion in IPython/Python 3.13
IPython/Python 3.13 indirectly imports rlcompleter, and the
completer is set up to reference rlcompleter.__main__.
However, this rlcompleter.__main__ is different from the
__main__ in the REPL execution.  Therefore, this completer
cannot correctly complete the REPL globals.  To address this
issue, we override rlcompleter.__main__ with __main__ only in
the case of IPython.

* lisp/progmodes/python.el (python-shell-completion-native-setup):
Modify __PYTHON_EL_native_completion_setup().  (Bug#76205)
2025-02-18 20:04:16 +01:00
Stefan Kangas
c180966b31 Prefer defvar-keymap in tcl.el
* lisp/progmodes/tcl.el (tcl-mode-map, inferior-tcl-mode-map): Prefer
defvar-keymap.
2025-02-18 20:04:16 +01:00
Stefan Kangas
697e7c3211 Prefer defvar-keymap in pascal.el
* lisp/progmodes/pascal.el (pascal-mode-map, pascal-outline-map):
Prefer defvar-keymap.
2025-02-18 20:04:16 +01:00
Stefan Kangas
941ba65d1e Prefer defvar-keymap in meta-mode.el
* lisp/progmodes/meta-mode.el (meta-common-mode-map): Prefer
defvar-keymap.
2025-02-18 20:04:16 +01:00
Basil L. Contovounesios
2e3cf73e05 Improve autoconf-mode macro detection
* doc/lispref/modes.texi (Search-based Fontification): Fix
indentation of (MATCHER . FACESPEC) example.
* doc/misc/cc-mode.texi (Performance Issues): Index
defun-prompt-regexp under variables, not functions.

* lisp/progmodes/autoconf.el (autoconf--symbol, autoconf--macro):
New rx definitions.
(autoconf-definition-regexp): Use an optional second capture group
to indicate a function rather than variable definition.  Detect
AC_DEFINE defining a function-like CPP macro.  Skip more shell
syntax such as variable ${} expansion and command `` substitution in
AC_DEFINE_UNQUOTED variable.  Match AH_VERBATIM, AM_CONDITIONAL, and
AM_MISSING_PROG as defining variables, and AC_DEFUN, AC_DEFUN_ONCE,
AU_ALIAS, and AU_DEFUN as defining functions.  Document first
capture group in docstring.
(autoconf-font-lock-keywords): Use autoconf--macro to match more
Autoconf macros, such as those defined in the Autoconf Archive and
Gnulib.  Reserve font-lock-function-name-face for function
definitions as determined by autoconf-definition-regexp, and use
font-lock-variable-name-face for the rest instead.  Use Font Lock
face symbols directly in place of their corresponding variable.
Fontify M4 changequote primitive only as a standalone symbol.
(autoconf-imenu-generic-expression): Add commentary mentioning new
submenu possibility.
(autoconf-current-defun-function): Update docstring accuracy.
Replace line-end-position with pos-eol since there are no fields.
(autoconf-mode): Define defun-prompt-regexp in terms of
autoconf--macro to support more toplevel macros, such as those
defined in Autoheader, M4sh, etc.  Set
open-paren-in-column-0-is-defun-start to nil to avoid false
positives when an Autoconf quote character is in column zero.

* test/lisp/progmodes/autoconf-resources/configure.ac: New file.
* test/lisp/progmodes/autoconf-tests.el
(autoconf-tests-current-defun-function-define)
(autoconf-tests-current-defun-function-subst): Replace character
motion with search.
(autoconf-tests-autoconf-mode-comment-syntax): Ditto.  Test both dnl
and # comments.  Use syntax-ppss-context.
(autoconf-tests-font-lock): New test.
2025-02-17 17:28:05 -08:00
Stefan Kangas
83bc811f7f Prefer plusp/minusp to cl-plusp/cl-minusp
* lisp/dired.el (dired--move-to-next-line):
* lisp/emacs-lisp/ert.el (ert-run-tests-batch, ert-face-for-stats):
* lisp/emacs-lisp/pp.el (pp--format-definition):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event--org-timestamp):
* lisp/ibuffer.el (ibuffer-compile-format, ibuffer--format-title)
(ibuffer--format-summary):
* lisp/image-mode.el (image-transform-set-percent):
* lisp/international/emoji.el (emoji--list-generate, emoji--read-emoji):
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation)
(ebrowse-set-member-buffer-column-width)
(ebrowse-cyclic-display-next/previous-member-list)
(ebrowse-draw-member-short-fn)
(ebrowse-switch-member-buffer-to-sibling-class, ebrowse-push-position):
* lisp/textmodes/dns-mode.el (dns-mode-reverse-and-expand-ipv6):
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--not-writable-directory)
(bytecomp-tests--dest-mountpoint)
(bytecomp-tests--target-file-no-directory):
* test/lisp/emacs-lisp/cl-seq-tests.el (cl-member-if-test)
(cl-member-if-not-test, cl-assoc-if-not-test, cl-rassoc-if-test)
(cl-rassoc-if-not-test):
* test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid):
Prefer plusp and minusp to cl-plusp and cl-minusp.
2025-02-17 22:46:56 +01:00
Stefan Kangas
fd5dbea21b Prefer '(oddp A)' to '(= 1 (logand A 1))'
* lisp/calendar/todo-mode.el (todo-padded-string):
* lisp/emacs-lisp/gv.el (setf):
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
* lisp/hexl.el (hexl-insert-hex-string):
* lisp/play/gamegrid.el (gamegrid-xbm):
* lisp/play/hanoi.el (hanoi-internal):
* lisp/progmodes/ebnf2ps.el (ebnf-end-of-string):
* lisp/progmodes/elisp-mode.el (elisp--highlight-function-argument):
* lisp/progmodes/ruby-mode.el (ruby-backward-sexp):
* lisp/ps-print.el (ps-print-page-p):
(ps-print-sheet-p): Prefer '(oddp A)' to '(= 1 (logand A 1))' and
variations thereof.
2025-02-17 19:33:56 +01:00
Po Lu
b236a2529d Adapt query-replace and lazy highlighting to text conversion
* lisp/isearch.el (isearch-lazy-highlight-new-loop): Rather call
redisplay to guarantee a valid window-start than sit-for, to
account for cases where this function is called from an
after-change-function bound to a special input event quickly
followed by another event that does not modify the buffer.

* lisp/progmodes/prog-mode.el (treesit-node-at): Declare
function before references.

* lisp/replace.el (perform-replace): When querying, suppress
text conversion around the input loop.
2025-02-17 16:47:09 +08:00
Vincenzo Pupillo
05a96fd398 Add mhtml-ts-mode.
New major-mode alternative to mhtml-mode, based on treesitter, for
editing files containing html, javascript and css.

* etc/NEWS: Mention the new mode and new functions.
* lisp/textmodes/mhtml-ts-mode.el: New file.
* lisp/progmodes/js.el
(js--treesit-thing-settings): New variable.
(js--treesit-font-lock-feature-list); New variable.
(js--treesit-simple-imenu-settings): New variable.
(js--treesit-defun-type-regexp): New variable.
(js--treesit-jsdoc-comment-regexp): New variable.
(js-ts-mode): Use of new variables instead of direct assignment of
values.
* lisp/textmodes/css-mode.el
(css-mode--menu): New variable.
(css-mode-map): Use new variable.
(css--treesit-font-lock-feature-list): New variable.
(css--treesit-simple-imenu-settings): New variable.
(css--treesit-defun-type-regexp): New variable.
(cs-ts-mode): Use of new variables instead of direct assignment of
values.
* lisp/textmodes/html-ts-mode.el
(html-ts-mode--treesit-things-settings): New variable.
(html-ts-mode--treesit-font-lock-feature-list): New variable.
(html-ts-mode--treesit-simple-imenu-settings): New variable.
(html-ts-mode--treesit-defun-type-regexp): New variable.
(html-ts-mode): Use of new variables instead of direct assignment of
values.
* lisp/treesit.el
(treesit-merge-font-lock-feature-list): New fuction.
(treesit-replace-font-lock-feature-settings): New fuction.
(treesit-modify-indent-rules): New function.
2025-02-17 09:22:22 +02:00
Stefan Kangas
e373a6e0d3 Prefer '(oddp A)' to '(= 1 (% A 2))'
* lisp/align.el (align-match-tex-pattern):
* lisp/calc/calc-funcs.el (math-bernoulli-number):
* lisp/cedet/semantic/bovine/el.el (semantic-ctxt-current-assignment):
* lisp/comint.el (comint-within-quotes):
* lisp/emacs-lisp/chart.el (chart-axis-draw):
* lisp/emacs-lisp/cl-extra.el (cl-round):
* lisp/emacs-lisp/eieio.el (defclass):
* lisp/emacs-lisp/elint.el (elint-check-setq-form):
* lisp/emulation/cua-rect.el (cua--rectangle-right-side):
* lisp/progmodes/gud.el (gud-gdb-completions-1):
* lisp/ps-print.el (ps-end-job):
* lisp/ses.el (ses-center):
* lisp/vc/ediff-ptch.el (ediff-get-patch-buffer): Prefer '(oddp A)' to
'(= 1 (% A 2))' and variations thereof.
2025-02-17 05:37:10 +01:00
Stefan Kangas
9efd11e5fd Prefer cl-evenp/cl-oddp in some places
* lisp/erc/erc.el (erc-format-message):
* lisp/obsolete/thumbs.el (thumbs-emboss-image):
* lisp/org/org-capture.el (org-capture-escaped-%):
* lisp/org/org-element-ast.el (org-element-create):
* lisp/org/org-macro.el (org-macro-extract-arguments):
* lisp/org/org-persist.el (org-persist--get-collection):
* lisp/org/ox-odt.el (org-odt-get-table-cell-styles):
* lisp/org/ox.el (org-export--dispatch-ui):
* lisp/progmodes/cperl-mode.el (cperl-forward-re)
(cperl-find-pods-heres): Prefer 'cl-evenp/'cl-oddp' to free-coding them
in some files that already depend on cl-lib in run-time.
2025-02-17 02:00:51 +01:00
João Távora
e8470b79f1 Eglot: Improve fix to bug#66144
The :exit notification should also take an empty JSON object instead of
JSON null as its parameters.

* lisp/progmodes/eglot.el (eglot-shutdown): Use eglot--{} in
:exit notifcation, too.
2025-02-16 18:29:41 +00:00
kobarity
6491fee366 Fix string end search in python-nav-end-of-statement
* lisp/progmodes/python.el (python-nav-end-of-statement):
Change to look for string delimiter characters and check
syntax, instead of looking for string-delimiter syntax.
* test/lisp/progmodes/python-tests.el
(python-nav-end-of-statement-5): New test.  (Bug#75387)
2025-02-15 13:24:59 +02:00
Po Lu
c37e7cef42 Merge from savannah/emacs-30
58e4bfe340 Add two missing NULL checks of malloc'd values on Android
81ca9c75f1 ; * etc/PROBLEMS: Document how to grant storage permissio...
d82d468979 ; * etc/TODO: Rethink finder-known-keywords.
b9b9c33dcb Fix (Non)GNU ELPA description in manual
87a61eba1b Move 'package-archives' documentation to emacs manual
316e47c5af ; * src/fns.c (Fmapconcat): Doc fix (bug#76242).
3cfbeb3fca ; Fix >72 character long lines in docstring
c68886ddb7 ; Change "virus" to "malicious" in lispref
6701866be4 Document (Non-)GNU ELPA in emacs manual
02851768b7 ; * .mailmap: Add entry for Thuna.  (Bug#76221)
2d7a8cbf4c Fix author name
1931425748 Use c-ts-common's comment setup in go-ts-mode (bug#75978)
316893ca38 Add java-language-server to eglot-server-programs
2025-02-15 16:58:55 +08:00
Yuan Fu
b58552ca98
; Another attempt at fixing c-ts-common--prev-standalone-sibling
* lisp/progmodes/c-ts-common.el:
(c-ts-common--prev-standalone-sibling): Fix.
2025-02-14 17:44:40 -08:00
Yuan Fu
ac9cf20919
; Fix c-ts-common--prev-standalone-sibling
* lisp/progmodes/c-ts-common.el:
(c-ts-common--prev-standalone-sibling): Fix.
2025-02-14 08:37:16 -08:00
Yuan Fu
7ac578c57c
Use a heuristic to support method chaining in c-ts-common
Test for "." at the beginning of a line to detect chained method.

* lisp/progmodes/c-ts-common.el:
(c-ts-common--standalone-predicate): New function.
(c-ts-common--standalone-parent):
(c-ts-common--prev-standalone-sibling): Use the new heuristic.
2025-02-13 21:59:00 -08:00
Yuan Fu
34f90bf2ca
Allow treesit-simple-indent-standalone-predicate to return anchor
* lisp/treesit.el:
(treesit-simple-indent-standalone-predicate): Allow it to return
an anchor instead of t.
(treesit-simple-indent-presets): Supports number.
* lisp/progmodes/c-ts-common.el:
(c-ts-common--standalone-parent):
(c-ts-common--prev-standalone-sibling): Supports number.
2025-02-13 20:47:23 -08:00
Yuan Fu
4b020b936c
Add treesit-simple-indent-standalone-predicate (bug#74386)
* lisp/treesit.el:
(treesit-simple-indent-standalone-predicate): New variable.
(treesit-simple-indent-presets): Use the predicate.
(treesit-simple-indent-presets): Update docstring.
* lisp/progmodes/c-ts-common.el:
(c-ts-common--standalone-parent):
(c-ts-common--prev-standalone-sibling): Use the predicate if
non-nil.  Also, handle method chaining by default.
* doc/lispref/modes.texi (Parser-based Indentation): Add
documentation.
2025-02-13 20:18:02 -08:00
Robert Pluim
2f8c2e64e0 Use 'const' instead of 'symbol' in 'c-ts-mode-indent-style
The 'symbol' widget is for when the user is expected to enter a
symbol; when using a definite symbol, 'const' is preferred.

* lisp/progmodes/c-ts-mode.el (c-ts-mode-indent-style): Use
'const' to define the options for a 'choice' widget.
2025-02-13 14:19:04 +01:00
Ship Mints
6077bbfc3d project-(remember|forget)-projects-under: Improve docstrings
* lisp/progmodes/project.el (project-forget-projects-under)
(project-remember-projects-under): Clarify docstrings (bug#76234).
2025-02-13 02:14:57 +02:00