* src/gtkutil.h: Declare 'xg_set_gtk_theme_dark_mode',
'xg_update_dark_mode_for_all_displays',
'xg_set_initial_dark_mode'.
* src/gtkutil.c (xg_set_gtk_theme_dark_mode): Toggle PGTK dark mode.
(xg_update_dark_mode_for_all_displays): Toggle PGTK dark mode for all
displays.
(xg_set_initial_dark_mode): Determine PGTK dark mode preference and set.
(xg_create_frame_widgets): Set PGTK dark mode preference for widgets.
(xg_create_frame_outer_widgets): Set PGTK dark mode preference for outer
widgets.
* src/xsettings.h: Declare 'xg_get_system_dark_mode'.
* src/xsettings.c (something_changed_gsettingsCB): Update PGTK dark mode
setting.
(xg_get_system_dark_mode): Determine PGTK dark mode preference.
GSETTINGS_COLOR_SCHEME: Defined and set to "color-scheme".
* etc/NEWS: Document automatic dark mode toggling.
(Bug#79689)
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Use the 'read-key'
branch only when the variable 'y-or-n-p-use-read-key' is non-nil.
Add a new cond-branch to read from the minibuffer.
Add a special case when def is nil in a kmacro in batch mode (bug#67836).
* test/lisp/files-tests.el (files-tests--with-buffer-offer-save):
Let-bind 'y-or-n-p-use-read-key' to t.
* doc/lispref/commands.texi (Reading One Event): Mention
'read-char-choice-use-read-key'.
* lisp/emacs-lisp/rmc.el (rmc--show-help): Show non-selected
resized Help window at bottom. Inhibit useless message.
Remove unnecessary call to 'pop-to-buffer'.
(read-multiple-choice): Call 'read-multiple-choice--from-minibuffer'
when 'read-char-choice-use-read-key' is nil.
(read-multiple-choice--from-minibuffer): New function.
* test/lisp/emacs-lisp/rmc-tests.el (test-rmc--with-minibuffer-setup):
New macro.
(test-read-multiple-choice, test-read-multiple-choice-help):
Test both values of 'read-char-choice-use-read-key'.
* etc/ERC-NEWS: New section for ERC 5.6.2 and new entry mentioning
slight change in `erc-channel-user' accessor behavior.
* lisp/erc/erc-common.el (erc-channel-user): Change type for status slot
to natnum from integer.
* lisp/erc/erc.el (erc-channel-user-signal-if-status-unknown): New
variable.
(erc--define-channel-user-status-compat-getter): Only use fallback in
Non-ERC buffers because "obviously" a status flag is unusable if the
server doesn't advertise it or, rather, advertises nonsupport via its
absence. This regression was introduced in ERC 5.6.
(erc-channel-begin-receiving-names): Sharp-quote function name.
(erc--get-prefix-flag): Mention in doc that a return value of nil can
also mean the status flag is not supported by the server.
* test/lisp/erc/erc-tests.el (erc--parsed-prefix): Show that it returns
nil in a non-ERC buffer.
(erc-tests--make-combinations)
(erc-tests--with-channel-user-status-accessors): New functions.
(erc-channel-user/status-accessors/solo/default)
(erc-channel-user/status-accessors/solo/ov)
(erc-channel-user/status-accessors/multi/default)
(erc-channel-user/status-accessors/multi/ov): New tests.
(Bug#67220)
* src/xfaces.c (face_inheritance_cycle): New function.
(Finternal_set_lisp_face_attribute): Signal an error if the
':inherit' attribute of a face is modified in a way that will
cause it to inherit from itself. (Bug#79672)
* test/src/xfaces-tests.el (xfaces-test-circular-inheritance): New
test.
* etc/NEWS: Announce the incompatible change.
* lisp/window-x.el (merge-frames): Rewrite doc-string. Error out
when FRAME1 and FRAME2 are not distinct frames.
(split-frame): Rewrite doc-string. Use 'user-error' instead of
'error'.
* doc/lispref/windows.texi (Changing Window Layouts): Document
'split-frame' and 'merge-frames'.
* etc/NEWS: Announce 'split-frame' and 'merge-frames'.
Some global minor modes require initialization. Those that are preloaded
currently abuse `custom-initialize-delay` for that, but it's suboptimal
and doesn't help those that aren't preloaded.
So introduce a new function to fill that need.
While at it, make `define-globalized-minor-mode` use it
automatically when useful.
* lisp/custom.el (custom-initialize-after-file-load): New function.
* lisp/tooltip.el (tooltip-mode):
* lisp/paren.el (show-paren-mode):
* lisp/rfn-eshadow.el (file-name-shadow-mode):
* lisp/epa-hook.el (auto-encryption-mode):
* lisp/minibuffer.el (minibuffer-regexp-mode, minibuffer-nonselected-mode):
* lisp/electric.el (electric-indent-mode): Use it instead of
`custom-initialize-delay` since the value does not depend on the
runtime context.
(electric-quote-mode): Don't use `custom-initialize-delay` since
the default value is nil anyway.
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Automatically add `:initialize` if needed.
* lisp/emacs-lisp/eldoc.el (global-eldoc-mode): Remove `:initialize`,
now provided automatically.
* doc/lispref/customize.texi (Variable Definitions):
* doc/lispref/modes.texi (Defining Minor Modes): Document and Suggest
`custom-initialize-after-file-load` instead of `custom-initialize-delay`.
This fixes bug#79649. Creating duplicate names F<num> is
prevented, ensuring that select-frame-by-name is still
effective on text terminals.
* src/frame.c (frame_get, frame_next_F_name): New functions.
(make_terminal_frame): Use frame_next_F_name.
(set_term_frame_name): In place of disallowing F<num>, check
that the requested F<num> doesn't already exist.
* etc/NEWS (Frames): Add an entry for this amendment.
* doc/emacs/dired.texi (Dired Enter): Update documentation of
Dired's display and handling of file names that contain newlines.
Document new user option 'dired-auto-toggle-b-switch'.
* etc/NEWS: Announce new warning and new user option.
* lisp/dired.el (dired-auto-toggle-b-switch): New user option.
(dired-internal-noselect): Pop up a warning if the Dired listing
displays a literal newline.
(dired-switches-escape-p): Take the 'ls' switch
'--quoting-style=escape' into account.
(dired-mode): Add 'dired--toggle-b-switch' to 'post-command-hook'.
(dired-move-to-end-of-filename): When the Dired listing includes a
file name containing a newline, this can result in no change in
the 'dired-filename' text property on the last file name, so in
this case take the position just before the final newline as the
end of the last file name to prevent a wrong-type-argument error.
(dired--filename-with-newline-p, dired--remove-b-switch)
(dired--toggle-b-switch, dired--set-auto-toggle-b-switch)
(dired--display-filename-with-newline-warning): New functions.
* lisp/progmodes/flymake.el (flymake-indicator-type):
Change the default value from 'fringes' to 'auto'.
(flymake--resize-margins): Use margins when
'flymake-indicator-type' is 'auto', but fringes are no available.
(flymake--highlight-line): Use display condition '(when CONDITION . SPEC)'
that checks for 'window-fringes' at display time and switches
between fringes and margins (bug#77313).
The buffer-local-versions of 'window-buffer-change-functions',
'window-size-change-functions',
'window-selection-change-functions' and
'window-state-change-functions' are now run with the respective
buffer temporarily current. Also, the local version of
'window-buffer-change-functions' is run for the buffer removed
from the window too.
* src/window.c (run_window_change_functions_locally)
(run_window_change_functions_globally): New functions replacing
'run_window_change_functions_1'.
(run_window_change_functions): Run the buffer local versions of
these hooks in their respective buffers. Run
'window-buffer-change-functions' for the buffer removed from the
window too.
(Vwindow_buffer_change_functions, Vwindow_size_change_functions)
(Vwindow_selection_change_functions)
(Vwindow_state_change_functions): Mention that the buffer-local
versions are run with their buffer temporarily current.
* doc/lispref/windows.texi (Window Hooks): Mention that
buffer-local-versions of window change functions are run with
their buffer temporarily current. Also say that
'window-buffer-change-functions' will be run for removed buffer
too.
* etc/NEWS: Advertise changes for the buffer-local versions of
window change functions.
* lisp/vc/log-view.el (log-view-copy-revision-as-kill): Signal
user-error if there is no revision at point.
* doc/emacs/maintaining.texi (VC Change Log):
* etc/NEWS: Shorten docs for the new command.
We use gfm-view-mode to render Markdown before we hand over the string
to ElDoc (which usually put it in a 'special' mode "*eldoc*" buffer).
'gfm-view-mode' adds keymap text properties to make links clickable. It
also makes some of the markup invisible with a special 'invisible'
property value which is specific to 'gfm-view-mode'. We used to delete
the latter, therefore breaking the link-clicking. Simply resetting the
regions with non-nil 'invisible' to 't' instead of deleting them fixes
this. See also https://github.com/joaotavora/eglot/discussions/1238
* lisp/progmodes/eglot.el: Make invisible markup invisible
instead of deleting it.
* etc/EGLOT-NEWS: Mention bugfix.
Co-authored-by: João Távora <joaotavora@gmail.com>
* lisp/vc/vc.el (vc-kill-other-working-tree-buffers): New
command.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind it.
* doc/emacs/vc1-xtra.texi (Other Working Trees):
* etc/NEWS: Document it.
* lisp/progmodes/project.el (project-prompter)
(project-prompt-project-dir, project-prompt-project-name):
* lisp/vc/vc.el (vc--prompt-other-working-tree): New ALLOW-EMPTY
optional argument.
(delete-working-tree, move-working-tree): Specify that callers
must ensure DIRECTORY is not the current working tree.
(vc-delete-working-tree, vc-move-working-tree): Pass ALLOW-EMPTY
non-nil to vc--prompt-other-working-tree. Bind
'default-directory' to another working tree when operating on
the current working tree.
(vc-delete-working-tree): Extra prompt when asked to delete the
current working tree. When deleting the current working tree,
call 'bury-buffer' one or more times at the end.
* etc/NEWS: Rename 'global-hl-line-modes' to 'global-hl-line-buffers'
(bug#79481). Mention new default value of 'global-hl-line-buffers'
(bug#64993). Mention new value 'window' of 'global-hl-line-sticky-flag'
that is more useful than the value 'all' now removed from NEWS (bug#64993).
* lisp/hl-line.el (hl-line-nonselected): New face.
(global-hl-line-sticky-flag): Add the value 'window'.
(global-hl-line-buffers): Change the default value to exclude
the minibuffer and 'cursor-face-highlight-mode'.
(global-hl-line-mode): Handle the value 'window' of
'global-hl-line-sticky-flag'.
(global-hl-line-window-redisplay): New function.
* lisp/mail/rmail.el (rmail-detect-suspicious-headers): New user
option.
(rmail-check-suspicious-from): New function, highlights suspicious
"From" addresses.
(rmail-show-message-1): Call 'rmail-check-suspicious-from' if
'rmail-detect-suspicious-headers' is non-nil.
* lisp/mail/sendmail.el (mail-send): Detect suspicious addresses
before sending.
* etc/NEWS: Announce the new features.
* lisp/mouse.el (mouse-drag-line): Restore dragging in character
increments and make it the default (Bug#79351).
* etc/NEWS: Mention restored behavior of mouse line dragging.
This patch makes 'next-completion' and 'previous-completion' work
in the vertical completions format analogously to how they work in
the default horizontal format (bug#78959). It also fixes wrapping
in the vertical format and confines navigation (including
wrapping) in column-wise movement in the vertical format to the
current line, analogously to how navigation (including wrapping)
in line-wise movement in the horizontal format is confined to the
current column.
* doc/emacs/mini.texi (Completion): Fix several typos and improve
wording is several places.
(Completion Commands): Document navigation of the *Completions*
buffer in the vertical format. Document the difference between
format-sensitive movement and strictly column-wise or line-wise
movement. Document 'minibuffer-complete-and-exit' and update the
documentation of 'minibuffer-completion-auto-choose' and
'minibuffer-choose-completion'. Document the use of a numeric
prefix argument with the navigation commands.
(Completion Options): Rearrange and improve documentation of
'completions-sort', 'completions-format' and
'completion-auto-wrap', updating the latter to document the new
behavior.
* lisp/minibuffer.el (minibuffer-visible-completions-map): Rebind
"<left>" to 'minibuffer-previous-column-completion' and "<right>"
to 'minibuffer-next-column-completion'.
(minibuffer-next-completion): Add check for whether completions
format is vertical to decide whether to call
'next-line-completion' and replace calling 'next-completion' by
'next-column-completion'.
(minibuffer-next-column-completion)
(minibuffer-previous-column-completion): New commands.
* lisp/simple.el (completion-list-mode-map): Rebind "<left>" to
'previous-column-completion' and "<right>" to 'next-column-completion'.
(last-completion): Add handling for vertical completions format.
(completion--move-to-candidate-end): Always move point to the
position immediately after the last character of the completion
candidate. This unifies the behavior, simplifies the
implementation and facilitates implementing the improved
navigation of the *Completions* buffer.
(previous-column-completion, next-column-completion): New
commands, replacing the previous definitions of
'previous-completion' and 'next-completion' to reflect their
column-wise operation. Confine navigation (including wrapping) in
vertical format to the current line.
(previous-line-completion, next-line-completion): Implement
line-wise navigation (including wrapping) through all completions
in vertical format, not just those in the current column as in
horiztonal format. Update doc strings.
(next-completion, previous-completion): Redefine to call
'{next,previous}-line-completion' when completions format is
vertical and '{next,previous}-column-completion' otherwise.
* test/lisp/minibuffer-tests.el
(completions-format-navigation--tests): New function providing a
template to define tests of the navigation and wrapping behavior
with specified numbers of completion candidates.
(completions-format-navigation-test-{2,3,4,5,10,15,16}): New tests.
* lisp/net/browse-url.el (browse-url-keymap-filter)
(browse-url-keymap-bind): New functions.
(browse-url-button-map): Bind "C-c RET" to 'browse-url-button-open'
and rebind "RET" with the filter 'browse-url-keymap-bind'.
* lisp/ansi-osc.el (ansi-osc-hyperlink-map):
* lisp/net/goto-addr.el (goto-address-highlight-keymap):
* lisp/progmodes/bug-reference.el (bug-reference-map):
Bind "RET" with the filter 'browse-url-keymap-bind'.