Jacob S. Gordon [Mon, 19 May 2025 19:05:37 +0000 (15:05 -0400)]
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)
Roi Martin [Fri, 21 Mar 2025 13:22:46 +0000 (14:22 +0100)]
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)
Dmitry Gutov [Fri, 13 Jun 2025 03:00:17 +0000 (06:00 +0300)]
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.
Juri Linkov [Thu, 12 Jun 2025 17:22:42 +0000 (20:22 +0300)]
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.
Handlers can be registered to term-osc-handler, which by defaults,
supports OSC 0, 2, 7 and 8, using handlers defined in ansi-osc.
Unknown OSC sequences are ignored.
* lisp/term.el (term-emulate-terminal): Handle OSC sequences.
(term-osc-handler): New configuration variable.
(term-control-seq-regexp): Extended regexp.
(term--osc-max-bytes): New private constant.
* lisp/ansi-osc.el (ansi-osc-handler): Handle OSC 0 like OSC 2.
* test/lisp/term-tests.el (term-ignore-osc, term-handle-osc)
(term-call-ansi-osc-handlers): New tests.
Paul Nelson [Tue, 10 Jun 2025 09:33:05 +0000 (11:33 +0200)]
Add simpler binds for calendar month/year navigation
* lisp/calendar/calendar.el (calendar-mode-map): Add keybindings
'{' and '}' for month navigation, '[' and ']' for year
navigation (bug#78753).
* doc/emacs/calendar.texi (Calendar Unit Motion): Document
them.
Alan Mackenzie [Wed, 11 Jun 2025 13:43:50 +0000 (13:43 +0000)]
Amend CC Mode so that the test suite in XEmacs runs error free
* lisp/progmodes/cc-awk.el (awk-font-lock-keywords):
Reformulate this using backquote and ,@. Only include the
entry for _" in Emacs.
* lisp/progmodes/cc-defs.el (c--mapcan, c--set-difference)
c--intersection, c--macroexpand-all, c--delete-duplicates): No
longer use the existence of cl-lib.el as the criterion for
what to expand to.
(c-min-property-position): Use c-next-single-property-change
rather than next-single-property-change. This now works in
XEmacs.
* lisp/progmodes/cc-engine.el
(c-invalidate-sws-region-after-del)
(c-invalidate-sws-region-after-ins, c-forward-sws)
(c-backward-sws, c-find-decl-spots): Replace
next/previous-single-property-change by
c-next/previous-single-property-change to ensure functionality
in XEmacs.
(c-forward-sws, c-backward-sws): Handle NO-BREAKING-SPACE as
whitespace. This corrects the error in hardspace.c in the test
suite.
* lisp/progmodes/cc-fonts.el (c-font-lock-ml-strings): Refactor
some nested `if's into a cond form. Don't fontify multiline
string delimiters in XEmacs, in keeping with its string
conventions.
* lisp/progmodes/cc-langs.el (c-populate-syntax-table): Set the
syntax of NO-BREAKING-SPACE to whitespace rather than
punctuation.
* lisp/progmodes/cc-mode.el (c-before-change): Use
c-previous-single-property-change rather than
previous-single-property-change to ensure functionality in
XEmacs.
Juri Linkov [Wed, 11 Jun 2025 06:43:45 +0000 (09:43 +0300)]
* test/lisp/repeat-tests.el: Add a command for global continue.
(repeat-tests-call-g): New command (bug#78742).
Put 'repeat-continue' with t on this symbol.
(repeat-tests-global-map): Bind it to 'C-M-g'.
(repeat-tests-continue-another): Add 'C-M-g' that should continue.
Paul Nelson [Tue, 10 Jun 2025 07:21:52 +0000 (09:21 +0200)]
Improve repeat-continue property handling
* lisp/repeat.el (repeat-get-map-sym): Support 'repeat-continue'
property value of t to continue any active repeat map (suggested
by Karthik Chikmagalur <karthikchikmagalur@gmail.com>).
Simplify logic so that repeat-continue does not interfere with
repeat-map activation.
(repeat-check-map): Allow commands with 'repeat-continue'
property value of t to continue without checking the key.
(repeat-mode): Update and tweak docstring.
* lisp/bind-key.el (bind-keys-form): Update handling of
':continue-only' keyword: only add keymap to 'repeat-continue'
if current value is a list.
(bind-keys): Update documentation, mirroring bind-keys-form.
* lisp/keymap.el (defvar-keymap): Update handling of ':continue'
keyword: only add keymap to 'repeat-continue' if current value
is a list.
* test/lisp/repeat-tests.el (repeat-tests-continue)
(repeat-tests-continue-another): Enable previously commented
tests that now work correctly.
* etc/NEWS: Update announcement of 'repeat-continue' (bug#78742).
Jim Porter [Wed, 28 May 2025 16:44:34 +0000 (09:44 -0700)]
Clean up text properties in 'visual-wrap-prefix-mode'
Before refontifying a region, remove any text properties we care about
so that we don't end up with stray properties. Additionally, make sure
to remove all the properties when deactivating the mode.
* lisp/emacs-lisp/subr-x.el (add-remove--display-text-property): New
function, extracted from...
(add-display-text-property): ... here.
(remove-display-text-property): New function.
* lisp/visual-wrap.el (visual-wrap--remove-properties): New function...
(visual-wrap-prefix-function, visual-wrap-prefix-mode): ... call it.
* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-remove-display-text-property): New test.
* test/lisp/visual-wrap-tests.el
(visual-wrap-tests/wrap-prefix-stickiness, visual-wrap-tests/cleanup):
New tests.
Jim Porter [Sat, 31 May 2025 19:11:01 +0000 (12:11 -0700)]
Improve documentation for display property functions
Specifically, use the term "display specification" more consistently to
distinguish from "display property", which is the full value of the
'display' text property.
* src/xdisp.c (find_display_property): Rename PROP to SPEC.
(Fget_display_property): Rename PROP to SPEC and improve docstring.
* lisp/emacs-lisp/subr-x.el (add-display-text-property): Rename PROP to
SPEC and improve docstring.
* doc/lispref/display.texi (Display Property): Reword documentation to
more-consistently refer to display specifications.
Jim Porter [Wed, 28 May 2025 16:55:58 +0000 (09:55 -0700)]
Don't delete in-place when replacing a display property
When calling 'add-display-text-property' on a region of text that
already contains PROP, we first delete the old display specification
from the region. If the region's 'display' property is a list of
display specifications, we need to avoid destructively modifying the
list; other regions of text could be using the same list object. (For a
'display' property that's a vector or a single display spec, this
doesn't matter since we first make a new list in the code.)
In addition, be more careful when working with a display property like
((margin ...) ...). This is a single display specification, not a list
of display specs.
* lisp/emacs-lisp/subr-x.el (add-display-text-property): Don't delete
in-place for list values. Handle (margin ...) display specification
type correctly.
* doc/misc/modus-themes.org (Preview theme colors):(Get a single color from the palette with ~modus-themes-get-color-value~):
(DIY Do not extend the region background, Note on SHR fonts): Fix some typos.
(Full support for packages or face groups): Include tmr in the
list of supported packages.
(Acknowledgements): Mention more people who have contributed to
the project in some capacity.
* etc/themes/modus-operandi-deuteranopia-theme.el:
* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-operandi-tinted-theme.el:
* etc/themes/modus-operandi-tritanopia-theme.el:
* etc/themes/modus-vivendi-deuteranopia-theme.el:
* etc/themes/modus-vivendi-theme.el:
* etc/themes/modus-vivendi-tinted-theme.el:
* etc/themes/modus-vivendi-tritanopia-theme.el: Make small changes to the palette of each theme.
* etc/themes/modus-themes.el
(modus-themes-after-load-theme-hook): Reword the doc string
(modus-themes--rotate, modus-themes--rotate-p)
(modus-themes--next-in-rotation, modus-themes-rotate): Make
rotation optionally move in the opposite direction.
(modus-themes-faces): Tweak some faces.
* java/org/gnu/emacs/EmacsActivity.java (interceptBackGesture):
New function.
(onCreate): Invoke the same to register back gesture callbacks
on Android 16 or better.
* java/org/gnu/emacs/EmacsWindow.java (onBackInvoked): New
function.
* src/keyboard.c (lispy_function_keys): Amend with new symbols
introduced in Android API 36.
Juri Linkov [Tue, 10 Jun 2025 06:34:28 +0000 (09:34 +0300)]
* test/lisp/repeat-tests.el: Add a command to continue but not activate.
(repeat-tests-call-e): New command.
(repeat-tests-global-map): Bind it to 'C-M-e'.
(repeat-tests-another-repeat-map, repeat-tests-repeat-map):
Add 'repeat-tests-call-e' to :continue.
(repeat-tests-continue, repeat-tests-continue-another):
Add 'C-M-e' that should continue but not activate.
Yuan Fu [Tue, 10 Jun 2025 05:35:34 +0000 (22:35 -0700)]
Add tree-sitter version of prog-fill-reindent-defun (bug#78703)
Add a tree-sitter version of prog-fill-reindent-defun that
indents the defun that encloses point, rather than the sibling
defun after point when there is one.
* lisp/progmodes/prog-mode.el:
(prog-fill-reindent-defun): Turns into a wrapper function.
(prog-fill-reindent-defun-function): New variable.
(prog-fill-reindent-defun-default): Old prog-fill-reindent-defun
becomes this function.
* lisp/treesit.el (treesit-fill-reindent-defun): New function.
(treesit-major-mode-setup): Setup
prog-fill-reindent-defun-function.
Yuan Fu [Tue, 10 Jun 2025 04:41:17 +0000 (21:41 -0700)]
Add new tactic to treesit-navigate-thing (bug#78703)
* doc/emacs/programs.texi (Moving by Defuns):
* doc/lispref/parsing.texi (User-defined Things): Describe the
new tactic.
* lisp/treesit.el (treesit-navigate-thing): Add new tactic.
Support checking auth-source for NickServ password for rcirc
* doc/misc/rcirc.texi: Mention new feature.
* etc/NEWS: Mention new feature.
* lisp/net/rcirc.el (rcirc-authinfo): Update type and documentation.
(rcirc-authenticate): Handle a special type to indicate that the
password is stored via auth-source.
* doc/emacs/maintaining.texi (VC With A Merging VCS)
(VC With A Locking VCS): Update text about 'C-x v v' with mixed
file statuses.
* etc/NEWS: Announce the recent improvements.
Sean Whitton [Sun, 8 Jun 2025 10:25:17 +0000 (11:25 +0100)]
vc-next-action: On mixed state sets, treat missing files as removed
* lisp/vc/vc.el (vc-only-files-state-and-model, vc-next-action):
Add the 'missing' state to the set of compatible states for
mixed state actions. This means you can commit removals of
files without first moving them to the 'removed' state.
* lisp/whitespace.el (whitespace-display-char-on): Copy from
'standard-display-table' if 'buffer-display-table' is nil. This
avoids overwriting display-table customizations by features that
modify 'standard-display-table' for global effects. (Bug#78522)
Sean Whitton [Fri, 6 Jun 2025 10:52:32 +0000 (11:52 +0100)]
New revert-files VC backend function for faster mass reverts
* lisp/vc/vc-git.el (vc-git-revert-files):
* lisp/vc/vc-hg.el (vc-hg-revert-files):
* lisp/vc/vc.el (vc-revert-files): New functions.
(vc-revert-files): Incorporate vc-revert's calls to message here
so that the messages are displayed more consistently.
(vc-next-action, vc-default-checkin-patch, vc-revert): Use
vc-revert-files instead of vc-revert-file.