1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00
Commit Graph

169263 Commits

Author SHA1 Message Date
Po Lu
4c9f9dbd50 Revert "Update etc/rgb.txt from X.Org upstream"
This reverts commit 11f10dc0d0.

* etc/rgb.txt: Restore X11R6.6 version, where non-portable color
names are absent.
2023-10-16 08:56:53 +08:00
Sam Steingold
3e23238735 Fixup for "no file modes on windows and dos"
* lisp/ls-lisp.el (ls-lisp-format): Keep the first group of
permissions even when `modes' is not in `ls-lisp-verbosity'.
2023-10-15 11:51:34 -04:00
Alan Mackenzie
a0cd986e67 c-indent-new-comment-line: don't test for a macro in a comment
This fixes bug#9860.

* lisp/progmodes/cc-cmds (c-indent-new-comment-line): Test for
a comment/string before testing for a macro, thus preventing a
"macro" being spuriously recognized in a comment.  This allows
auto-fill-mode to work on a line beginning with # in a comment.
2023-10-15 10:54:23 +00:00
Gerd Möllmann
98748aa6e6 ; New command alias xprint for LLDB 2023-10-15 09:40:24 +02:00
Po Lu
47ddff8ae8 ; Correct typos in android.texi
* doc/emacs/android.texi (Android Environment): Correct typos.
2023-10-15 15:02:43 +08:00
Po Lu
93104cff53 Correctly receive files through Android DND
* java/org/gnu/emacs/EmacsService.java (getUsefulContentResolver)
(getContentResolverContext): New functions which return a
content resolver from an EmacsActivity, if at all possible.
(openContentUri, checkContentUri): Probe or open URIs through
such content resolvers.  Probe URIs by opening them if merely
testing permissions fails, for DND URIs do not make
checkCallingUriPermission return true.

* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Address
potential crash.

