]> git.eshelyaron.com Git - emacs.git/log
emacs.git
4 weeks agoEglot: unbreak tests for older Emacsen
João Távora [Wed, 22 Jan 2025 22:24:26 +0000 (22:24 +0000)]
Eglot: unbreak tests for older Emacsen

* test/lisp/progmodes/eglot-tests.el (eglot-test-basic-symlink):
Use skip-unless

(cherry picked from commit 47a938c8890e81c4472018df52e62ab196efb103)

4 weeks agoEglot: fix edebug spec of eglot--dbind
João Távora [Wed, 22 Jan 2025 22:02:00 +0000 (22:02 +0000)]
Eglot: fix edebug spec of eglot--dbind

* lisp/progmodes/eglot.el (eglot--dbind): Fix edebug spec.

(cherry picked from commit 9068dcbd71b05bcb6ff2fdbb6e56375f8ac162fb)

4 weeks agoEglot: unbreak completion in Emacs 26.3 (at least)
João Távora [Wed, 22 Jan 2025 21:52:56 +0000 (21:52 +0000)]
Eglot: unbreak completion in Emacs 26.3 (at least)

For reasons yet to be investigated, in some Emacs older versions,
callers of the completion table created by eglot-completion-at-point
will destroy text properties in the strings returned by the
"all-completions" call (destroy here means completely erase).  This
completely breaks Eglot completion.

(eglot-completion-at-point): Copy substrings in all-completions
call.

(cherry picked from commit 7e2f6ce0cb1e5eb2c686451836275acf234bc354)

4 weeks agoEglot: abandon compat.el
João Távora [Wed, 22 Jan 2025 21:43:10 +0000 (21:43 +0000)]
Eglot: abandon compat.el

After period of months using this to help compatibility to older Emacs
versions.  It's not really buying us that much and complicates
maintenance, so it gets the axe.

A common problem is the compatibility alias for require-with-check,
which often errors with some "Feature X loaded from Y is now provided by
Z".  The tests for Emacs 26.3 were all failing in the Github tracker
ever since this (and track-changes.el) were added to Eglot.

* lisp/progmodes/eglot.el (compat): No longer require.
(eglot-alternatives): Reword comment.
(eglot-alternatives): Call eglot--executable-find.
(eglot--guess-contact): Call eglot--executable-find.
(eglot--connect): Check if package-get-version exists.
(eglot--format): Check if substitute-quotes exists.
(eglot--format-markup): Check if text-property-search exists.

(cherry picked from commit a60249b098d22093ec79b6cbc27a759b7b4f8883)

4 weeks agoEglot: abandon track-changes.el
João Távora [Wed, 22 Jan 2025 15:44:41 +0000 (15:44 +0000)]
Eglot: abandon track-changes.el

After a ~10 month period of using track-changes.el as a support library
for tracking buffer changes, I've decided to go back to manually using
after-change-functions and before-change-functions.

track-changes.el showed promise:

- One of the selling points was to turn complicated a-c-functions and
  b-c-functions into something easier, but that objectively didn't pan
  out, with "virtual" positions, one-shot hooks, and tracker
  registrations being abstractions and complications mastered by very
  few.

- The other selling point was the ability to log and detect those parts
  of Emacs that cheat the modification hooks and correct them.  As far
  as I can tell, only one such cheater -- quail.el -- was identified.
  But with little consequence, only an ugly workaround in eglot.el (now
  removed).

- After using Eglot daily for all this time, I didn't notice any
  decrease in desynchronization events.

- I did notice an increase in track-changes.el related bugs, some of
  which still baffle me and and hard to reproduce.  A common occurence
  is the '(cl-assertion-failed (memq id track-changes--trackers))'
  which is hard to track down.

- The library makes it more complicated to run Eglot on older Emacsen.

I might yet revisit this matter for the next version but this
experience has shown that it didn't bring the advantages I thought it
would, so I'm abandoning it until at least 1.19 is out.

* lisp/progmodes/eglot.el (track-changes): No longer require.
(eglot--virtual-pos-to-lsp-position): Delete.
(eglot--managed-mode): Simplify.
(eglot--track-changes): Delete this variable.
(eglot--recent-changes): Reword doc.
(eglot--before-change, eglot--after-change): Bring back.
(eglot--track-changes-fetch): Delete.
(eglot--add-one-shot-hook): Delete.
(eglot--track-changes-signal): Delete.

(cherry picked from commit ac902ddadcd236dfd1d610768569e26ea8fc5b7f)

4 weeks agoMinor image_error related cleanups
Stefan Kangas [Wed, 22 Jan 2025 22:42:13 +0000 (23:42 +0100)]
Minor image_error related cleanups

* src/image.c (image_create_x_image_and_pixmap_1): Avoid temporary
variable by passing the value directly to image_error.
(tiff_handler): Prefer image_error to add_to_log for local
consistency.

(cherry picked from commit d3ada49a37e19d25170bf6322fee70d527055958)

4 weeks ago; * src/pdumper.c (dump_hash_table): Adjust hash; bitfields changed.
Pip Cet [Wed, 22 Jan 2025 19:50:31 +0000 (19:50 +0000)]
; * src/pdumper.c (dump_hash_table): Adjust hash; bitfields changed.

(cherry picked from commit bf55eb1a8ae95051ac5c8a646b2a106053d7b1b7)

4 weeks agoPort allows-stdout test to overly-suspicious bwrap
Paul Eggert [Wed, 22 Jan 2025 19:03:08 +0000 (11:03 -0800)]
Port allows-stdout test to overly-suspicious bwrap

* test/src/emacs-tests.el (emacs-tests/bwrap/allows-stdout):
Skip test if bwrap prohibits even "echo Hi",
which it does on my Ubuntu 24.10 platform.
This extra check means we no longer need to test
separately whether the filter is readable.

(cherry picked from commit 34166dcf9cbd961d4f53ce9029e179a21a12c001)

4 weeks agoDon’t silently truncate connection-lost diagnostic
Paul Eggert [Wed, 22 Jan 2025 06:25:48 +0000 (22:25 -0800)]
Don’t silently truncate connection-lost diagnostic

* src/xterm.c (x_io_error_quitter): Do not silently truncate
the diagnostic when a connection is lost to an X server.

(cherry picked from commit 2efffbe7731ba979540df851819af0ef15b94c62)

4 weeks agoCheck for snprintf truncation in pgtkterm
Paul Eggert [Wed, 22 Jan 2025 06:19:08 +0000 (22:19 -0800)]
Check for snprintf truncation in pgtkterm

* src/pgtkterm.c (pgtk_enumerate_devices):
Abort if snprintf truncated.

(cherry picked from commit db9ea9b77a0d03342bfe2a976b3943de5e5a4518)

4 weeks agoPort pdumper to unlikely long sprintf output
Paul Eggert [Wed, 22 Jan 2025 06:18:17 +0000 (22:18 -0800)]
Port pdumper to unlikely long sprintf output

