]> git.eshelyaron.com Git - emacs.git/log
emacs.git
17 months agoSupport displaying function name in the header line
Spencer Baugh [Sun, 9 Jul 2023 16:16:28 +0000 (12:16 -0400)]
Support displaying function name in the header line

In some languages, the function name as displayed in the mode-line by
which-func-mode can be quite long.  It's useful to be able to display
it in the header-line instead.  Let's support that.

* lisp/progmodes/which-func.el (which-func-display)
(which-func--use-header-line, which-func--use-mode-line):
Add. (Bug#64533)
(which-func-try-to-enable): Support 'which-func--use-header-line'.
(which-func--disable): Add, to support 'which-func--use-header-line'.
(which-func-ff-hook, which-func-update-1): Use 'which-func--disable'.

17 months agoShow SHA-256 digest of a public key in 'nsm-format-certificate'
Łukasz Stelmach [Tue, 13 Jun 2023 11:26:39 +0000 (13:26 +0200)]
Show SHA-256 digest of a public key in 'nsm-format-certificate'

* lisp/net/nsm.el (nsm-format-certificate): Show public key
digest (SHA-256 if available).  Displaying the digest enables
users to verify the certificate with other tools like 'gnutls-cli'
which present much more detailed information.

* src/gnutls (emacs_gnutls_certificate_details): Export SHA-256
public key digest if supported by GnuTLS.  (Bug#64043)

17 months ago; * lisp/vc/ediff-wind.el: hush bytecomp warnings on non-X platforms
Mattias Engdegård [Fri, 14 Jul 2023 16:47:08 +0000 (18:47 +0200)]
; * lisp/vc/ediff-wind.el: hush bytecomp warnings on non-X platforms

17 months agoProvide backtrace for byte-ops car, cdr, setcar, setcdr, nth and elt
Mattias Engdegård [Fri, 14 Jul 2023 16:05:32 +0000 (18:05 +0200)]
Provide backtrace for byte-ops car, cdr, setcar, setcdr, nth and elt

Include calls to these primitives from byte-compiled code in
backtraces.  For nth and elt, not all errors are covered.
(Bug#64613)

* src/bytecode.c (exec_byte_code): Add error backtrace records for
car, cdr, setcar, setcdr, nth and elt.
* src/data.c (syms_of_data): Add missing defsyms for car, setcar,
setcdr, nth and elt.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--error-frame, bytecomp-tests--byte-op-error-cases)
(bytecomp--byte-op-error-backtrace): New test.

17 months agoFix misreporting of window top line
Po Lu [Fri, 14 Jul 2023 07:33:48 +0000 (15:33 +0800)]
Fix misreporting of window top line

* src/frame.h (FRAME_TOOL_BAR_TOP_LINES): Return tool_bar_lines,
not tool_bar_height.

17 months agoReorder NaN, INF paras
Paul Eggert [Fri, 14 Jul 2023 06:55:50 +0000 (23:55 -0700)]
Reorder NaN, INF paras

* doc/lispref/numbers.texi (Float Basics):
Reorder paragraphs so that examples follow defns.

17 months agoImprove doc for VAX reading NaN, INF
Paul Eggert [Fri, 14 Jul 2023 06:36:33 +0000 (23:36 -0700)]
Improve doc for VAX reading NaN, INF

* doc/lispref/numbers.texi (Float Basics): Improve description of
how Lisp reads infinities and NaNs on a VAX.

17 months agocl-print: Allow expanding the contents of hash-tables
Stefan Monnier [Fri, 14 Jul 2023 02:26:19 +0000 (22:26 -0400)]
cl-print: Allow expanding the contents of hash-tables

* lisp/emacs-lisp/cl-print.el (cl-print-object) <hash-table>:
Add an ellipsis.
(cl-print-object-contents) <hash-table>: New method.

17 months ago* lisp/emacs-lisp/backtrace.el (backtrace--change-button-skip): Typo)
Stefan Monnier [Fri, 14 Jul 2023 01:51:03 +0000 (21:51 -0400)]
* lisp/emacs-lisp/backtrace.el (backtrace--change-button-skip): Typo)

17 months agoDecouple keep-place-indicator from global ERC module
F. Jason Park [Thu, 13 Jul 2023 06:53:06 +0000 (23:53 -0700)]
Decouple keep-place-indicator from global ERC module

* etc/ERC-NEWS: Let users know that `keep-place-indicator' is a wholly
separate module from `keep-place'.
* lisp/erc/erc-goodies.el (erc-keep-place-indicator-setup): Perform
some housekeeping on `erc-keep-place-mode'.
(erc-keep-place-indicator-mode, erc-keep-place-indicator-enable,
erc-keep-place-indicator-disable): Take precautions to work around the
activation state of global module `keep-place', but no longer depend
on it.
(erc--keep-place-indicator-on-global-module): New function to ensure
`erc-keep-place' runs exactly once on `erc-insert-pre-hook',
regardless of whether module `keep-place' is active.
* test/lisp/erc/erc-goodies-tests.el
(erc-goodies-tests--assert-kp-indicator-on,
erc-goodies-tests--assert-kp-indicator-off,
erc-goodies-tests--kp-indicator-populate,
erc-goodies-tests--keep-place-indicator): New helper functions.
(erc-keep-place-indicator-mode,
erc-keep-place-indicator-mode--no-global): Factor out some common
logic and rename former to latter.
(erc-keep-place-indicator-mode--global): New test.  (Bug#59943)

17 months agoImprove walkthrough and sample config in ERC manual
F. Jason Park [Thu, 29 Jun 2023 14:12:46 +0000 (07:12 -0700)]
Improve walkthrough and sample config in ERC manual

* doc/misc/erc.texi: Improve "Sample Session" and "Sample
Configuration" sections.  Move introductory paragraph detailing the
history of official GNU IRC channels to the "History" chapter (from
"Sample Sessoin"), and leave a link in its place.  Silence strange
warning in "Getting Help and Reporting Bugs" about lack of punctuation
after xref.

17 months agoAdd mini modules bufbar and nickbar to ERC
F. Jason Park [Thu, 4 May 2023 07:01:11 +0000 (00:01 -0700)]
Add mini modules bufbar and nickbar to ERC

* doc/misc/erc.texi: Add `bufbar' and `nickbar' to known modules.
Also add `keep-place', which was missing, and remove `bbdb', which is
not part of ERC.  Add new section "Auxiliary Modules" for listing
experimental modules or those typically managed by some other feature.
* erc/ERC-NEWS: Mention new mini modules for libraries
erc-status-sidebar.el and erc-speedbar.el.
* lisp/erc/erc.el (erc-modules): Add `bufbar' and `nickbar' to
selection of offered modules.
* test/lisp/erc/erc-tests.el (erc-tests--modules): Add `bufbar' and
`nickbar'.  (Bug#63595)

17 months agoAdd erc-status-sidebar integration to erc-speedbar
F. Jason Park [Thu, 4 May 2023 07:01:11 +0000 (00:01 -0700)]
Add erc-status-sidebar integration to erc-speedbar

