Add 'list' and 'sentence' things to treesit-thing-settings,
and move mistakenly added 'sentence' to 'text' (bug#73404).
Set 'treesit-defun-name-function' and 'treesit-simple-imenu-settings'.
Reset 'outline-regexp'.
Mauro Aranda [Fri, 17 Jan 2025 20:12:08 +0000 (17:12 -0300)]
Prepare markers for insertions inside of a widget
Recreating child widgets without recreating the parent widget
may lead to situations where the parent widget doesn't cover its
children or buttons entirely anymore. This bug manifests as a
faulty fontification of children or buttons, for example.
(Bug#69941)
* lisp/wid-edit.el (widget--prepare-markers-for-inside-insertion)
(widget--prepare-markers-for-outside-insertion): New functions.
(widget-default-create): Use them.
* test/lisp/wid-edit-tests.el (widget-test-insertion-at-parent-markers)
(widget-test-insertion-at-parent-markers-2): New tests.
Correctly handled the local parser for jsdoc (bug#75456)
As a result of recent patches to treesitter, local parsers must
now be recognized by 'treesit-language-at-point' and have their
own indentation rules.
* lisp/progmodes/js.el
(js--treesit-indent-rules): New rule for jsdoc.
(js--treesit-language-at-point): New function.
(js-ts-mode): Use the new function.
Yuan Fu [Wed, 5 Feb 2025 07:35:37 +0000 (23:35 -0800)]
Make treesit-node-at more readable
* lisp/treesit.el (treesit-node-at): Make the logic for finding
the parser (and the root node) more explicit and
straightforward. Don't use treesit-buffer-root-node; instead,
find the parser and use treesit-parser-root-node directly.
Paul Eggert [Wed, 5 Feb 2025 00:56:56 +0000 (16:56 -0800)]
Remove no-longer-needed delete_frame UNINIT
* src/frame.c (delete_frame): Remove a local with UNINIT that is
no longer needed now that GCC bug#85563 is fixed, as we don’t
need to worry about porting --enable-gcc-warnings to older GCC.
This change reverts this part of my commit
“Port --enable-gcc-warnings to GCC 8” 8c3215e7a47e3caaa005bf573765ed63e0739b89
dated Sat Apr 28 16:49:24 2018 -0700.
kobarity [Tue, 4 Feb 2025 15:02:05 +0000 (00:02 +0900)]
Make it configurable to highlight Python 2 builtins
By default, Python 2-only builtins are not highlighted.
* lisp/progmodes/python.el (python-2-support): New defcustom.
(python-font-lock-builtin-types)
(python-font-lock-builtins-python3)
(python-font-lock-builtins-python2)
(python-font-lock-builtins)
(python-font-lock-special-attributes)
(python-font-lock-builtin-exceptions-python3)
(python-font-lock-builtin-exceptions-python2)
(python-font-lock-builtin-exceptions): New variables.
(python-font-lock-keywords-level-2)
(python-font-lock-keywords-maximum-decoration)
(python--treesit-builtin-types)
(python--treesit-builtins)
(python--treesit-special-attributes)
(python--treesit-exceptions): Use new variables.
Co-authored-by: Konstantin Kharlamov <Hi-Angel@yandex.ru> Co-authored-by: Stefan Kangas <stefankangas@gmail.com>
(cherry picked from commit 999d054dc1e265f1a39c10035a3a3f7f75de8445)
Jim Porter [Tue, 4 Feb 2025 17:25:17 +0000 (09:25 -0800)]
Improve calculation of indent prefixes when using text scaling
Previously, the display spec for the "average space" was wrong. It used
a plain number for the width of the specified space, which means "N
times the normal character width for the buffer", but we want "N times
the normal character width for the *current face*" (bug#76008).
* lisp/visual-wrap.el (visual-wrap--content-prefix): Specify the width
of the "average space" in terms of the average width of the current
face.
* lisp/net/shr.el (shr-indent): As above, and call 'string-pixel-width'
without specifying the buffer, to match 'shr-string-pixel-width'.
Andrew G Cohen [Wed, 5 Jul 2023 07:21:16 +0000 (15:21 +0800)]
Don't use obsolete In-Reply-To format in messages (Bug#64454)
When creating a new message, message-send-mail uses an obsolete format
for the In-Reply-To header that includes additional information about
the originating message. This patch changes the default to use the
rfc5322 approved format, but allow the obsolete format through a
defcustom.
* lisp/gnus/message.el (message-make-in-reply-to): Return only the
message-id of the originating message (the default) unless the new
custom variable message-header-use-obsolete-in-reply-to is non-nil.
* doc/misc/message.texi: Document the new custom variable
message-header-use-obsolete-in-reply-to.
* etc/NEWS: Update NEWS.
Michael Albinus [Tue, 4 Feb 2025 13:09:52 +0000 (14:09 +0100)]
Add inhibit-auto-revert macro
* doc/lispref/backups.texi (Reverting):
Add inhibit-auto-revert-buffers and inhibit-auto-revert.
* etc/NEWS: Add inhibit-auto-revert-buffers and inhibit-auto-revert.
Fix typos.
* lisp/autorevert.el (inhibit-auto-revert-buffers): New variable.
(inhibit-auto-revert): New macro.
(auto-revert-active-p, auto-revert-handler):
Check `inhibit-auto-revert-buffers'.
* lisp/dired.el (dired--inhibit-auto-revert): Remove.
(dired-buffer-stale-p): Don't set it.
(dired-map-over-marks, dired-internal-do-deletions):
Use `inhibit-auto-revert.
* test/lisp/autorevert-tests.el
(auto-revert-test08-auto-revert-inhibit-auto-revert)
(auto-revert-test08-auto-revert-inhibit-auto-revert-remote): New tests.
João Távora [Tue, 4 Feb 2025 12:02:06 +0000 (12:02 +0000)]
Eglot: avoid 'null' as params to 'shutdown' request (bug#66144)
Doing so confuses some servers. It used to be needed for the
gopls server, but according to
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66144#32
that has been fixed.
Thanks to Javier Olaechea <pirata@gmail.com>
* lisp/progmodes/eglot.el (eglot-shutdown): Use eglot--{}.
Change the way we handle `save-place-abbreviate-file-names` such that
this preference is applied lazily when we load the alist, rather than
eagerly when we define it (which forced the alist to be loaded before we
needed it).
* lisp/saveplace.el (save-place-load-alist-from-file): Use `unless`,
`when`, and `with-temp-buffer` to hopefully help readability.
Call `save-place--normalize-alist`.
(save-place--normalize-alist): New function extracted from the setter
of `save-place-abbreviate-file-names`.
(save-place-abbreviate-file-names): Use it.
(save-place-alist-to-file): Use `with-temp-buffer`.
Eli Zaretskii [Mon, 3 Feb 2025 16:36:11 +0000 (18:36 +0200)]
Fix -nw sessions on MS-Windows
* src/w32console.c (w32con_clear_end_of_line): Set the space
glyphs' frame to NULL.
(w32con_write_glyphs): Handle face_id_frame == NULL, when called
from 'w32con_clear_end_of_line'.
(tty_draw_row_with_mouse_face): Adjust to changes in term.c.
Stefan Kangas [Mon, 3 Feb 2025 11:37:06 +0000 (12:37 +0100)]
; Don't use HTTPS in HTTP-specific example
* doc/misc/org.org (External Links): Change HTTP example to use HTTP.
Changing it to HTTPS has been done before, but it's a mistake. To avoid
making this mistake again, change the URL to orgmode.org to make it more
similar to the example on the next line, thereby contrasting the two.
Ulrich Müller [Sat, 1 Feb 2025 22:10:53 +0000 (23:10 +0100)]
Avoid ln(10) expression in calc units definition
* lisp/calc/calc-ext.el (calc-init-extensions): Autoload calc-math
for math-ln-10.
* lisp/calc/calc-units.el (math-standard-units): Use new ln10
constant instead of ln(10) in the decibel definition.
(math-find-base-units-rec): Allow ln10 in expression.
(math-to-standard-rec): Recognize the ln10 constant. (Bug#75861)
Michael Albinus [Mon, 3 Feb 2025 11:51:48 +0000 (12:51 +0100)]
Better NaN handling in proced-tests.el
* test/lisp/proced-tests.el (proced--cpu-at-point): Make it more robust.
(proced--assert-process-valid-cpu-refinement):
Handle `ert-test-skipped' signal.
Eli Zaretskii [Sun, 2 Feb 2025 13:58:18 +0000 (15:58 +0200)]
Improve documentation of 'display-monitor-attributes-
* doc/lispref/frames.texi (Multiple Terminals):
* lisp/frame.el (display-monitor-attributes-list): Better
documentation of what the 'source' key means on X. (Bug#75936)
Stephen Gildea [Mon, 3 Feb 2025 04:14:40 +0000 (20:14 -0800)]
; time-stamp: documentation, tests, NEWS
* lisp/time-stamp.el (time-stamp-pattern, time-stamp-count): Document
how to update different time stamps on multiple lines.
* doc/emacs/files.texi (Time stamps): Add an example showing a time
stamp at the end of a file.
* etc/NEWS: Announce time-stamp format additions.
* test/lisp/time-stamp-tests.el: More title-case tests.
F. Jason Park [Fri, 31 Jan 2025 03:07:00 +0000 (19:07 -0800)]
Run erc-services-regain-mode callback on a timer
* lisp/erc/erc-services.el (erc-services-regain-timeout-seconds): New
variable.
(erc-services-regain-mode): Mention CertFP in doc string.
(erc--nickname-in-use-make-request): Ensure the 900 RPL_LOGGEDIN
callback always runs after `erc-services-regain-timeout-seconds', even
when SASL isn't being used.
* test/lisp/erc/erc-scenarios-services-misc.el
(erc-scenarios-services-misc--regain-command/oftc): New test.
* test/lisp/erc/resources/services/regain/taken-regain-oftc.eld: New
file.
Paul Eggert [Sun, 2 Feb 2025 06:20:04 +0000 (22:20 -0800)]
Improve format-seconds on negative args
* lisp/calendar/time-date.el (format-seconds):
Work better with negative seconds (Bug#75849).
* test/lisp/calendar/time-date-tests.el (test-format-seconds): Test it.
Eli Zaretskii [Sun, 2 Feb 2025 06:23:02 +0000 (08:23 +0200)]
Fix mouse pointer inside mouse-face on text with 'pointer' property
* src/dispnew.c (gui_update_window_end): Don't consider mouse face
overwritten.
* src/xdisp.c (show_mouse_face): Accept an additional argument;
redefine the mouse cursor only if that argument is 'true'. All
callers changed. (Bug#75931)
Paul Eggert [Sat, 1 Feb 2025 22:09:06 +0000 (14:09 -0800)]
Omit 2 ‘volatile’s in internal_lisp_condition_case
* src/eval.c (internal_lisp_condition_case): Omit an unnecessary
‘volatile’ and an unnecessary pointer-to-volatile local var.
Perhaps these were needed in previous versions of Emacs, or to
pacify older versions of GCC when using --enable-gcc-warnings,
but they are not needed to pacify current GCC.
shipmints [Sat, 25 Jan 2025 18:12:56 +0000 (13:12 -0500)]
Add missing custom :set to 'savehist-autosave-interval'
* lisp/savehist.el (savehist-autosave-interval): Correctly
reset 'savehist-timer' when 'savehist-autosave-interval' changes
via setopt or a Customize command. (Bug#75834)
shipmints [Sat, 25 Jan 2025 19:04:51 +0000 (14:04 -0500)]
Add auto save timer to save-place (bug#75837)
* lisp/saveplace.el (save-place-autosave-interval):
New user option 'save-place-autosave-interval' which defaults to nil,
and has a custom :set to manage the timer. Add
'save-place--manage-timer' to enable or cancel the timer if the mode is
enabled and 'save-place-autosave-interval' is non-nil. Amend
'save-place-mode' to invoke save-place--manage-timer. Add
'save-place--cancel-timer'. Add 'save-place--autosave'.
Pip Cet [Sat, 18 Jan 2025 20:55:18 +0000 (20:55 +0000)]
Use #$ for lambda fixups in native compilation data vectors
The "#$" syntax is recognized by Fread, which substitutes
Vload_file_name in its place. If Vload_file_name is bound
appropriately, no other value can produce an object EQ to the one
produced by "#$".
We use this to check the data vector for entries that we know should
have been initialized: if the value is still equal to what we bound
Vload_file_name to when it was read, it wasn't initialized, and we
abort.
* lisp/emacs-lisp/comp.el (comp--#$): New defvar.
(comp--finalize-container): Use it.
* src/comp.c (ABI_VERSION): Bump.
(emit_static_object): Ensure 'comp--#$' prints as "#$".
(load_static_obj): Ensure '#$' reads as Vcomp__hashdollar.
(check_comp_unit_relocs): Adjust assertion.
(syms_of_comp): Define 'comp--#$'.
* src/pdumper.c (dump_do_dump_relocation): Adjust assertion.
When the visited TAGS file was removed, commands that depend on
TAGS, such as auto-completion, may invoke an interactive question
whether a user wants to re-read the file. From that point on,
the question will be asked over and over, because the file no
longer exists, which results in mtime mismatch and inability to
"fix the mismatch" by reading from the file. Fix that by simply
ignoring the mismatch if the file no longer exists.
* lisp/progmodes/etags.el (tags-verify-table): Avoid infinite
questions if TAGS file was removed. (Bug#75946)
Pengji Zhang [Mon, 27 Jan 2025 11:42:00 +0000 (19:42 +0800)]
New user option 'Buffer-menu-human-readable-sizes'
* lisp/buff-menu.el (Buffer-menu-human-readable-sizes): New user
option.
(list-buffers--refresh): Use it.
* etc/NEWS: Announce the new user option. (Bug#75825)
shipmints [Mon, 27 Jan 2025 16:16:04 +0000 (11:16 -0500)]
Add new user option bookmark-bmenu-type-column-width
* lisp/bookmark.el (bookmark-bmenu-mode):
Add new user option bookmark-bmenu-type-column-width, defaulting to 8
for backwards compatibility, and use it when creating the tabulated
bookmark list. (Bug#75826)
Eli Zaretskii [Sat, 1 Feb 2025 10:22:13 +0000 (12:22 +0200)]
Rename a recently-added variable (bug#56197)
* lisp/emacs-lisp/lisp-mode.el
(lisp-fill-paragraphs-as-doc-string): Renamed from
'lisp-fill-paragraph-as-displayed' and default value reversed.
(lisp-fill-paragraph): Adjust to the change.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-fill-paragraph-as-displayed): Likewise.
Paul Eggert [Fri, 31 Jan 2025 22:42:33 +0000 (14:42 -0800)]
Don’t use garbage after tty_frame_at returns nil
* src/term.c (handle_one_term_event): Don’t access possibly
uninitialized storage if frame is nil. This fixes an issue introduced
in commit 5eae7f5227c7789dea45cef26fec17c057024670 dated 2025-01-26
14:43:51 -0800. Issue caught by --enable-gcc-warnings, which enables
-Wanalyzer-use-of-uninitialized-value with gcc (GCC) 14.2.1 20250110
(Red Hat 14.2.1-7).
Paul Eggert [Fri, 31 Jan 2025 22:42:33 +0000 (14:42 -0800)]
Port dest-mountpoint test to suspicious bwrap
* test/lisp/emacs-lisp/bytecomp-tests.el:
(bytecomp-tests--dest-mountpoint): Skip test if bwrap prohibits
even ‘true’, which it does on my Ubuntu 24.10 platform.
João Távora [Fri, 31 Jan 2025 10:31:37 +0000 (10:31 +0000)]
Eglot: add server menu into main menu
* lisp/progmodes/eglot.el (eglot-menu): Add separator at end
and add in eglot-server menu at load-time.
(eglot-server-menu): Rework menu title and description.
Martin Rudalics [Fri, 31 Jan 2025 08:31:05 +0000 (09:31 +0100)]
In 'replace-buffer-in-windows' try to preserve current buffer (Bug#75949)
* lisp/window.el (replace-buffer-in-windows): Preserve current
buffer when 'kill-buffer-quit-windows' is non-nil and a window
showing BUFFER shall be quit. Running 'kill-buffer-hook' relies
on it (Bug#75949).
shipmints [Thu, 30 Jan 2025 17:57:00 +0000 (12:57 -0500)]
Add new variable tab-bar-format-tab-help-text-function
* lisp/tab-bar.el (tab-bar--format-tab):
Add new variable 'tab-bar-format-tab-help-text-function' and a default
function 'tab-bar-format-tab-help-text-default'. 'tab-bar--format-tab'
respects this new variable when producing a tab's help text, normally
shown in the echo area or via tooltips (bug#75950).
Yuan Fu [Fri, 31 Jan 2025 00:54:20 +0000 (16:54 -0800)]
Add treesit-add-simple-indent-rules
* lisp/treesit.el:
(treesit-add-simple-indent-rules): New function.
* etc/NEWS: Update NEWS.
*
test/src/treesit-tests.el:
(treesit-test-add-simple-indent-rules): Add a test for the new
function.
Stefan Kangas [Sun, 26 Jan 2025 13:53:49 +0000 (14:53 +0100)]
Do not set `trusted-content` in major modes
* lisp/progmodes/elisp-mode.el (lisp-interaction-mode):
* lisp/ielm.el (inferior-emacs-lisp-mode): Do not set `trusted-content.
* lisp/ielm.el (ielm):
* lisp/simple.el (get-scratch-buffer-create): Set `trusted-content` here
instead.
* lisp/files.el (trusted-content): Doc fix; warn against setting this
option to :all in a major or mode mode.
Problem reported by Max Nikulin <manikulin@gmail.com>.
shipmints [Thu, 30 Jan 2025 12:20:34 +0000 (07:20 -0500)]
* lisp/tab-bar.el (tab-bar-select-tab): Fix wc-bl/wc-bbl when nil
Remove the nil-check conditionals around 'wc-bl' and 'wc-bbl' that reset
frame parameters 'buffer-list' and 'buried-buffer-list'. This ensures
originating nil values correctly propagate (bug#75935).
shipmints [Wed, 29 Jan 2025 18:43:04 +0000 (13:43 -0500)]
Add new user option tab-bar-define-keys
* lisp/tab-bar.el (tab-bar-define-keys):
Add new defcustom tab-bar-define-keys. Reorganize key binding functions
to accommodate. Also remove checks for tab-bar-mode enabled in
'tab-bar-select-tab-modifiers', as unnecessary and which prevented user
changes from being accepted in cases where the user defers enabling
tab-bar-mode (bug#75918).