Juri Linkov [Thu, 25 May 2023 18:40:38 +0000 (21:40 +0300)]
* lisp/progmodes/project.el: Move :safe from defcustom to autoload (bug#63469)
(project-vc-ignores, project-vc-merge-submodules)
(project-vc-include-untracked, project-vc-name)
(project-vc-extra-root-markers, project-kill-buffers-display-buffer-list):
Autoload the line that puts 'safe-local-variable' property on defcustom symbol
instead of using the :safe keyword.
Juri Linkov [Thu, 25 May 2023 18:24:23 +0000 (21:24 +0300)]
Add vc-create/switch/print-branch to menu and update documentation (bug#63690)
* doc/emacs/maintaining.texi (VC Change Log):
Add 'C-x v b l' (vc-print-branch-log).
(Creating Branches): Add @kindex and @findex for vc-create-branch.
(Switching Branches): Add @kindex and @findex for vc-switch-branch.
* lisp/vc/vc-hooks.el (vc-menu-map): Add menu items for new
commands vc-create-branch and vc-switch-branch, and also
vc-print-branch-log.
Eli Zaretskii [Tue, 23 May 2023 14:44:23 +0000 (17:44 +0300)]
Fix 'use-dialog-box-p' and friends
* lisp/subr.el (use-dialog-box-p): Use dialog boxes also when
invoked from some window-system gesture. (Bug#63655)
(y-or-n-p): Fix the description in the doc string of conditions
under which a dialog box will be used.
* src/fns.c (Fyes_or_no_p): Use the same condition for dialog
boxes as in 'use-dialog-box-p'. Fix the description in the doc
string of conditions under which a dialog box will be used.
* doc/lispref/minibuf.texi (Multiple Queries, Yes-or-No Queries):
Fix the description of conditions under which a dialog box will be
used.
Stefan Monnier [Mon, 22 May 2023 16:49:26 +0000 (18:49 +0200)]
Avoid duplicates when adding package dirs to load-path
Do not merge to master, we're going to delete this code there.
* lisp/emacs-lisp/package.el (package-activate-1): Check if the path
we're about to add is already in 'load-path', since package autoload
files have been updating 'load-path' for a decade.
Robert Pluim [Mon, 22 May 2023 13:44:21 +0000 (15:44 +0200)]
Avoid duplicate load-path entry when generating package autoloads
'file-name-directory' produces a path ending in '/', so that needs to be
run through 'directory-file-name' to avoid duplicate entries in
'load-path'. (Bug#63625)
* lisp/emacs-lisp/package.el (package-generate-autoloads): Call
'directory-file-name' on the directory of 'load-file-name'.
Eli Zaretskii [Tue, 23 May 2023 11:30:31 +0000 (14:30 +0300)]
Disable loading SQLite3 extensions when SQLite3 version is too old
* src/sqlite.c (HAVE_LOAD_EXTENSION): Define to 1 only if
enabling/disabling extension loading is supported as well.
(load_dll_functions, Fsqlite_load_extension): Condition on
HAVE_LOAD_EXTENSION, not on HAVE_SQLITE3_LOAD_EXTENSION.
(Bug#63653)
; Fix markup of some treesit vars in Elisp manual.
* doc/lispref/modes.texi (Parser-based Font Lock):
(Parser-based Indentation):
* doc/lispref/parsing.texi (Multiple Languages): Use @code in place
of @var when the argument is not a metavariable.
Jens Schmidt [Sat, 20 May 2023 21:46:42 +0000 (23:46 +0200)]
Remove obsolete information from Gnus manual
The Gnus manual was still referencing long-removed external
marks in section "Archiving Mails". Without external marks,
that section is almost pointless, so remove it completely.
* doc/misc/gnus.texi (Archiving Mail): Remove section.
(Top, Browsing the Web): Remove references to "Archiving
Mail". (Bug#63497)
Jens Schmidt [Sat, 20 May 2023 21:03:29 +0000 (23:03 +0200)]
Preserve mark in comint-history-isearch
This preserves mark in `comint-history-isearch-backward' and
friends, which tend to set the mark on completion of the isearch
to unexpected positions.
* lisp/comint.el (comint-history-isearch-end): Set `isearch-opoint'
to point. (Bug#63616)
Eli Zaretskii [Sat, 20 May 2023 14:56:40 +0000 (17:56 +0300)]
Fix Skeletons menu-bar menu in Python modes
* lisp/progmodes/python.el (python-mode, python-ts-mode): Call
'python-skeleton-add-menu-items' here, not in 'python-base-mode',
since the "Python" menu is not yet set up in the latter.
(Bug#63598)
Eli Zaretskii [Sat, 20 May 2023 12:43:44 +0000 (15:43 +0300)]
Fix loading SQLite extensions
* src/sqlite.c (sqlite3_db_config) [WINDOWSNT]: Load from the DLL.
(Fsqlite_load_extension): Use 'sqlite3_db_config' to enable and
disable loading of extensions. Add a few free extensions to the
allow-list. Fix testing for the ".dll" extension. (Bug#63590)
* test/src/sqlite-tests.el (sqlite-load-extension): Fix the test
to require successful load if the extension does exist.
Yuan Fu [Fri, 19 May 2023 23:09:17 +0000 (16:09 -0700)]
Improve c-ts-mode font-lock for function names (bug#63390)
When a function definition has preproc directives in its body, it
can't correctly parse into a function_definition. This fix tries to
recognize this case and highlight the function_declarator correctly.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--font-lock-settings): New rule.
(c-ts-mode--top-level-declarator): New function.
Juri Linkov [Fri, 19 May 2023 18:14:16 +0000 (21:14 +0300)]
* lisp/tab-bar.el: Don't use 'minibuffer-selected-window' (bug#62427).
(tab-bar-select-tab, tab-bar-new-tab-to):
Use 'window-minibuffer-p' instead of 'minibuffer-selected-window'.
And switch to 'get-mru-window' instead of 'minibuffer-selected-window'.
Juri Linkov [Fri, 19 May 2023 18:04:50 +0000 (21:04 +0300)]
Split windows horizontally in places that use split to create a new window.
* lisp/tab-bar.el (tab-bar-new-tab-to):
* lisp/window.el (window-state-put):
To create a new window, split horizontally instead of vertically.
Use 'window-safe-min-width' for the SIZE arg of 'split-window'.
(bug#62592)
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)