Move lexical-binding warning from checkdoc to byte-compiler
This warning is much more appropriate for the compiler, since lexical
binding affects what it can reason and warn about, than for checkdoc
as the warning has no bearing to documentation at all.
The move also improves the reach of the warning.
Eli Zaretskii [Sat, 21 Oct 2023 12:06:08 +0000 (08:06 -0400)]
; Merge from origin/emacs-29
The following commits were skipped:
62920dcb0de Update Tramp version (don't merge with master) d963bc6c6b6 ; * lisp/ldefs-boot.el: Regenerated for Emacs 29.1.90. 0cbc91f29ae Bump Emacs version
Move and edit text about lexical environment representation
It's only relevant for the second argument to `eval`; the actual
internal representation is an implementation matter and usually
different from what was described here.
* doc/lispref/variables.texi (Lexical Binding): Move the relevant
part of the description of the internal representation of
lexical environments from here...
* doc/lispref/eval.texi (Eval): ...to here, where it belongs.
Eli Zaretskii [Sat, 21 Oct 2023 10:53:21 +0000 (13:53 +0300)]
Fix mouse clicks on links under 'global-display-line-numbers-mode'
* src/indent.c (line_number_display_width): No longer static.
* src/lisp.h (line_number_display_width): Add prototype.
* src/keyboard.c (save_line_number_display_width)
(line_number_mode_hscroll): New functions.
(make_lispy_event): Call 'save_line_number_display_width' and
'line_number_mode_hscroll' to avoid interpreting up-event as drag
event when redisplay scrolls the text horizontally between the
down- and up-event to account for the changed width of the
line-number display. (Bug#66655)
Huan Nguyen [Sat, 7 Oct 2023 10:03:55 +0000 (12:03 +0200)]
New keyword :default-language in treesit-font-lock-rules function.
* lisp/treesit.el (treesit-font-lock-rules): Keyword :default-language
LANGUAGE will be chosen for every :feature. Using :language will
override the :default-language for the next :feature.
Stefan Monnier [Sat, 21 Oct 2023 00:42:04 +0000 (20:42 -0400)]
(buffer-match-p): Replace `&optional` with `&rest` (bug#65797)
* lisp/subr.el (buffer-match-p--past-warnings): New var.
(buffer-match-p): Use it. Replace `&optional arg` with `&rest args`.
(match-buffers): Replace `&optional arg` with `&rest args`.
* lisp/window.el (display-buffer-alist): Fix out of date docstring.
* doc/lispref/buffers.texi (Buffer List): Document new calling convention.
F. Jason Park [Sun, 15 Oct 2023 20:20:07 +0000 (13:20 -0700)]
Prefer erc-target to erc-default-target
* etc/ERC-NEWS: Mention `erc-target' and new `erc-server-buffer-p'
alias.
* lisp/erc/erc-backend.el (erc-process-sentinel): Set `joined-p' slot
of `erc--target-channel' object to nil when applicable.
(erc-server-JOIN): Mark `erc--target-channel' object as being joined.
* lisp/erc/erc-common.el (erc--target-channel): Add `joined-p' slot.
Use hyphenated name so accessor function's name ends in "joined-p"
rather than "joinedp". Note that this will always be nil when
disconnected.
(erc--target): Relocate here from erc.el.
(erc-target): New public API function to return the current buffer's
target as a string, even in channels that have been unjoined.
* lisp/erc/erc-networks.el (erc--default-target): Remove forward
declaration.
(erc-networks--id-reload): Use `erc-target' instead of
`erc--default-target' as predicate for visiting target buffers.
* lisp/erc/erc.el (erc-remove-channel-users): Set channel "joinedness"
to nil in `erc--target-channel' object, when applicable.
(erc--target): Move to erc-common.
(erc--default-target): Remove, replaced by new function `erc-target'.
(erc-query-buffer-p): Use `erc-target'.
(erc-after-connect): Revise doc string.
(erc-connection-established): Revise doc string and move
`erc-unhide-query-prompt' business before hook.
(erc--current-buffer-joined-p): Remove comment and use new `joined-p'
slot of `erc--target-channel' for determining "joinedness" of channel.
(erc-kill-buffer-function): Use `erc--target-channel-p' for detecting
whether the buffer is a channel buffer.
* test/lisp/erc/erc-networks-tests.el
(erc-networks--shrink-ids-and-buffer-names--hook-collapse-target):
Remove comment.
* test/lisp/erc/erc-scenarios-base-reuse-buffers.el
(erc-scenarios-common--base-reuse-buffers-channel-buffers):
Clarify assertion.
* test/lisp/erc/erc-tests.el (erc-with-all-buffers-of-server):
Replace `erc-default-recipients' with `erc--target'.
(erc--target-from-string): Update expected shape of
`erc--target-channel' struct with new `joined-p' slot.
(erc-message): Set `erc--target' in buffer "#chan". (Bug#66578)
F. Jason Park [Sun, 15 Oct 2023 14:22:31 +0000 (07:22 -0700)]
Rename erc-server-buffer-p
* lisp/erc/erc-log.el (erc-log-all-but-server-buffers): Use
`erc--server-buffer-p' instead of `erc-server-buffer-p'. This
replacement is presumed to be relatively "safe" because this function
is unused in the code base and only appears in the doc string for the
option `erc-enable-logging'.
* lisp/erc/erc-match.el (erc-match-message): Leave comment proposing
that `erc--server-buffer-p' should be preferred to
`erc-server-buffer-p'. Use preferred alias for `erc-server-buffer-p'.
* lisp/erc/erc-notify.el (erc-cmd-NOTIFY): Use preferred alias for
`erc-server-buffer-p', and leave FIXME comment.
* lisp/erc/erc-speedbar.el (erc-speedbar-buttons): Use
`erc--server-buffer-p' instead of `erc-server-buffer-p'. The logic
here seems simple enough to justify a change, however the absence of
related bug reports is perhaps an argument against this.
* lisp/erc/erc-track.el (erc-track-modified-channels): Use preferred
alias for `erc-server-buffer-p' and leave comment noting possible bug.
* lisp/erc/erc.el (erc-once-with-server-event): Use
`erc--server-buffer-p' instead of `erc-server-buffer-p'. This change
seems justified because the function sets local hooks that would
otherwise be ignored outside of a server buffer.
(erc-server-buffer-p, erc-server-or-unjoined-channel-buffer-p): Make
the former an obsolete alias for the latter.
(erc--server-buffer-p): New function to replace `erc-server-buffer-p'
internally in new code. Unlike its predecessor, it returns nil in
parted and kicked channels.
(erc-open-server-buffer-p): Use `erc--server-buffer-p' instead of
`erc-server-buffer-p'. Given the name and the doc string, breaking
the odd misuse of this function in parted buffers seems justified
because this is clearly a bug fix. Also, all uses in-tree conform to
the intended behavior as documented. And a cursory grep of all "erc-"
prefixed packages on MELPA reveals zero instances of this function.
Nor is it used in erbot.
(erc-get-buffer): Mention behavior in doc string regarding parted and
kicked-from channels.
(erc-cmd-GQUIT): Fix wrong-number-of-arguments bug in timer function.
(erc-default-target): Mention behavior regarding unjoined channels.
(erc-kill-query-buffers): Don't use `erc-server-buffer-p'. This
replacement may break third-party code expecting to leave parted
channels behind, but it seems sane when considering only the lone
internal use in `erc-cmd-QUIT'.
; * test/lisp/erc/resources/join/network-id/foonet.eld: Timeouts.
(Bug#66578)
F. Jason Park [Thu, 19 Oct 2023 06:20:07 +0000 (23:20 -0700)]
Respect user markers in erc-insert-timestamp-left
* lisp/erc/erc-stamp.el (erc-insert-timestamp-left): Convert to normal
function, a mere wrapper that defers to existing generic variants, in
order to dissuade users from adding their own methods, which could
complicate troubleshooting, etc.
(erc--insert-timestamp-left): Rename both methods using internal
double-hyphen convention. In `erc-stamp--display-margin-mode'
implementation, don't displace third-party markers.
* test/lisp/erc/erc-scenarios-stamp.el: New file. (Bug#60936)
F. Jason Park [Thu, 19 Oct 2023 06:20:07 +0000 (23:20 -0700)]
Fix right-sided stamps commingling with erc-prompt
* lisp/erc/erc-stamp.el (erc-insert-timestamp-left-and-right): Fix bug
that saw the prompt being inserted after messages but just inside the
narrowed operating portion of the buffer, which meant remaining
modification hooks would see it upon visiting. Thanks to Corwin Brust
for catching this.
* test/lisp/erc/erc-fill-tests.el (erc-fill-wrap--monospace): Use
custom `erc-prompt' function to guarantee invariants asserted by
`erc--assert-input-bounds' are preserved throughout. (Bug#60936)
F. Jason Park [Mon, 16 Oct 2023 00:22:22 +0000 (17:22 -0700)]
Restore missing metadata props in erc-display-line
* etc/ERC-NEWS: Designate `erc-display-message' as the favored means
of inserting messages.
* lisp/erc/erc-fill.el (erc-fill-wrap): Skip any `unknown' `erc-msg'.
* lisp/erc/erc-stamp.el (erc-stamp--current-time): Use an existing
`erc-ts' text property, when present, for the current message time.
* lisp/erc/erc.el (erc-display-line-1, erc-insert-line): Update doc
string and declare the former an obsolete alias for the latter,
`erc-insert-line'. Have `erc-log' label say `erc-display-message'
even though this function is actually `erc-insert-line'.
(erc-display-line): Convert to a thin wrapper around
`erc-display-message', and move its existing body to a new internal
function, `erc--route-insertion'.
(erc--route-insertion): Adopt former body of `erc-display-line', now a
convenience wrapper around `erc-display-message'. Copy
`erc--msg-props' hash table when inserting a message in multiple
buffers. At present, only `erc-server-QUIT' uses this facility, so
such a move shouldn't impact performance in any measurable way. Also,
improve readability with at most one recursive call for the
fall-through case.
(erc--compose-text-properties, erc--merge-text-properties-p): Rename
former to latter to avoid confusion with `composition' property.
(erc-display-message): Update doc string. Attempt to adapt a non-nil
TYPE parameter for use as the value of the `erc-msg' text property
before resorting to a value of `unknown'. But only do this when
PARSED is nil, and MSG is a string. Call `erc--route-insertion'
instead of `erc-display-line'. Use new name for
`erc--compose-text-properties'.
(erc-put-text-property): Update name of variable
`erc--compose-text-properties'.
* test/lisp/erc/erc-networks-tests.el (erc-networks--set-name): Mock
`erc--route-insertion' instead of `erc-display-line'.
* test/lisp/erc/erc-scenarios-display-message.el: New file.
* test/lisp/erc/erc-tests.el (erc--route-insertion): New test.
* test/lisp/erc/resources/base/display-message/multibuf.eld: New test
data.
; * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update.
; * 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.
(Bug#60936)
Gerd Möllmann [Thu, 19 Oct 2023 14:24:53 +0000 (16:24 +0200)]
Fix Gud LLDB completion for function names
LLDB completion candidates can contain parentheses.
* lisp/progmodes/gud.el (gud-lldb-fetch-completions): Use unique
completion list delimiters. Add timeout to accept-process-input.
(gud-lldb-def-python-completion-function): Use new completion
list delimiters.
(lldb): Add hint about completions to doc string.
(gud-lldb-marker-filter): Don't use eval.
Po Lu [Fri, 20 Oct 2023 07:03:56 +0000 (15:03 +0800)]
Treat empty mailto URIs properly under Android
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): If an
empty mailto: URI is supplied, ascertain if EXTRA_EMAIL is set,
then derive a mailto URI from that if so.
Jens Schmidt [Wed, 18 Oct 2023 20:43:37 +0000 (22:43 +0200)]
; Fix argument name for function `copy-file'
* doc/lispref/files.texi (Changing Files): Change name of last
argument of function `copy-file' from `preserve-extended-attributes'
to `preserve-permissions', as used in the function's description, its
doc string and the description below in the manual.
Dmitry Gutov [Thu, 19 Oct 2023 22:24:56 +0000 (01:24 +0300)]
Improve behavior with project-switch-use-entire-map=t
* lisp/progmodes/project.el (project--keymap-prompt): New function.
(project--switch-project-command): Use it when
project-switch-use-entire-map is non-nil. Also check that CHOICE
is not a number (bug#63648). And print incorrect inputs too.
Juri Linkov [Thu, 19 Oct 2023 18:50:28 +0000 (21:50 +0300)]
* lisp/progmodes/project.el (project--other-place-prefix): New function.
(project-other-window-command, project-other-frame-command)
(project-other-tab-command): Use it in Emacs versions not less than 30
where other-*-prefix commands are available.
This fixes the cases such as 'C-u C-x 5 p p f TAB' from bug#65558.
Michael Albinus [Thu, 19 Oct 2023 14:28:26 +0000 (16:28 +0200)]
Update Tramp version (don't merge with master)
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.6.2.29.2".
(customize-package-emacs-version-alist):
Adapt Tramp version integrated in Emacs 29.2.
Andrea Corallo [Wed, 18 Oct 2023 14:14:45 +0000 (16:14 +0200)]
Improve cstr typeset normalization
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add four tests.
* lisp/emacs-lisp/comp-cstr.el (comp--sym-lessp)
(comp--direct-supertype, comp--normalize-typeset0): New functions.
(comp-normalize-typeset): Rework to make use of
'comp--normalize-typeset0'.
(comp--direct-subtypes): New function.
Gerd Möllmann [Thu, 19 Oct 2023 09:27:14 +0000 (11:27 +0200)]
Gud support for column numbers
Allow gud-last-frame to be of the form (FILE LINE COLUMN).
* lisp/progmodes/gud.el (gud-display-frame): Support column numbers.
(gud-display-line): New optional parameter for column number. Move
point to that column, if set.
(gud-lldb-marker-filter): Set column number.
Gerd Möllmann [Thu, 19 Oct 2023 08:28:15 +0000 (10:28 +0200)]
Don't rely on LLDB output format
Let Gud define its own frame format that is easily parseable,
and also contains the full source file path.
* lisp/progmodes/gud.el (gud-lldb-stop): New function.
(gud-lldb-marker-filter): Support new frame-format.
(gud-lldb-frame-format): variable for frame-format.
(gud-lldb-initialize): Set frame-format.
Po Lu [Thu, 19 Oct 2023 08:19:18 +0000 (16:19 +0800)]
Relay body and attachments within Android e-mails to message-mailto
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Infer
e-mail body and subject from its parameters and convey this
information to message-mailto.
* lisp/gnus/message.el (message-mailto): New arguments SUBJECT,
BODY and FILE-ATTACHMENTS.
(message-mailto-1): Insert these arguments as appropriate.
Gerd Möllmann [Thu, 19 Oct 2023 06:39:07 +0000 (08:39 +0200)]
Gud LLDB fix for large completion count (bug#66625)
* lisp/progmodes/gud.el (gud-lldb-max-completions): New defcustom.
(gud-lldb-def-python-completion-function): New argument.
(gud-lldb-fetch-completions): Pass max count to gud_complete.
(gud-lldb-initialize): Change text displayed at the end.
Harald Jörg [Wed, 18 Oct 2023 14:25:56 +0000 (16:25 +0200)]
; cperl-mode.el: Fix indentation issues after a format declaration.
* lisp/progmodes/cperl-mode.el (cperl-sniff-for-indent): Recognize
the end of a format declaration as a statement boundary. This fixes
indentation if several format declarations immediately follow each
other.
(cperl-find-pods-heres): use the correct capture group for the
name of an unterminated format declaration. Fix an out of
boundary error when a format declaration is typed at the end of a
buffer (Bug#66139).
F. Jason Park [Mon, 14 Feb 2022 18:28:01 +0000 (10:28 -0800)]
Improve SOCKS error handling and support version 4a
* doc/misc/url.texi: Mention version 4a in SOCKS portion of "Gateways
in general" node.
* etc/NEWS: Mention version 4a support in new `socks' section.
* lisp/net/socks.el (socks-server): Add new Custom choice `4a' for
version field. This change does not further overload the field in
terms of expected type because `socks-send-command' and `socks-filter'
already accommodate the symbol `http'.
(socks--errors-4): Add new constant containing error messages for
version 4. The semantics are faithful to the de facto spec, but the
exact wording is slightly adapted.
(socks-filter): Allow for a null "type" field on error with version 5.
Previously, certain errors would not propagate because a wrong-type
signal would get in the way.
(socks-send-command): Massage existing version 4 protocol parsing to
accommodate 4a, and add error handling for version 4. Use variable
`socks-username' for v4 variable-length ID field instead of calling
`user-full-name', which has potential privacy implications.
* test/lisp/net/socks-tests.el (socks-tests-v4-basic): Don't mock
`user-full-name' because `socks-send-command' no longer calls it to
determine the ID.
(socks-tests-v4a-basic, socks-tests-v4a-error): Add a couple tests for
SOCKS version 4a. (Bug#53941)
F. Jason Park [Mon, 14 Feb 2022 18:28:01 +0000 (10:28 -0800)]
Don't hard code server ports in SOCKS tests
* test/lisp/net/socks-tests.el (socks-tests-canned-server-create,
socks-tests-filter-response-parsing-v4): Fix bug in process filter to
prevent prepared outgoing responses from being implicitly encoded as
UTF-8. Fix similar mistake in v4 filter test.
(socks-tests-v4-basic, socks-tests-v5-auth-user-pass,
socks-tests-v5-auth-user-pass-blank, socks-tests-v5-auth-none): Allow
system to choose port instead of hard-coding it.
(socks-tests-perform-hello-world-http-request): Add optional `method'
parameter to specify a gateway method.
(socks-tests-v5-auth-none): Move body to helper function of the same
name.
(socks-override-functions): New test ensuring top-level advice around
`open-networks-stream' still supported. (Bug#53941)
João Távora [Wed, 18 Oct 2023 10:48:49 +0000 (05:48 -0500)]
Eglot: respect completion sort order dictated by the server
Don't use flex style to do any completion sorting.
Previously, it was thought that the 'flex' completion style was only
kicking in to do (approximate) fontification of the completions
returned by the server, but it was found that it was also doing some
its own sorting in certain situation of non-empty matching patterns.
Replaced it with a new eglot--dumb-flex style which does only
fontification.
Po Lu [Wed, 18 Oct 2023 05:52:19 +0000 (13:52 +0800)]
Correctly bisect format 12 and 8 cmap tables
* src/sfnt.c (sfnt_bsearch_above): Cease returning the last
element if it is ordered below the key itself.
(sfnt_lookup_glyph_8, sfnt_lookup_glyph_12): Verify whether the
group returned is NULL.
Po Lu [Tue, 17 Oct 2023 00:33:25 +0000 (08:33 +0800)]
Correctly register focus events concomitant with alpha changes
* src/xterm.c (x_frame_highlight, x_frame_unhighlight): Skip
changing the frame alpha when the frame is not eligible for
focus state-specific alpha values; otherwise, the alpha might be
reset by the time a alpha change wrought by a focus change
arrives, impeding handle_one_xevent from subsequently restoring
the initial value. (bug#66398)
Jim Porter [Mon, 16 Oct 2023 20:21:07 +0000 (13:21 -0700)]
; Use the "new" calling convention for 'sit-for' in Eshell
* lisp/eshell/esh-proc.el (eshell-process-wait-seconds)
(eshell-process-wait-milliseconds): Make obsolete in favor of...
(eshell-process-wait-time): ... this, and...
(eshell-wait-for-process): ... use it.
* lisp/vc/vc-hooks.el (vc-mode-line-state): New function with code moved from
'vc-default-mode-line-string'.
(vc-default-mode-line-string): Use 'vc-mode-line-state'.
* lisp/vc/vc-git.el (vc-git-mode-line-string): Use
'vc-mode-line-state' instead of hacking the string returned from
'vc-default-mode-line-string'.
* lisp/vc/vc-hg.el (vc-hg-mode-line-string): Use
'vc-mode-line-state' instead of duplicating code from
'vc-default-mode-line-string'.
Eli Zaretskii [Mon, 16 Oct 2023 11:17:57 +0000 (14:17 +0300)]
Fix "C-0 C-x C-s" with write-protected files
* lisp/files.el (basic-save-buffer-2): Call 'set-file-modes' to
try to make the file writable, even if
'set-file-extended-attributes' succeeded. (Bug#66546)
Michael Albinus [Mon, 16 Oct 2023 07:02:39 +0000 (09:02 +0200)]
Merge from origin/emacs-29
07c45f20fd3 Fix test in files-tests 5d3f3288d22 ; * doc/emacs/search.texi (Regexp Backslash): Improve ind... 9525315c117 Add missing :version to two defcustoms 9044d4d94bb Fix a defcustom :type in eldoc.el 8141d73ea7f Document 'M-x align' in the Emacs manual
Alan Mackenzie [Sun, 15 Oct 2023 10:54:23 +0000 (10:54 +0000)]
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.
Po Lu [Sun, 15 Oct 2023 05:10:34 +0000 (13:10 +0800)]
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.
* src/androidvfs.c (android_check_content_access): Circumvent
JNI dynamic method dispatch.
(android_authority_name): Guarantee NAME is never a directory.
Mauro Aranda [Thu, 12 Oct 2023 12:41:58 +0000 (09:41 -0300)]
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)
Stefan Kangas [Sat, 14 Oct 2023 19:07:30 +0000 (21:07 +0200)]
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)
Alan Mackenzie [Sat, 14 Oct 2023 19:14:57 +0000 (19:14 +0000)]
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.
Spencer Baugh [Fri, 13 Oct 2023 01:06:53 +0000 (21:06 -0400)]
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)
Mauro Aranda [Sat, 14 Oct 2023 12:05:35 +0000 (09:05 -0300)]
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.
* 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.
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.