Po Lu [Sun, 9 Feb 2025 04:06:52 +0000 (12:06 +0800)]
Fix program execution on Android 15 QPR2 Beta
* exec/trace.c (process_vm_readv, process_vm_writev): New
function pointers. Attempt to load them on recent Android
systems when `exec' was not linked with a sufficiently
up-to-date libc.
(read_memory, user_copy): Always use process_vm_readv and
process_vm_writev if available.
(handle_openat): Write trailing NULL byte of filename to user
buffer.
(exec_init): Attempt to dlsym process_vm_readv and
process_vm_writev.
shipmints [Fri, 7 Feb 2025 19:25:50 +0000 (14:25 -0500)]
Eliminate savehist duplicated symbols
* lisp/savehist.el (savehist-save): Do not save symbols
duplicated between 'savehist-minibuffer-history-variables'
and 'savehist-additional-variables'. (Bug#76123)
* test/lisp/savehist-tests.el: New file.
Jared Finder [Thu, 6 Feb 2025 22:32:00 +0000 (14:32 -0800)]
Cleanup tool-bar-mode documentation
* doc/emacs/frames.texi (Tool Bars): Downcase concept index
text.
* lisp/cus-start.el (standard): Copy custom :tag strings
from window-tool-bar-style's, which are more descriptive.
(Bug#75844)
Jared Finder [Sun, 2 Feb 2025 18:11:20 +0000 (10:11 -0800)]
Update window-tool-bar
Add support for the remaining tool bar item specs, new user
option `window-tool-bar-style', and add support for older
Emacs versions.
* doc/emacs/windows.texi (Window Tool Bar): Add documentation
for new user option `window-tool-bar-style'.
* lisp/window-tool-bar.el
(customize-package-emacs-version-alist): Add package-version to
Emacs version mapping.
(window-tool-bar-string): Do not show spacers after hidden
buttons.
(window-tool-bar--keymap-entry-to-string): Call new function
`window-tool-bar--style'. Add handling for :visible, :filter,
:button, :vert-only, and :help item specs. Show key bindings.
(window-tool-bar--last-command-triggers-refresh-p): Use "cannot"
in comment.
(window-tool-bar--allow-images): Delete this, it is replaced by
new user option `window-tool-bar-style'.
(window-tool-bar--use-images): Delete this, it is replaced by
new function `window-tool-bar--style'.
(window-tool-bar--turn-on): Move earlier in file, no changes.
(window-tool-bar-style): New user option supporting all values
`tool-bar-style' supports as well as inheriting from
tool-bar-style.
(window-tool-bar--style): New function to calculate active tool
bar style based on `window-tool-bar-style', `tool-bar-style',
and frame capabilities.
(global-window-tool-bar-mode, window-tool-bar-button)
(window-tool-bar-button-hover, window-tool-bar-button-disabled):
Retroactively add package-version.
(window-tool-bar-button-checked)
(window-tool-bar-button-checked-hover): New faces for :button
item spec.
(window-tool-bar--get-keymap): Call new function
`window-tool-bar--style'. (Bug#75844)
Björn Bidar [Tue, 21 Jan 2025 23:28:22 +0000 (01:28 +0200)]
Add 'nnregistry-request-group' function for 'gnus-refer-article'
nnregistry doesn't handle any servers or groups; however we have to
define the dummy function so Gnus-registry works as refer article
method, as the `gnus-check-group-server' function requires it.
The latter function is called when referring to articles to check the
source group first before actually requesting any articles.
* lisp/gnus/nnregistry.el (nnregistry-request-group): New deffoo.
(Bug#22414)
Nicolas Despres [Sat, 21 Dec 2024 11:45:12 +0000 (12:45 +0100)]
Prioritize split along the longest edge by default.
Currently, `split-window-sensibly' prefers to try to split
vertically first, disregarding the actual shape of the frame
or the user preferences. This is a good default when Emacs
is taller than wider. However, when Emacs is in full-screen
(landscape screen layout), trying to split vertically may not
be what the user expected, since there is plenty of space
available on the right.
Typical scenario: Emacs is in landscape layout, one buffer is
open in a window covering the entire frame. Another buffer is
opened in a second window (C-x 4 f). Both splits are feasible
but users may prefer the horizontal one.
This patch preserves the behavior of the `split-height-threshold'
and `split-width-threshold' variables. Splitting continues not
to be permitted if the edge length is below the threshold.
* lisp/window.el (split-window-sensibly): First tried split
direction follows user preferences.
* etc/NEWS: Add an entry for new variable
`split-window-preferred-direction'.
* doc/emacs/windows.texi: Document new variable.
F. Jason Park [Sat, 8 Feb 2025 02:54:22 +0000 (18:54 -0800)]
; Make ERC test fixture more robust
* test/lisp/erc/erc-tests.el (erc-tests--assert-printed-in-subprocess):
Scan for sentinel before reading.
(erc--find-mode, erc--essential-hook-ordering): Use contrived :result
protocol expected by `erc-tests--assert-printed-in-subprocess'.
* test/lisp/erc/resources/erc-tests-common.el
(erc-tests-common-create-subprocess): Divert stderr to messages buffer.
F. Jason Park [Tue, 4 Feb 2025 14:11:50 +0000 (06:11 -0800)]
More clearly define local module behavior in ERC
* doc/misc/erc.texi (Modules): Label all local modules as being such.
Move `querypoll' to the auxiliary section. Rework entire "Local
Modules" portion.
* lisp/erc/erc-goodies.el (erc-keep-place-indicator-mode)
(erc-command-indicator-mode): Mention what buffer types they operate in.
* lisp/erc/erc-nicks.el (erc-nicks-mode): Mention the mode is enabled in
all buffers.
* lisp/erc/erc-notify.el (erc-querypoll-mode): Mention which buffers it
operates in.
* lisp/erc/erc-sasl.el (erc-sasl-mode): Disable completely in target
buffers so its mode variable is nil.
* lisp/erc/erc-services.el (erc-services-regain-mode): Disable in target
buffers.
* lisp/erc/erc.el (erc-open): When activating local modules, skip those
that have just been enabled by a fellow module. Do this even though
their setup code is meant to be idempotent.
* test/lisp/erc/erc-scenarios-base-local-modules.el
(erc-scenarios-base-local-modules--toggle-helpers): Revise to assert
current behavior. (Bug#57955)
João Távora [Fri, 7 Feb 2025 20:33:41 +0000 (20:33 +0000)]
Eglot: fix bug in eglot--lookup-mode
When lookup in eglot-server-programs fails, fall back to a
half-decent (((foo-mode . "foo")) . nil) return value. This
enables interactive M-x eglot for modes not yet registered in
e-s-p.
* lisp/progmodes/eglot.el (eglot--lookup-mode): Fallback when
lookup fails.
João Távora [Fri, 7 Feb 2025 11:08:29 +0000 (11:08 +0000)]
Eglot: add support for call and type hierarchies
* lisp/progmodes/eglot.el (eglot--lsp-interface-alist): Add new
interfaces.
(eglot-client-capabilities): Advertise support for callHierarchy
and typeHierarchy.
(eglot-ignored-server-capabilities): Add new providers.
(eglot--goto): New helper.
(eglot-menu): Add new menu items.
(eglot-handle-request window/showDocument): Use eglot--goto.
(button, tree-widget): Require them.
(eglot--hierarchy-item): New button type.
(eglot--hierarchy-interactive, eglot--hierarchy-children)
(eglot--hierarchy-label, eglot--hierarchy-1, eglot--hierarchy-2):
New internal functions.
(eglot--define-hierarchy-command): New macro.
(eglot-show-type-hierarchy, eglot-show-call-hierarchy)
(eglot-hierarchy-center-on-node): New commands.
(eglot--hierarchy-roots, eglot--hierarchy-specs): New local variables.
(eglot-hierarchy-label-map): New keymap.
(eglot-hierarchy-mode): New major mode.
* doc/misc/eglot.texi (Eglot Commands, Eglot Features): Describe
new feature.
* etc/EGLOT-NEWS (Changes in upcoming Eglot): Mention new feature.
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)