1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-08 23:40:24 -08:00
Commit graph

98029 commits

Author SHA1 Message Date
Vincent Belaïche
dec7539233 Rewrite ses-set to be lexical-binding-proof. 2025-06-21 21:13:24 +02:00
Vincent Belaïche
6c2256f52e Bind dynamically row col on calling ses-after-entry-functions. 2025-06-21 21:13:23 +02:00
Vincent Belaïche
ed25af44d3 Add formula as an expression setters to ses-setq. 2025-06-21 21:13:22 +02:00
Vincent Belaïche
e1f6a02022 ses-setq new function. 2025-06-21 21:13:21 +02:00
Vincent Belaïche
26390cf993 Fix ses-select accordingly with changes for having ses-setq.
* lisp/ses.el (ses-select): Fix accordingly with new definition of
'ses-range'. 'ses-select' is no longer a macro, but a function,
and ranges are evaluated as list of values, not list of symbols.
Also the order of elements is not changed.
(ses-select): Add un extra optional argument to allow configure
the test function.
2025-06-21 21:13:18 +02:00
Vincent Belaïche
212b0faebd Fix ses-insert-range.
* lisp/ses.el (ses-insert-range): Fix after change of definition of
'ses-range'.
2025-06-21 21:13:17 +02:00
Vincent Belaïche
91c74c7a76 ses-range as a wrapper macro for a helper function ses-range-engine.
* lisp/ses.el (ses--cell-value): New function.
(ses--range-engine): New function.
(ses-range): Delegate processing to helper function
ses--range-engine. Has an extra-argument value-extractor.
2025-06-21 21:13:16 +02:00
Vincent Belaïche
ab7d6fbe88 Make ses-range environment agnostic.
* lisp/ses.el (ses-sym-rowcol): Do not make border effect on interned
symbols.
(ses-formula-references): Do not use ses-range implementation any
longer, as the ses-range is now environnement agnostic, and as such do
not expand any longer to a list of symbols.
(ses-range): Do not make border effect on interned symbols, and be
environment agnostic. As such ses-range macro now expand to a sexp the
evaluation of which yields a list of symbol, and no longer to a list
of symbol with some function call to make it evaluate to the
list of values.