* src/androidvfs.c (android_check_content_access): Circumvent
JNI dynamic method dispatch.
(android_authority_name): Guarantee NAME is never a directory.
2023-10-15 13:11:37 +08:00
Mauro Aranda
a3fd382f3f Fix searching for tags in compressed files
* lisp/progmodes/etags.el (etags--ensure-file): New function.
(etags--all-files): Make sure files in TAGS can be visited, even if
the files are compressed.  (Bug#2807)
(etags--xref-find-definitions): Report to xref a file that we are sure
it exists.  (Bug#44494)
2023-10-15 00:09:52 -04:00
Stefan Kangas
90b4a7acb5 Update publicsuffix.txt from upstream
* etc/publicsuffix.txt: Update from
https://publicsuffix.org/list/public_suffix_list.dat
dated 2023-10-01 03:58:26 UTC.
2023-10-15 00:34:02 +02:00
Stefan Kangas
11f10dc0d0 Update etc/rgb.txt from X.Org upstream
The upstream version contains the following changes:

  2023-07-10  rgb: Make color entries uniform
  2014-07-06  Add aliases for colors that differ between X11 and CSS
  2014-07-06  Add missing colors from CSS Color Module Level 4
  2008-06-04  Nuke CVS version tags
  2003-11-14  R6.6 is the Xorg base-line

* etc/rgb.txt: Sync with the version in X.Org upstream
https://cgit.freedesktop.org/xorg/app/rgb/tree/rgb.txt
commit 0d2caecebf0e2a10994c22960921f366dd98d19a.  (Bug#66538)
2023-10-14 21:23:57 +02:00
Alan Mackenzie
64850eaf98 Fix an infinite loop in c-beginning-of-defun-1
This fixes bug#61436.

The loop manifested itself in c-get-fallback-scan-pos as the
position returned wasn't at a {, so the search back in
c-beginning-of-defun-1 with a defun-prompt-regexp found the
same BOL and moved forward to after the match, repeat.

* lisp/progmodes/cc-defs.el (c-beginning-of-defun-1): Accept a
position found by beginning-of-defun (which uses
defun-prompt-regexp) only when the \\s( following it is a {.
Repeat the backward search when this isn't the case.
2023-10-14 19:16:45 +00:00
Dmitry Gutov
fe62315ef3 Fix vc-hg-log-edit-toggle-amend
* lisp/vc/log-edit.el (log-edit--toggle-amend): Handle the case
when the VCS returns log entry that doesn't end with a newline
(bug#66423).
2023-10-14 20:47:57 +03:00
Dmitry Gutov
c0ffa8958e (vc-default-checkin-patch): Try to be compatible with BSD 'patch'
* lisp/vc/vc.el (vc-default-checkin-patch):
Try to be compatible with BSD 'patch' (bug#66211).
2023-10-14 20:10:08 +03:00
Dmitry Gutov
717d0335d7 (vc-root-diff): Don't compute and pass on WORKING-REVISION
* lisp/vc/vc.el (vc-root-diff): Don't compute and pass on
WORKING-REVISION (bug#66364).  It was unused.
2023-10-14 20:01:24 +03:00
Spencer Baugh
64dcdb7417 Optimize vc-hg-state for directories
Directories are never tracked in hg, so it's pointless to run
vc-hg-state on them.  And, in fact, our implementation previously
would list all the files contained in the directory and then parse
that in Emacs, which is very slow in large repos.

Let's just use the knowledge that directories aren't tracked in hg,
and skip running hg entirely.

* lisp/vc/vc-hg.el (vc-hg-state): Return nil for
directories.  (Bug#66364)
2023-10-14 19:57:31 +03:00
Harald Jörg
330dd51f8b ;cperl-mode.el: Do not mistake a left-shift operator for a here-doc.
* lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Empty
unquoted delimiters for here-documents are now forbidden
(Bug#65834).

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-65834):
New test.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-65834.pl: new
resource with source code from the bug report.
2023-10-14 18:22:11 +02:00
Mauro Aranda
ad02fc212b Fix indentation and fontification in shell-script (Bug#26217)
* lisp/progmodes/sh-script.el (sh-smie--sh-keyword-p): Treat "do" as
special, like we treat "in".
(sh-smie--sh-keyword-in-p): Change signature.  Take the token to
decide correctly if it's a keyword.
(sh-font-lock-keywords-var-1): Add do.

* test/lisp/progmodes/sh-script-resources/sh-indents.erts: New test.
* test/lisp/progmodes/sh-script-tests.el
(sh-script-test-do-fontification): New test.
2023-10-14 11:00:15 -04:00
Mattias Engdegård
1f95f91d85 Simplify and describe docstrings-wide check
* lisp/emacs-lisp/bytecomp.el
(byte-compile--wide-docstring-substitution-len): Remove.
* lisp/emacs-lisp/bytecomp.el (bytecomp--docstring-line-width):
Add back explanatory comments lost in a previous change.
2023-10-14 13:26:20 +02:00
Eli Zaretskii
fe110cb611 Merge from origin/emacs-29
06a8773811 ; * lisp/calendar/time-date.el (days-to-time): Doc fix.
0ea2d6d9e8 Document that time-to-days and days-to-time use different...
2023-10-14 06:55:05 -04:00
Mattias Engdegård
fbbe40cf50 Make the docstrings-wide check 70x faster
Instead of performing a number of expensive transformations on the
original doc string and then use a dynamically-created regexp to find
wide lines, step through the lines in the unmodified string and only
perform the transformations on lines that exceed the limit.
This is sound because the transformations are contractive.

The new check will usually not cons nor perform any regexp matching.

* lisp/emacs-lisp/bytecomp.el (bytecomp--docstring-line-width): New.
(byte-compile--wide-docstring-p): Cheaper implementation.
2023-10-14 12:15:33 +02:00
Eli Zaretskii
06a8773811 ; * lisp/calendar/time-date.el (days-to-time): Doc fix. 2023-10-14 12:00:51 +03:00
Bob Rogers
0ea2d6d9e8 Document that time-to-days and days-to-time use different epochs
* doc/lispref/os.texi (Time Calculations):
* lisp/calendar/time-date.el (days-to-time, time-to-days): Doc fixes.
(Bug#66502)
2023-10-14 11:57:30 +03:00
Mattias Engdegård
548bc3e3d1 Sort byte compiler warnings in alphabetic order
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types):
Rearrange.  Add a few missing ones.
2023-10-14 10:34:10 +02:00
Jens Schmidt
115a940a4b Fix beginning-of-defun not jumping to BOF
In batch mode or when font-lock and some other niceties are switched
off, function `syntax-ppss' can modify match data held by function
`beginning-of-defun-raw'.  In that case, `beginning-of-defun' can jump
to some seemingly arbitrary position, and not the actual BOF.

* lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): Save match data
around a call to `syntax-ppss'. (Bug#66218)
2023-10-14 11:01:52 +03:00
Mauro Aranda
281258e574 Fix saving faces with attributes that need filtering
* lisp/cus-edit.el (custom-face-save): The :shown-value property for
the custom-face widget is supposed to be a value suitable for the
customization widget.  (Bug#66391)
2023-10-14 10:48:12 +03:00
Michael Albinus
1677a65554 Merge from origin/emacs-29
dc8b336d02 * lisp/files.el (file-name-non-special): Handle quoted ti...
2023-10-14 09:38:17 +02:00
Michael Albinus
dc8b336d02 * lisp/files.el (file-name-non-special): Handle quoted tilde.
(Bug#65685)

* test/lisp/files-tests.el
(files-tests-file-name-non-special-expand-file-name-tilde):
New test.
2023-10-14 09:34:40 +02:00
Po Lu
03f5a06a05 Implement multi-window drag-and-drop under Android
* java/org/gnu/emacs/EmacsNative.java (sendDndDrag, sendDndUri)
(sendDndText): Declare new event-sending functions.

* java/org/gnu/emacs/EmacsView.java (onDragEvent): New function.

* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): New
function; respond to each drag and drop event, request
permissions if necessary and transfer dropped data to Lisp.

* lisp/dnd.el (dnd-unescape-file-uris): New variable.
(dnd-get-local-file-name): If that variable is nil, refrain from
unescaping URLs provided.

* lisp/term/android-win.el (android-handle-dnd-event): New
function.
(special-event-map): Bind drag-n-drop-event.

* src/android.c (sendDndDrag, sendDndUri, sendDndText): New
functions.

* src/androidgui.h (enum android_event_type): New event types
ANDROID_DND_DRAG_EVENT, ANDROID_DND_URI_EVENT,
ANDROID_DND_TEXT_EVENT.
(struct android_dnd_event): New structure.
(union android_event) <dnd>: New field.

* src/androidterm.c (handle_one_android_event)
<ANDROID_DND_..._EVENT>: Generate drag-n-drop events for each
of these types.
(syms_of_androidterm) <Quri, Qtext>: New defsyms.
2023-10-14 10:15:42 +08:00
Eric Abrahamsen
0dd7e6e3ae Have gnus-summary-limit-to-age operate on calendar days
Reported and patched by Łukasz Stelmach <stlman@poczta.fm>.

* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-age): Rather than
24-hour blocks. Also use `read-number', and drop the confusing option
to reverse younger/older both with the prefix argument and with a
negative number.
2023-10-13 16:48:55 -07:00
Stefan Monnier
9ecb595dea (sit-for): Remove support for old calling convention
* lisp/subr.el (sit-for): Remove support for old calling convention

* doc/lispref/functions.texi (Obsolete Functions): Adjust wording now
that we don't support `sit-for`s old convention any more.
* doc/lispref/commands.texi (Waiting): Remove mention of old calling
convention for `sit-for`.
2023-10-13 19:28:30 -04:00
Harald Jörg
a5789198b3 cperl-mode.el: Add new user option to etc/NEWS
* etc/NEWS: Announce new user option `cperl-fontify-trailer'.
2023-10-14 00:48:23 +02:00
Harald Jörg
3a1fc81628 cperl-mode.el: Optionally treat trailing text as comment
* lisp/progmodes/cperl-mode.el (cperl-fontify-trailer): New
customization variable.  With a value of 'comment, cperl-mode
treats trailing text after after __END__ and __DATA__ as comment,
like perl-mode does (Bug#66161).
(cperl-find-pods-heres): Treat trailing text after __END__ and
__DATA__ according to the customization variable
`cperl-fontify-trailer'.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-66161):
New test, verifying the changed behavior if the custom variable is
set to 'comment.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-66161.pl: New
resource file, source code from the corresponding bug report.
2023-10-14 00:34:41 +02:00
Mauro Aranda
baf778c7ca More defcustom fixes in ERC (Bug#66520)
* lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): Change
:type to choice, to allow nil.
* lisp/erc/erc-goodies.el (erc-keep-place-indicator-style): Fix
copy-pasta.
* lisp/erc/erc-networks.el (erc-networks-alist): Don't advertise that
MATCHER can be a function since it doesn't look like that's ever been
the case, reaching as far back as erc-networks.el's introduction to
the old CVS repo, in 2006.  (Bug#66520)
2023-10-13 07:47:01 -07:00
F. Jason Park
52af0a5fb9 Add command to refill buffer in erc-fill-wrap-mode
* lisp/erc/erc-fill.el (erc-fill-function, erc-fill-wrap-mode):
Mention new command `erc-fill-wrap-refill-buffer' in doc string.
(erc-fill--wrap-rejigger-last-message): New internal variable.
(erc-fill--wrap-rejigger-region, erc-fill-wrap-refill-buffer): New
command and helper function for fixing alignment issues that arise,
for example, from adjusting pixel-display widths of buffer text during
a session.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--simulate-refill):
New function for approximating `erc-fill-wrap-refill-buffer'.
(erc-fill-wrap--merge): Assert refilling is idempotent.  (Bug#60936)
2023-10-13 07:47:01 -07:00
F. Jason Park
f8af241192 Treat previous/next-line specially in erc-fill-wrap
* lisp/erc/erc-fill.el (erc-fill-wrap-visual-keys): Mention option
`erc-fill-wrap-force-screen-line-movement' in doc string.
(erc-fill-wrap-force-screen-line-movement): New option to suppress
logical-line movement with `previous-line' and `next-line' when
`erc-fill-wrap-mode' is enabled.
(erc-fill--wrap-move): Accept trailing args.
(erc-fill--wrap-previous-line, erc-fill--wrap-next-line): Use
`erc-fill--wrap-move', like all the other `fill-wrap' commands.
(Bug#60936)
2023-10-13 07:47:01 -07:00
F. Jason Park
5e2be1e0ba Swap hook positions of erc-fill and erc-match-message
* etc/ERC-NEWS: Fix new order of reserved modify-hook members.
* lisp/erc/erc-fill.el: Increase depth of `erc-fill' in both modify
hooks from 40 to 60.
* lisp/erc/erc-match.el (erc-match-mode, erc-match-enable,
erc-match-disable): Use general module setup function
`erc-match--setup' for buffer-local modifications instead of calling
`erc-match--modify-invisibility-spec' directly.  Add and remove new
post-modify hook `erc-match--on-insert-post'.
(erc-hide-fools): Use `erc--msg-props' for communicating to
post-processing step for applying invisible props instead of doing so
immediately.
(erc-match--on-insert-post): New function to apply module-specific
`invisible' props.  Will likely be replaced by a general service to do
the same, perhaps provided by a future "erc-ignore"-like module.
(erc-match--modify-invisibility-spec, erc-match--setup): Rename former
to latter and only operate on current buffer.
* test/lisp/erc/erc-scenarios-match.el
(erc-scenarios-match--stamp-left-fools-invisible,
erc-scenarios-match--stamp-right-fools-invisible,
erc-scenarios-match--stamp-right-invisible-fill-wrap,
erc-scenarios-match--stamp-both-invisible-fill-static): Update
expected order of ERC-owned `invisible' prop members `match-fools' and
`timestamp'.
* test/lisp/erc/erc-tests.el (erc--essential-hook-ordering): Swap
expected order of `erc-fill' and `erc-add-timestamp' in both hooks.
(Bug#64301)
2023-10-13 07:47:01 -07:00
F. Jason Park
c68dc7786f Manage some text props for ERC insertion-hook members
* etc/ERC-NEWS: Mention that ERC only adds the text property
`cursor-sensor-functions' when `erc-echo-timestamps' is enabled.  Also
mention that date stamps are now inserted as separate messages.
* lisp/erc/erc-fill.el (erc-fill): Look for text prop `erc-cmd'
instead of `erc-command' and use helper utility to do so.
(erc-fill-static): Skip date stamps because this fill style leaves
them flush left.
(erc-fill-wrap-mode, erc-fill-wrap-enable, erc-fill-wrap-disable):
Don't hook on the soon-to-be-removed function interface
`erc-stamp--insert-date-function' because date stamps are now separate
messages.
(erc-fill--wrap-continued-message-p): Restore accidentally discarded
doc string.  Derive context about current message from text props at
`point-min', and use updated property names and utility functions.
Abort when previous message is now hidden.
(erc-fill--wrap-stamp-insert-prefixed-date): Remove unused function,
originally meant to be new in ERC 5.6, and move logic for date-stamp
measuring portion directly to `erc-fill-wrap' itself.
(erc-fill--wrap-measure): New helper function.
(erc-fill-wrap): Use helper `erc-fill--wrap-measure' and incorporate
date-stamp detection and width measuring from removed helper.  Don't
dedent first word for messages of unknown origin, such as those
inserted by `erc-display-line' alone without prior preparation from
`erc-display-message'.
* lisp/erc/erc-goodies.el (erc-readonly-mode, erc-readonly-enable):
Set hook depth explicitly to 70.
* lisp/erc/erc-stamp.el (erc-timestamp-format-left): Mention that a
trailing newline is implicit if not provided and that users who don't
want date stamps should use `erc-timestamp-format-right' instead.
(erc-stamp-mode, erc-stamp-enable): Call `erc-stamp--setup' instead
of `erc-munge-invisibility-spec', and bump hook depth for
`erc-add-timestamp' to 70.
(erc-stamp--current-time): Use `erc-ts' instead of `erc-timestamp'
text property in doc string.
(erc-stamp--skip): New internal variable.
(erc-stamp--allow-unmanaged): New variable for legacy code to force
`erc-add-timestamps' to run when `erc--msg-props' is nil.
(erc-add-timestamp): Always run when `erc-stamp--allow-unmanaged' is
non-nil unless `erc-stamp--skip' is as well because the latter takes
precedence.  Don't add `erc-ts' text prop directly unless
`erc-stamp--allow-unmanaged is non-nil.  Instead, use the new
`erc--msg-props' facility to defer until after modification hooks.
Likewise, don't add `cursor-senor-functions' directly either unless
the same compatibility flag is enabled.  Instead, expect the latter to
be handled by a post-modify hook conditioned on the option
`erc-echo-timestamps'.
(erc-timestamp-last-inserted-left): Mention that the final trailing
newline specified in the format string no longer appears in the
recorded value.
(erc-stamp-prefix-log-filter): Use updated name for timestamp
property as well as helper utility for accessing it.
(erc-stamp--inherited-props): Add doc string.
(erc-insert-timestamp-right): Fix bug involving object cycle where
the time-stamp string would appear in its own `display' property.
(erc-stamp--insert-date-function, erc-stamp--insert-date-hook): Remove
unused internal function-valued interface variable and replace with
the latter, a normal hook.
(erc-stamp--date-format-end, erc-stamp--propertize-left-date-stamp):
New function and auxiliary variable to apply date stamp properties at
the post-modify stage.  Add text property `erc-stamp-type' to inserted
date stamps to help folks distinguish between them and other
left-sided stamps.
(erc-stamp--current-datestamp-left,
erc-stamp--format-date-stamp,
erc-stamp--insert-date-stamp-as-phony-message,
erc-stamp--lr-date-on-pre-modify): New functions and state variable to
help ERC treat date stamps as separate messages while working within
the established mechanism for processing inserted messages.  Shadow
`erc-stamp--invisible-property' when calling `erc-format-timestamp' in
order to prevent date stamps from inheriting other `invisible' props.
These date stamps are special in that they have no business being
hidden along with the current message.
(erc-insert-timestamp-left-and-right): On initial run in any buffer,
remember whether the date stamp needed newline massaging on insertion.
Move all business for inserting date stamps to post-modify hooks, but
run them forcibly if this is the very first date stamp in the current
buffer.  Also mention some specifics related to relevant text props in
the doc string.
(erc-format-timestamp): Don't add `invisible' prop to stamp unless
`erc-stamp--invisible-property' is non-nil.
(erc-stamp--csf-props-updated-p): New local variable.
(erc-munge-invisibility-spec): Restore `cursor-sensor-functions' text
property for existing messages when a user enables the option
mid-session.  Add and remove hooks for use with automatic timestamp
echoing.
(erc-stamp--add-csf-on-post-modify): New function to add
`cursor-sensor-functions' property on post-modify hooks.
(erc-stamp--setup): Perform some additional teardown.
(erc-stamp--on-clear-message): Look for text property `erc-ts' instead
of `erc-timestamp'.
(erc-echo-timestamp, erc--echo-ts-csf): Use utility to find time-stamp
text prop in current message.
(erc-stamp--update-saved-position, erc-stamp--reset-on-clear): Use
hook `erc-stamp--insert-date-hook' instead of excised function-valued
variable interface `erc-stamp--insert-date-function'.
* lisp/erc/erc-truncate.el (erc-truncate-buffer-to-size): Use internal
utility to find beginning of message.
* lisp/erc/erc.el (erc--msg-props, erc--msg-props-overrides): New
internal variables for initializing and conveying metadata-oriented
text properties among insert and send hooks.
(erc-insert-modify-hook): Mention reserved depth ranges for built-in
members in doc string.
(erc-send-action):  Use convenience variable to modifying text props
instead of awkwardly overriding `erc-insert-pre-hook'.
(erc--check-msg-prop, erc--get-inserted-msg-bounds,
erc--get-inserted-msg-prop, erc--with-inserted-msg,
erc--traverse-inserted): New utility functions and macros to help
modules find metadata and message-delimiting text props.
(erc-display-line-1): Ensure the first character of every message in
an ERC buffer has the `erc-msg' property, as well as any other props
in `erc--msg-props', when populated.
(erc--hide-message): Don't bother offsetting start of first message in
a buffer.
(erc--ranked-properties, erc--order-text-properties-from-hash): New
variable and function to convert `erc--msg-props' into a plist
suitable for `add-text-properties'.
(erc-display-message): Make doc string more informative.  Bind and
initialize `erc--msg-props' for use by all hooks.  Respect
`erc--msg-prop-overrides' when non-nil.  Don't add `erc-command'
property.  Instead, ensure `erc--msg-props' contains an `erc-cmd' item
when the parameter PARSED is non-nil.
(erc--own-property-names): Add `erc-stamp-type'.
(erc--get-speaker-bounds): Use helper to find message start.
(erc-process-ctcp-query, erc-send-current-line): Use convenience
variable to leverage framework for manipulating message metadata
instead of overriding `erc-insert-pre-hook'.
(erc-display-msg): Bind `erc--msg-props' for use by all send-related
hooks.  Add text props from table after `erc-send-post-hook'.
(erc-restore-text-properties): Improve doc string.
(erc--get-eq-comparable-cmd): Use `if-let' instead of `if-let*'.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--insert-privmsg):
Make phony message more realistic.
(erc-fill-tests--wrap-populate): Shorten overlong line.
(erc-fill-tests--wrap-check-prefixes): Make test utility more vigilant
in asserting no gaps exist in `line-prefix' property interval.
(erc-fill-tests--compare): Compare text props on text-prop values that
are themselves strings.
* test/lisp/erc/erc-scenarios-log.el (erc-scenarios-log--clear-stamp):
Ensure `erc-stamp' is loaded.
* test/lisp/erc/erc-scenarios-match.el
(erc-scenarios-match--stamp-left-current-nick,
erc-scenarios-match--invisible-stamp): Use `default-value' for
`erc-insert-modify-hook' in ordering assertion.
(erc-scenarios-match--find-bol, erc-scenarios-match--find-eol): Remove
unused assertion helper functions.
(erc-scenarios-match--stamp-right-fools-invisible): Remove misplaced
ERT tag from function and use utility to find message bounds.
(erc-scenarios-match--stamp-right-fools-invisible): Use real utility
from main library to find message end.
(erc-scenarios-match--fill-wrap-stamp-dedented-p): New assertion
utility function.
(erc-scenarios-match--hide-fools/stamp-both/fill-wrap) New test.
(erc-scenarios-match--hide-fools/stamp-both/fill-wrap/speak): New
test.
(erc-scenarios-match--stamp-both-invisible-fill-static): Expect
`erc-cmd' at beginning of inserted message's filled line, even if the
line starts with white space.  Also, add new function parameter
`assert-ds', a callback to run when visiting the second date stamp,
which is followed by a hidden message.  In the test of the same name,
expect the date stamp's invisibility interval to begin at the newline
after the previous message and to not contain any existing
invisibility props, namely, those belonging to the subsequent hidden
"fools" message.  Also use shortened "metadata" text prop names.
(erc-scenarios-match--stamp-both-invisible-fill-static--nooffset):
Expect the date stamp's invisibility interval to match its field's
instead of starting and ending sooner.
* test/lisp/erc/erc-stamp-tests.el: Put well-known metadata prop at
the start of the message.
* test/lisp/erc/erc-tests.el (erc--refresh-prompt): Prevent modules
from mutating hooks.
(erc--order-text-properties-from-hash, erc--check-msg-prop): New
tests.
* test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update
test data.
* test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update
test data.
* test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update.
* test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld:
Update.
* test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld:
Update.
* test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld:
Update.
* test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld:
Update.
* test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: Update.
* test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld: Update.
* test/lisp/erc/resources/match/fools/fill-wrap.eld: New file.
(Bug#60936)
2023-10-13 07:47:01 -07:00
F. Jason Park
a4bae965e0 Easily excise list-valued text prop members in ERC
* lisp/erc/erc.el (erc--remove-from-prop-value-list): New function for
removing `invisible' and `face' prop members cleanly.
* test/lisp/erc/erc-tests.el (erc--remove-from-prop-value-list,
erc--remove-from-prop-value-list/many): New tests.  (Bug#60936)
2023-10-13 07:47:01 -07:00
F. Jason Park
f97fdf5e50 Deprecate option erc-remove-parsed-property
* etc/ERC-NEWS: Add entry for `erc-remove-parsed-property'.
* lisp/erc/erc.el (erc-remove-parsed-property): Deprecate option
because the potential for inadvertent self harm outweighs the
potential benefits.  Additionally, replicating this functionality via
hooks is trivial.
(erc-display-line-1): Remove quasi-deprecated `tags' property because
the preferred format for `erc-response.tags' has changed, and ERC has
never supported IRCv3 tags.
2023-10-13 07:47:01 -07:00
F. Jason Park
9c2f99b7d7 Use erc-display-message instead of erc-make-notice
* lisp/erc/erc-backend.el (erc-server-JOIN): Let `erc-display-message'
handle formatting instead of baking out a string.  The text ultimately
inserted remains unchanged, but forwarding the original `format-spec'
arguments now has the side effect of influencing text properties, which
conveys richer meaning for modules to act upon when doing things like
deciding whether to hide a given message.
* lisp/erc/erc.el (erc-cmd-IGNORE, erc-cmd-UNIGNORE,
erc--unignore-user, erc-cmd-IDLE, erc-cmd-BANLIST, erc-cmd-MASSUNBAN):
Use `erc-display-message' with `notice' for the TYPE parameter instead
of composing `erc-make-notice' and `erc-display-line'.
2023-10-13 07:47:01 -07:00
F. Jason Park
1950ddebac Allow spoofing process marker in erc-display-line-1
* lisp/erc/erc.el (erc--insert-marker): New internal variable for
overriding `erc-insert-marker' when displaying messages at a
non-default location in the buffer.
(erc-display-line-1): Favor `erc--insert-marker' over
`erc-insert-marker' when non-nil.
; * test/lisp/erc/resources/base/assoc/multi-net/barnet.eld: Timeouts.
; * test/lisp/erc/resources/base/assoc/multi-net/foonet.eld: Timeouts.
; * test/lisp/erc/resources/base/netid/bouncer/barnet-drop.eld: Timeouts.
; * test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld: Timeouts.
; * test/lisp/erc/resources/erc-d/resources/dynamic-foonet.eld: Timeouts.
; * test/lisp/erc/resources/sasl/scram-sha-1.eld: Timeouts.
; * test/lisp/erc/resources/sasl/scram-sha-256.eld: Timeouts.
2023-10-13 07:47:00 -07:00
F. Jason Park
d46c016fbd Sort and dedupe when loading modules in erc-open
* doc/misc/erc.texi: Add new subheading "Module Loading" under the
"Modules" chapter.
* lisp/erc/erc.el (erc--sort-modules): New utility function to sort
and dedupe modules.
(erc-modules): In `custom-set' function, factor out collation into
separate utility `erc--sort-modules'.
(erc-update-modules): Call `erc--update-modules' with an argument, the
current value of `erc-modules'.
(erc--aberrant-modules): New variable, a list of symbols whose modules
ERC suspects of being incorrectly defined.
(erc--warn-about-aberrant-modules): New function to print an error
message and emit a warning prior to connecting when
`erc--aberrant-modules' is non-nil.
(erc--find-mode): Make heuristic more robust by always checking for a
mode activation command rather than just a state variable.  This fixes
a compatibility bug, new in 5.6, affecting third-party modules that
autoload module definitions instead of their corresponding
mode-activation commands.
(erc--update-modules): Add new positional argument `modules'.
(erc--setup-buffer-hook): Add new default member,
`erc--warn-about-aberrant-modules'.
(erc-open): Pass sorted `erc-modules' to `erc--update-modules'.
* test/lisp/erc/erc-tests.el (erc--sort-modules): New test.
(erc-tests--update-modules): New fixture.
(erc--update-modules): Remove and rework as three separate tests
dedicated to specific contexts.  The existing one had poor coverage
and was difficult, if not impossible, to follow.
(erc--update-modules/unknown, erc--update-modules/local,
erc--update-modules/realistic): New tests.  (Bug#57955)
2023-10-13 07:47:00 -07:00
F. Jason Park
9120d7a32e Honor nil values in erc--restore-initialize-priors
* lisp/erc/erc.el (erc--restore-initialize-priors): Don't produce
invalid "empty" `setq' form when parameter VARS contains defaults that
initialize to nil.  This function is mainly used by local modules,
which were first made usable in ERC 5.5 (bug#57955).
* test/lisp/erc/erc-tests.el (erc--restore-initialize-priors): Fix
expected expansion, which is now slightly leaner.  (Bug#60936)
2023-10-13 07:47:00 -07:00
F. Jason Park
328a985651 Skip post-minibuffer restore in erc-scrolltobottom-all
* etc/ERC-NEWS: Remove mention of `erc-scrolltobottom-relaxed' in
entry for module `scrolltobottom'.
* lisp/erc/erc-goodies.el (erc-input-line-position): Fix mention of
abandoned option `erc-scrolltobottom-relaxed'.
(erc-scrolltobottom-all): Subsume option `erc-scrolltobottom-relaxed'
by recognizing a third value state, `relaxed'.  A separate option
would make more sense if other options also depended on
`erc-scrolltobottom-all'.
(erc-scrolltobottom-relaxed): Remove redundant option, which was to be
new in ERC 5.6.
(erc-scrolltobottom-enable, erc-scrolltobottom-mode): Warn if user
attempts to enable `erc-scrolltobottom-all' on Emacs 27, which is not
supported.
(erc--scrolltobottom-relaxed-commands,
erc--scrolltobottom-post-force-commands,
erc--scrolltobottom-relaxed-skip-commands): Remove unused variables.
(erc--scrolltobottom-on-pre-command,
erc--scrolltobottom-on-pre-command-relaxed,
erc--scrolltobottom-on-post-command-relaxed): Remove unused functions.
(erc--scrolltobottom-on-post-command): Remove conditional branch for
dealing with a non-nil `erc--scrolltobottom-window-info'.
(erc--scrolltobottom-setup): Convert from generic to normal function
and remove setup and teardown for unused hooks.  Set variable
`read-minibuffer-restore-windows' locally when option
`erc-scrolltobottom-all' is non-nil.
(erc--scrolltobottom-on-pre-insert): Replace reference to subsumed
option `erc-scrolltobottom-relaxed' with new value `relaxed' for
existing option `erc-scrolltobottom-all'.
* test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el
(erc-scenarios-scrolltobottom--relaxed): Replace option
`erc-scrolltobottom-relaxed' with new value `relaxed' for
`erc-scrolltobottom-all'.  (Bug#64855)
2023-10-13 07:47:00 -07:00
Mattias Engdegård
bd29713201 Fix ls-lisp-verbosity custom type
* lisp/ls-lisp.el (ls-lisp-verbosity): Include `modes` in the type
and doc string.
2023-10-13 16:38:54 +02:00
Alan Mackenzie
9795934965 Fix c-in-knr-argdecl to avoid false recognition of K&R
In the OP's test case, the type of a declaration was a macro
with parentheses, which confused c-in-knr-argdecl.

* lisp/progmodes/cc-engine.el (c-in-knr-argdecl): Amend this
function to return nil if a "parameter declaration" can't be
parsed as a declaration.
2023-10-13 14:27:18 +00:00
Michael Albinus
bbccef3ceb Merge from origin/emacs-29
c8ea14e782 Handle quoted tilde in Tramp
30239759ee ; Set maintainer for elint.el to emacs-devel
eedd9db619 Update to Org 9.6.10

# Conflicts:
#	lisp/net/tramp-gvfs.el
2023-10-13 16:18:06 +02:00
Michael Albinus
d40f9668f9 ; Merge from origin/emacs-29
The following commit was skipped:

73ccd9d295 Don't call font-lock-mode in treesit-major-mode-setup (bu...
2023-10-13 16:16:22 +02:00
Michael Albinus
9f83b46bee Merge from origin/emacs-29
53292c5d81 Fix treesit-query-validate for string input (bug#66400)
81a0c1ed2e ; Improve documentation of VC commands
0590e3e69a Recommend `M-x man` in woman.el docs
809da7fc9a ; * doc/lispref/processes.texi (Process Buffers): More ac...
8f23a02a9e Fix updating process-mark position in 'set-process-buffer'
2023-10-13 16:16:19 +02:00
Michael Albinus
fde5f1a1a3 ; Merge from origin/emacs-29
The following commit was skipped:

247743bd1e ; * lisp/treesit.el (treesit-language-at-point-function):...
2023-10-13 16:16:11 +02:00
Michael Albinus
c8ea14e782 Handle quoted tilde in Tramp
* lisp/net/tramp.el (tramp-handle-expand-file-name):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name):
* lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name):
* lisp/net/tramp-smb.el (tramp-smb-handle-expand-file-name):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-expand-file-name):
Handle quoted tilde.  (Bug#65685)

* test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name-tilde):
New test.
2023-10-13 16:09:51 +02:00