* src/pdumper.c (dump_ptr_referrer): Port to platforms
where sprintf %p generates absurdly long output.
(dump_vectorlike): Port to hypothetical platforms
where %d generates absurdly long output.

(cherry picked from commit 4a25ed300fec579f8fc75a53edbd9a6f74e2d44f)

4 weeks agoWhen debugging image.c, abort if silent truncation
Paul Eggert [Wed, 22 Jan 2025 06:16:22 +0000 (22:16 -0800)]
When debugging image.c, abort if silent truncation

* src/image.c (image_build_heuristic_mask, png_load_body):
Abort if snprintf truncated.  (If truncation is not possible
here we should use sprintf instead, as that simplifies
automatic runtime checking.)

(cherry picked from commit 8ff7338fdd05fe6d21765711327a99c87cfd7613)

4 weeks agoDestroy GTK tool bar widget if it was never attached (bug#75636)
Pip Cet [Wed, 22 Jan 2025 00:51:33 +0000 (00:51 +0000)]
Destroy GTK tool bar widget if it was never attached (bug#75636)

* src/gtkutil.c (xg_free_frame_widgets): Call gtk_widget_destroy on an
unpacked toolbar widget.

(cherry picked from commit 6ea1e03fe7f9e49387789c86b8f91f6333de679c)

4 weeks agoPrefer snprintf to sprintf in image.c
Stefan Kangas [Tue, 21 Jan 2025 23:47:02 +0000 (00:47 +0100)]
Prefer snprintf to sprintf in image.c

* src/image.c (image_background, image_build_heuristic_mask)
(png_load_body): Prefer snprintf to sprintf.

(cherry picked from commit cdcfffd50a61058b135ddca1f748a5a20a7da32e)

4 weeks agoDelete some duplicate face attributes
Stefan Kangas [Tue, 21 Jan 2025 19:49:38 +0000 (20:49 +0100)]
Delete some duplicate face attributes

* etc/themes/leuven-dark-theme.el:
* etc/themes/leuven-theme.el:
* etc/themes/manoj-dark-theme.el: Delete duplicate face attributes.

(cherry picked from commit 5f108cb663a9488c587507e4f723fe1e12732945)

4 weeks agoImprove copying current glyphs when building frame matrix
Gerd Möllmann [Tue, 21 Jan 2025 19:40:19 +0000 (20:40 +0100)]
Improve copying current glyphs when building frame matrix

* src/dispnew.c (build_frame_matrix_from_leaf_window): Don't make space
glyphs. More comments.

(cherry picked from commit d30f40868bf260692c7702e43b439d592b830e16)

4 weeks ago; * src/gtkutil.c (free_frame_tool_bar): Remove redundant assignment.
Pip Cet [Tue, 21 Jan 2025 19:13:24 +0000 (19:13 +0000)]
; * src/gtkutil.c (free_frame_tool_bar): Remove redundant assignment.

(cherry picked from commit 1f02677500211a163dd22b1263edec0d7be0fd16)

4 weeks agoHandle unknown units provided by the rsvg library (bug#75712)
Pip Cet [Tue, 21 Jan 2025 18:55:01 +0000 (18:55 +0000)]
Handle unknown units provided by the rsvg library (bug#75712)

* src/image.c (svg_css_length_to_pixels): Restructure so GCC warns
about new enum members.  Add case for RSVG_UNIT_CH.  Warn about
unknown units discovered at runtime.

(cherry picked from commit d7bdaa4170cd6115a6e3b4d872d8a428397fb2d8)

4 weeks agoDon't use a redisplay optimization in a certain case on ttys
Gerd Möllmann [Tue, 21 Jan 2025 17:31:10 +0000 (18:31 +0100)]
Don't use a redisplay optimization in a certain case on ttys

* src/dispnew.c (is_tty_root_frame_with_visible_child): New function.
* src/dispextern.h: Declare it.
* src/xdisp.c (redisplay_internal): Don't use optimization 1 for tty root
frames with a visible child frame.

(cherry picked from commit 0fd5b2d146e3578820446aa69b30d93958d9b1a5)

4 weeks agoRemove a false #ifdef HAVE_WINDOW_SYSTEM
Gerd Möllmann [Mon, 20 Jan 2025 17:11:58 +0000 (18:11 +0100)]
Remove a false #ifdef HAVE_WINDOW_SYSTEM

* src/xdiso.c (update_tab_bar)_ Don't use #ifdef HAVE_WINDOW_SYSTEM for
setting the selected frame. That only makes a build without window
system misbehave.

(cherry picked from commit eaa79e25a6b34f5f3dca5961233498afbacaec58)

4 weeks agoSignal error when keyword/arg list is malformed
Robert Pluim [Mon, 20 Jan 2025 17:43:00 +0000 (18:43 +0100)]
Signal error when keyword/arg list is malformed

* src/data.c (syms_of_data): Add Qmalformed_keyword_arg_list
error symbol.

* src/process.c (Fmake_process, Fmake_pipe_process)
(Fserial_process_configure, Fmake_serial_process)
(Fmake_network_process): Signal Qmalformed_keyword_arg_list when
the argument list length is odd.
* src/sound.c (parse_sound): Also here..
* src/w32fns.c (Fw32_notification_notify): ..and here.

(Bug#75584)

(cherry picked from commit 14e686e6cca83054afceb353ad7a1e24ebdb0133)

4 weeks agoPrefer defface's ':slant italic' to obsolete alias ':italic t'
Stefan Kangas [Tue, 21 Jan 2025 08:56:59 +0000 (09:56 +0100)]
Prefer defface's ':slant italic' to obsolete alias ':italic t'

* etc/themes/manoj-dark-theme.el (manoj-dark):
* etc/themes/modus-themes.el (modus-themes-faces):
* etc/themes/manoj-dark-theme.el (manoj-dark):
* etc/themes/modus-themes.el (modus-themes-faces):
* lisp/emacs-lisp/eieio-custom.el (eieio-custom-slot-tag-face):
* lisp/gnus/gnus-art.el (gnus-emphasis-italic)
(gnus-emphasis-underline-italic, gnus-emphasis-bold-italic)
(gnus-emphasis-underline-bold-italic, gnus-signature)
(gnus-header-from, gnus-header-subject, gnus-header-newsgroups)
(gnus-header-content):
* lisp/gnus/gnus-cite.el (gnus-cite-attribution, gnus-cite-1)
(gnus-cite-2, gnus-cite-3, gnus-cite-4, gnus-cite-5, gnus-cite-6)
(gnus-cite-7, gnus-cite-8, gnus-cite-9, gnus-cite-10, gnus-cite-11):
* lisp/gnus/gnus-srvr.el (gnus-server-cloud-host)
(gnus-server-closed):
* lisp/gnus/gnus.el (gnus-group-mail-1-empty)
(gnus-group-mail-2-empty, gnus-summary-low-ticked)
(gnus-summary-low-ancient, gnus-summary-low-undownloaded)
(gnus-summary-low-unread, gnus-summary-low-read):
* lisp/gnus/message.el (message-header-to)
(message-header-newsgroups, message-header-other):
* lisp/gnus/mm-decode.el (mm-command-output):
* lisp/mh-e/mh-e.el (mh-face-data, mh-folder-body):
* lisp/net/dictionary.el (dictionary-word-entry-face):
* lisp/org/org-faces.el (org-formula, org-agenda-date-today)
(org-scheduled, org-scheduled-today):
* lisp/proced.el (proced-interruptible-sleep-status-code):
* lisp/progmodes/prolog.el (prolog-font-lock-keywords):
* lisp/progmodes/verilog-mode.el (verilog-font-lock-translate-off-face)
(verilog-font-lock-p1800-face, verilog-font-lock-ams-face)
(verilog-font-lock-grouping-keywords-face):
* lisp/progmodes/vhdl-mode.el (vhdl-font-lock-attribute-face)
(vhdl-font-lock-enumvalue-face, vhdl-font-lock-function-face)
(vhdl-font-lock-directive-face):
* lisp/transient.el (transient-inapt-suffix):
* lisp/vc/ediff-init.el (ediff-even-diff-A, ediff-even-diff-B)
(ediff-even-diff-C, ediff-even-diff-Ancestor, ediff-odd-diff-A)
(ediff-odd-diff-B, ediff-odd-diff-C, ediff-odd-diff-Ancestor):
Prefer defface attribute ':slant italic' to its obsolete alias
':italic t'.  See also Bug#73552.

(cherry picked from commit 64d314e0f6495de6fcf4f4c51e710b597a237e4f)

4 weeks agoPrefer defface's ':weight bold' to obsolete alias ':bold t'
Stefan Kangas [Tue, 21 Jan 2025 08:23:03 +0000 (09:23 +0100)]
Prefer defface's ':weight bold' to obsolete alias ':bold t'

* etc/themes/adwaita-theme.el (adwaita):
* etc/themes/manoj-dark-theme.el (manoj-dark):
* etc/themes/modus-themes.el (modus-themes-faces):
* lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud)
(gnus-server-opened, gnus-server-denied, gnus-server-offline):
* lisp/gnus/gnus.el (gnus-group-news-1, gnus-group-news-2)
(gnus-group-news-3, gnus-group-news-4, gnus-group-news-5)
(gnus-group-news-6, gnus-group-news-low, gnus-group-mail-1)
(gnus-group-mail-2, gnus-group-mail-3, gnus-group-mail-low-empty)
(gnus-group-mail-low, gnus-summary-high-ticked)
(gnus-summary-high-ancient, gnus-summary-high-undownloaded)
(gnus-summary-high-unread, gnus-summary-high-read):
* lisp/gnus/message.el (message-header-to, message-header-cc)
(message-header-subject, message-header-newsgroups)
(message-header-other, message-header-name, message-header-xheader)
(message-separator, message-cited-text-1, message-cited-text-2)
(message-cited-text-3, message-cited-text-4, message-mml)
(message-signature-separator):
* lisp/mh-e/mh-e.el (mh-face-data, mh-folder-cur-msg-number)
(mh-speedbar-folder-with-unseen-messages)
(mh-speedbar-selected-folder-with-unseen-messages):
* lisp/net/dictionary.el (dictionary-button-face):
* lisp/org/org-faces.el (org-drawer, org-tag, org-list-dt, org-todo)
(org-done, org-headline-todo, org-formula, org-agenda-structure)
(org-scheduled, org-scheduled-today, org-scheduled-previously)
(org-upcoming-deadline):
* lisp/proced.el (proced-uninterruptible-sleep-status-code)
(proced-executable, proced-cpu, proced-user, proced-time-colon):
* lisp/progmodes/erts-mode.el (erts-mode-specification-name)
(erts-mode-specification-value):
* lisp/progmodes/prolog.el (prolog-font-lock-keywords):
* lisp/progmodes/verilog-mode.el (verilog-font-lock-p1800-face)
(verilog-font-lock-ams-face)
(verilog-font-lock-grouping-keywords-face):
* lisp/progmodes/vhdl-mode.el (vhdl-font-lock-prompt-face)
(vhdl-font-lock-attribute-face, vhdl-font-lock-enumvalue-face)
(vhdl-font-lock-function-face, vhdl-font-lock-directive-face)
(vhdl-font-lock-reserved-words-face): Prefer defface attribute
':weight bold' to its obsolete alias ':bold t'.  See also Bug#73552.

(cherry picked from commit 375befcacc8e7c37ec490145aa6ff9737ad102a1)

4 weeks agoEglot: release version 1.18
João Távora [Mon, 20 Jan 2025 19:19:08 +0000 (19:19 +0000)]
Eglot: release version 1.18

* etc/EGLOT-NEWS: Update.

* lisp/progmodes/eglot.el (Version): Bump to 1.18

(cherry picked from commit 49f449bb5bc90bc1eca6b4a1f013d4c0b5460d65)

4 weeks agoEglot: fix signature's of Eglot's ElDoc functions
João Távora [Mon, 20 Jan 2025 19:21:22 +0000 (19:21 +0000)]
Eglot: fix signature's of Eglot's ElDoc functions

These functions are specified to be passed at least one
argument, so our implementation must accept an arbitrary number
of arguments.

* lisp/progmodes/eglot.el (eglot-signature-eldoc-function)
(eglot-hover-eldoc-function): Fix signature.

(cherry picked from commit aa94e1c56c1b4aeb2e2c98f3b7ccbc354f50108e)

4 weeks agoEglot: add support for insertReplaceEdit (bug#73857)
João Távora [Mon, 20 Jan 2025 18:58:05 +0000 (18:58 +0000)]
Eglot: add support for insertReplaceEdit (bug#73857)

* lisp/progmodes/eglot.el (eglot-server-programs): Mention zig-ts-mode.
(eglot--lsp-interface-alist): Describe 'InsertReplaceEdit'.
(eglot-client-capabilities): Advertise 'insertReplaceSupport'.
(eglot-completion-at-point): Consider 'InsertReplaceEdit'.
(eglot--apply-text-edits): Consider 'InsertReplaceEdit'.

* test/lisp/progmodes/eglot-tests.el
(eglot-test-zig-insert-replace-completion): New test.

Special thanks to kcbanner@gmail.com

(cherry picked from commit 1143cf09a339d57051a4341103c9e342d8876649)

4 weeks agoEglot: make eglot-test-javascript-basic more robust
João Távora [Mon, 20 Jan 2025 17:42:59 +0000 (17:42 +0000)]
Eglot: make eglot-test-javascript-basic more robust

* test/lisp/progmodes/eglot-tests.el
(eglot-test-javascript-basic): Mark test expensive and increase timeout.

(cherry picked from commit a1ce633ca9be91c4acba4125cdabc5b6f600e5ff)

4 weeks agoEglot: try again to fix try-completion logic
João Távora [Mon, 20 Jan 2025 17:23:08 +0000 (17:23 +0000)]
Eglot: try again to fix try-completion logic

Emacs partial completion simply doesn't make sense in LSP.
Attempts to make it make some sense end up failing for one
reason or another.

This commit restores the original intention of the
eglot--dumb-allc and eglot--dumb-tryc functions, which was to be
dumb and pop up a *Completions* buffer (or a company tooltip),
as soon as there is doubt over what the user wants to do.

It also fixes tests, including an expensive Rust test that had
been broken for a long time.

* lisp/progmodes/eglot.el (eglot--dumb-allc): Consider point.
(eglot--dumb-tryc): Make it suitably dumb again.

* test/lisp/progmodes/eglot-tests.el
(eglot--wait-for-rust-analyzer): Wait longer.
(eglot-test-common-prefix-completion): Delete this test.  It's not
the intended behavior.
(eglot--kill-completions-buffer): New helper.
(eglot-test-try-completion-nomatch): Rework test.
(eglot-test-try-completion-inside-symbol): Pops *Completions*
buffer because mustn't partial complete.
(eglot-test-try-completion-inside-symbol-2): Does complete.
(eglot-test-rust-completion-exit-function): Fix long-broken test.

(cherry picked from commit 73f51f3a99ed454fa57e5ebe177df00cada1f11a)

4 weeks agoPrefer defvar-keymap in bat-mode.el
Stefan Kangas [Mon, 20 Jan 2025 17:32:33 +0000 (18:32 +0100)]
Prefer defvar-keymap in bat-mode.el

* lisp/progmodes/bat-mode.el (bat-mode-map): Prefer defvar-keymap.
(bat-menu): Move to top level.

(cherry picked from commit 275df7420cfb6a514171cb69a03235ee09aebebf)

4 weeks agoDon't skip or double-process files in dired with auto-revert-mode (bug#75626)
Tassilo Horn [Mon, 20 Jan 2025 15:21:24 +0000 (16:21 +0100)]
Don't skip or double-process files in dired with auto-revert-mode (bug#75626)

* lisp/dired.el (dired--inhibit-auto-revert): New variable.
(dired-map-over-marks): Make the generated code bind it.
(dired-buffer-stale-p): Return nil if dired--inhibit-auto-revert is
non-nil.

(cherry picked from commit 40d5ff01e51ed6319933e18df0fbe9ef55d9bece)

4 weeks agoscope.el: Handle cl-macrolet
Eshel Yaron [Thu, 23 Jan 2025 08:52:30 +0000 (09:52 +0100)]
scope.el: Handle cl-macrolet

4 weeks agoMinor cleanups
Eshel Yaron [Tue, 21 Jan 2025 17:01:25 +0000 (18:01 +0100)]
Minor cleanups

4 weeks ago; Update lisp/ldef-boot.el
Eshel Yaron [Mon, 20 Jan 2025 21:14:46 +0000 (22:14 +0100)]
; Update lisp/ldef-boot.el

4 weeks agoNew library dwim.el
Eshel Yaron [Mon, 20 Jan 2025 21:12:52 +0000 (22:12 +0100)]
New library dwim.el

4 weeks ago(scope-1): Recognize hook names in a few more functions
Eshel Yaron [Mon, 20 Jan 2025 21:11:52 +0000 (22:11 +0100)]
(scope-1): Recognize hook names in a few more functions

4 weeks agoSuggest fix for undefined ELisp function
Eshel Yaron [Mon, 20 Jan 2025 21:11:23 +0000 (22:11 +0100)]
Suggest fix for undefined ELisp function

4 weeks agoscope.el: Improve handling of cl-destructuring-bind
Eshel Yaron [Mon, 20 Jan 2025 18:53:13 +0000 (19:53 +0100)]
scope.el: Improve handling of cl-destructuring-bind

4 weeks agoFix ```elisp code``` handling in mails
Eshel Yaron [Mon, 20 Jan 2025 18:51:48 +0000 (19:51 +0100)]
Fix ```elisp code``` handling in mails

4 weeks agoUse 'max' macro in clip_to_bounds
Stefan Kangas [Mon, 20 Jan 2025 13:05:37 +0000 (14:05 +0100)]
Use 'max' macro in clip_to_bounds

* src/lisp.h (clip_to_bounds): Use 'max' macro.

(cherry picked from commit b568ff418ce7147c27d7f82fe4a8eef325b9de2c)

4 weeks ago; Fix last change
Eli Zaretskii [Mon, 20 Jan 2025 12:39:20 +0000 (14:39 +0200)]
; Fix last change

* src/treesit.c (Ftreesit_parser_create): Fix comment wording.

* doc/lispref/parsing.texi (Using Parser): Fix wording and markup.

(cherry picked from commit ad51b3b3911bcca1dba5a5b3e5581465d2277d64)

4 weeks agoMake treesit-language-remap-alist completely transparent (bug#72388)
Yuan Fu [Mon, 20 Jan 2025 06:34:11 +0000 (22:34 -0800)]
Make treesit-language-remap-alist completely transparent (bug#72388)

* doc/lispref/parsing.texi (Using Parser): Update manual.
* src/treesit.c (Ftreesit_parser_create): Use the LANGUAGE
argument given as the language for the parser, not the actual
language.

(cherry picked from commit 458135155675a29a2c064998afc0cb416cd38b52)

4 weeks agopdumper: Add static_assert for EMACS_RELOC_TYPE_BITS
Stefan Kangas [Mon, 20 Jan 2025 02:10:34 +0000 (03:10 +0100)]
pdumper: Add static_assert for EMACS_RELOC_TYPE_BITS

* src/pdumper.c: Add static_assert for EMACS_RELOC_TYPE_BITS.

(cherry picked from commit 9093a0f824d709af15a29da528259dbca30f5c29)

4 weeks agoRemove redundant case_Lisp_Int macro
Stefan Kangas [Mon, 20 Jan 2025 00:55:19 +0000 (01:55 +0100)]
Remove redundant case_Lisp_Int macro

The case_Lisp_Int macro was originally introduced with different
definitions depending on USE_2_TAGS_FOR_INTS.  However, since commit
2b5701247845, we have assumed that USE_2_TAGS_FOR_INTS is always
defined, and the macro has only a single definition.  As a result, the
macro is now unnecessary, and replacing it with standard C case labels
improves readability and understanding.

* src/lisp.h (case_Lisp_Int): Delete macro.
* src/alloc.c (process_mark_stack, survives_gc_p):
* src/data.c (Fcl_type_of):
* src/fns.c (value_cmp, sxhash_obj):
* src/pdumper.c (dump_object):
* src/print.c (print_object):
* src/xfaces.c (face_attr_equal_p): Remove uses of above macro.

(cherry picked from commit 278d1994af4c52a5590c793d27d8fd2867fe7a66)

4 weeks agoPort better to AIX 7.3 with -lsqlite3 but not sqlite3.h
Paul Eggert [Mon, 20 Jan 2025 00:23:06 +0000 (16:23 -0800)]
Port better to AIX 7.3 with -lsqlite3 but not sqlite3.h

* configure.ac (HAVE_SQLITE): Yes only if sqlite3.h can be
included (Bug#75667).

(cherry picked from commit dcccb9256262f8e992b75602dd4e861371b97361)

4 weeks agoPort better to AIX 7.3 with -lz but not zlib.h
Paul Eggert [Sun, 19 Jan 2025 19:29:59 +0000 (11:29 -0800)]
Port better to AIX 7.3 with -lz but not zlib.h

* configure.ac (HAVE_ZLIB, LIBZ):
Define only if zlib.h can be included (Bug#75667).

(cherry picked from commit a94988c01d45e4e494789d8715eed7ff7b383341)

4 weeks agoRemove workaround for AIX 3.2 crashes
Stefan Kangas [Sun, 19 Jan 2025 17:09:36 +0000 (18:09 +0100)]
Remove workaround for AIX 3.2 crashes

Emacs does not support AIX 3.2 since 2008.

This workaround for AIX 3.2.3 and 3.2.4 (released in 1992) was
introduced in 1999 and was only active with #ifdef AIX3_2.  In 2008, the
condition was changed to #ifdef AIX when support for these older AIX
versions was dropped. I couldn't find any justification for why this
workaround was retained (instead of being removed) in the commit message
or mailing list archives.

Given that users of AIX 4.0 (released in 1995) or later have not had
this workaround for over a decade (1999-2008), it seems safe to assume
that it is no longer necessary.  Removing it will also prevent the
incorrect overriding of the LANG variable on those systems.

* src/emacs.c [AIX] (main): Remove workaround for AIX 3.2.  (Bug#75153)

(cherry picked from commit 4021b92403ca184bc0cd52f33ed5c6e27780cede)

4 weeks agoPrefer the 'min'/'max' macros where possible
Stefan Kangas [Sun, 19 Jan 2025 16:04:12 +0000 (17:04 +0100)]
Prefer the 'min'/'max' macros where possible

* src/composite.c (find_automatic_composition):
* src/lisp.h (clip_to_bounds):
* src/pgtkfns.c (PATH_MAX_LEN):
* src/profiler.c (approximate_median):
* src/unexmacosx.c (unexec_write_zero, unexec_copy, unexec_realloc):
* src/xdisp.c (get_nearby_bol_pos): Prefer the 'min' and 'max' macros.

(cherry picked from commit c37aa3df9d84325924a7a163271154447dfc0cfd)

4 weeks agoDelete duplicate 'min' macro
Stefan Kangas [Sun, 19 Jan 2025 16:15:20 +0000 (17:15 +0100)]
Delete duplicate 'min' macro

* src/gmalloc.c (min): Delete duplicate macro.  We import lisp.h
unconditionally, so it is always defined here.

(cherry picked from commit f3b57fa519797df13f2e0ed9ebb097c37f5d71ce)

4 weeks agoMake NSM warn for RSA key exchange on medium severity
Stefan Kangas [Sun, 19 Jan 2025 14:10:45 +0000 (15:10 +0100)]
Make NSM warn for RSA key exchange on medium severity

* lisp/net/nsm.el (network-security-protocol-checks): Bump rsa-kx
severity to medium.
(nsm-protocol-check--dhe-kx): Update docstring to describe several more
recent attacks, and its removal in TLS 1.3.

(cherry picked from commit 4106fd28c7719d363395438400530752fb86f57c)

4 weeks agoDelete unused aliases for calln
Stefan Kangas [Sun, 19 Jan 2025 04:29:27 +0000 (05:29 +0100)]
Delete unused aliases for calln

* src/lisp.h (call1, call2, call3, call4)
(call5, call6, call7, call8): Delete unused aliases for calln.

(cherry picked from commit 6a0db0d80d538978f4e681b5947d60b7fb93cf9e)

4 weeks agoReplace call[1-8] with calln
Stefan Kangas [Sun, 19 Jan 2025 03:59:22 +0000 (04:59 +0100)]
Replace call[1-8] with calln

Since the introduction of the 'calln' macro, the 'call1', 'call2', ...,
'call8' macros are just aliases for the former.  This is slightly
misleading and potentially unhelpful.  The number of arguments N can
also easily go out-of-synch with the used alias callN.  There is no
reason not to replace these aliases with using 'calln' directly.

To reduce the risk for mistakes, the tool Coccinelle was used to make
these changes.  See <https://coccinelle.gitlabpages.inria.fr/website/>.

* src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c:
* src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c:
* src/chartab.c, src/cmds.c, src/coding.c, src/composite.c:
* src/data.c, src/dbusbind.c, src/dired.c, src/doc.c:
* src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c:
* src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c:
* src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c:
* src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c:
* src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c:
* src/pgtkselect.c, src/print.c, src/process.c, src/sort.c:
* src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c:
* src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c:
* src/xmenu.c, src/xselect.c, src/xterm.c:
Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.

(cherry picked from commit 251e3d2654ae8e5fdee4624d9af93fb9c0e1b698)

4 weeks agoDocument use of calln in C code in internals.texi
Stefan Kangas [Sun, 19 Jan 2025 11:44:05 +0000 (12:44 +0100)]
Document use of calln in C code in internals.texi

* doc/lispref/internals.texi
(Writing Emacs Primitives): Don't recommend `call0`, `call1`, etc.
Instead recommend `calln`, which covers all of those use cases.

(cherry picked from commit 7362f9f75d5aca1c97f920531dd62763918ba5fe)

4 weeks agoImproved git-add completion
Peter Seibel [Sat, 18 Jan 2025 15:54:51 +0000 (07:54 -0800)]
Improved git-add completion

* lisp/pcmpl-git.el (pcomplete/git)): Complete untracked files.
(Bug#75336)

Copyright-paperwork-exempt: yes
(cherry picked from commit 2fd72a6ed3f6ea2937b38a4d74d93e8cfa1a54fb)

4 weeks ago; Skip commit ba5360f700b1cbdd16e13a83f622e5c2d29c9439
Eshel Yaron [Mon, 20 Jan 2025 15:58:51 +0000 (16:58 +0100)]
; Skip commit ba5360f700b1cbdd16e13a83f622e5c2d29c9439

4 weeks ago; Fix autorevert-tests on MS-Windows
Eli Zaretskii [Sun, 19 Jan 2025 12:42:46 +0000 (14:42 +0200)]
; Fix autorevert-tests on MS-Windows

* test/lisp/autorevert-tests.el
(auto-revert-test04-auto-revert-mode-dired): Fix test on
MS-Windows.

(cherry picked from commit be786ab3bb263cb88e548f439562cbdf93587a3f)

4 weeks ago* src/fileio.c (Finsert_file_contents): Fix last change.
Eli Zaretskii [Sun, 19 Jan 2025 12:20:18 +0000 (14:20 +0200)]
* src/fileio.c (Finsert_file_contents): Fix last change.

(cherry picked from commit f367b01f128223d3fc7c34985eccce744333fa8f)

4 weeks agoFix visiting files in /proc/ directory
Eli Zaretskii [Sun, 19 Jan 2025 10:51:18 +0000 (12:51 +0200)]
Fix visiting files in /proc/ directory

* src/fileio.c (Finsert_file_contents): Treat regular files whose
size is reported as zero as if they were special files.  (Bug#75569)

(cherry picked from commit 26c9fbc94dae34fc119828661c71242d80bb33c5)

4 weeks agoFix Tramp error handling process buffer
Michael Albinus [Sun, 19 Jan 2025 10:30:10 +0000 (11:30 +0100)]
Fix Tramp error handling process buffer

* lisp/net/tramp-cache.el (tramp-list-connections):
* lisp/net/tramp-cmds.el (tramp-cleanup-connection): Use connection
property " connected" for a check of active connections.

* lisp/net/tramp.el (tramp-get-buffer): Set connection property
" connected".

(cherry picked from commit 40a8d0ebf0ca6199697c95a308201e739dd9540d)

4 weeks agoAlign files after dired revert (Bug#17219)
Jakub Ječmínek [Sun, 22 Dec 2024 20:53:53 +0000 (21:53 +0100)]
Align files after dired revert (Bug#17219)

* lisp/dired.el (dired-revert): Add 'dired--align-all-files'
function call, to re-align files after reverting.

(cherry picked from commit cce6a57af7cff36936340a6a43be73ccfcadea5f)

4 weeks agoPrefer EMACS_INT_MAX to TYPE_MAXIMUM (EMACS_INT)
Paul Eggert [Sun, 19 Jan 2025 08:19:50 +0000 (00:19 -0800)]
Prefer EMACS_INT_MAX to TYPE_MAXIMUM (EMACS_INT)

* src/dispextern.h (GLYPH_CODE_P):
Use EMACS_INT_MAX instead of TYPE_MAXIMUM (EMACS_INT),
as it’s shorter and is what all the other code uses
in this situation.

(cherry picked from commit 7809086b3bd4f7e7257b42955e3e9eccefb289c3)

4 weeks agoPort recently-added bitfields back to GCC
Paul Eggert [Sun, 19 Jan 2025 08:16:28 +0000 (00:16 -0800)]
Port recently-added bitfields back to GCC

* src/lisp.h (hash_table_std_test_t, hash_table_weakness_t):
Name these as enum tags as well as typedefs,
so that ENUM_BF works for them.

(cherry picked from commit f9be225501ce1ae53ec78136679de14ff093f46d)

4 weeks agoAlways define image_compute_scale
Paul Eggert [Sun, 19 Jan 2025 07:26:02 +0000 (23:26 -0800)]
Always define image_compute_scale

* src/image.c (image_compute_scale): Define even if
! (defined HAVE_IMAGEMAGICK || defined HAVE_NATIVE_TRANSFORMS),
because it is always used.  Needed in platforms that lack all
those image libraries.

(cherry picked from commit fb434b85167d28e6739c8fc6fa80970011b79a0d)

4 weeks agoPort recently-added bitfields to IBM XL C 16.1
Paul Eggert [Sun, 19 Jan 2025 07:10:53 +0000 (23:10 -0800)]
Port recently-added bitfields to IBM XL C 16.1

* src/lisp.h (struct Lisp_Hash_Table):
Use ENUM_BF for members weakness and frozen_test,
since they are enum bitfields.

(cherry picked from commit abf2e097b281c92a7bc2776a967893b248a68384)

4 weeks agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sun, 19 Jan 2025 06:33:25 +0000 (22:33 -0800)]
Update from Gnulib by running admin/merge-gnulib

(cherry picked from commit 866cb87185d9096b248f42c11ee03c19ed7c7598)

4 weeks agoPort to AIX 7.3 ‘find’
Paul Eggert [Sun, 19 Jan 2025 04:01:16 +0000 (20:01 -0800)]
Port to AIX 7.3 ‘find’

* configure.ac (FIND_DELETE): Port to AIX 7.3 ‘find’,
which exits with nonzero status if ‘-exec rm -f {} +’
is never invoked.

(cherry picked from commit d65f727ab401a8dfe11de7837ecee6661a113fea)

4 weeks agoSimplify cross cleaning
Paul Eggert [Sun, 19 Jan 2025 04:01:16 +0000 (20:01 -0800)]
Simplify cross cleaning

* cross/Makefile.in (clean, maintainer-clean):
Prefer a single ‘find’ to doing ‘find’ in a shell loop.

(cherry picked from commit 421d30773372b650a00fe250442f6db2bcc71270)

4 weeks ago; Fix cross-references in Texinfo manuals
Eli Zaretskii [Sun, 19 Jan 2025 06:23:23 +0000 (08:23 +0200)]
; Fix cross-references in Texinfo manuals

(cherry picked from commit 0f75a01acd3fe880da6884018565870ba800f30e)

4 weeks agoRevert "Revert "Use @xref more consistently; "See @ref" -> "@xref"""
Eli Zaretskii [Sun, 19 Jan 2025 06:06:48 +0000 (08:06 +0200)]
Revert "Revert "Use @xref more consistently; "See @ref" -> "@xref"""

This reverts commit 59167e2de8a93341cd235d83e034c00be32403f6.
TRT to use reference in Texinfo is to place some punctuation
character after a reference.  This is common both to @ref and
to @xref.  So this is what should be done to fix the changeset,
not to revert it.

(cherry picked from commit 2a314666e4800639a81ff6562395c3d38cb97e7b)

4 weeks agoPrefer 'list (...)' to 'listn (N, ...)'
Stefan Kangas [Sun, 19 Jan 2025 03:25:52 +0000 (04:25 +0100)]
Prefer 'list (...)' to 'listn (N, ...)'

* src/androidfns.c (Fandroid_query_battery):
* src/buffer.c (make_lispy_itree_node):
* src/keyboard.c (init_while_no_input_ignore_events):
* src/window.c (Fset_window_configuration):
* src/xterm.c (x_dnd_send_unsupported_drop): Prefer 'list (...)' to
'listn (N, ...)'.
* admin/coccinelle/listn.cocci: New file.

(cherry picked from commit 20c282ae331a5b71d7bae258ccdaa1e54490c3ef)

4 weeks agoFix a GTK memory leak (Bug#75636)
Pip Cet [Sun, 19 Jan 2025 03:27:34 +0000 (03:27 +0000)]
Fix a GTK memory leak (Bug#75636)

* src/gtkutil.c (xg_create_frame_widgets): Don't call g_object_ref.

(cherry picked from commit d5f99f4431551865ff547ff2ecb7f10844ce881a)

4 weeks agoRevert "Use @xref more consistently; "See @ref" -> "@xref""
Po Lu [Sun, 19 Jan 2025 00:58:45 +0000 (08:58 +0800)]
Revert "Use @xref more consistently; "See @ref" -> "@xref""

This reverts commit e54b94c28cdf9699009e7691f7c8ffa5b2c7b741,
which prevented building Emacs on a number of my machine(s).

(cherry picked from commit 59167e2de8a93341cd235d83e034c00be32403f6)

4 weeks agoUse @xref more consistently; "See @ref" -> "@xref"
Stefan Kangas [Sun, 19 Jan 2025 00:34:44 +0000 (01:34 +0100)]
Use @xref more consistently; "See @ref" -> "@xref"

* doc/lispref/commands.texi (Using Interactive):
* doc/lispref/customize.texi (Type Keywords):
* doc/lispref/edebug.texi (Using Edebug, Specification List):
* doc/lispref/frames.texi (Frame Layout):
* doc/lispref/functions.texi (What Is a Function, Related Topics):
* doc/lispref/keymaps.texi (Controlling Active Maps, Key Lookup):
* doc/lispref/minibuf.texi (Completion Variables):
* doc/lispref/os.texi (Terminal Input):
* doc/lispref/text.texi (JSONRPC Overview):
* doc/misc/calc.texi (More About Embedded Mode, Customizing Calc):
* doc/misc/cc-mode.texi (Movement Commands, Auto-newlines)
(Config Basics, Custom Auto-newlines):
* doc/misc/gnus.texi (Email Based Diary):
* doc/misc/htmlfontify.texi (Interactive, Non-interactive):
(Variables):
* doc/misc/idlwave.texi (Using the Shell):
* doc/misc/srecode.texi (Quick Start, User Templates)
(Parts of SRecode, Compound Variable Values, Template Macros):
* doc/misc/tramp.texi (Inline methods, FUSE-based methods)
(Predefined connection information, Remote shell setup)
(Frequently Asked Questions):
* doc/misc/transient.texi (Configuration, Technical Introduction):
(Binding Suffix and Infix Commands, Transient State):
(Prefix Slots, Predicate Slots):
* doc/misc/wisent.texi (Example, Compiling a grammar, Conflicts):
(Grammar Debugging, Error recovery):

(cherry picked from commit e54b94c28cdf9699009e7691f7c8ffa5b2c7b741)

4 weeks agoInitialize full range in parse_menu_item
Stefan Kangas [Sat, 18 Jan 2025 23:48:08 +0000 (00:48 +0100)]
Initialize full range in parse_menu_item

* src/keyboard.c (parse_menu_item): Initialize the full range of item,
in case future changes makes ITEM_PROPERTY_ENABLE != ITEM_PROPERTY_MAX.
Problem reported by Pip Cet <pipcet@protonmail.com>.
Ref: https://mail.gnu.org/r/emacs-devel/2025-01/msg00680.html

(cherry picked from commit 2c7b08c60a20268b3f55c95699542c9df95fc786)

4 weeks agoscope.el,elisp-mode.el: Recognize 'declare' specs
Eshel Yaron [Mon, 20 Jan 2025 15:48:05 +0000 (16:48 +0100)]
scope.el,elisp-mode.el: Recognize 'declare' specs

4 weeks agoscope.el: Handle 'cl-defmethod' and 'cl-defun'
Eshel Yaron [Mon, 20 Jan 2025 07:58:20 +0000 (08:58 +0100)]
scope.el: Handle 'cl-defmethod' and 'cl-defun'

4 weeks ago* lisp/emacs-lisp/scope.el: Analyze type argument of cl-typep
Eshel Yaron [Mon, 20 Jan 2025 07:57:16 +0000 (08:57 +0100)]
* lisp/emacs-lisp/scope.el: Analyze type argument of cl-typep

4 weeks ago(elisp-create-defun): New command
Eshel Yaron [Mon, 20 Jan 2025 07:56:46 +0000 (08:56 +0100)]
(elisp-create-defun): New command

4 weeks agoscope.el,elisp-mode.el: Recognize warning types
Eshel Yaron [Mon, 20 Jan 2025 07:56:06 +0000 (08:56 +0100)]
scope.el,elisp-mode.el: Recognize warning types

4 weeks ago* lisp/loadhist.el (file-set-intersect): Drop it.
Eshel Yaron [Mon, 20 Jan 2025 07:55:12 +0000 (08:55 +0100)]
* lisp/loadhist.el (file-set-intersect): Drop it.

4 weeks ago(loadhist-unload-element): Implement also for 'define-widget'
Eshel Yaron [Mon, 20 Jan 2025 07:54:46 +0000 (08:54 +0100)]
(loadhist-unload-element): Implement also for 'define-widget'

4 weeks agoscope.el: Recognize a few more widgets
Eshel Yaron [Mon, 20 Jan 2025 07:54:05 +0000 (08:54 +0100)]
scope.el: Recognize a few more widgets

5 weeks agoRemove unnecessary stdalign.in.h
Paul Eggert [Sat, 18 Jan 2025 19:22:22 +0000 (11:22 -0800)]
Remove unnecessary stdalign.in.h

* lib/stdalign.in.h: Remove.  This file was already removed in
commit b429274c5b4b2b511d2d351111dea2d354498e0f (2023-02-04)
but was brought back mistakenly by a merge from emacs-29 in
commit ecf08f0621c25ad1dfadd96399e204c389ab1695 (2024-01-02).
* nt/inc/stdalign.h: Don’t mention removed file in comment.

(cherry picked from commit 8661f40ce4d6bce649cb2a564f7c4e766318476c)

5 weeks agoruler-mode: Improve compatibility with text-scale (bug#75168)
Arsen Arsenović [Sat, 18 Jan 2025 15:40:29 +0000 (16:40 +0100)]
ruler-mode: Improve compatibility with text-scale (bug#75168)

* lisp/ruler-mode.el (ruler-mode-ruler): Use pixelwise line-number
display width for alignment with line numbers.

(cherry picked from commit 311b3f70f543a106bc9ebc369b69432a106b0e38)

5 weeks ago; Skip commit 63a322b616b8e2d1edd2b3dd9217ff595eaaec6e
Eshel Yaron [Sat, 18 Jan 2025 22:05:00 +0000 (23:05 +0100)]
; Skip commit 63a322b616b8e2d1edd2b3dd9217ff595eaaec6e

5 weeks ago; Fix last change by using 'cl-oddp' and 'cl-evenp' (bug#75633).
Eli Zaretskii [Sat, 18 Jan 2025 11:08:45 +0000 (13:08 +0200)]
; Fix last change by using 'cl-oddp' and 'cl-evenp' (bug#75633).

(cherry picked from commit 840057bb1bfc05a52519793c620d729688ea1d8f)

5 weeks agoNew unit-tests for cl-lib (bug#75633).
Ahmed Khanzada [Fri, 17 Jan 2025 14:48:57 +0000 (09:48 -0500)]
New unit-tests for cl-lib (bug#75633).

(cherry picked from commit 103ae72ee9f197943265b76590cbad1d6e08a9b5)

5 weeks ago; * lisp/net/eww.el (eww-download): Doc fix (bug#75585)
Eli Zaretskii [Sat, 18 Jan 2025 10:56:48 +0000 (12:56 +0200)]
; * lisp/net/eww.el (eww-download): Doc fix (bug#75585)

(cherry picked from commit 853719c4c23a4ae0802a6eed3f855dc88381997f)

5 weeks ago; * nt/gnulib-cfg.mk: Remove unused modules. (Bug#75551)
Eli Zaretskii [Sat, 18 Jan 2025 07:44:26 +0000 (09:44 +0200)]
; * nt/gnulib-cfg.mk: Remove unused modules.  (Bug#75551)

(cherry picked from commit 43c2e49d19f2e7a840507ae9e728b623fcb7c341)

5 weeks ago; * doc/lispref/parsing.texi (Pattern Matching): Fix markup in @example.
Eli Zaretskii [Sat, 18 Jan 2025 07:22:39 +0000 (09:22 +0200)]
; * doc/lispref/parsing.texi (Pattern Matching): Fix markup in @example.

(cherry picked from commit 17d9c22b801783ed02e60c297d4af7abdd031c74)

5 weeks ago; * doc/lispref/parsing.texi (Pattern Matching): Fix punctuation.
Eli Zaretskii [Sat, 18 Jan 2025 07:18:09 +0000 (09:18 +0200)]
; * doc/lispref/parsing.texi (Pattern Matching): Fix punctuation.

(cherry picked from commit d6151e9da5459c316b2f2e0407ecbf4f20c9a66c)

5 weeks ago; Fix a declare-function for reconsider-frame-fonts
Gerd Möllmann [Sat, 18 Jan 2025 07:06:48 +0000 (08:06 +0100)]
; Fix a declare-function for reconsider-frame-fonts

* lisp/dynamic-setting.el (reconsider-frame-fonts): Declare.

(cherry picked from commit bee2f814f266290ce94ebb88281db356735e3356)

5 weeks agoFix treesit.el tests
Yuan Fu [Sat, 18 Jan 2025 02:24:45 +0000 (18:24 -0800)]
Fix treesit.el tests

* lisp/treesit.el (treesit--imenu-merge-entries):
(Ftreesit_parser_set_included_ranges): Warn in the docstring
that the function is destructive/owns the argument.
* test/src/treesit-tests.el (treesit-range-fixup-after-edit):
(treesit-imenu): Fix tests.

(cherry picked from commit fae424aba97163738f6666ebec1351ceff4b5b2b)

5 weeks agoMake sure treesit.el doesn't create parsers by itself (bug#75456)
Yuan Fu [Sat, 18 Jan 2025 01:40:04 +0000 (17:40 -0800)]
Make sure treesit.el doesn't create parsers by itself (bug#75456)

Up to this point, functions in
treesit.el (font-lock/indentation/etc) creates a parser if one
doesn't exist.  This doesn't work well with local parsers,
because local parsers are not visible at global level and
font-lock or indentation functions might accidentally create a
global parser for an embedded language.

The solution is to not create parsers automatically.  This has
the potential of breaking things, but I don't expect any actual
breakage: all the major modes create parsers they need in the
major mode body, even though previously it isn't technically
necessary.

* lisp/treesit.el (treesit-buffer-root-node):
(treesit--update-ranges-local):
(treesit-update-ranges):
(treesit--guess-primary-parser): Use treesit-parser-list instead
of treesit-parser-create.

(cherry picked from commit f7e41ba3d0fb5f89b1d2712b699b526ef7d7b82c)

5 weeks agoRemap language symbol in treesit-query-compile (bug#72388)
Yuan Fu [Sat, 18 Jan 2025 01:26:23 +0000 (17:26 -0800)]
Remap language symbol in treesit-query-compile (bug#72388)

* src/treesit.c (Ftreesit_query_compile): Use remapped language.

(cherry picked from commit 197d09a5fa9e94a09b7569a42480253138a5b2fd)

5 weeks agoUse treesit-query-first-valid in c-ts-mode
Yuan Fu [Wed, 15 Jan 2025 07:52:37 +0000 (23:52 -0800)]
Use treesit-query-first-valid in c-ts-mode

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Use treesit-query-first-valid.  Use :default-language keyword.
(c-ts-mode--test-virtual-named-p): Remove function.

(cherry picked from commit e3b9de03e641cef5daeada4912fa711470697ba3)

5 weeks agoAdd treesit-query-first-valid
Yuan Fu [Wed, 15 Jan 2025 07:32:48 +0000 (23:32 -0800)]
Add treesit-query-first-valid

This should help major modes to support grammar versions.

* doc/lispref/parsing.texi (Pattern Matching): Mention new function.
* lisp/treesit.el (treesit-query-first-valid): New function.
(treesit-query-valid-p): New function.

(cherry picked from commit 814b45775ffcfa91c03fb54b78611eb97973c387)

5 weeks agoSimplify alloc by assuming MALLOC_IS_LISP_ALIGNED
Paul Eggert [Thu, 16 Jan 2025 07:32:43 +0000 (23:32 -0800)]
Simplify alloc by assuming MALLOC_IS_LISP_ALIGNED

Problem reported by Hong Xu <https://bugs.gnu.org/75551#14>.
* src/alloc.c (MALLOC_IS_LISP_ALIGNED): static_assert it,
since it is true on all current Emacs platforms.
All uses simplified to assume it is true.
(xmalloc, xzalloc, xrealloc, lisp_malloc): Just use
malloc/calloc/realloc.  Since we are using the malloc-gnu
and realloc-posix modules, we need not worry about whether
these functions return a null pointer for zero-size requests.
(xrealloc): Stop worrying about no-longer-existing platforms
where realloc (nullptr, ...) did not work.
(laligned, lmalloc, lrealloc): Remove.  All uses removed.

(cherry picked from commit d3a2ec5210746a942263d5e18ee3b8190b9698e1)

5 weeks agoLet Gnulib deal with malloc/realloc 0
Paul Eggert [Fri, 17 Jan 2025 07:28:34 +0000 (23:28 -0800)]
Let Gnulib deal with malloc/realloc 0

Instead of worrying about whether malloc and realloc yield a
non-null pointer when given size 0 (the traditional behavior
recommended by Doug McIlroy, and the only behavior that makes
sense for Emacs), let Gnulib arrange for the traditional behavior.
* admin/merge-gnulib (GNULIB_MODULES): Add malloc-gnu (which we
were already depending on indirectly) and realloc-posix.
* lib/gnulib.mk.in, m4/gnulib-comp.m4:
Regenerate by running admin/merge-gnulib.

(cherry picked from commit 29794c71452c58c596c58fd6148741d213d3ee7b)

5 weeks agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Fri, 17 Jan 2025 23:34:41 +0000 (15:34 -0800)]
Update from Gnulib by running admin/merge-gnulib

(cherry picked from commit 9eefe7ccdae5cc9d5cfb8b7e5897497490d4be4f)

5 weeks agoFix build on Solaris 10 (bug#75451)
Pip Cet [Fri, 17 Jan 2025 17:13:29 +0000 (17:13 +0000)]
Fix build on Solaris 10 (bug#75451)

* autogen.sh: Avoid bashism.
* configure.ac (AC_PROG_AWK): Use.
* src/Makefile.in (AWK): Set.
(dmpstruct.h): Use "$(AWK)", not "awk".
* src/dired.c (DT_UNKNOWN, DT_DIR, DT_LNK): Define all three constants
or none of them.

(cherry picked from commit 2a00bedeaef0a0caf8c810842c524b5c46de06ed)