Ben Simms [Sun, 5 Jan 2025 19:03:53 +0000 (20:03 +0100)]
Support colored stipples on Cocoa NS (Bug#73384)
On Cocoa builds of NS Emacs, stipples are now rendered
using masked CGImages instead of patterned NSColors so that
stipples now render with color.
* src/nsimage.m ([EmacsImage stippleMask:]): Use a CGImageMask to
store the stipple mask when building for Cocoa.
* src/nsterm.m (ns_maybe_dumpglyphs_background): Perform a masked
fill to draw stipples when building for Cocoa.
(ns_draw_stretch_glyph_string): Perform a masked fill to draw
stipples when building for Cocoa.
Po Lu [Tue, 4 Mar 2025 06:24:56 +0000 (14:24 +0800)]
Document requirements respecting XDG MIME databases on Android
* doc/emacs/android.texi (Android Software): State that librsvg
requires a MIME database to display embedded images, and how to
acquire such a database.
Paul Eggert [Tue, 4 Mar 2025 06:20:08 +0000 (22:20 -0800)]
Revert “Avoid some union buffered_input_event uses”
Revert my commit 29a9fd4f4ba17822eca0f00c2037da3868bd874e
and the following commit 1ec0889e7b786d79351cee3ed4964d82295f059f.
This fixes a bug where ‘emacs -nw’ would sometimes freeze when Emacs is
configured with ‘--with-pgtk --enable-link-time-optimization
--disable-gc-mark-trace’ on GNU/Linux x86-64 (Bug#76729).
As it is not yet clear whether this freeze is due to an Emacs bug that
I introduced, or due to GCC bug 117423
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117423>,
play it safe for now and revert to the previous state.
Stefan Monnier [Tue, 4 Mar 2025 03:18:02 +0000 (22:18 -0500)]
(advice--make-nadvice-docstring): Rename
* lisp/emacs-lisp/nadvice.el (advice--make-nadvice-docstring): Rename
from `nadvice--make-docstring`, to stick to the `advice-` namespace.
Update all callers.
Stefan Kangas [Tue, 4 Mar 2025 01:59:03 +0000 (02:59 +0100)]
Update Makefile and docs for new Spanish refcards
* etc/refcards/Makefile (PDF_SPANISH, PS_SPANISH): New variables.
(PDF_TARGETS): Use above new variables.
(spanish, spanish-ps): New targets for Spanish translation. (Bug#76300)
* admin/release-process:
* etc/refcards/README: Document new Spanish translation.
Po Lu [Tue, 4 Mar 2025 01:46:48 +0000 (09:46 +0800)]
Render Android hourglass cursor mechanics more consistent with X
* src/androidterm.c (android_show_hourglass): Always define the
hourglass cursor, but...
(android_hide_hourglass): ... restore the invisible cursor
subsequently, if need be.
(android_toggle_visible_pointer): Do not hide the current cursor
if it is an hourglass.
Matthew Bauer [Tue, 4 Mar 2025 01:33:15 +0000 (02:33 +0100)]
Replace anonymous lambda timers with named functions
* lisp/emacs-lisp/eldoc.el (eldoc--update, eldoc-schedule-timer):
* lisp/jit-lock.el (jit-lock-context--update)
(jit-lock--antiblink-update): New functions broken out from...
* lisp/emacs-lisp/eldoc.el (eldoc-schedule-timer):
* lisp/jit-lock.el (jit-lock-mode, jit-lock--antiblink-post-command):
...here. Use them as values for timers, to give them readable names
in 'M-x list-timers'. (Bug#71354)
Eli Zaretskii [Mon, 3 Mar 2025 19:08:35 +0000 (21:08 +0200)]
Fix MS-Windows build broken by buffered_input_event changes
* src/keyboard.c (kbd_buffer_store_selection_event_hold):
* src/keyboard.h (kbd_buffer_store_selection_event_hold): Declare
and define only for (HAVE_X11 || HAVE_PGTK).
Juri Linkov [Mon, 3 Mar 2025 18:38:40 +0000 (20:38 +0200)]
Improve treesit settings for js-ts-mode (bug#73404)
* lisp/progmodes/js.el (js--treesit-font-lock-settings):
Add 'class' alongside 'class_declaration'.
(js--treesit-defun-name): Add "variable_declaration"
alongside "lexical_declaration".
(js--treesit-valid-imenu-entry): Add "variable_declaration"
and provide the predicate to 'treesit-node-top-level'.
(js--treesit-sentence-nodes): Add "jsx_attribute" like in html-ts-mode
instead of jsx elements matched in 'js--treesit-list-nodes'.
(js--treesit-list-nodes): Add "jsx_element" and "jsx_self_closing_element"
instead of "_jsx_string".
(js--treesit-simple-imenu-settings): Move "method_definition" to separate
section "Method" from the "Class" section. Add "variable_declaration"
to the "Variable" section.
(js-ts-mode--outline-predicate): New variable.
(js--treesit-defun-type-regexp): Add bos/eos.
(js--treesit-jsdoc-comment-regexp): Add bos/eos.
(js-ts-mode): Set treesit-outline-predicate to
'js-ts-mode--outline-predicate'.
* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--html-defun-name):
Remove unused function.
(mhtml-ts-mode): Use 'js-ts-mode--outline-predicate' in
'treesit-aggregated-outline-predicate'.
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--outline-predicate):
Use 'treesit-node-top-level' instead of 'treesit-parent-until'.
Stefan Kangas [Mon, 3 Mar 2025 17:37:43 +0000 (18:37 +0100)]
Fix fontification outside hunks in Git patches
* lisp/vc/diff-mode.el (diff-font-lock-keywords): Don't fontify lines in
Git patches starting with + or - as added/removed, if they are either
before the first hunk, or in the email signature. (Bug#75884)
(diff-buffer-type): Move definition up.
(diff--indicator-added-re, diff--indicator-removed-re): New variables.
(diff--git-preamble-end, diff--git-footer-start)
(diff--indicator-matcher-helper, diff--indicator-added-matcher)
(diff--indicator-removed-matcher): New functions.
* test/lisp/vc/diff-mode-tests.el (diff-mode-test-git-patch)
(diff-mode-test-git-patch/before-first-hunk)
(diff-mode-test-git-patch/signature): New tests.
* test/lisp/vc/diff-mode-resources/git.patch: New file.
Paul Eggert [Mon, 3 Mar 2025 17:32:08 +0000 (09:32 -0800)]
Avoid some union buffered_input_event uses
Simplify by using separate local vars for struct input_event and
struct selection_input_event, rather than a single local var that
is the union of the two. This makes the code easier to follow by
the human reader, and should help avoid GCC bug 117423
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117423> and
therefore work around Emacs bug 76559 <https://bugs.gnu.org/76559>.
* src/androidterm.c (handle_one_android_event):
* src/gtkutil.c (xg_widget_key_press_event_cb):
* src/pgtkterm.c (evq_flush):
* src/xterm.c (handle_one_xevent): Use struct input_event and
kbd_buffer_store_event_hold, or struct selection_input_event and
kbd_buffer_store_selection_event_hold, rather than union
buffered_input_event and union buffered_input_event.
* src/keyboard.c (beware_long_paste, maybe_quit_while_no_input):
New functions, broken out from kbd_buffer_store_buffered_event.
(kbd_buffer_store_event_hold): Define here, with a simplified
version of the body of the old kbd_buffer_store_buffered_event,
rather than defining in keyboard.h. Specialize to struct
input_event.
(kbd_buffer_store_selection_event_hold): New function; it is
a simplified version of the old kbd_buffer_store_buffered_event,
specialized to struct selection_input_event.
(is_ignored_event_kind): Accept enum event_kind instead of
union buffered_input_event. All callers changed.
* src/keyboard.h (kbd_buffer_store_event_hold):
Remove definition, as keyboard.c now defines it.
* src/pgtkterm.c (evq_grow_if_needed): New function.
(evq_enqueue, evq_selection_enqueue): Two functions now,
not one. Args are now struct input_event const * or
struct selection_input_event const *, not
union buffered_input_event *. All callers changed.
This lets us simplify the callers so that they need
not use the union.
Yuan Fu [Mon, 3 Mar 2025 04:26:28 +0000 (20:26 -0800)]
Don't process function range settings in treesit--update-range-1
This fixes a bug where we call treesit-query-language on a
function, which happens before the QUERY in a range setting can
be either a function or a query, but we call it with
treesit-query-language before knowing whether it's a query or
function.
* lisp/treesit.el:
(treesit--update-range-1): Skip function range settings.
(treesit-update-ranges): Handle function range settings here.
* lisp/progmodes/eglot.el (eglot-client-capabilities): Set
window/showMessage/messageActionItem/additionalPropertiesSupport to t.
(eglot-handle-request window/showMessageRequest): Return the whole
selected MessageActionItem, not just its title.
* test/lisp/term-tests.el (term-line-wrap-no-auto-margins): add test
* lisp/term.el (term-auto-margins): new variable
(term-mode): documentation
(term-termcap-format): mention auto-margins flag
(term-emulate-terminal): support it
(term-reset-terminal): reset it
(term-handle-ansi-escape): notice it
* etc/e/eterm-color.ti: add auto margin capability
Juri Linkov [Sun, 2 Mar 2025 18:44:40 +0000 (20:44 +0200)]
Adapt recent css-ts-mode changes to mhtml-ts-mode
* lisp/textmodes/css-mode.el (css--treesit-thing-settings):
(css-ts-mode--outline-predicate): New variables.
(css-ts-mode): Set treesit-outline-predicate.
* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--treesit-thing-settings):
Use css--treesit-thing-settings and css--treesit-defun-type-regexp.
(mhtml-ts-mode): Use 'css-ts-mode--outline-predicate' for
'treesit-aggregated-outline-predicate'.
Juri Linkov [Sun, 2 Mar 2025 18:07:21 +0000 (20:07 +0200)]
Improve treesit settings for css-ts-mode (bug#73404)
* lisp/textmodes/css-mode.el (css--treesit-settings): Add
"@supports" and '(at_keyword)' to 'keyword', 'keyframe_block' to
'selector', 'keyframes_name' to 'query'.
(css--treesit-defun-name): Support "keyframe_block",
"keyframes_statement" and "supports_statement" as well.
(css--treesit-simple-imenu-settings): Add "keyframes_statement",
"keyframe_block", "supports_statement".
(css--treesit-defun-type-regexp): Add "keyframe_block".
(css-ts-mode): Add 'treesit-thing-settings'.
Stefan Kangas [Sun, 2 Mar 2025 17:04:32 +0000 (18:04 +0100)]
Don't warn when calling hl-lock-mode from init file
This was a compatibility kluge introduced in Emacs 22.1, twenty years
ago. It's fair to assume that any former Emacs 21 user have seen this
warning already, and will have updated their init file. So remove it.
* lisp/hi-lock.el (hi-lock-mode): Don't warn when calling plain
hi-lock-mode from init file.
(hi-lock-archaic-interface-message-used)
(hi-lock-archaic-interface-deduce): Remove associated variables.
Po Lu [Sun, 2 Mar 2025 12:54:36 +0000 (20:54 +0800)]
Specifically report attempts to exit Emacs during test execution
* test/infra/android/test-driver.el (ats-in-eval): Fix typo in
doc string.
(ats-eval-as-printed, ats-eval-serial, ats-eval-do-decode):
Render buffer-local.
(ats-executing-form): New variable.
(ats-process-filter): Bind the same around `eval'.
(ats-kill-emacs-function): New function; register it to execute
when Emacs exits.
Stefan Kangas [Sun, 2 Mar 2025 12:26:43 +0000 (13:26 +0100)]
Fix a vc test for Breezy by setting $HOME
* test/lisp/vc/vc-tests.el (vc--fix-home-for-bzr): New macro.
(vc-test--create-repo, vc-test--register, vc-test--working-revision)
(vc-test--checkout-model, vc-test--rename-file)
(vc-test--version-diff): Fix test for Breezy by setting HOME to a
temporary directory. (Bug#70195)
Po Lu [Sun, 2 Mar 2025 08:02:46 +0000 (16:02 +0800)]
Run Android tests in the initial frame
* test/infra/android/early-init.el: New file.
* test/infra/android/test-controller.el (ats-connect): Upload
`early-init.el' to the staging directory and configure that
directory as the Emacs instance's initialization directory.
(ats-run-test): Always append to the test buffer. Execute tests
within terminal-frame.
(ats-run-all-tests): Gracefully respond to errors.
(ats-cmd-error): New function.
(ats-execute-tests-batch): Accept a number of command line
arguments.
Po Lu [Sun, 2 Mar 2025 08:00:33 +0000 (16:00 +0800)]
Enable kmacro-call-macro to function in some circumstances
* lisp/kmacro.el (kmacro-call-macro): Enable to function when
the selected frame's terminal is different from that most
recently consulted by the event loop.
Eshel Yaron [Sun, 2 Mar 2025 07:03:04 +0000 (08:03 +0100)]
; (completion-preview--try-table): Propagate extra properties.
* lisp/completion-preview.el
(completion-preview--try-table): Let-bind
'completion-extra-properties' to completion properties
that the completion backend (capf) provides, so that these
properties take effect when querying the completion table.
* test/lisp/completion-preview-tests.el
(completion-preview-propagates-properties): Add test.
Dmitry Gutov [Sun, 2 Mar 2025 03:22:56 +0000 (05:22 +0200)]
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.
Eli Zaretskii [Sat, 1 Mar 2025 14:04:52 +0000 (16:04 +0200)]
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)
Eli Zaretskii [Sat, 1 Mar 2025 13:45:57 +0000 (15:45 +0200)]
; Improve documentation of 'rmail-movemail-program'
* lisp/mail/rmail.el (rmail-movemail-program):
* doc/emacs/rmail.texi (Movemail): Document how to change the
value of 'rmail-movemail-program' safely. (Bug#76595)
Tassilo Horn [Sun, 23 Feb 2025 08:46:54 +0000 (09:46 +0100)]
doc-view: Fix error during revert in editing mode
When in editing mode in a doc-view buffer and then reverting (which can
happen automatically when editing OpenDocument contents), we errored in
the advide function doc-view--revert-buffer because the local
doc-view--buffer-file-name has been killed when switching to the editing
mode.
Also restore doc-view-minor-mode after reverting during being in the
editing mode.
* lisp/doc-view.el (doc-view--revert-buffer): Check that
'doc-view--buffer-file-name' is non-nil.
(doc-view-minor-mode): Add re-enabling function to
'revert-buffer-restore-functions'.
Trevor Murphy [Wed, 12 Feb 2025 01:26:55 +0000 (17:26 -0800)]
Ignore dedicated windows in 'display-buffer-reuse-mode-window'
Ignore the dedicated windows unless the dedicated window is
already displaying the buffer-to-be-displayed. In that case,
the window may be reused, according to the setting of
'inhibit-same-window'.
* lisp/window.el (display-buffer-reuse-mode-window): Check
'window-dedicated-p' before pushing the candidate window onto
the stack. (Bug#76216)
Eli Zaretskii [Sat, 1 Mar 2025 10:59:32 +0000 (12:59 +0200)]
; Document what happens when 'display' and 'invisible' props clash
* doc/lispref/display.texi (Replacing Specs, Overlay Properties)
(Invisible Text): Document that 'invisible' is ignored when
'display' property covers the same text. (Bug#76658)
Eli Zaretskii [Sat, 1 Mar 2025 08:27:17 +0000 (10:27 +0200)]
Save IELM input history on "C-c C-c"
* lisp/ielm.el (ielm--write-history-on-interrupt): New function.
(inferior-emacs-lisp-mode): Install it as buffer-local value of
the 'interrupt-process-functions' hook. (Bug#76585)
Łukasz Stelmach [Wed, 7 Feb 2024 13:37:39 +0000 (14:37 +0100)]
Fix handling of delta values with negative month field
* lisp/calendar/time-date.el (decoded-time-add): If the new
variable is less then zero, the year needs to be decremented
by quotient of new and 12 increased by one.
* test/lisp/calendar/time-date-tests.el (test-decoded-add):
Add applicable test cases. (Bug#68969)
Stefan Kangas [Sat, 1 Mar 2025 02:22:30 +0000 (03:22 +0100)]
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)
Stefan Kangas [Fri, 28 Feb 2025 18:59:12 +0000 (19:59 +0100)]
; Grammar fixes for "native-compiled"
1. Prefer "native-compiled" to "native compiled".
The adjective "native-compiled" with the hyphen is generally more
consistent with the typical pattern in English, especially when the
compound modifies a noun (e.g., "native-compiled code").
2. Prefer "natively compiled" to "natively-compiled".
The adverb "natively" modifies "compiled", and it is standard not
to hyphenate an adverb + adjective combination when the adverb ends
in -ly (e.g., "code that is natively compiled").
For example, note that we say "high-speed internet" but "highly
performant code".