* test/lisp/ses-tests.el (ses-expand-range): New test.
2025-06-21 21:13:14 +02:00
Vincent Belaïche
5a8c993eb3 ses-range < > shorthands.
* lisp/ses.el (ses-range): Fix handling of shorthands < >.
2025-06-21 21:13:13 +02:00
Vincent Belaïche
90af74af7a Ensure SES idle timer hook operate in correct buffer context.
* lisp/ses.el (ses--idle-timer-hook): New defun.
(ses-mode): Does not call ses-command-hook directly from idle
timer, but rather use a wrapper function with some context
argument to ensure that the current buffer is properly set when
the hook is called and timer is cleaned up if SES buffer has been
killed.
2025-06-21 21:13:12 +02:00
Sean Whitton
c916f816e0 ; * lisp/vc/vc.el (vc-checkin): Fix thinko. 2025-06-21 19:03:54 +01:00
Eli Zaretskii
31febb1a28 Merge from origin/emacs-30
a2bfce5d2a ; Fix customization and doc strings in pp.el
2025-06-21 06:26:10 -04:00
Eli Zaretskii
f1696c3c27 ; * lisp/progmodes/python.el (treesit-thing-settings): Defvar. 2025-06-21 06:23:51 -04:00
Manuel Giraud
d7e5555875 Avoid rebuilding a static alist inside a loop
* lisp/calendar/diary-lib.el (diary-mark-entries-1): Build
months-alist outside of the loop.  (Bug#78779)
2025-06-21 12:39:56 +03:00
Elías Gabriel Pérez
60fbeda771 Support strings for electric pairs (bug#78053)
This add support for insert string pairs in 'electric-pairs-mode'.
* lisp/elec-pair.el (electric-pair-pairs)
(electric-pair-text-pairs): Add new defcustom types.
(electric-pair-syntax-info)
(electric-pair-post-self-insert-function): Add support for
strings.

* etc/NEWS: Announce changes.

* test/lisp/electric-tests.el: Add new tests.
2025-06-21 12:24:55 +03:00
Eli Zaretskii
e379f14193 Fix setting custom 'c++-ts-mode' indent style
* lisp/progmodes/c-ts-mode.el (c-ts-mode-set-style): Fix a typo.
(Bug#78814)
2025-06-21 12:10:54 +03:00
Zach Shaftel
075ebed98f Fix byte-compilation of defalias with a constant macro cons pair
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
Quote the function name in '(macro . function-name), since we eval
it later.
* test/lisp/emacs-lisp/bytecomp-tests.el
(test-eager-load-macro-expand-defalias): New test.
(Bug#78792)
2025-06-21 11:40:17 +03:00
Jostein Kjønigsen
39721a4d79 python-ts-mode: Improve fontification
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)
2025-06-21 11:17:51 +03:00
Manuel Giraud
00b8d11ac8 Fix bold or underline of underscores (bug#78839)
* lisp/man.el (Man-fontify-manpage): Fix the "_\b_" case.
2025-06-21 11:15:26 +03:00
Eli Zaretskii
4607d3e426 Fix 'split-string' when TRIM is used
* lisp/subr.el (split-string): Support the case where STRING
begins with a match for SEPARATORS, and a match for SEPARATORS
also matches TRIM.  Doc fix.  (Bug#78690)

* test/lisp/subr-tests.el (subr-test-split-string): New test.
2025-06-21 11:08:05 +03:00
Stefan Monnier
df86d10316 (peg--merge-error) <guard>: Add missing method
Also clarify that the package requires at least Emacs-25.

* lisp/progmodes/peg.el (peg--merge-error) <guard>: Add missing method.
2025-06-20 19:59:54 -04:00
Juri Linkov
1a76b527ac Use keyword :commit with full hashes for treesit-language-source-alist.
* 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.
2025-06-20 19:58:28 +03:00
Martin Rudalics
60a567af86 Have 'split-window' forget previous window height (Bug#78835)
* lisp/window.el (split-window): When WINDOW has a
'quit-restore' parameter that specifies a previous height to
restore, remove that when splitting vertically.  It does more
harm than good now (Bug#78835).
2025-06-20 08:51:58 +02:00
Pip Cet
b6cf7c0942 Make cl-random behave consistently for unusual arguments (bug#75105)
The old behavior was for (cl-random -1.0e+INF) to return NaN in about
one in eight million calls, and -1.0e+INF otherwise.  Other unusual
arguments were handled inconsistently as well.

* lisp/emacs-lisp/cl-extra.el (cl-random): Handle positive finite
arguments consistently, error for nonpositive or infinite arguments.
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-random): New
test.
2025-06-20 06:09:24 +00:00
Juri Linkov
e5646f7903 Fix repeat-echo-message-string for keys with hints (bug#78797).
* lisp/repeat.el (repeat-echo-message-string): For one character
use it to format hints.  For multi-key sequence first print it,
then use the last character to format hints in parenthesis.

* test/lisp/repeat-tests.el (repeat-tests-another-repeat-map): Add hints.
(repeat-tests-hints): Add test.
2025-06-19 09:40:36 +03:00
Michael Albinus
e3e0be8786 ; Fix last change 2025-06-18 21:08:30 +02:00
Michael Albinus
5310083ba0 Show test name in ERT progress bar
* lisp/emacs-lisp/ert.el
(ert--results-progress-bar-button-help-echo): New defun.
(ert--results-progress-bar-button): Use it.
2025-06-18 20:12:55 +02:00
shipmints
318715105d Make savehist timer actually repeat
* lisp/savehist.el (savehist--manage-timer): Correct the
arguments to 'run-with-timer'.  Suggestion from Stéphane Marks
<shipmints@gmail.com>.  (Bug#78820)
2025-06-18 17:03:36 +02:00
Pip Cet
af68c6e825 Remove eieio's ...-list-p predicate (bug#78782)
There seem to be no remaining callers of this function, which has not
been working for a while.

* lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): Don't
mention "-list-p" predicate.
(eieio-defclass-autoload): Don't autoload predicate.
(eieio-defclass-internal): Remove code to generate list-p predicate.
2025-06-18 11:41:43 +00:00
Yuan Fu
27a524602f
Use treesit-thing-settings in python-ts-mode
* lisp/progmodes/python.el (python--thing-settings): New variable.
(python-ts-mode): Setup treesit-thing-settings.
2025-06-17 17:44:23 -07:00
Yuan Fu
eb3f089356
Remove obsolete tree-sitter type-regexp vars
* lisp/treesit.el (treesit-text-type-regexp):
(treesit-sexp-type-regexp):
(treesit-sentence-type-regexp): Remove variables.
2025-06-17 17:33:08 -07:00
Mattias Engdegård
3f72004961 Fix function arity check for noncompiled callees (bug#78685)
This fixes a regression from Emacs 29, and is the second attempt after
the later reverted 8b0f5b0597.

* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition):
Make it work for functions that aren't compiled.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--f):
(bytecomp-tests--warn-arity-noncompiled-callee): Add test.
2025-06-17 20:18:53 +02:00
Stephen Berman
79e50ddb9c Fix regression in 'kill-this-buffer' (bug#78809)
This restores the ability to use 'kill-this-buffer' when a
keyboard event pops up the Global Menu.  Instead of raising an
error if the command was not called by a mouse event, an error is
now raised if it was not called from a menu or a tool bar.

* lisp/menu-bar.el (kill-this-buffer): Remove optional EVENT from
argument list and "e" code from interactive spec.  Adjust doc
string.  Use 'last-command-event' to determine if command was
called from a menu or a tool bar.  Use 'event--posn-at-point' in
test for frame.

* lisp/net/eudc-hotlist.el (eudc-hotlist-quit-edit):
* lisp/net/eudc.el (eudc-display-records, eudc-query-form):
* lisp/vc/pcvs.el (cvs-mode-map): Replace uses of
'kill-this-buffer' by 'kill-current-buffer'.
2025-06-17 16:08:32 +02:00
Andrea Corallo
f38e969e47 Make nativecomp don't error when encountering undeclared types (bug#6573)
* test/src/comp-resources/comp-test-funcs.el (comp-test-76573-1-f): New
function.
* lisp/emacs-lisp/comp-cstr.el (comp-supertypes): Don't error if 'type'
is unknown.
2025-06-17 09:22:32 +02:00
Stefan Monnier
376bd36f34 register.el: Fix use of cl-find-class
`declare-function` doesn't cut it because the function can get
called without having loaded `cl-extra` beforehand.
Use `cl--find-class` instead, since that one gets inlined.

* lisp/register.el: Require `cl-macs`.
(register--get-method-type): Use `cl--find-class`.
(cl-find-class): Don't declare.
2025-06-16 17:15:37 -04:00
Eli Zaretskii
a2bfce5d2a ; Fix customization and doc strings in pp.el
* lisp/emacs-lisp/pp.el (pp-default-function): Fix :tag's.
(pp-29, pp-28): Doc fixes.  (Bug#78801)
2025-06-16 10:00:41 +03:00
James Thomas
a4ca0cd7f0 Add repeat map for tab-bar-history (bug#78804)
Add repeat map similar to that of winner-mode (to which
tab-bar-history is an alternative).

* lisp/tab-bar.el (tab-bar-history-repeat-map): Make the change.
2025-06-16 09:36:22 +03:00
Eli Zaretskii
336253ddd3 Merge from origin/emacs-30
df3fb94f09 Insert missing step to make use of directory tracking OSC...
1bed294958 * lisp/keymap.el (keymap-set): Refer to 'key-description'...
941158fc13 Support new tree-sitter grammar filename format (bug#78754)
888f846d37 Fix crash when evaluating "(signal nil 5)" (bug#78738)
51b9e92ab8 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
c0a913ea4f ; * doc/lispref/modes.texi (Font Lock Basics): Remove old...
37de076017 Adapt emba integration (don't merge)
2025-06-14 11:23:54 -04:00
Steven Allen
e1d0ee1b6b mailcap: Treat .ics files as text/calendar
This ensures iCalendar attachments are always displayed correctly
(via `gnus-icalendar-mm-inline'), even when they have an incorrect
MIME type (looking at you Google Calendar).
* lisp/net/mailcap.el (mailcap-mime-extensions): Add a mapping from ".ics"
to "text/calendar".  (Bug#78764)
2025-06-14 17:29:01 +03:00
Eli Zaretskii
994f816ca8 ; * lisp/time.el (world-clock--sort-entries): Avoid compiler warning. 2025-06-14 17:21:18 +03:00
Jacob S. Gordon
9c6c7c4bb7 world-clock: Add user option to control order of entries
* lisp/time.el (world-clock-sort-order): Add user option.
(world-clock--sort-entries): Add auxiliary sorting function.
(world-clock-display): Sort entries based on the new user option.
(Bug#78678)
2025-06-14 17:16:22 +03:00
Jacob S. Gordon
5bd9fa084d calc: Allow strings with character codes above Latin-1
The current behavior of the functions 'calc-display-strings',
'strings', and 'bstrings' is to skip any vector containing
integers outside the Latin-1 range (0x00-0xFF).  We introduce a
custom variable 'calc-string-maximum-character' to replace this
hard-coded maximum, and to allow vectors containing higher
character codes to be displayed as strings.  The default value
of 0xFF preserves the existing behavior.

* lisp/calc/calc.el (calc-string-maximum-character): Add custom
variable 'calc-string-maximum-character'.
* lisp/calc/calccomp.el (math-vector-is-string): Replace hard-coded
maximum with 'calc-string-maximum-character', and the 'natnump'
assertion with 'characterp'.  The latter guards against the
maximum being larger than '(max-char)', but not on invalid types of
the maximum such as strings.

* test/lisp/calc/calc-tests.el (calc-math-vector-is-string): Add
tests for 'math-vector-is-string' using different values of
'calc-string-maximum-character'.

* doc/misc/calc.texi (Quick Calculator, Strings, Customizing Calc):
Add variable definition for 'calc-string-maximum-character' and
reference thereof when discussing 'calc-display-strings'.
Generalize a comment about string display and availability of 8-bit
fonts.
(Bug#78528)
2025-06-14 17:07:19 +03:00
Roi Martin
24a699243e Add semantic linefeed support for paragraph filling
* lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Add function
to fill a region using semantic linefeeds as if it were a single
paragraph.
(fill-paragraph-semlf): Add function to fill paragraph using semantic
linefeeds.
* test/lisp/textmodes/fill-tests.el
(fill-test-fill-region-as-paragraph-semlf)
(fill-test-fill-paragraph-semlf)
(fill-test-fill-paragraph-semlf-fill-paragraph-function)
(fill-test-fill-paragraph-semlf-justify)
(fill-test-fill-paragraph-semlf-sentence-end-double-space)
(fill-test-fill-paragraph-semlf-fill-column)
(fill-test-fill-paragraph-semlf-punctuation-marks)
(fill-test-fill-paragraph-semlf-twice)
(fill-test-fill-paragraph-semlf-fill-prefix)
(fill-test-fill-paragraph-semlf-indented-block)
(fill-test-fill-paragraph-semlf-revert)
(fill-test-fill-paragraph-semlf-emacs-lisp-mode)
(fill-test-fill-paragraph-semlf-c-mode)
(fill-test-fill-paragraph-semlf-org-mode)
(fill-test-fill-paragraph-semlf-markdown-mode): Add tests.
* test/lisp/textmodes/fill-resources/semlf-c-mode.erts:
* test/lisp/textmodes/fill-resources/semlf-emacs-lisp-mode.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-column.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-paragraph-function.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-prefix.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-region-as-paragraph.erts:
* test/lisp/textmodes/fill-resources/semlf-indented-block.erts:
* test/lisp/textmodes/fill-resources/semlf-justify.erts:
* test/lisp/textmodes/fill-resources/semlf-markdown-mode.erts:
* test/lisp/textmodes/fill-resources/semlf-org-mode.erts:
* test/lisp/textmodes/fill-resources/semlf-punctuation-marks.erts:
* test/lisp/textmodes/fill-resources/semlf-revert.erts:
* test/lisp/textmodes/fill-resources/semlf-sentence-end-double-space.erts:
* test/lisp/textmodes/fill-resources/semlf-twice.erts:
* test/lisp/textmodes/fill-resources/semlf.erts: Add test data.  (Bug#78561)
2025-06-14 16:34:52 +03:00
Dmitry Gutov
bec823b107 New user option: vc-allow-async-diff
Centralize the control for whether 'vc-diff' is asynchronous
across the backends, while also allowing 'vc-BACKEND-diff' to be
called asynchronously when needed.  Previously in bug#21969.

* lisp/vc/vc.el (vc-allow-async-diff): New user option.

* lisp/vc/vc.el (vc-version-diff, vc-diff, vc-diff-mergebase)
(vc-root-diff): Obey it.

* lisp/vc/log-view.el (log-view-diff-common): Same.

* lisp/vc/vc-annotate.el
(vc-annotate-show-diff-revision-at-line-internal): Same.

* lisp/vc/vc-git.el (vc-git-diff): Follow the ASYNC argument.

* lisp/vc/vc-hg.el (vc-hg-diff): Same.

* lisp/vc/vc-rcs.el (vc-rcs-diff): Same.
2025-06-13 06:00:52 +03:00
Juri Linkov
76f422da26 Add 'treesit-sexp-thing' to use instead of 'treesit-sexp-type-regexp'.
* 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
2025-06-12 20:22:42 +03:00
Sean Whitton
799cef5d94 ; * lisp/vc/log-edit.el (log-edit-show-diff): Insert comma. 2025-06-12 11:17:27 +01:00
Sean Whitton
651d4b11bc vc-finish-logentry: Fix syncing buffers: include whole fileset
* lisp/vc/vc-dispatcher.el (log-edit-vc-backend)
(vc-buffer-sync-fileset): Declare.
(vc-finish-logentry): Call vc-buffer-sync-fileset instead of
just vc-buffer-sync.
2025-06-12 11:15:56 +01:00
Sean Whitton
28f40f7997 log-edit-diff-fileset: Pass NOT-ESSENTIAL non-nil to vc-diff
* lisp/vc/log-edit.el (log-edit-diff-fileset): Pass
NOT-ESSENTIAL non-nil to vc-diff.
2025-06-12 11:14:49 +01:00
Sean Whitton
932e413f8a Replace vc-async-checkin-backends with a backend properties function
* lisp/vc/vc-git.el (vc-git-async-checkins):
* lisp/vc/vc-hg.el (vc-hg-async-checkins):
* lisp/vc/vc.el (vc-default-async-checkins): New functions.
(vc-checkin): Use them.
(vc-async-checkin-backends): Delete.
2025-06-12 10:18:54 +01:00
Eli Zaretskii
323ac96236 ; Fix last change. 2025-06-12 10:04:51 +03:00