* lisp/erc/erc-speedbar.el: Require `erc-button' atop file and don't
bother loading `dframe', which `speedbar' handles for us.
(erc-speedbar): Explain that `nickbar' is the module for this group
and library for the benefit of those who run M-x customize-group.
(erc-speedbar-nicknames-window-width): New option.
(erc-speedbar-hide-mode-topic): New option determining whether to hide
the mode and topic.
(erc-speedbar-my-nick-face): New option for determining face to use
when displaying user's current nick.
(erc-speedbar-browser): Call `erc-install-speedbar-variables'
explicitly and remove top-level `with-eval-after-load'.
(erc-speedbar-insert-target): Add parenthesized channel count after
channel name in server and channel views.
(erc-speedbar-expand-channel): Hide mode and topic depending on option
`erc-speedbar-hide-mode-topic' and pass buffer to
`erc-speedbar-insert-user'.
(erc-speedbar--nick-face-function): New internal function-valued
variable.
(erc-speedbar--highlight-self-and-ops): New function to serve as
default value for `erc-speedbar--nick-face-function'.
(erc-speedbar--on-click): Dispatch `erc-nick-popup' after trimming
status chars.
(erc-speedbar-insert-user): Revise doc string.  Call
`erc-speedbar--nick-face-function' to determine face.  Change
token for both expansion and on-click text props.  Assign
`erc-speedbar--on-click' as the mouse handler for nick items.
(erc-speedbar--buffer-options): Variable to override options locally
in speedbar buffer.
(erc-speedbar--hidden-speedbar-frame): Add variable to hold original
`speedbar-frame' before spoofing by setting to selected frame
containing window showing ERC buffer.
(erc-speedbar--emulate-sidebar-set-window-preserve-size,
erc-speedbar--status-sidebar-mode--unhook): Add function
to ensure status sidebar is showing correctly and helper to
unregister from hook on teardown.
(erc-speedbar--emulate-sidebar): Add function to control sidebar
nicknames setup.
(erc-speedbar--toggle-nicknames-sidebar): Add toggle function
for speedbar or emulated sidebar.
(erc-speedbar--ensure): Add helper function to show speedbar if it's
hidden or create one if none exists.
(erc-nickbar-mode, erc-nickbar-enable, erc-nickbar-disable):
Add new mini module.
(erc-speedbar--dframe-controlled) Add function to overwrite
`speedbar-frame-mode' as `dframe-controlled' in speedbar buffer.
(erc-speedbar-toggle-nicknames-window-lock,
erc-speedbar-close-nicknames-window): Add commands to close speedbar
window and toggle its cyclability.
(erc-speedbar--compose-nicks-face): Add helper for nicks integration.
* test/lisp/erc/erc-scenarios-status-sidebar.el
(erc-scenarios-status-sidebar--nickbar): New test.  (Bug#63595)

17 months agoAdd preset styles to erc-status-sidebar
F. Jason Park [Thu, 4 May 2023 07:01:11 +0000 (00:01 -0700)]
Add preset styles to erc-status-sidebar

* lisp/erc/erc-networks.el (erc-networks--rename-server-buffer): Store
`erc-networks--id' in process object's plist.
* lisp/erc/erc-status-sidebar.el (erc-status-sidebar): Change group
parent from `convenience' to `erc'.
(erc-status-sidebar-channel-format): Mention in doc string that it
depends on new option `erc-status-sidebar-style'.
(erc-status-sidebar-highlight-active-buffer): New option to control
whether the current window's target is highlighted in the status bar.
(erc-status-sidebar-style): New option to determine whether servers
and queries also appear in the sidebar.
(erc-status-sidebar-click-display-action,
erc-status-sidebar-singular): New options.
(erc-status-sidebar-get-window): Consider
`erc-status-sidebar-singular'.
(erc-status-sidebar-open): Fix toggle functionality that somehow fell
through the cracks after the adoption of the package into ERC proper.
(erc-bufbar-mode, erc-bufbar-enable, erc-bufbar-disable): New module
named `bufbar' instead of `sidebar', which is more easily confusable
with `speedbar'.  The preferred name, `status-sidebar' was unavailable
because its minor-mode would have been `erc-status-sidebar-mode',
which is already taken by the major mode used for status-bar buffers
themselves.
(erc-status-sidebar-toggle): Ignore `erc-status-sidebar-singular'.
(erc-status-sidebar--trimpat, erc-status-sidebar--prechan): Add helper
vars for new sorting function, allowing it to honor the existing
interface, which only expects one argument.
(erc-status-sidebar-prefer-target-as-name): New function for
determining buffer name, preferring targets for target buffers.
(erc-status-sidebar-get-channame): Use internal API to help determine
name of buffer in sidebar.
(erc-status-sidebar-prefer-target-as-name,
erc-status-sidebar--show-disconnected,
erc-status-sidebar-all-target-buffers,
erc-status-sidebar-default-allsort): Add new naming and sorting
functions and associated helper functions and variables.
(erc-status-sidebar--active-marker,
erc-status-sidebar--set-active-line): New variable and function for
highlighting the active target in the status bar.
(erc-status-sidebar-default-insert,
erc-status-sidebar-pad-hierarchy): New functions for visiting various
stages of buffer modification when rendering sidebar.
(erc-status-sidebar-refresh): Consider presets and new options when
rendering sidebar.
(erc-status-sidebar-kill):  Disable `erc-bufbar-mode' when active.
(erc-status-sidebar-click): Appeal to option
`erc-status-sidebar-display-action' for `pop-to-buffer' action.
(erc-status-sidebar-scroll-up, erc-status-sidebar-scroll-down,
erc-status-sidebar-recenter): Add commands to scroll and
recenter sidebar from a target buffer's window.
(erc-status-sidebar-set-window-preserve-size): Ignore
`erc-status-sidebar-singular'.
(erc-status-sidebar-mode): Make non-interactive to avoid confusion
when folks run "M-x erc-status-sidebar-mode" expecting a module
toggle.
* test/lisp/erc/erc-scenarios-status-sidebar.el: New file.
* test/lisp/erc/resources/base/gapless-connect/foonet.eld: Fix wrong
manifest for channel and extend PASS timeout.  (Bug#63595)

17 months agoAllow ERC's module toggles access to the prefix arg
F. Jason Park [Mon, 15 May 2023 07:16:00 +0000 (00:16 -0700)]
Allow ERC's module toggles access to the prefix arg

* lisp/erc/erc-common.el (erc--module-toggle-prefix-arg): Add internal
variable for preserving the `arg' passed to a module's minor-mode
toggle, which was previously discarded.  Doing this lets modules that
are more interactive in nature overload their mode toggles with
alternate behaviors.
(define-erc-module): Bind `erc--module-toggle-prefix-arg' to the `arg'
parameter, which is normally defined inside a `define-minor-mode' body
form.
* test/lisp/erc/erc-tests.el (define-erc-module--global,
define-erc-module--local): Expect activation body to be wrapped by a
let form binding `erc--module-toggle-prefix-arg'.  (Bug#63595)

17 months agoFix buffer-mismatch bug in erc-scroll-to-bottom
F. Jason Park [Thu, 18 May 2023 02:48:02 +0000 (19:48 -0700)]
Fix buffer-mismatch bug in erc-scroll-to-bottom

* lisp/erc/erc-goodies.el (erc-scroll-to-bottom): Only `recenter' when
the selected window's buffer is current.  Previously, the module
`scrolltobottom' signaled an "Error in `post-command-hook'" when a
user clicked a channel indicator in the mode line from a window
showing another ERC buffer.
* lisp/erc/erc-track.el (erc-track--switch-fallback-blockers): New
internal variable used by `erc-track--switch-buffer' in deciding
whether to set `erc-track-last-non-erc-buffer' to the current buffer.
(erc-track--switch-buffer): Consult list of `buffer-match-p'
conditions in `erc-track--switch-fallback-blockers' to decide whether
to set `erc-track-last-non-erc-buffer' to the current buffer.
(Bug#63595)

17 months agoAdd module for colorizing nicknames to ERC
David Leatherman [Mon, 19 Dec 2022 03:01:40 +0000 (19:01 -0800)]
Add module for colorizing nicknames to ERC

* doc/misc/erc.texi: Add `nicks' to module lineup.
* etc/ERC-NEWS: Mention new module `nicks'.
* lisp/erc/erc-nicks.el: New file.
* lisp/erc/erc.el: (erc-modules): Add `nicks'.
* test/lisp/erc/erc-nicks-tests.el: New file.
* test/lisp/erc/erc-tests (erc-tests--modules): Add `nicks' to
inventory of available modules.  (Bug#63569)

Special thanks to Corwin Brust for doing much of the administrative
legwork to bring this addition to ERC.

Co-authored-by: Andy Stewart <lazycat.manatee@gmail.com>
Co-authored-by: F. Jason Park <jp@neverwas.me>
17 months agoAllow custom display-buffer actions in ERC
F. Jason Park [Wed, 31 May 2023 06:27:12 +0000 (23:27 -0700)]
Allow custom display-buffer actions in ERC

* doc/misc/erc.texi: Add new section under "Integrations" chapter
describing `display-buffer' Custom function choice for ERC's many
buffer-display options.
* etc/ERC-NEWS: Mention new function variant for all buffer-display
options.
* lisp/erc/erc-backend.el: Add forward declaration for
`erc--called-as-input-p' and `erc--display-context'.
(erc--server-reconnect-display-timer,
erc--server-last-reconnect-display-reset): Use new name for option
`erc-reconnect-display', now `erc-auto-reconnect-display'.
(erc--server-determine-join-display-context): New generic function to
determine value of `erc--display-context' during JOINs.
(erc-server-JOIN, erc-server-PRIVMSG): Set `erc--display-context' to a
symbol for the handler's IRC command, like `JOIN', for the benefit of
custom `display-buffer'-like functions running in `erc-setup-buffer'.
(erc-server-471, erc-server-471-functions, erc-server-473,
erc-server-473-functions): New handlers for JOIN rejections.  Also
remove 471 and 473 from comment at bottom of file.
(erc-server-475): Bind `erc--called-as-input-p' so that `erc-cmd-JOIN'
sets `erc-interactive-display' context.
* lisp/erc/erc-join.el (erc-autojoin-mode, erc-autojoin-enable,
erc-autojoin-disable): Kill local variable
`erc-join--requested-channels'.  Add and remove
`erc-join--remove-requested-channels' to/from various server-handler
hooks for JOIN rejection numerics.
(erc-join--requested-channels): New local variable to remember
channels we've attempted to JOIN this session that haven't yet been
confirmed by the server.
(erc-join--remove-requested-channel): New JOIN rejection handler to
stop tracking channel in `erc-join--requested-channels'.
(erc--server-determine-join-display-context): module-specific
implementation of generic function for `erc-autojoin-mode'.
(erc-autojoin--join): Remember channels slated for JOIN'ing.
* lisp/erc/erc.el (erc--buffer-display-choices): New helper constant
for defining common `:type' for all buffer-display options.
(erc-buffer-display, erc-interactive-display,
erc-auto-reconnect-display, erc-receive-query-display): Use helper
`erc--buffer-display-choices' for defining `:type', which
includes a new choice for a `display-buffer'-like function.
(erc-reconnect-display, erc-auto-reconnect-display): Alias former to
latter, now the preferred name.
(erc-reconnect-timeout, erc-auto-reconnect-timeout): Change name from
former to latter.  This option is new in ERC 5.6.
(erc-reconnect-display-server-buffers): New option.
(erc-buffer-do): Revise doc string.
(erc--display-context): New variable, an alist of "context tokens" to
be forwarded as the "action alist" to `erc-buffer-display' functions.
(erc-skip-displaying-selected-window-buffer): New variable, deprecated
at birth, to act as an escape hatch for folks who don't want to skip
the displaying of buffers already showing in the selected window.
(erc--display-buffer-overriding-action): Local variable allowing
modules to influence the displaying of new ERC buffers independently
of user options.
(erc-setup-buffer): Do nothing when the selected window already shows
current buffer unless user has provided a custom display function.
Accommodate new Custom choice function values, like `display-buffer'
and `pop-to-buffer'.
(erc-open): Run `erc-setup-buffer' when option
`erc-reconnect-display-server-buffers' is non-nil, even for existing
server buffers.  Bind `display-buffer-overriding-action' to the value
of `erc--display-buffer-overriding-action' around calls to
`erc-setup-buffer'.
(erc-select-read-args): Add `erc--display-context' to environment.
(erc, erc-tls): Bind `erc--display-context' around calls to
`erc-select-read-args' and main body.
(erc-cmd-JOIN, erc-cmd-QUERY, erc--cmd-reconnect, erc-handle-irc-url):
Add item for `erc-interactive-display' to `erc--display-context'.
(erc-connection-established): Update name of
`erc-reconnect-display-timeout' to
`erc-auto-reconnect-display-timeout'.
(erc-message-english-s471, erc-message-english-s473): New variables,
format templates for JOIN rejection messages.
* test/lisp/erc/erc-scenarios-base-buffer-display.el
(erc-scenarios-base-buffer-display--defwin-recbury-intbuf,
erc-scenarios-base-buffer-display--defwino-recbury-intbuf,
erc-scenarios-base-buffer-display--count-reset-timeout): Use preferred
name `erc-auto-reconnect-display' for `erc-reconnect-display'.
* test/lisp/erc/erc-scenarios-join-display-context.el: New file.
* test/lisp/erc/erc-tests.el (erc--initialize-markers): Fix
unrealistic call to `erc-open'.
(erc-setup-buffer--custom-action): New test.
(erc-select-read-args, erc-tls, erc--interactive, erc-server-select):
Expect new environment binding for `erc--display-context'.
* test/lisp/erc/resources/join/buffer-display/mode-context.eld: New
file.  (Bug#62833)

17 months agoOptionally combine faces in erc-display-message
F. Jason Park [Sun, 25 Jun 2023 01:33:20 +0000 (18:33 -0700)]
Optionally combine faces in erc-display-message

* etc/ERC-NEWS: Tell module authors that `erc-display-message' can now
combine faces.
* lisp/erc/erc-button.el (erc-button--display-error-notice-with-keys):
Ask `erc-display-message' to compose `erc-notice-face' and
`erc-error-face'.
* lisp/erc/erc-match.el (erc-hide-fools): Merge `invisible' prop
`erc-match' with existing, if present, and move body to helper for
hiding matched messages.
(erc-match--hide-message): New helper function to hide messages
regardless of match type.
* lisp/erc/erc-track.el: (erc-track-faces-priority-list): Note in doc
string that faces reserved for critical messages are always
prioritized.  Wrap :type declaration in macro helper to ensure
`erc-button' is loaded beforehand.  Otherwise calling `setopt' with
the option's default value fails.
(erc-track--attn-faces): Add new internal variable for faces that
should always appear in the mode line, at least in the default client.
(erc-track-modified-channels, erc-track-face-priority): Prepend
`erc-track--attn-faces' to `erc-track-faces-priority-list'.
* lisp/erc/erc.el (erc-send-action): Ask `erc-display-message' to
apply both `erc-input-face' and `erc-action-face' to messages.
(erc--compose-text-properties): New internal variable to act as flag
for altering behavior of `erc-put-text-property'.
(erc--merge-prop): New function copied from `erc-button-add-face' for
general internal use with any text property by all of ERC.
(erc-display-message-highlight): Set fallback face to
`erc-default-face' the symbol instead of the string.  For this to
break third-party code, callers would have to supply erroneous types
for nonexistent or undefined handlers and then explicitly check for
and depend on such misuse, which seems unlikely and therefore not
worth mentioning in etc/ERC-NEWS.
(erc-display-message): Explain how `type' param works when it's a
list.  Fix code in type-as-list branch so that it optionally combines
faces instead of clobbers them.
(erc-put-text-property): Unalias from `put-text-property', but fall
back to the latter unless caller wants to combine faces, in which case,
defer to `erc--merge-prop'.
* test/lisp/erc/erc-button-tests.el
(erc-button--display-error-notice-with-keys): Expect a combined "error
notice" face.  (Bug#64301)

17 months agoAdd text props for CTCP messages and speakers in ERC
F. Jason Park [Sun, 25 Jun 2023 01:33:20 +0000 (18:33 -0700)]
Add text props for CTCP messages and speakers in ERC

* etc/ERC-NEWS: Mention reduction in boldness of `erc-notice-face' and
`erc-action-face'.
* lisp/erc/erc-fill.el (erc-fill-spaced-commands,
erc-fill--spaced-commands): Rename former to latter and demote from
user option to internal variable.
(erc-fill): Change `erc-fill-spaced-commands' to
`erc-fill--spaced-commands'.
(erc-fill--wrap-continued-message-p): Use more precise `erc-ctcp' text
prop instead of face-based heuristic to detect CTCP ACTION message.
(erc-fill--wrap-action-dedent-p): New variable to toggle whether
`line-prefix' is applied to CTCP ACTION messages.  This exists less
to accommodate user preferences and more for third-party code that
assumes the first non-whitespace span in every message is a nick.
(erc-fill-wrap): Look for `erc-speaker' property before falling back
on word at point.  Use `erc-ctcp' to detect CTCP ACTION messages.
* lisp/erc/erc.el (erc-notice-face, erc-action-face): Prefer weight of
`semi-bold' when available so that buttonization is at least somewhat
perceptible in notices and action messages.
(erc-send-action): Ensure nickname passed to `erc-display-message' has
`erc-speaker' property and `erc-ctcp' ACTION property.
(erc--own-property-names): Add `erc-speaker' to lineup.
(erc-format-privmessage): Don't clobber `erc-nick-prefix-face'.  That
is, retain face applied to a leading stretch of characters in the
`nick' parameter, but continue to discard trailing faces.
(erc-format-my-nick, erc-ctcp-query-ACTION): Add new text property
`erc-speaker' to the nick portion of the formatted speaker label.  Do
this to assist modules, like `button' and `match', that currently
re-parse speakers in inserted messages.
(erc-process-ctcp-query): Add `erc-ctcp' property to entire message
before insertion hooks see it.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--compare): Warn
about certain unreliable comparisons if generalizing helper for use by
other modules.
* test/lisp/erc/erc-tests.el (erc-tests--equal-including-properties):
New helper compat macro.
(erc-format-privmessage): New test.  (Bug#64301)

17 months agoSimplify erc-button-add-nickname-buttons
F. Jason Park [Sat, 1 Jul 2023 06:42:01 +0000 (23:42 -0700)]
Simplify erc-button-add-nickname-buttons

* lisp/erc/erc-button.el (erc-button--nick): Remove `face' slot, which
was set to `erc-button-face' by default.  It's ignored when the button
is a nick and thus useless and misleading.
(erc-button-add-nickname-buttons): Rework and reflow for readability.
Don't bind or set `erc-button' face because it's ignored when dealing
with nicks.  Don't return the value of face options when calling a
`form' function because they can be nil in practice even though their
Custom type specs do not say so.
* lisp/erc/erc-common.el (erc--with-dependent-type-match): Add helper
macro for Custom :type defs that incur warnings from `setopt' due to
some missing dependency.  This occurs when specifying a :type of
`face' instead of `symbol' and the option's default value includes
faces from another library that hasn't been loaded.
* lisp/erc/erc.el (erc--get-speaker-bounds): New helper function to
retrieve bounds of a speaker label when present.
* test/lisp/erc/erc-tests.el (erc--with-dependent-type-match): Add
test.  (Bug#64301)

17 months agoRespect existing invisibility props in erc-stamp
F. Jason Park [Mon, 3 Jul 2023 03:58:37 +0000 (20:58 -0700)]
Respect existing invisibility props in erc-stamp

* etc/ERC-NEWS: mention `erc-match-toggle-hidden-fools' and new
merging behavior when handling `invisible' text property.
* lisp/erc/erc-match.el (erc-hide-fools): change `invisible' property
to `erc-match' for all messages, not just those with offset bounds.
(erc-match--modify-invisibility-spec): Fix error in doc string.
(erc-match-toggle-hidden-fools): New command.
* lisp/erc/erc-stamp.el (erc-stamp--invisible-property): Add new
internal variable to hold existing `invisible' property merged with
the one registered by this module, the non-namespaced `timestamp'.
(erc-stamp--skip-when-invisible): Add new internal variable, an escape
hatch for pre-ERC-5.6 behavior in which timestamps were not applied at
all to invisible messages.  This led to strange-looking, uneven logs,
and it prevented other modules from offering toggle functionality for
invisibility-spec members registered to them.
(erc-add-timestamp): Merge with existing `invisible' property, when
present, instead of clobbering, but only when escape hatch
`erc-stamp--skip-when-invisible' is nil.
(erc-insert-timestamp-left, erc-format-timestamp): Use possibly merged
`invisible' prop value.  Don't bother with `isearch-open-invisible',
which only affects overlays.
(erc-insert-timestamp-right): Bind `buffer-invisibility-spec' to nil
when figuring `current-column'.  Apply `invisible' text prop to white
space around stamp.
* test/lisp/erc/erc-scenarios-match.el: Require `erc-fill' and
`erc-stamp'.
(erc-scenarios-match--invisible-stamp): Move common setup and core
assertions for some stamp and invisibility-related tests into a
fixture-like helper.
(erc-scenarios-match--stamp-left-fools-invisible): Fix temporarily
disabled test and use fixture.
(erc-scenarios-match--find-eol): New helper.
(erc-scenarios-match--stamp-right-fools-invisible,
erc-scenarios-match--stamp-right-invisible-fill-wrap,
erc-scenarios-match--stamp-both-invisible-fill-static): New tests.
(Bug#64301)

17 months agoDeprecate erc-server-alist and erc-server-select
F. Jason Park [Thu, 29 Jun 2023 14:12:46 +0000 (07:12 -0700)]
Deprecate erc-server-alist and erc-server-select

* etc/ERC-NEWS: Announce deprecation of `erc-server-alist' and
`erc-server-select'.
* lisp/erc/erc-networks.el: Comment out call to `erc-get' at end of
file.
(erc-server-alist) Change shape to accommodate a fifth member: TLS
ports.  Add default TLS ports for Libera.Chat and OFTC.  Deprecate
option.
(erc-ports-list): Overload for internal use to accept a number instead
of a list, but don't advertise this fact.
(erc-networks--server-select): Convert `erc-server-select' into a
function that performs the same prompting but returns a full URL or a
host name instead of calling `erc'.
(erc-server-select): Move to erc.el.
* lisp/erc/erc.el (erc--prompt-for-server-functions): New variable to
allow callers of `erc-select-read-args' to affect how server-prompting
is handled without adding additional params.
(erc-select-read-args): Defer to `erc--prompt-for-server-function'
when non-nil.
(erc-server-select): New transplanted function, a deprecated, now
TSL-aware version of the old quirky entry point from erc-networks.el.
Reimplemented as a simple wrapper for `erc'.
* test/lisp/erc/erc-networks-tests.el (erc-ports-list): New test.
* test/lisp/erc/erc-tests.el (erc-server-select): New test.
(Bug#64478)

17 months agoFix command-line parsing regression in erc-cmd-DCC
F. Jason Park [Sat, 8 Jul 2023 04:27:03 +0000 (21:27 -0700)]
Fix command-line parsing regression in erc-cmd-DCC

* lisp/erc/erc-compat.el (erc-compat--28-split-string-shell-command,
erc-compat--split-string-shell-command): Remove unused function and
macro.
* lisp/erc/erc-dcc.el (erc-cmd-DCC): Use own arg-parsing function.
* lisp/erc/erc.el (erc--shell-parse-regexp,
erc--split-string-shell-cmd): New regexp constant and arg-parsing
function based on those in shell.el.
* test/lisp/erc/erc-dcc-tests.el
(erc-dcc-tests--erc-dcc-do-GET-command): Accept new `nuh' argument
representing message source/sender.
(erc-dcc-do-GET-command): Add tests for regression involving pipe
character.
* test/lisp/erc/erc-tests.el (erc--split-string-shell-cmd): New test.
(Bug#62444)

Thanks to Fernando de Morais for reporting this bug.

17 months agoUse 'emacs-lisp-compilation-mode' in native compilation buffers
Eli Zaretskii [Thu, 6 Jul 2023 08:50:41 +0000 (11:50 +0300)]
Use 'emacs-lisp-compilation-mode' in native compilation buffers

Re-install this commit 40492581f96, now that source of
the recursive-load has been fixed (bug#64494).

* lisp/emacs-lisp/comp.el (comp-log-to-buffer)
(comp-run-async-workers): Use 'emacs-lisp-compilation-mode' in the
buffers where we log the results of native compilation.  Suggested
by No Wayman <iarchivedmywholelife@gmail.com>.  (Bug#64452)

17 months agosrc/comp.c: Use `pending_funcalls` to fix bug#64494
Stefan Monnier [Fri, 14 Jul 2023 00:11:55 +0000 (20:11 -0400)]
src/comp.c: Use `pending_funcalls` to fix bug#64494

Make sure `comp.el` is never loaded synchronously by simply
delaying all calls to `native--compile-async` via `pending_funcalls`.

* lisp/startup.el (comp--compilable, comp--delayed-sources): Don't declare.
(startup--require-comp-safely)
(startup--honor-delayed-native-compilations): Delete functions.
(normal-top-level): Don't call `startup--honor-delayed-native-compilations`.

* src/comp.c (maybe_defer_native_compilation): Use `pending_funcalls`.
(syms_of_comp): Delete `Vcomp__delayed_sources` and `comp__compilable`.
Define `Qnative__compile_async`.

17 months agocl-print: Put buttons on ellipses
Stefan Monnier [Thu, 13 Jul 2023 23:00:51 +0000 (19:00 -0400)]
cl-print: Put buttons on ellipses

Currently, in *Backtrace* we have a nice behavior for cl-printed objects
where they're truncated by default to a manageable size but we can click
on the "..." to expand them when needed.

The patch below moves that functionality to `cl-print.el` such
that it can be enjoyed "everywhere" (bug#64536).  It also has the
benefit of simplifying the code since `backtrace.el` had to look for
ellipses in order to add buttons to them, whereas now we can put
the ellipses right when we write them.

* lisp/emacs-lisp/cl-print.el (cl-print-object-contents): Improve docstring.
(cl-print-expand-ellipsis-function): New var.
(cl-print--default-expand-ellipsis): New function.
(cl-print-expand-ellipsis): New command.
(cl-print-insert-ellipsis): Allow nil instead of 0 to mean "this elides
the whole object".
(cl-print-ellipsis): Move button type from `backtrace.el`.
(cl-print-propertize-ellipsis): Put a button.
(cl-print--expand-ellipsis): Rename from `cl-print-expand-ellipsis`.
(cl-print-to-string-with-limit): Allow new value t for `limit`.

* lisp/emacs-lisp/backtrace.el (backtrace--font-lock-keywords): Simplify.
(backtrace--match-ellipsis-in-string): Delete function.
(backtrace--change-button-skip): Adjust to new button type name.
(backtrace--expand-ellipsis): New function, extracted from
`backtrace-expand-ellipsis`.
(backtrace-expand-ellipsis): Delete function.
(backtrace-ellipsis): Move button type to `cl-print.el`.
(backtrace--print-to-string): Don't look for cl-print ellipses any more.
(backtrace-mode): Use `backtrace--expand-ellipsis`.

* lisp/ielm.el (ielm--expand-ellipsis): New function.
(inferior-emacs-lisp-mode): Use it to fill the data when expanded.

* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-check-ellipsis-expansion)
(cl-print-tests-check-ellipsis-expansion-rx): Adjust to new internal
function name.

17 months agoDon't recalculate the buffer basename inside uniquify
Spencer Baugh [Sun, 9 Jul 2023 14:24:33 +0000 (10:24 -0400)]
Don't recalculate the buffer basename inside uniquify

Previously, uniquify--create-file-buffer-advice would use the filename
of the buffer to calculate what the buffer's basename should be.  Now
that gets passed in from create-file-buffer, which lets us fix several
bugs:

1. before this patch, if a buffer happened to be named the same thing
as directory in its default-directory, the buffer would get renamed
with a directory separator according to uniquify-trailing-separator-p.

2. buffers with a leading space should get a leading |, as described
by create-file-buffer's docstring; before this patch, uniquify would
remove that leading |.

* lisp/dired.el (dired-internal-noselect): Pass a directory name to
create-file-buffer.
* lisp/files.el (create-file-buffer): Do uniquify-trailing-separator-p
handling if passed a directory filename. (bug#62732)
* lisp/uniquify.el (uniquify-item):
(uniquify-rationalize-file-buffer-names, uniquify-rationalize,
uniquify-get-proposed-name, uniquify-rationalize-conflicting-sublist):
Remove uniquify-trailing-separator-p handling.
(uniquify--create-file-buffer-advice): Take new basename argument and
use it, instead of recalculating the basename from the filename.

17 months agoPort NaN, infinity handling better to VAX
Paul Eggert [Thu, 13 Jul 2023 21:26:29 +0000 (14:26 -0700)]
Port NaN, infinity handling better to VAX

Nowadays .elc files routinely contain tokens like 1.0e+INF and
0.0e+NaN that do not work on antiques like the VAX that lack IEEE fp.
Port Emacs to these platforms, by treating infinities as extreme
values and NaNs as strings that trap if used numerically.
* src/lread.c (INFINITY): Default to HUGE_VAL if non-IEEE.
(not_a_number) [!IEEE_FLOATING_POINT]: New static array.
(syms_of_lread) [!IEEE_FLOATING_POINT]: Initialize it.
(read0): Report invalid syntax for +0.0e+NaN on platforms
that lack NaNs.
(string_to_number): On non-IEEE platforms, return HUGE_VAL
for infinity and a string for NaN.  All callers changed.

17 months ago* lisp/help-mode.el (help-setup-xref): Disable outline-minor-mode (bug#64575).
Juri Linkov [Thu, 13 Jul 2023 16:38:36 +0000 (19:38 +0300)]
* lisp/help-mode.el (help-setup-xref): Disable outline-minor-mode (bug#64575).

17 months agoFix flymake mode line scrolling with pixel-scroll-precision-mode
Spencer Baugh [Sun, 2 Jul 2023 21:49:23 +0000 (17:49 -0400)]
Fix flymake mode line scrolling with pixel-scroll-precision-mode

When pixel-scroll-precision-mode is enabled, scrolling the mouse
wheel will yield wheel-{up,down} events.  Flymake now binds the
new events in addition to the old mouse-wheel-{up,down}-event.

* lisp/progmodes/flymake.el:(flymake--mode-line-counter-scroll-prev)
(flymake--mode-line-counter-scroll-next)
flymake--mode-line-counter-map): New.
(flymake--mode-line-counter): Use new keymap and include
'flymake--diagnostic-type' as a property in the mode-line.
(Bug#64428)

17 months agoPrevent tex-shell buffer from reusing same window
Robert Pluim [Mon, 19 Jun 2023 15:31:25 +0000 (17:31 +0200)]
Prevent tex-shell buffer from reusing same window

* lisp/window.el (display-tex-shell-buffer-action): Add
'inhibit-same-window' to the default action.

17 months agoAutodetect coding system when yanking media
Robert Pluim [Thu, 22 Jun 2023 14:59:19 +0000 (16:59 +0200)]
Autodetect coding system when yanking media

Some browers send eg 'text/html' selections formatted as UTF-8, but
with a type of STRING, which actually means iso-latin-1.  Autodetect
the correct coding system to use by calling 'gui-get-selection'.

* lisp/yank-media.el (yank-media--get-selection): Call
'gui-get-selection' instead of 'gui-backend-get-selection'.

17 months ago; * lisp/progmodes/project.el (project-current): Doc fix.
Eshel Yaron [Sat, 24 Jun 2023 14:16:19 +0000 (17:16 +0300)]
; * lisp/progmodes/project.el (project-current): Doc fix.

Avoid saying that 'project-current' asks specifically for a
directory, as it can also ask for a project's directory by other
identifiers, such as the project's name, when 'project-prompter'
is set to a different value than the default
'project-prompt-project-dir'.  (Bug#64266)

17 months agoMinor correction to X error handling
Po Lu [Wed, 12 Jul 2023 10:07:53 +0000 (18:07 +0800)]
Minor correction to X error handling

* src/xterm.c (x_error_handler): Clear fail->selection_serial
after reporting an error during selection transfer, in case any
other outstanding requests within the protected section also
report errors.

17 months agoImprove commentary
Po Lu [Wed, 12 Jul 2023 10:04:03 +0000 (18:04 +0800)]
Improve commentary

* src/xterm.c (x_ignore_errors_for_next_request): Reword
description of SELECTION_SERIAL.

17 months agoEglot: fix advertisement of textDocument.codeAction.resolveSupport
João Távora [Wed, 12 Jul 2023 09:11:34 +0000 (10:11 +0100)]
Eglot: fix advertisement of textDocument.codeAction.resolveSupport

See https://github.com/joaotavora/eglot/issues/1255.

* lisp/progmodes/eglot.el (eglot-client-capabilities):
Use correct format for textDocument.codeAction.resolveSupport.

17 months ago; * doc/misc/eshell.texi (Invocation): Whitespace cleanup.
Michael Albinus [Tue, 11 Jul 2023 10:18:31 +0000 (12:18 +0200)]
; * doc/misc/eshell.texi (Invocation): Whitespace cleanup.

17 months agoFix Wrong type argument: consp, nil error
Bill Wohler [Tue, 11 Jul 2023 03:46:58 +0000 (20:46 -0700)]
Fix Wrong type argument: consp, nil error

* lisp/mh-e/mh-folder.el (mh-update-sequences): Add cur sequence when
missing

17 months agoFix mh-show-msg: Symbol’s value as variable is void: mh-mm-inline-media-tests
Bill Wohler [Tue, 11 Jul 2023 03:41:57 +0000 (20:41 -0700)]
Fix mh-show-msg: Symbol’s value as variable is void: mh-mm-inline-media-tests

* lisp/mh-e/mh-show.el: Require mh-mime

17 months agoEglot: add support for :codeAction/resolve
João Távora [Mon, 10 Jul 2023 23:09:08 +0000 (00:09 +0100)]
Eglot: add support for :codeAction/resolve

See https://github.com/emacs-grammarly/eglot-grammarly/issues/7.

* lisp/progmodes/eglot.el (eglot--lsp-interface-alist): Augment
CodeAction type.
(eglot-execute): Consider :codeAction/resolve
(eglot-client-capabilities): Advertise
textDocument.codeAction.resolveSupport

17 months agoAdd support for explicitly-remote commands in Eshell
Jim Porter [Sun, 9 Jul 2023 19:06:13 +0000 (12:06 -0700)]
Add support for explicitly-remote commands in Eshell

* lisp/files.el (file-remote-p):
* doc/lispref/files.texi (Magic File Names): Document 'never' for
CONNECTED argument.

* lisp/net/tramp.el (tramp-handle-file-remote-p): Handle CONNECTED
value of 'never'.

* lisp/eshell/esh-ext.el (eshell-explicit-remote-commands): New
option.
(eshell-ext-initialize): Apply 'eshell-handle-remote-command' when
requested.
(eshell-handle-remote-command): New function.
(eshell-remote-command): Reimplement this function and dispatch to
'eshell-external-command', which can handle remote processes on its
own.

* test/lisp/eshell/esh-ext-tests.el
(esh-ext-test/explicitly-remote-command)
(esh-ext-test/explicitly-local-command): New tests.

* doc/misc/eshell.texi (Remote Access): Document explicitly-remote
commands.

* etc/NEWS: Announce this change.

17 months agoAdd documentation about remote access in Eshell
Jim Porter [Sun, 9 Jul 2023 19:04:01 +0000 (12:04 -0700)]
Add documentation about remote access in Eshell

* doc/misc/eshell.texi
(Invocation): Mention the '*' prefix.
(Remote Access): New section...
(Commands): ... link to it.

17 months ago* lisp/progmodes/project.el (project-prompt-project-name): Fix order.
Juri Linkov [Mon, 10 Jul 2023 17:43:13 +0000 (20:43 +0300)]
* lisp/progmodes/project.el (project-prompt-project-name): Fix order.

Reverse choices in this recently added new command to follow exactly
the same order as in the old function 'project-prompt-project-dir'.

17 months agoFurther simplify configure-time locale testing
Paul Eggert [Mon, 10 Jul 2023 16:53:07 +0000 (09:53 -0700)]
Further simplify configure-time locale testing

* configure.ac (gl_STDLIB_H): Replace this, not gt_LOCALE_FR_UTF8,
as this lets us also omit MB_CUR_MAX checking that will never be
executed, and also lets us remove testing for ecvt, fcvt, gcvt
that Emacs doesn’t need.
(AC_C_RESTRICT): Invoke explicitly, as Emacs uses ‘restrict’
directly.  Also, simplifies the replacement for gl_STDLIB_H, which
would otherwise need to AC_REQUIRE AC_C_RESTRICT.
* lib/gnulib.mk.in: Regenerate via admin/merge-gnulib.

17 months agoAdapt Tramp test
Michael Albinus [Mon, 10 Jul 2023 16:11:24 +0000 (18:11 +0200)]
Adapt Tramp test

* test/lisp/net/tramp-tests.el (tramp-test33-environment-variables):
Adapt test.

17 months ago; * lisp/subr.el (with-demoted-errors): warning message typo
Mattias Engdegård [Mon, 10 Jul 2023 14:31:28 +0000 (16:31 +0200)]
; * lisp/subr.el (with-demoted-errors): warning message typo

17 months agoEglot: fix eglot--sig-info again
João Távora [Mon, 10 Jul 2023 13:06:42 +0000 (14:06 +0100)]
Eglot: fix eglot--sig-info again

See https://github.com/joaotavora/eglot/issues/1253

* lisp/progmodes/eglot.el (eglot--sig-info): Fall back to regexp
technique if no parameters or poor parameter information.

17 months agoEglot: fix eglot--sig-info
João Távora [Mon, 10 Jul 2023 12:09:48 +0000 (13:09 +0100)]
Eglot: fix eglot--sig-info

See https://github.com/joaotavora/eglot/issues/1253

* lisp/progmodes/eglot.el (eglot--sig-info): Fix.

17 months agoSimplify ‘configure’ check for MB_CUR_MAX
Paul Eggert [Sun, 9 Jul 2023 20:27:54 +0000 (13:27 -0700)]
Simplify ‘configure’ check for MB_CUR_MAX

* admin/merge-gnulib: Remove m4/locale-fr.m4.
* configure.ac (gt_LOCALE_FR_UTF8): Replace Gnulib’s
definition with a near no-op, as Emacs doesn’t care
about the Solaris 10 MB_CUR_MAX bug.
* lib/gnulib.mk.in: Regenerate.
* m4/locale-fr.m4: Remove; no longer needed due
to above changes.

17 months agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sun, 9 Jul 2023 20:05:01 +0000 (13:05 -0700)]
Update from Gnulib by running admin/merge-gnulib

17 months agocl-print.el: Reduce code duplication
Stefan Monnier [Sun, 9 Jul 2023 00:19:02 +0000 (20:19 -0400)]
cl-print.el: Reduce code duplication

While at it, fix a bug in `cl-print-object-contents` for strings,
where we forgot to pass `stream` to `princ` at one place and simplify
a `substring` call using a negative offset.

* lisp/emacs-lisp/cl-print.el (cl-print--cons-tail)
(cl-print--vector-contents, cl-print--struct-contents)
(cl-print--string-props): New functions, extracted from
`cl-print-object-contents`.
(cl-print-object, cl-print-object-contents): Use them.

17 months ago; Re-add recently removed comment in cyrillic.el.
Basil L. Contovounesios [Sat, 8 Jul 2023 21:27:20 +0000 (22:27 +0100)]
; Re-add recently removed comment in cyrillic.el.

https://lists.gnu.org/r/emacs-devel/2023-07/msg00303.html

17 months agoAdd special '$GID' variable in Eshell
Jim Porter [Sat, 8 Jul 2023 06:18:33 +0000 (23:18 -0700)]
Add special '$GID' variable in Eshell

See bug#64529.

* lisp/eshell/esh-var.el (eshell-variable-aliases-list): Add '$GID'.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/gid-var): New test.

* doc/misc/eshell.texi (Variables): Document '$GID'.

* etc/NEWS: Announce this change (and the previous change for '$UID').

17 months ago; * doc/misc/eshell.texi: Fix last change.
Jim Porter [Sat, 8 Jul 2023 19:13:22 +0000 (12:13 -0700)]
; * doc/misc/eshell.texi: Fix last change.

17 months agopp-fill: Fix missing indentation in some cases
Stefan Monnier [Sat, 8 Jul 2023 19:10:23 +0000 (15:10 -0400)]
pp-fill: Fix missing indentation in some cases

* lisp/emacs-lisp/pp.el (pp-fill): Improve handling of char-tables.
(pp-buffer): Improve backward compatibility.

17 months ago* lisp/menu-bar.el (menu-bar-search-options-menu): Don't quote lambdas
Stefan Monnier [Sat, 8 Jul 2023 19:08:10 +0000 (15:08 -0400)]
* lisp/menu-bar.el (menu-bar-search-options-menu): Don't quote lambdas

Expose the commands to the compiler.

17 months ago; Simplify last change to cyrillic.el.
Basil L. Contovounesios [Sat, 8 Jul 2023 16:50:43 +0000 (17:50 +0100)]
; Simplify last change to cyrillic.el.

https://lists.gnu.org/r/emacs-devel/2023-07/msg00297.html

17 months ago; * test/lisp/shell-tests.el: Add tests for shell-dirtrack-mode (bug#64311)
Vladimir Sedach [Tue, 27 Jun 2023 04:30:25 +0000 (22:30 -0600)]
; * test/lisp/shell-tests.el: Add tests for shell-dirtrack-mode (bug#64311)

17 months agoMinor tree-sitter cleanups
Basil L. Contovounesios [Sat, 3 Jun 2023 10:25:05 +0000 (11:25 +0100)]
Minor tree-sitter cleanups

* lisp/treesit.el (treesit-fontify-with-override): Fix docstring
grammar.  Remove redundant precondition (bug#64052).
* src/treesit.c (Ftreesit_parser_set_included_ranges): Fix typo in
commentary.
(treesit_predicate_equal, treesit_predicate_match)
(treesit_predicate_pred): Avoid fixnum roundtrip by using
list_length in place of Flength.  Make error messages more accurate.
(treesit_eval_predicates): Quote predicate names in error message.

17 months agoMinor search_buffer cleanup
Basil L. Contovounesios [Sat, 3 Jun 2023 13:46:19 +0000 (14:46 +0100)]
Minor search_buffer cleanup

* src/search.c: Move commentary that used to precede search_buffer
to that location once more.  Update it for the current arglist.
(search_command, search_buffer_non_re, search_buffer):
* src/lisp.h (search_buffer): Turn RE flag/argument from an int into
a bool.  All callers changed (bug#64049).

17 months ago; Fix last change to lisp/language/cyrillic.el.
Basil L. Contovounesios [Sat, 8 Jul 2023 15:24:15 +0000 (16:24 +0100)]
; Fix last change to lisp/language/cyrillic.el.

For discussion, see the following emacs-devel thread:
https://lists.gnu.org/r/emacs-devel/2023-07/msg00221.html

17 months agoRearrange setting date and modes in Tramp
Michael Albinus [Sat, 8 Jul 2023 14:48:20 +0000 (16:48 +0200)]
Rearrange setting date and modes in Tramp

* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): Set date
and modes if appropriate.
(tramp-do-copy-or-rename-file-via-buffer)
(tramp-do-copy-or-rename-file-directly)
(tramp-do-copy-or-rename-file-out-of-band): Do not set date and modes.

17 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sat, 8 Jul 2023 13:43:37 +0000 (16:43 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

17 months agoFix condition-case-unless-debug with :success
Basil L. Contovounesios [Mon, 3 Jul 2023 09:10:47 +0000 (10:10 +0100)]
Fix condition-case-unless-debug with :success

* lisp/subr.el (condition-case-unless-debug): Don't add debug
condition to :success handler (bug#64404).
* test/lisp/subr-tests.el (condition-case-unless-debug)
(condition-case-unless-debug-success): New tests.

17 months agoMention minibuffer-next-completion in completion-help
Spencer Baugh [Mon, 3 Jul 2023 13:59:04 +0000 (09:59 -0400)]
Mention minibuffer-next-completion in completion-help

Now that it's not necessary to switch to the *Completions* buffer to
switch between and choose completions, we should make that clear in
the help text.  Let's also make the bindings uniform both in and
outside the *Completions* buffer so users don't have to think about
the difference.

In working with new users, they've assumed that since the help text in
*Completions* says "Click on a completion to select it", that that's
the only way to select a completion.  This text should help clarify
that.

* doc/emacs/mini.texi (Completion Commands): Document new bindings.
* lisp/simple.el (completion-list-mode-map): Bind
minibuffer-{next,previous,choose}-completion.
(completion-setup-function): Mention bindings for
minibuffer-{next,previous,choose}-completion. (Bug#64425)

17 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 8 Jul 2023 09:46:10 +0000 (05:46 -0400)]
Merge from origin/emacs-29

600b90ed568 Mark failing icalendar test as unstable (bug#56241)
f8a918c9778 ; * src/coding.c (Fcoding_system_put): Improve doc string.
40f84e906f6 ; * doc/lispref/keymaps.texi (Key Binding Commands): Fix ...
502a7800319 ; Improve documentation of 'vertical-motion' in ELisp manual
0d90873fa41 ; * src/indent.c (Fvertical_motion): Doc fix.
9b38773a20b ; * lisp/dired.el (dired-no-confirm): Doc fix.  (Bug#64493)
a30ebe7a556 ; Improve documentation of key-binding commands
c3fefb2b3ae Improve natnump shortdoc
244d4c837ab correct info documentation of benchmark-call
67def1f5502 * lisp/progmodes/grep.el (rgrep): Fix docstring.
8da2091362d ; Fix documentation of minibuffer-completion commands
aa030698cef ; Fix typos in documented names of keymap-* functions
a9b46bb25df Include a help-echo for flymake's modeline counters
37ed3d15f38 Avoid errors in completion due to 'completion-regexp-list'
15ff8761777 ; * lisp/register.el (register-val-describe): Doc fix.
fe7b909c16c ; Fix two typos in recent changes in the manual
7a74b8c3277 C Mode: Don't fontify foo globally as type due to "struct...
823bf6bdb1a * lisp/rect.el (rectangle--duplicate-right): Fix rectangl...
e339d0080d3 ; * test/lisp/misc-tests.el (ert): require misc to avoid ...

# Conflicts:
# lisp/rect.el

17 months agoFix 'toggle-side-windows' with 3 or more side windows
Martin Rudalics [Fri, 7 Jul 2023 13:56:22 +0000 (15:56 +0200)]
Fix 'toggle-side-windows' with 3 or more side windows

* lisp/window.el (window--state-put-1): Consider
'window-combined-p' when determining 'window-combination-limit'.
(window-state-put): Bind 'window-combination-limit' and
'window-combination-resize' to nil.  (Bug#64405)

17 months ago; Fix last change.
Eli Zaretskii [Sat, 8 Jul 2023 08:48:12 +0000 (11:48 +0300)]
; Fix last change.

17 months ago* etc/NEWS: Document changes to coding-system mnemonics.
Eli Zaretskii [Sat, 8 Jul 2023 08:47:32 +0000 (11:47 +0300)]
* etc/NEWS: Document changes to coding-system mnemonics.

17 months agoDisambiguate mode line indication for utf-8 and utf-16
Ulrich Müller [Thu, 6 Jul 2023 18:36:09 +0000 (20:36 +0200)]
Disambiguate mode line indication for utf-8 and utf-16

* lisp/international/mule-conf.el (utf-7):
* lisp/language/cyrillic.el (koi8-u): Change mnemonic letters to
?u and ?\N{cyrillic capital letter u}, respectively.

17 months agoFix 'shell-dirtrack-mode' showing as enabled in unrelated buffers
Vladimir Sedach [Tue, 27 Jun 2023 04:32:07 +0000 (22:32 -0600)]
Fix 'shell-dirtrack-mode' showing as enabled in unrelated buffers

* lisp/shell.el (shell-dirtrack-mode): Reverse the alias.
(shell-dirtrack-mode): Move before first use of the variable.  Add
:interactive keyword.
(shell-directory-tracker, shell-cd): Use 'shell-dirtrack-mode'
instead of 'shell-dirtrackp'.  (Bug#64311)

17 months agoAvoid aborts when trying to 'read' sub-char-tables
Stefan Monnier [Tue, 4 Jul 2023 23:58:12 +0000 (19:58 -0400)]
Avoid aborts when trying to 'read' sub-char-tables

* src/data.c (Ftype_of): Support 'sub-char-table'.  (Bug#64450)
* src/lisp.h: Fix commentary of char-table.

17 months ago; * doc/misc/eshell.texi: Fix typos and clean up unclear wording.
Jim Porter [Sat, 8 Jul 2023 01:19:08 +0000 (18:19 -0700)]
; * doc/misc/eshell.texi: Fix typos and clean up unclear wording.

17 months agoDocument some missing Eshell commands
Jim Porter [Sat, 8 Jul 2023 00:30:26 +0000 (17:30 -0700)]
Document some missing Eshell commands

* doc/misc/eshell.texi (Built-ins): Document 'eshell-debug'.
(Extra built-in commands): Document 'count', 'ff', and 'gf'.

17 months ago* lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Fix bug#64232
Stefan Monnier [Fri, 7 Jul 2023 16:09:50 +0000 (12:09 -0400)]
* lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Fix bug#64232

17 months agoMark failing icalendar test as unstable (bug#56241)
Mattias Engdegård [Fri, 7 Jul 2023 12:40:37 +0000 (14:40 +0200)]
Mark failing icalendar test as unstable (bug#56241)

* test/lisp/calendar/icalendar-tests.el
(icalendar-export-bug-56241-dotted-pair):
This test started failing early July 2023 in multiple branches at
once without any change to the code and is likely sensitive to the
current date.  Tag it to keep it quiet for now.

17 months ago; * src/coding.c (Fcoding_system_put): Improve doc string.
Eli Zaretskii [Fri, 7 Jul 2023 07:29:55 +0000 (10:29 +0300)]
; * src/coding.c (Fcoding_system_put): Improve doc string.

17 months ago* lisp/tab-bar.el: Fix tab-bar-tab-name-current for active minibuffer.
Juri Linkov [Fri, 7 Jul 2023 07:18:43 +0000 (10:18 +0300)]
* lisp/tab-bar.el: Fix tab-bar-tab-name-current for active minibuffer.

(tab-bar-tab-name-current): Use get-mru-window in the active minibuffer
when minibuffer-selected-window is nil after switching to another tab.
(tab-bar-tab-name-current-with-count)
(tab-bar-tab-name-truncated): Use tab-bar-tab-name-current.

17 months ago; * doc/lispref/keymaps.texi (Key Binding Commands): Fix typo.
Eli Zaretskii [Fri, 7 Jul 2023 06:59:52 +0000 (09:59 +0300)]
; * doc/lispref/keymaps.texi (Key Binding Commands): Fix typo.

17 months ago* lisp/tab-bar.el: Improve tab-bar-minibuffer-restore-tab (bug#64373).
Juri Linkov [Fri, 7 Jul 2023 06:33:56 +0000 (09:33 +0300)]
* lisp/tab-bar.el: Improve tab-bar-minibuffer-restore-tab (bug#64373).

(tab-bar-select-tab): Set tab-bar-minibuffer-restore-tab and
minibuffer-exit-hook minibuffer-locally to handle recursive minibuffers
for non-nil read-minibuffer-restore-windows.
(tab-bar-minibuffer-restore-tab): No need to reset minibuffer-local values.

17 months ago; Improve documentation of 'vertical-motion' in ELisp manual
Eli Zaretskii [Fri, 7 Jul 2023 06:26:58 +0000 (09:26 +0300)]
; Improve documentation of 'vertical-motion' in ELisp manual

* doc/lispref/positions.texi (Screen Lines): Improve the
documentation of 'vertical-motion'.

17 months ago; * src/indent.c (Fvertical_motion): Doc fix.
Eli Zaretskii [Fri, 7 Jul 2023 06:16:12 +0000 (09:16 +0300)]
; * src/indent.c (Fvertical_motion): Doc fix.

17 months ago; cperl-mode: Refine syntax of attributes
Harald Jörg [Thu, 6 Jul 2023 15:29:42 +0000 (17:29 +0200)]
; cperl-mode: Refine syntax of attributes

Attributes may start with underscore, and must be separated.
Thanks to Mattias Engdegård for pointing out a regex mistake.

* lisp/progmodes/cperl-mode.el (defconst): Fix bad grouping and
allow attributes to start with an underscore in
cperl--single-attribute-rx.  Adjust cperl--attribute-list-rx
accordingly.
(cperl-find-sub-attrs): Allow attributes to start with an underscore.

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-attribute-list-rx): Add new test cases for valid and
invalid attribute lists.

17 months agoRevert "Use 'emacs-lisp-compilation-mode' in native compilation buffers"
Eli Zaretskii [Thu, 6 Jul 2023 15:00:05 +0000 (18:00 +0300)]
Revert "Use 'emacs-lisp-compilation-mode' in native compilation buffers"

This reverts commit 40492581f96626e405e4b453456b8c9b83822c97.
It caused a recursive-load error when native-compiling files.
(Bug#64391)

17 months ago; * lisp/dired.el (dired-no-confirm): Doc fix. (Bug#64493)
Eli Zaretskii [Thu, 6 Jul 2023 10:12:21 +0000 (13:12 +0300)]
; * lisp/dired.el (dired-no-confirm): Doc fix.  (Bug#64493)

17 months agoUse 'emacs-lisp-compilation-mode' in native compilation buffers
Eli Zaretskii [Thu, 6 Jul 2023 08:50:41 +0000 (11:50 +0300)]
Use 'emacs-lisp-compilation-mode' in native compilation buffers

* lisp/emacs-lisp/comp.el (comp-log-to-buffer)
(comp-run-async-workers): Use 'emacs-lisp-compilation-mode' in the
buffers where we log the results of native compilation.  Suggested
by No Wayman <iarchivedmywholelife@gmail.com>.  (Bug#64452)

17 months ago; Improve documentation of key-binding commands
Eli Zaretskii [Thu, 6 Jul 2023 08:42:01 +0000 (11:42 +0300)]
; Improve documentation of key-binding commands

* doc/lispref/keymaps.texi (Key Binding Commands): Improve the
documentation of arguments expected by key binding commands.

* lisp/keymap.el (keymap-set, keymap-global-set)
(keymap-local-set, keymap-global-unset, keymap-local-unset)
(keymap-unset, key-parse): Doc fixes.

17 months ago; * etc/NEWS: News entry for previous change (bug#62164).
Spencer Baugh [Fri, 7 Apr 2023 21:54:06 +0000 (17:54 -0400)]
; * etc/NEWS: News entry for previous change (bug#62164).

17 months agoAllow floating the ediff control frame under X
Spencer Baugh [Fri, 7 Apr 2023 21:54:06 +0000 (17:54 -0400)]
Allow floating the ediff control frame under X

This is a step in the direction of making ediff behave better by
default under tiling window managers and fixing Bug#62164.

* lisp/vc/ediff-wind.el (ediff-floating-control-frame): Add
defcustom.
(ediff-frame-make-utility, ediff-setup-control-frame): Allow setting
the control frame up as a utility window under X.  (Bug#62164)

17 months ago; * etc/NEWS: Fix punctuation and whitespace of last added entry.
Eli Zaretskii [Thu, 6 Jul 2023 07:33:43 +0000 (10:33 +0300)]
; * etc/NEWS: Fix punctuation and whitespace of last added entry.

17 months agoSupport right-align in mode-line
Hugo Heagren [Sat, 1 Apr 2023 21:27:25 +0000 (22:27 +0100)]
Support right-align in mode-line

* lisp/bindings.el (mode-line-right-align-edge):  New custom
variable, controls where `mode-line-format-right-align' should
align to.
(mode-line-format-right-align):  New function.  If the symbol
`mode-line-format-right-align' appears in `mode-line-format',
then return return a padding string which aligns everything
after that symbol to the right.  Padding width is altered with
the display property and depends on the value of
`mode-line-right-align-edge'.
(mode-line-format-right-align):  New variable.  Convenience
definition for including right alignment in `mode-line-format'.
* doc/lispref/modes.texi (Mode Line Variables):  Document new
alignment functionality and user option.  (Bug#62606)

17 months agoImprove Python imports management commands
Matthias Meulien [Sat, 1 Jul 2023 20:12:43 +0000 (22:12 +0200)]
Improve Python imports management commands

* lisp/progmodes/python.el (python--list-imports): Handle import
errors.
(python--do-isort): Specialize error message.  (Bug#64406)

17 months agoFix target-async and background execution in gdb-mi.el
Wang Diancheng [Fri, 30 Jun 2023 07:08:18 +0000 (15:08 +0800)]
Fix target-async and background execution in gdb-mi.el

* lisp/progmodes/gdb-mi.el (gdb-target-async-checked): New
variable.
(gdb-non-stop-setting): Change the value back to default to
non-nil on systems other than MS-Windows.
(gdb-non-stop-handler): Try to set mi-async first, falling back to
target-async by calling 'gdb-set-mi-async-handler'.
(gdb-set-mi-async-handler, gdb-try-check-target-async-support):
New functions.
(gdb-check-target-async): Set 'gdb-non-stop' here...
(gdb-starting): ...and here.
(gdb-stopped): Call 'gdb-try-check-target-async-support' when the
program stops for the first time.  (Bug#64186)  (Bug#63084)

Copyright-paperwork-exempt: yes

17 months ago; fix last change
Mattias Engdegård [Wed, 5 Jul 2023 17:42:05 +0000 (19:42 +0200)]
; fix last change

* lisp/language/tibetan.el (tibetan-regexp, tibetan-precomposed-regexp)
(tibetan-precomposition-rule-regexp):
Don't use regexp-opt after all since it breaks bootstrapping.

17 months agoImprove some big regexps
Mattias Engdegård [Wed, 5 Jul 2023 13:25:30 +0000 (15:25 +0200)]
Improve some big regexps

* lisp/language/lao-util.el (lao-transcription-pattern):
Remove duplicate definition.
* lisp/language/tibetan.el (tibetan-regexp, tibetan-precomposed-regexp)
(tibetan-precomposition-rule-regexp): Use regexp-opt.

17 months ago* lisp/tab-bar.el: Restore the original tab where minibuffer was activated.
Juri Linkov [Wed, 5 Jul 2023 17:20:48 +0000 (20:20 +0300)]
* lisp/tab-bar.el: Restore the original tab where minibuffer was activated.

(tab-bar-minibuffer-restore-tab): New variable and function.
(tab-bar-select-tab): Use them (bug#64373).

17 months ago* lisp/emacs-lisp/syntax.el (syntax-propertize-rules): Fix bug#64459
Stefan Monnier [Wed, 5 Jul 2023 15:37:28 +0000 (11:37 -0400)]
* lisp/emacs-lisp/syntax.el (syntax-propertize-rules): Fix bug#64459

17 months agoAdapt information about Tramp's temporary directory
Michael Albinus [Wed, 5 Jul 2023 14:19:23 +0000 (16:19 +0200)]
Adapt information about Tramp's temporary directory

* doc/misc/tramp.texi (Overview): Use scp in the example.
(FUSE-based methods): Move information about mount point to node
"FUSE setup".
(Overview, Predefined connection information, FUSE setup)
(Traces and Profiles): Refer to node "Temporary directory".
(Frequently Asked Questions): Move information about temporary
directory to node "Temporary directory".
(Temporary directory): New node.
(Top, Files directories and localnames): Add it to @menu.

17 months ago* test/lisp/net/tramp-tests.el (tramp-test49-unload): Extend test.
Michael Albinus [Wed, 5 Jul 2023 09:33:57 +0000 (11:33 +0200)]
* test/lisp/net/tramp-tests.el (tramp-test49-unload): Extend test.