Michael Albinus [Thu, 8 Jun 2023 07:59:06 +0000 (09:59 +0200)]
Fix connection-local user options handling (bug#63300)
* lisp/files-x.el (connection-local-set-profiles)
(connection-local-set-profile-variables): Avoid saving the changed
user option to file unless triggered explicitly by user. (Bug#63300)
Andrea Corallo [Tue, 6 Jun 2023 09:27:13 +0000 (11:27 +0200)]
Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#58314)
* lisp/emacs-lisp/comp.el (comp-write-bytecode-file): New function
spilling code from `batch-byte+native-compile'.
(batch-byte+native-compile): Make use of.
* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Produce the elc file and ask
to have it loaded.
Revert changes to the order in which package descs are loaded
* lisp/emacs-lisp/package.el (package-load-all-descriptors): Remove
NOSORT argument to 'directory-files', reverting back to the behaviour
as of Emacs 28. (Bug#63757)
Spencer Baugh [Sat, 3 Jun 2023 00:57:32 +0000 (20:57 -0400)]
Handle point in last file-name component in minibuffer completion
This is a followup to commit e338a8ac41d4a9fd798dda90275abe75ac071335
(Handle point not at EOB in minibuffer-choose-completion).
That commit added a heuristic, but the heuristic was insufficient:
It still had the original wrong behavior when completing the last
file-name component (i.e., the completion category is 'file' and
there's no slash after point). This patch makes the heuristic
cover that case as well.
* lisp/minibuffer.el (minibuffer-next-completion)
(minibuffer-choose-completion): If in file completion and there's no
slash after point, clear what's after point when we complete.
(Bug#62700)
Some AWK implementations have a fixed buffer for sprintf; for mawk the
default size is 8192 bytes. Hoist a string concatenation from
a sprintf call to avoid running into that limit. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00090.html .
Йордан Миладинов [Fri, 26 May 2023 14:23:26 +0000 (17:23 +0300)]
Fix apostrophe handling in rust-ts-mode and go-ts-mode (Bug#63708)
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--syntax-propertize):
Treat apostrophes as strings if used to define character literals.
Treat LT and GT as pairs if used to define type parameters (formerly
they were treated as pairs only for type arguments).
* lisp/progmodes/go-ts-mode.el (go-ts-mode--syntax-table): Treat
apostrophes as strings if used to define rune literals.
Eli Zaretskii [Sat, 3 Jun 2023 07:20:08 +0000 (10:20 +0300)]
Fix 'python-util-clone-local-variables'
* lisp/progmodes/python.el (python-util-clone-local-variables):
Avoid signaling an error when a local variable is unbound.
Patch by Ernesto Alfonso <erjoalgo@gmail.com>. (Bug#63818)
We have found that there are performance issues when editing a large
file. The issue can be reproduced as follows:
1. emacs -Q
2. Open large Python file (e.g. turtle.py in Python)
3. Near the top of the buffer, enter open paren and some characters.
The above commit extends the region to be font-locked using
`python-nav-end-of-statement'. However, if there are unbalanced
parens, it may move point to the end of the buffer. This causes
almost the entire buffer to be font-locked, which is not acceptable
for large files.
Robert Pluim [Fri, 2 Jun 2023 11:54:56 +0000 (13:54 +0200)]
Make VS-15 and VS-16 compositions work correctly
There is a conflict between forward matching and backward matching
composition rules involving the same codepoint, which can cause the
backward matching ones not to be invoked. Ensure that VS-15 (U+FE0E)
and VS-16 (U+FE0F) are composed by forward matching rules instead in
order to avoid this issue.
* admin/unidata/emoji-zwj.awk: Add rules for CHAR+VS-15 and CHAR+VS-16.
* lisp/composite.el: remove backward matching rule for VS-15. (Bug#63731)
Dmitry Gutov [Fri, 2 Jun 2023 02:10:15 +0000 (05:10 +0300)]
Fix project-name for vc-aware backend in non-file buffers
* lisp/progmodes/project.el (project-name): Make sure
project-vc-name is picked up from dir-locals in all
non-file-visiting buffers too (mentioned in bug#63469).
; Fix 'package-install-upgrade-built-in' check for package menu
* lisp/emacs-lisp/package.el (package-menu--find-upgrades): Use
correct check to verify if a built-in packages in the package menu can
be upgraded or not.
Stephen Berman [Wed, 31 May 2023 14:15:48 +0000 (16:15 +0200)]
Fix several todo-mode.el item editing bugs (bug#63811)
* lisp/calendar/todo-mode.el (todo-insert-item--basic): With
insertion type 'here', ensure item is inserted on the todo-mode
line where the command was invoked.
(todo-edit-item--cat, todo-edit-item--pos): New variables.
(todo-edit-item--text): Restrict the scope of nil-valued
buffer-read-only to the functions that change buffer text. If
user moved point while editing a single-line todo item or a done
item comment, or while inserting a done item comment, restore
point, and for comments, make sure the done items section is
displayed. For multiline items, set the new variables so
todo-edit-quit can use them.
(todo-edit-quit): Use the values of the new variables to restore
point in the todo-mode buffer if it had been moved while editing.
(todo-edit-item--header): Avoid clobbering match data when editing
a todo item header.
Juri Linkov [Mon, 29 May 2023 17:34:53 +0000 (20:34 +0300)]
* lisp/tmm.el (tmm-completion-delete-prompt): Add more checks (bug#63754).
In case when 'completions-header-format' is nil, the first 'mouse-face'
property is at the beginning of the buffer. So first use 'get-text-property'
at point-min.
Robert Pluim [Tue, 25 Apr 2023 10:28:47 +0000 (12:28 +0200)]
Allow dired to invoke secondary browser
'browse-url-of-dired-file' always invokes the primary browser, but
sometimes it's handy to call a different browser, which is why
'browse-url-secondary-browser-function' exists.
* lisp/net/browse-url.el (browse-url-of-dired-file): Call
'browse-url-secondary-browser-function' when invoked with a prefix
argument.
* etc/NEWS: Announce the change.
Eli Zaretskii [Mon, 29 May 2023 12:32:51 +0000 (15:32 +0300)]
Fix order of tmm-menubar when 'tmm-mid-prompt' is nil
* lisp/tmm.el (tmm-prompt): Reverse 'tmm-km-list' when
'tmm-mid-prompt' is nil, to present the menu in the correct order.
Suggested by Thiago Melo <tmdmelo@gmail.com>.
Robert Pluim [Sun, 28 May 2023 14:36:44 +0000 (16:36 +0200)]
Add instructions and test file for VS-15/VS-16
* admin/notes/unicode: Add instructions for emoji-variation-sequences.txt
* admin/unidata/emoji-variation-sequences.txt: New file, imported from
Unicode 15.
Eli Zaretskii [Sat, 27 May 2023 17:09:40 +0000 (20:09 +0300)]
Fix tmm-menubar when 'tmm-completion-prompt' is nil
* lisp/tmm.el (tmm-prompt): Handle nil value of 'tmm-mid-prompt'.
(tmm-completion-delete-prompt): Don't rely on the exact text of
the completion heading line, as it is now a customizable format
string, and can be nil, meaning no heading line is inserted at
all. Instead, search for the first character of the menu based on
text properties used for it. (Bug#63754)
kobarity [Wed, 24 May 2023 13:06:51 +0000 (22:06 +0900)]
Use 'font-lock-extend-region-functions' in python-mode
* lisp/progmodes/python.el (python-font-lock-extend-region): Change
arguments and return value for 'font-lock-extend-region-functions'.
(python-mode): Change from
'font-lock-extend-after-change-region-function' to
'font-lock-extend-region-functions'. (Bug#63622)
kobarity [Wed, 24 May 2023 13:01:12 +0000 (22:01 +0900)]
Fix python-info-docstring-p
* lisp/progmodes/python.el (python-info-docstring-p): Stop using
python-rx string-delimiter.
* test/lisp/progmodes/python-tests.el
(python-font-lock-escape-sequence-bytes-newline)
(python-font-lock-escape-sequence-hex-octal)
(python-font-lock-escape-sequence-unicode)
(python-font-lock-raw-escape-sequence): Mark as expected failures
until another bug in 'python-info-docstring-p' is corrected.
(python-info-docstring-p-7): New test. (Bug#63622)
Handle #@00 in new reader in a compatible way (bug#63722)
This was a regression from Emacs 28.
* src/lread.c (skip_lazy_string, read0): Make #@00 read as nil, which
is a quirk from the old reader that we preserve for compatibility.
* test/src/lread-tests.el (lread-skip-to-eof): Verify it.
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).