* test/lisp/emacs-lisp/cl-lib-tests.el (old-struct):
Use the `vector` constructor instead of vector literals to
avoid failing because of `type-of` constant-folding.
* lisp/emacs-lisp/byte-opt.el (byte-optimize--substitutable-p):
Allow quoted lists and conses, and vector literals, to be substituted
from lexical variables. This can eliminate variable bindings and
create new constant folding opportunities.
Remove useless handling of erroneous code in Lisp optimiser
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
((closure ...) ...) is a malformed function call; treat it as such.
Better malformed function warning location.
João Távora [Fri, 5 May 2023 18:44:11 +0000 (19:44 +0100)]
Fido-mode: never shadow 'external' completion style
As explained in the manual (20.7.2 Fast minibuffer selection)
'fido-mode' and 'fido-vertical-mode' give priority the "flex"
completion style.
In fact, bug#62015 was recently fixed in commit because that priority
was not taking place correctly and some completions were missed.
However, an exception must be made for the 'external' completion
style.
That style, made available by the lisp/external-completion.el library,
is specifically designed to work with backends that provide only a
partial view of all completions. If we allow 'flex' to step in front
of 'external' it could mean that 'flex' matches something and
'external' isn't triggered as it probably should.
To reproduce have the rust-mode ELPA package and the rust-analyzer LSP
server handy. Then:
Now start M-x eglot and M-x fido-vertical-mode and type C-u M-. to
find an arbitrary symbol in this one-file project.
Type 'f'. You will see the three foo's are listed, correctly.
Now type '3'. You will only see "foo3".
But that's wrong because "foobar3" was available, if only the server
had been asked for it. This commit fixes the situation and no
completions are lost.
As an unfortunate side-effect of this commit, the fontification of
completions-common-part on the matches is lost, but that is not worse
than missing out on completions and there are better ways to recover
the fontification anyway (in external-completion.el).
See also:
https://github.com/joaotavora/eglot/discussions/1219#discussioncomment-5818336
* lisp/icomplete.el (icomplete--fido-ccd): Do not touch entries
with 'external in them.
Fix dired and tramp where `ls` does not have the `-N` option
This includes BSD ls, also used by macOS (bug#63142).
* lisp/dired.el (dired-insert-directory):
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
Test whether -N is understood by ls since that option is used along
with --dired. Remove -N when we remove --dired.
Alan Mackenzie [Wed, 3 May 2023 10:01:14 +0000 (10:01 +0000)]
Fontify "extern foo ();" correctly inside a function
This fixes bug#63224.
* lisp/progmodes/cc-engine.el (c-forward-type): Handle the "("
as a special case by trying to parse it with
c-forward-declarator and accepting it as a typeless function
when that fails.
Jim Porter [Mon, 1 May 2023 16:49:00 +0000 (09:49 -0700)]
Use connection-aware functions when getting the UID/GID in Eshell
This means, for example, that when using Tramp to sudo in Eshell, "rm"
queries the user before deleting anything (bug#63221).
* lisp/eshell/esh-util.el (eshell-user-login-name): New function...
* lisp/eshell/em-unix.el (eshell/whoami): ... use it.
* lisp/eshell/em-ls.el (eshell-ls-applicable): Use 'file-user-uid' and
'eshell-user-login-name'.
(eshell-ls-decorated-name): Use 'file-user-uid'.
* lisp/eshell/em-pred.el (eshell-predicate-alist): Use 'file-user-uid'
and 'file-group-gid'.
* lisp/eshell/em-unix.el (eshell-interactive-query): New widget...
(eshell-rm-interactive-query, eshell-mv-interactive-query)
(eshell-cp-interactive-query, eshell-ln-interactive-query): ... use
it.
(eshell-interactive-query-p): New function...
(eshell/rm, eshell/mv, eshell/cp, eshell/ln): ... use it.
* lisp/simple.el (file-group-gid): New function.
* lisp/net/ange-ftp.el (ange-ftp-file-group-gid): New function...
(file-group-gid): ... use it.
* lisp/net/tramp.el (tramp-handle-file-group-gid):
* lisp/net/tramp-archive.el (tramp-archive-handle-file-group-gid): New
functions.
Shynur [Mon, 1 May 2023 17:32:44 +0000 (01:32 +0800)]
Display matched offscreen open paren with a distinct face
Propertize matched offscreen openparen that is showing in
the echo area in order to make it prominent; use shadow
face for non-context characters (i.e., 'Matches') for the
same purpose.
* lisp/simple.el (blink-matching-paren-offscreen): Add this
face for highlighting.
* lisp/simple.el (blink-matching-paren-highlight-offscreen): Add
this option to toggle face `blink-matching-paren-offscreen'.
* lisp/simple.el (blink-paren-open-paren-line-string): Propertize
the matched offscreen openparen with a face conditionally.
(Bug#63089)
Handle point not at EOB in minibuffer-choose-completion
Without this change, only the minibuffer contents before point
are cleared when a completion is chosen, which results in stray
text when point is in the middle of the minibuffer.
After this change, we heuristically decide either to clear the
whole buffer or only part of it, taking into account the
location of point.
This is a backport for the Emacs 29 release branch of a simpler
fix in minibuffer-completion-help.
* lisp/minibuffer.el (minibuffer-next-completion):
(minibuffer-choose-completion):
Recalculate completion-base-affixes with point. (Bug#62700)
Eli Zaretskii [Tue, 2 May 2023 17:46:17 +0000 (20:46 +0300)]
Fix Dired when QUITING_STYLE is set in the environment
* lisp/dired.el (dired-insert-directory): Ensure non-default
quoting style of file names is not used by 'ls' when we invoke it
with the --dired switch. (Bug#63142)
Eli Zaretskii [Tue, 2 May 2023 12:43:51 +0000 (15:43 +0300)]
Revert "; * lisp/progmodes/c-ts-mode.el: allow loading file without treesit"
This reverts commit 7d246c359cf3d25cab5134076e393c4d25015827.
The same problem was already fixed on the release branch,and this
change will just cause merge conflicts.
Declare `cl-delete` to have important-return-value (bug#61730)
* lisp/emacs-lisp/cl-macs.el: Set property on `cl-delete`.
* lisp/progmodes/python.el (python-shell--add-to-path-with-priority):
Prevent warning by cleaner code.
Add the function declaration and property `important-return-value`
Now the declaration
(declare (important-return-value t))
can be used to have the byte-compiler warn when the return value from
a call is discarded (bug#61730).
* lisp/emacs-lisp/bytecomp.el (byte-compile-form)
(important-return-value-fns): Use the function property
`important-return-value` instead of looking through a static list.
* lisp/emacs-lisp/byte-run.el (byte-run--set-important-return-value)
(defun-declarations-alist): New function declaration, setting the
property of the same name.
* lisp/emacs-lisp/cl-macs.el:
* lisp/subr.el (assoc-default): Set the property.
* doc/lispref/functions.texi (Declare Form):
* doc/lispref/symbols.texi (Standard Properties): Document.
* etc/NEWS: Announce.
Eli Zaretskii [Mon, 1 May 2023 12:27:21 +0000 (15:27 +0300)]
Fix vertical-motion when tab-line is displayed in a window
* src/xdisp.c (try_window, try_window_id): Account for tab-line,
if present, when converting scroll-margin at the top of the window
to vertical pixel coordinate. (Bug#63201)
F. Jason Park [Fri, 28 Apr 2023 14:01:14 +0000 (07:01 -0700)]
Compare case-folded nicks with erc-fill-wrap-merge
* lisp/erc/erc-fill.el (erc-fill--wrap-continued-message-p): Downcase
both current and previous speaker when comparing nicks.
* test/lisp/erc/erc-fill-tests.el (erc-fill-wrap--merge): Add
title-case nick to test.
* test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update
snapshot.
* test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update
snapshot. (Bug#60936)
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Remove
optimisation that would mistakenly discard old loaddefs in case a file
was not modified by EXTRA-DATA is non-nil. (Bug#62734)
Eli Zaretskii [Sun, 30 Apr 2023 13:24:05 +0000 (16:24 +0300)]
Fix redisplay of mode line after its format changes from nil
* src/dispnew.c (update_window): Make sure a mode-line's row of
the current glyph matrix is disabled when the mode line is not
being displayed. (Bug#63186)
Andrew G Cohen [Sun, 30 Apr 2023 01:55:42 +0000 (09:55 +0800)]
Fix outgoing mime type regression (Bug#62815)
* lisp/net/mailcap.el (mailcap-mime-extensions,
mailcap-parse-mimetype-file, mailcap-mime-types): Don't regexp-quote
mimetypes in a context where they should be strings.
(mailcap--regexp-quote-type): Remove.
Yuan Fu [Sat, 29 Apr 2023 22:39:54 +0000 (15:39 -0700)]
Fix FOR_EACH_TAIL fontification (bug#62951)
Fix the fontification inconsistency between different FOR_EACH_TAIL's.
See the comment for more explanation. Also enable the emacs-devel
feature automatically when c-ts-mode-emacs-sources-support is on.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--for-each-tail-regexp): Move up.
(c-ts-mode--font-lock-settings): New font-lock rule for FOR_EACH_TAIL.
(c-ts-mode--fontify-for-each-tail): New function.
(c-ts-mode): Automatically enable emacs-devel feature.
Eli Zaretskii [Sat, 29 Apr 2023 08:50:47 +0000 (11:50 +0300)]
Optimize search for composable characters in redisplay
* src/composite.c (composition_compute_stop_pos): Accept new
argument INCLUDE_STATIC, and look for potential static
compositions only if this argument is non-zero.
* src/xdisp.c:
* src/composite.c:
* src/indent.c: All callers adjusted.
* src/xdisp.c (compute_stop_pos): Don't search for static
compositions. Search for automatic compositions only after the
iterator gets past the composition stop_pos computed last time.
Use a better position for limiting search for automatic
compositions. (Bug#62780)
Eli Zaretskii [Sat, 29 Apr 2023 06:39:15 +0000 (09:39 +0300)]
Fix documentation of libxml-parse-* functions
* doc/lispref/text.texi (Parsing HTML/XML):
* src/xml.c (Flibxml_parse_html_region, Flibxml_parse_xml_region):
Update the documentation regarding the use of BASE-URL argument.
(Bug#63125)
Jonas Bernoulli [Wed, 29 Mar 2023 14:57:33 +0000 (16:57 +0200)]
Support displaying all package maintainers (Bug#62524)
* lisp/emacs-lisp/package.el (describe-package-1): Use new
:maintainers package extra property from "archive-contents",
if non-nil.
* (package-buffer-info): Fix docstring.
* etc/tutorials/TUTORIAL.cn (INTRO): Additions from English
version; say "interrupt" not "quit" a partially-entered command;
fixed minor inconsistency (English says partially-entered command,
Chinese used to say partially-executed command -- they are
different); converted half-width square brackets containing
translators' notes into full-width ones for consistency.
(BASIC CURSOR CONTROL): mention that a word boundary for Chinese
can also be space; fixed incorrect terminology (keyboard vs
terminal); retain English term "terminal"; retain English term
"prefix argument"; "most commands _interpret_ prefix args as
repeat-count", not "explain"; ensure space is added on both ends
of an English word.
(WINDOWS): Clarify it is the digit 1 in C-x 1.
(INSERTING AND DELETING): Mention the term "continuation line" and
retain its English term, because this term is mentioned again
later in the tutorial; avoid saying the name of "\\"; add
description for "electric" and a rough translation; sync English
for prefix argument for DEL and C-d; ensure that translators'
notes are marked explicitly so; add indentation to the instruction
about continuation lines; additional translations such as
mentioning C--, etc.
(FILES): Re-pluralize the heading; space around English words;
describe what C-g cancels (the command) when entering file name;
replace "search for" with "find"; minor rephrasing; explicit
translator notes; fixed the write-file message to no longer
contain ellipses (see src/fileio.c:5541).
(BUFFERS): Re-pluralize the heading; mention that C-x C-b also
shows buffer name; C-x s only looks for file-visiting buffers.
(EXTENDING THE COMMAND SET): Include C-x s and C-x b in list of
learned commands.
(MODE LINE): Remove the dashes in description on the point
location.
(MULTIPLE WINDOWS): Mention the difference between frame
and window; also add translator notes pointing to end of
tutorial which contains a terminology list.
(MULTIPLE FRAMES): Change the M-x commands to keybinds C-x 5 2 and
C-x 5 0 to sync with English.
(GETTING MORE HELP): Change C-h f to C-h x, to sync with English.
(INSTALLING PACKAGES): Rephrase "available packages", used to say
lit., "existing", now says lit., "installable"; consistently
translate the term "package", and retain its English name.
(TRANSLATION): Add my name as co-maintainer of this file.
* etc/tutorials/TUTORIAL.translators (TUTORIAL.cn): Add my name
as co-maintainer for TUTORIAL.cn.
Po Lu [Fri, 28 Apr 2023 03:51:01 +0000 (11:51 +0800)]
Merge from origin/emacs-29
a40f1816237 Fix two crashes upon startup 44ebd9cbd56 Eglot: explain how to update Eglot in manual (bug#62720) 941ef044f2e Eglot: fix edge case when deleting inlay hint overlays a365984d9e1 package-upgrade[-all]: Expand docstrings to note the curr... f965f35b33b Rename all functions called package-*-update-* to package... 31b58161bb5 Fix FOR_EACH_TAIL in c-ts-mode (bug#62951) 0cf6e0998ba * Makefile.in (distclean): Remove the 'native-lisp' direc... 933705d61e5 Improve greek-ibycus4 input method
Po Lu [Fri, 28 Apr 2023 03:47:46 +0000 (11:47 +0800)]
Fix two crashes upon startup
* src/image.c (image_create_bitmap_from_data)
(image_create_bitmap_from_file): Specify a Window or a Pixmap
describing the screen, not a back buffer drawable which may not exist.
Otherwise, Emacs crashes on startup when a bitmap icon is in use.
João Távora [Thu, 27 Apr 2023 19:51:07 +0000 (20:51 +0100)]
Eglot: fix edge case when deleting inlay hint overlays
When asked to update hints in a region (FROM TO),
eglot--update-hints-1 first deletes the existing hints. It must
however take care to delete all overlays that logically belong to the
region, even if they don't physically belong to it, e.g. inlay
overlays spanning (FROM-1 FROM) and having a 'after-string' property.
Rename all functions called package-*-update-* to package-*-upgrade-*
* lisp/emacs-lisp/package-vc.el (package-vc-upgrade-all):
Rename from 'package-vc-update-all'.
(package-vc-upgrade): Rename from 'package-vc-update'.
* lisp/emacs-lisp/package.el (package-upgrade):
Rename from 'package-update' (bug#62750).
(package--upgradeable-packages):
Rename from 'package--updateable-packages'.
(package-upgrade-all): Rename from 'package-update-all'.
Yuan Fu [Thu, 27 Apr 2023 03:09:42 +0000 (20:09 -0700)]
Fix FOR_EACH_TAIL in c-ts-mode (bug#62951)
* lisp/progmodes/c-ts-mode.el
(c-ts-mode--indent-styles): New indent rule.
(c-ts-mode--for-each-tail-regexp)
(c-ts-mode--for-each-tail-body-matcher)
(c-ts-mode--emacs-c-range-query)
(c-ts-mode--for-each-tail-ranges)
(c-ts-mode--reverse-ranges)
(c-ts-mode--emacs-set-ranges): New functions and variables.
(c-ts-mode): Create a emacs-c parser. More setup for Emacs source
support.
Don't rewrite (nconc X nil) -> X for any X (bug#63103)
Since the last cdr of a non-terminal argument to `nconc` is
overwritten no matter its value:
(nconc (cons 1 2) nil) => (1)
a terminating nil arg cannot just be eliminated unconditionally.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-nconc):
Only eliminate a terminal nil arg to `nconc` if preceded by
a nonempty proper list. Right now we only bother to prove this
for `(list ...)`, so that
(nconc (list 1 2 3) nil) -> (list 1 2 3)
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--test-cases): Add test cases.
Po Lu [Thu, 27 Apr 2023 10:50:47 +0000 (18:50 +0800)]
Fix bootstrap on Unix
* admin/charsets/Makefile.in (${charsetdir}/JISX0201.map): Use
run_mapconv, which uses the correct awk.
* admin/charsets/mapconv (LC_ALL): Don't place assignment in
same line as export.
Stefan Kangas [Thu, 27 Apr 2023 04:30:14 +0000 (06:30 +0200)]
Merge from origin/emacs-29
af43f0a2954 * doc/misc/erc.texi: Elaborate on upgrading via ELPA. 10948948c12 Improve outline-default-state docstring b5ace2eed80 Document problems with /bin/sh on Solaris 10 7b2ad8f199e ; Add missing <<inserted by help-with-tutorial>> line to ...
* lisp/net/tramp-cmds.el (tramp-tainted-remote-process-buffers):
New defvar.
(tramp-cleanup-dired-buffer-p)
(tramp-delete-tainted-remote-process-buffer-function)
(kill-buffer-hook, tramp-cleanup-remote-process-p)
(tramp-cleanup-some-buffers): New defuns.
(tramp-cleanup-some-buffers-hook): New defcustom. Add
`buffer-file-name', `tramp-cleanup-dired-buffer-p' and
`tramp-cleanup-remote-process-p' to the hook.
(kill-buffer-hook):
Add `tramp-delete-tainted-remote-process-buffer-function'.
(tramp-cleanup-all-buffers): Rework.
* lisp/net/tramp-compat.el (tramp-compat-always): New defalias.
F. Jason Park [Fri, 21 Apr 2023 14:39:05 +0000 (07:39 -0700)]
Explain ERC 5.5 regressions in new version 5.5.0.29.1
* doc/misc/erc.texi: Bump version to 5.5.0.29.1.
* etc/ERC-NEWS: Don't hype bugged option `erc-reconnect-display'.
* lisp/erc/erc-dcc.el (erc-dcc-do-GET-command): Add comment explaining
parsing bug in ERC 5.5 (bug#62444).
* lisp/erc/erc-networks.el (erc-networks-on-MOTD-end): Mention known
/MOTD bug in error notice so people don't waste energy reporting
it (bug#62151).
* lisp/erc/erc.el: Change Version header to 5.5.0.29.1. Don't bother
updating the `customize-package-emacs-version-alist' entry
because no option defaults are affected.
(erc-version): Change version to 5.5.0.29.1.
(erc-reconnect-display, erc-query-on-unjoined-chan-privmsg): Add
warning to doc strings and `custom-set' functions. It's believed that
these bugs degrade the user experience significantly enough to warrant
such mentions (bug#62833).
(erc-query): Fix erroneous redirect string in deprecation spec.
Do not merge to master.
Antero Mejr [Thu, 13 Apr 2023 15:59:54 +0000 (15:59 +0000)]
eww: Provide completions for bookmarks and suggested URIs.
* lisp/net/eww.el (eww): Add the result of 'eww-suggest-uris' to the
completion collection argument.
(eww-bookmark-urls): New procedure.
(eww-suggest-uris): Add "eww-bookmark-urls" to the default list.
* etc/NEWS (EWW): Add NEWS entry for the change. (Bug#62800)
Antero Mejr [Wed, 12 Apr 2023 17:56:01 +0000 (17:56 +0000)]
eww: Enable completion in URL/keyword prompt.
* lisp/net/eww.el (eww): Use 'completing-read' when prompting for a URL
or keywords.
(eww-minibuffer-url-keymap): New keymap for use in the URL/keyword
prompt.
* etc/NEWS (EWW): Add NEWS entry for the change. (Bug#62800)
Eli Zaretskii [Tue, 25 Apr 2023 13:57:23 +0000 (09:57 -0400)]
Merge from origin/emacs-29
524e161a536 Followup to addition of TUTORIAL.fa 76f50df1539 Add Farsi/Persian translation of the tutorial 8eacfaea6d8 Add Mongolian language environments fe8efbb8f75 Document the 'end-session' event on MS-Windows d80f959bede Update to Org 9.6.4-9-g8eb209 98c6cfcbe4a Don't support versioned grammar libraries on MS-Windows 8f71c1546df Accept versioned tree-sitter language grammar files 99add09d5e1 tab-bar-new-tab: inhibit side-window checks 087e8181947 * etc/NEWS: Fix outline level. (Bug#63042) d7f38558c4c ; Improve font selection for Traditional Mongolian 965c5e0231c Fix rendering of Traditional Mongolian script 9a0f10b5f88 Fix line-number-at-pos when POSITION is out of narrowing 4e0f4292aaf ; * etc/tutorials/TUTORIAL: Fix punctuation. dec2ac0c657 Fix exiting Emacs after saving a tutorial