Martin Rudalics [Mon, 10 Feb 2025 09:58:05 +0000 (10:58 +0100)]
Implement tab line dragging with mouse (Bug#76084)
* lisp/mouse.el (mouse-drag-line): Allow tab line dragging if
there's a window above. Consider tab line height when
calculating 'position'. Add 'tab-line' binding to transient
map.
(mouse-drag-tab-line): Have it drag the tab line only (and not
the entire frame) when the tab line is between two windows.
Martin Rudalics [Mon, 10 Feb 2025 09:36:38 +0000 (10:36 +0100)]
Fix handling of visibility on tty frames (Bug#76031)
* src/frame.h (FRAME_REDISPLAY_P): Remove. Use the new function
frame_redisplay_p instead. Extern frame_redisplay_p.
* src/frame.c (frame_redisplay_p): New function to replace
FRAME_REDISPLAY_P macro.
(make_terminal_frame): Don't tinker with frame visibility and
don't make the new frame the terminal's top frame.
(do_switch_frame): Make sure frame switched to and any of its
ancestors are visible. Don't reset the visibility of other
frames.
(other_frames): Do not assume tty frames are by default visible.
(Fmake_frame_invisible): When making the selected tty frame
invisible, explicitly select the next visible frame.
* src/dispnew.c (Fredraw_display): Use frame_redisplay_p instead
of FRAME_REDISPLAY_P.
* src/xdisp.c (clear_garbaged_frames, echo_area_display)
(prepare_menu_bars, redisplay_internal, display_and_set_cursor)
(gui_clear_cursor): Use frame_redisplay_p instead of
FRAME_REDISPLAY_P.
* src/keyboard.c (tty_read_avail_input): When storing an event
and the selected frame is a child frame whose root is its
terminal's top frame, set the frame_or_window slot to the child
frame since otherwise the next switch frame event will select
the top frame instead.
* lisp/gnus/gnus-registry.el (gnus-registry-unload-function):
* lisp/gnus/spam-stat.el (spam-stat-unload-function):
* lisp/gnus/spam.el (spam-unload-function): ...to this. Don't set the
corresponding variables, always return nil, update callers, and leave
old name as obsolete function aliases.
Ref: https://lists.gnu.org/r/emacs-devel/2025-02/msg00294.html
Stefan Kangas [Sun, 9 Feb 2025 21:16:09 +0000 (22:16 +0100)]
Use unload-function instead of unload-hook in ert
* lisp/emacs-lisp/ert.el
(ert-unload-function): Rename from 'ert--unload-function'.
(ert--unload-function): Make into obsolete function alias for the above.
* lisp/textmodes/html-ts-mode.el (html-ts-mode--defun-name):
Get a grandchild 'tag_name' from 'element' that was already
defined by 'treesit-defun-type-regexp'.
(html-ts-mode--outline-predicate): New function.
(html-ts-mode): Add "comment" to the 'list' thing
in 'treesit-thing-settings'. Use "tag_name" and "attribute"
in 'sentence' to conform to sentence navigating arguments
in other ts-modes. Remove unnecessary heading
from 'treesit-simple-imenu-settings' and use "element"
supported by 'html-ts-mode--defun-name'.
Set 'treesit-outline-predicate' to 'html-ts-mode--outline-predicate'.
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--defun-name)
(yaml-ts-mode--outline-predicate): New functions.
(yaml-ts-mode): Set 'treesit-defun-type-regexp',
'treesit-defun-name-function', 'treesit-defun-tactic'.
Add 'sentence' to 'treesit-thing-settings'.
Set 'treesit-simple-imenu-settings' and 'treesit-outline-predicate'.
Use 'kill-local-variable' for 'forward-sexp-function'
and 'show-paren-data-function' instead of resetting their value.
* lisp/treesit.el (treesit-outline-search): Check for the thing
before the end of the line to support such case when the thing
fits on the current line and ends before the end of the line
such as e.g. '<h1>...</h1>' in html-ts-mode.
(treesit-hs-find-next-block, treesit-hs-inside-comment-p):
Use anchors for "\\`comment\\'" (bug#75609).
Put the property 'mode-class' with the value 'special' on the symbol
'diff-mode'. This fixes the case when 'view-read-only' is non-nil
by disabling activation of 'view-mode' that overrides single keys
from 'diff-mode-shared-map' (bug#75993).
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)