Jens Schmidt [Tue, 16 May 2023 21:31:19 +0000 (23:31 +0200)]
Clarify misleading comment in isearch.el
Clarify a misleading comment in isearch.el as to whether frame events
should exit an isearch or not (Bug#62032, Bug#41338 for background
information).
* lisp/isearch.el (isearch-mode-map): Replace the misleading comment.
(Bug#62032)
* lisp/progmodes/python.el (python--completion-predicate)
(python-shell--completion-predicate): Filter M-x completion based on
python-base-mode instead of python-mode. This allows for
python-ts-mode as well (bug#63552).
Joseph Turner [Sat, 6 May 2023 21:49:43 +0000 (14:49 -0700)]
Fix building of VC package manuals with relative includes
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Invoke makeinfo with -I to ensure the package directory is always
consulted for @include statements. (Bug#63337)
Eli Zaretskii [Sat, 13 May 2023 08:28:38 +0000 (11:28 +0300)]
Fix auto-filling in Texinfo mode
This fixes auto-filling in Texinfo buffers. It was broken by the
fix to bug#49558, which made M-q fill over-long @noindent lines by
refraining from customizing 'paragraph-separate' in Texinfo mode.
The underlying problem here is that 'auto-fill-mode' doesn't call
mode-specific filling functions, but does its job by itself, and
depends on 'forward-paragraph' to find the beginning of the
paragraph as appropriate for calculation of 'fill-prefix', and a
different value of 'paragraph-separate' broke that. As a side
effect, the change below also changes paragraph-movement commands
in Texinfo back to how they behaved prior to that bugfix, but I
don't see why the paragraph-movement behavior introduced by that
fix made more sense. Try to move through a series of
@-directives, like a paragraph preceded by several @cindex
entries, and you will see the inconsistencies. In any case, the
adverse effects of that fix on auto-filling is unacceptable.
* lisp/textmodes/texinfo.el (fill-paragraph-separate): New
variable.
(texinfo-mode): Set 'fill-paragraph-separate' to the default value
of 'paragraph-separate'. Customize 'paragraph-separate' to the
Texinfo-specific value, as it was before commit dde591571abf.
(texinfo--fill-paragraph): Bind 'paragraph-separate' to the value
of 'fill-paragraph-separate', to keep 'M-q' happy.
Gregory Heytings [Fri, 12 May 2023 21:56:28 +0000 (21:56 +0000)]
Fix the return type of 'labeled_restrictions_get_bound'
* src/editfns.c:
(labeled_restrictions_get_bound): Return a Lisp_Object instead of
a pointer to a struct Lisp_Marker.
(unwind_reset_outermost_restriction, reset_outermost_restrictions)
(Fwiden, Fnarrow_to_region): Adapt to the new return type.
Ensure that package menu respects 'package-install-upgrade-built-in'
* lisp/emacs-lisp/package.el (package-menu--find-upgrades): Check if
built-in packages can be upgraded if
'package-install-upgrade-built-in' is non-nil.
Alan Mackenzie [Fri, 14 Apr 2023 10:33:03 +0000 (10:33 +0000)]
Make c-emacs-features use the proper binding of parse-sexp-lookup-properties
This is relevant for bug #58558, although it does not fix it. Due to a wrong
ordering of with-current-buffer and a let form, the function overwrote the
global value of parse-sexp-lookup-properties and two other variables.
* lisp/progmodes/cc-defs.el (c-emacs-features): Change the nesting of
with-current-buffer and let so that the let bindings get used.
Stefan Monnier [Wed, 10 May 2023 02:30:52 +0000 (22:30 -0400)]
with-display-message: Workaround for bug#63253
Running arbitrary ELisp code from an atimer is still dangerous,
at least because the regexp engine is not-reentrant, so let's patch up
the case we bumped into. There are probably many other such holes :-(
* src/alloc.c (garbage_collection_inhibited): Make it non-static.
* src/xdisp.c (garbage_collection_inhibited): Declare it.
(set_message, clear_message): Use it as a proxy for "we're in
a dangerous context like within `probably_quit`".
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.
Alan Third [Thu, 27 Apr 2023 19:08:23 +0000 (20:08 +0100)]
Fix crash when creating a child frame in NS (bug#63107)
* src/nsterm.m ([EmacsView initFrameFromEmacs:]): Have a second go at
creating the toolbar.
([EmacsWindow createToolbar:]): If there is already a toolbar or the
EmacsView's layer is not an EmacsLayer, then do nothing.
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.
define-minor-mode: sanitize mode function messages
* emacs-lisp/easy-mmode.el (define-minor-mode): Ensure mode's
pretty name is not interprted as a message formatting string,
e.g., if the mode name contains a '%'. (Bug#63343)
* lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Check for
keywords containing 'enum' on the line before an opening bracket, and
make it behave like a class-open token.
Dmitry Gutov [Sat, 6 May 2023 00:32:08 +0000 (03:32 +0300)]
(package-upgrade): Don't remove the package from 'package-selected-packages'
* lisp/emacs-lisp/package.el (package-upgrade):
Don't remove the package from 'package-selected-packages', fixing
the problem described in https://debbugs.gnu.org/62720#718.
Eli Zaretskii [Fri, 5 May 2023 07:08:59 +0000 (10:08 +0300)]
Fix arguments of xml.c functions as displayed in Help buffers
* lisp/subr.el (libxml-parse-xml-region)
(libxml-parse-html-region): Adjust advertised-calling-convention
to the changes in commit cc33c6cf3a. (Bug#63291)
Cyril Arnould [Wed, 3 May 2023 19:40:18 +0000 (19:40 +0000)]
Improve VHDL mode highlighting
* lisp/progmodes/vhdl-mode.el (vhdl-compiler-alist): Differentiate
between ModelSim errors, warnings, and notes when highlighting
them. Add a new entry for Xilinx Vivado. (Bug#63251)
* lisp/net/rcirc.el (rcirc): Pass SERVER-ALIAS before CLIENT-CERT.
(rcirc-connect): Take SERVER-ALIAS before CLIENT-CERT.
This is necessary for the 'rcirc-reconnect' trick to work that applies
the contents of 'rcirc-connection-info' to 'rcirc-connect', otherwise
the server alias gets lost as certfp information.
Thuna [Wed, 23 Nov 2022 03:14:36 +0000 (04:14 +0100)]
Fix rcirc messages printing in the wrong place
* lisp/net/rcirc.el (rcirc-send-message): Print the message before
sending it to the server.
(rcirc-print): Get the time with subsecond precision.
* lisp/calendar/parse-time.el (parse-time-string
parse-iso8601-time-string): Accept optional second FORM arguments,
with the same meaning as in `decode-time'. Mention as such in the
docstring. (Bug#59501)
Prevent unnecessary modifications of 'package-vc-selected-packages'
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Handle the
structure of correctly, not as an alist but a list of alists.
(package-vc--archive-spec-alist, package-vc--archive-spec-alists,
package-vc--desc->spec, package-vc--read-archive-data,
package-vc--download-and-read-archives, package-vc--unpack): Rename
'package-vc--archive-spec-alist' to 'package-vc--archive-spec-alists'.
Randy Taylor [Wed, 26 Apr 2023 15:15:45 +0000 (11:15 -0400)]
go-ts-mode: Use iota query only if supported (Bug#63086)
iota query support was added on January 5, 2022. To support older
versions of the tree-sitter-go grammar (like the latest tagged version,
v0.19.1, which was released on March 3, 2021), check if the query is
supported before trying to use it.
* lisp/progmodes/go-ts-mode.el (go-ts-mode--iota-query-supported-p): New
function.
(go-ts-mode--font-lock-settings): Use it.
Dmitry Gutov [Wed, 3 May 2023 20:58:27 +0000 (23:58 +0300)]
(rng-complete-tag): Add the (ignored) argument to the :company-kind function
* lisp/nxml/rng-nxml.el (rng-complete-tag): Add the (ignored)
argument to the :company-kind function. Fixes the "Wrong number
of arguments" error reported at
https://github.com/company-mode/company-mode/issues/1386.
Recognize defstruct slot names in various eieio functions
* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Set
each slot's name's 'slot-name' property so that
'eieio--known-slot-name-p' can recognize them. (Bug#62959)
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 [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)
* 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)
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 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)
* 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.