Eglot: improve treatment of completion items without :sortText (bug#61532)
Previously, defaulting to the empty string put candidates without
:sortText to the top of the list. since string-lessp is safe with nil
arguments, this makes them sort to the end instead.
Eli Zaretskii [Sun, 19 Feb 2023 09:29:32 +0000 (11:29 +0200)]
Fix invocation of File->Close from the menu bar
* lisp/simple.el (kill-buffer--possibly-save): Don't request
LONG-FORM from 'read-multiple-choice' if GUI dialog should be
used.
* lisp/emacs-lisp/rmc.el (read-multiple-choice): Doc fix.
(read-multiple-choice--short-answers): Don't append "?" to
CHOICES and don't display the prompt in the echo area if GUI
dialog is used. Use 'use-dialog-box-p'. (Bug#61553)
Eli Zaretskii [Sun, 19 Feb 2023 09:04:57 +0000 (11:04 +0200)]
; Improve documentation of 'native-comp-enable-subr-trampolines'
* doc/lispref/compile.texi (Native-Compilation Variables):
Document the interpretation of non-absolute directory names that
are the value of 'native-comp-enable-subr-trampolines'.
martin rudalics [Sun, 12 Feb 2023 09:33:11 +0000 (10:33 +0100)]
Fix 'display-buffer-use-least-recent-window'
* src/window.c (Fwindow_use_time): Doc fix.
(Fwindow_bump_use_time): Bump use time of the seleceted window as
well. Doc fix.
* lisp/window.el (display-buffer-avoid-small-windows): Remove.
All users changed.
(window--display-buffer): Bump window use time when requested.
(display-buffer--lru-window): New function.
(display-buffer-use-some-window): Use it.
(display-buffer-use-least-recent-window): Rewrite and enhance doc
string.
* doc/lispref/windows.texi (Selecting Windows)
(Buffer Display Action Functions, Buffer Display Action Alists)
(The Zen of Buffer Display): Improve and update documentation of
window selection and display facilities.
kobarity [Mon, 13 Feb 2023 15:30:15 +0000 (00:30 +0900)]
Fix point moving when calling python-shell-send-region
* lisp/progmodes/python.el (python-shell-buffer-substring): Add
`save-excursion' to prevent the point from moving.
* test/lisp/progmodes/python-tests.el (python-tests-should-not-move):
New helper function to assert that point does not move while calling a
function.
(python-shell-buffer-substring-*): Use
`python-tests-should-not-move'. (Bug#61463)
Eli Zaretskii [Sat, 18 Feb 2023 11:40:56 +0000 (13:40 +0200)]
Fix cursor motion when there's line-prefix and display string at BOL
* src/xdisp.c (move_it_in_display_line_to): Handle 'line-prefix' and
'wrap-prefix' when the screen line has a display string at its
beginning. (Bug#61580)
Yuan Fu [Sat, 18 Feb 2023 10:20:12 +0000 (02:20 -0800)]
Fix comment in treesit_record_change (bug#61369)
Turns out the previous commit message and comment is not entirely
correct: the old behavior is in fact wrong, not just "correct but has
problems".
Here is why the old code is wrong:
|visible range| -> markup for visible range
updated range -> markup for updated range
-------------
First we have some text
|aaaaaa|
Now we insert something at the beginning, because we clip
new_end_offset to visible_end, out of eight b's inserted, only the
first six are known to tree-sitter.
Eli Zaretskii [Sat, 18 Feb 2023 08:58:00 +0000 (10:58 +0200)]
Fix some uses of 'use-dialog-box'
* lisp/frame.el (display-mouse-p): Fix return value on MS-Windows
in batch invocations.
* lisp/hi-lock.el (hi-lock-unface-buffer): Don't consider
'last-nonmenu-event' being nil as a mouse event, for the purpose
of using dialog boxes.
Eli Zaretskii [Sat, 18 Feb 2023 07:37:34 +0000 (09:37 +0200)]
Fix regression due to change in face sort order by 'face-list'
* lisp/faces.el (x-create-frame-with-faces): Undo reversing of
the face list, which is no longer necessary, since 'face-list's
sorting order has been reversed recently. (Bug#61521)
Yuan Fu [Fri, 17 Feb 2023 22:21:49 +0000 (14:21 -0800)]
Don't completely clip into visible range in treesit_record_change
(Bug#61369)
From
min (visible_end, max (visible_beg, new_end_byte)) - visible_beg
to
max (visible_beg, new_end_byte) - visible_beg
* src/treesit.c (treesit_record_change): We don't clip the new end
into the visible range anymore. If you think of it, when inserting in
a narrowed region, the visible region is always extended to
accommodate more text, rather than pushing text at the end to keep the
size of the visible region.
lu4nx [Fri, 25 Nov 2022 06:38:29 +0000 (14:38 +0800)]
Fixed ctags local command execute vulnerability
* lib-src/etags.c:
(clean_matched_file_tag): New function
(do_move_file): New function
(readline_internal):
Add `leave_cr` parameter, if true, include the \r character
* test/manual/etags/CTAGS.good_crlf: New file
* test/manual/etags/CTAGS.good_update: New file
* test/manual/etags/crlf: New file
* test/manual/etags/Makefile: Add `ctags -u` test cases
Eli Zaretskii [Fri, 17 Feb 2023 08:27:39 +0000 (10:27 +0200)]
Fix order of faces in 'face-list'
* lisp/faces.el (frame-face-alist, face-list): Sort faces in
decreasing order of face IDs. Patch by Brennan Vincent
<brennan@umanwizard.com>. (Bug#61521)
Eli Zaretskii [Fri, 17 Feb 2023 07:40:32 +0000 (09:40 +0200)]
Allow 'icon-title-format' to have the value t
* src/xdisp.c (gui_consider_frame_title, syms_of_xdisp): If the
value of 'icon-title-format' is t, use 'frame-title-format'
instead. (Bug#61496)
* etc/NEWS:
* doc/lispref/frames.texi (Frame Titles): Document the new
handling of the value t.
(Basic Parameters): Fix the documentation of the 'title' and
'name' frame parameters.
It looks like there are few if no other cases where we get this
particular error in the AST than with insertion of '#'.
Consider:
```
int
main()
{
|
}
```
If we only add '#' the AST yields (ERROR (ERROR)), which we can
exploit to hook onto electric indent. The end result should be the
hashtag anchored to column 0.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule.
(c-ts-base-mode): Add # to electric-indent-chars.
Robert Pluim [Thu, 16 Feb 2023 12:04:53 +0000 (13:04 +0100)]
Rename 'emacs-news-toggle-tag' to 'emacs-news-cycle-tag'
* lisp/textmodes/emacs-news-mode.el (emacs-news-cycle-tag): Renamed
from 'emacs-news-toggle-tag'.
(emacs-news-mode-map, emacs-news-mode-menu): Use new name.
* test/lisp/textmodes/emacs-news-mode-resources/cycle-tag.erts:
Renamed from "toggle-tag.erts".
* test/lisp/textmodes/emacs-news-mode-tests.el (emacs-news-cycle-tag):
Rename test from 'emacs-news-toggle-tag', and call
'emacs-news-cycle-tag' with new resource file name.
Robert Pluim [Thu, 16 Feb 2023 09:40:40 +0000 (10:40 +0100)]
Add menu to news-mode
* lisp/textmodes/emacs-news-mode.el (emacs-news-mode-map): Add binding
for 'emacs-news-delete-temporary-markers'.
(emacs-news-mode-menu): Add menu for common actions.
; Avoid installing VC package dependencies multiple times
* lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies):
Check if two package names are eq, instead checking the structural
equality of package-desc objects.
Attempt to recognise if a VC package has no Elisp files
* lisp/emacs-lisp/package-vc.el (package-vc-non-code-file-names): Add
new variable used to avoid false-positives.
(package-vc--unpack): Recursively search for .el files excluding the
ones listed in 'package-vc-non-code-file-names', offering to abort the
installation if none are found.
F. Jason Park [Tue, 14 Feb 2023 15:29:25 +0000 (07:29 -0800)]
; Prevent ERC-induced false positive in JUnit report
* test/lisp/erc/erc-scenarios-internal.el: Mimic other test files,
like perl-mode-tests.el, in setting `ert-load-file-name' globally.
This file formerly caused a false positive in the error detection
logic of `ert-write-junit-test-summary-report'. It affected all
scheduled pipelines, including those for the release branch, Emacs 29.
Randy Taylor [Thu, 9 Feb 2023 02:43:04 +0000 (21:43 -0500)]
Fix rust-ts-mode type and module highlighting (Bug#61302)
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
Specify import queries to avoid clashing with scoped identifiers in
the code. Highlight attributes with font-lock-preprocessor-face.
Dmitry Gutov [Tue, 14 Feb 2023 17:29:30 +0000 (19:29 +0200)]
rust-ts-mode: Highlight variable reassignments
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode):
New treesit font-lock feature: 'assignment' (bug#61302).
(rust-ts-mode--fontify-pattern): Remove the node lookup step.
(rust-ts-mode--font-lock-settings): Update variable declaration
queries to match the 'pattern' child node right away. Add
highlights for 'assignment.
Gregory Heytings [Tue, 14 Feb 2023 20:22:50 +0000 (20:22 +0000)]
Improve backward compatibility of save-restriction
* src/editfns.c (save_restriction_save_1): Renamed from
'save_restrictions_save'. Make it static.
(save_restriction_restore_1): Renamed from
'save_restriction_restore'. Make it static.
(save_restriction_restore): New function, combining
'save_restriction_save_1' and 'narrowing_locks_save'.
(save_restriction_save): New function, combining
'save_restriction_restore_1' and 'narrowing_locks_restore'.
(Fsave_restriction): Restore the previous code.
(narrowing_locks_save, narrowing_locks_restore): Make them static.
* src/lisp.h: Remove two functions that are not externally visible
anymore.
* src/comp.c (helper_save_restriction): Restore the previous code.
* src/bytecode.c (exec_byte_code): Restore the previous code.
F. Jason Park [Wed, 30 Nov 2022 06:53:44 +0000 (22:53 -0800)]
; Prepare to update ERC version to 5.5
* doc/misc/erc.texi: Mention in various places that ERC is also
available from GNU ELPA.
* etc/ERC-NEWS: Mention Compat dependency and shorten title for
auth-source section.
* lisp/erc/erc-backend.el: (erc-server-reconnect-function,
erc-tags-format): Update package version to 5.5.
(erc--parse-message-tags): Downcase warning "type" to remain
consistent with all other ERC warnings.
* lisp/erc/erc-button.el: (erc-button-alist): Change package-version
to 5.5.
* lisp/erc/erc-match.el (erc-match-quote-when-adding): Update package
version to 5.5.
* lisp/erc/erc-sasl.el: Mention actual info node in Commentary.
(erc-sasl): Update package version to 5.5.
(erc-sasl-password): Reword doc string.
(erc-sasl-auth-source-function): Capitalize "info" in doc string.
* lisp/erc/erc-services.el (erc-auth-source-services-function): Update
package version to 5.5. Capitalize "info" in doc string. Change
choice type from const to function-item.
* lisp/erc/erc.el (erc-password): Capitalize "info" in doc string.
(erc-inhibit-multiline-input, erc-ask-about-multiline-input,
erc-prompt-hidden, erc-hide-prompt, erc-unhide-query-prompt,
erc-join-buffer, erc-reconnect-display, erc-kill-server-hook,
erc-kill-channel-hook, erc-kill-buffer-hook,
erc-url-connect-function): Update package version to 5.5.
(erc-auth-source-server-function, erc-auth-source-join-function):
Update package version to 5.5. Change choice type from const to
function-item. Capitalize "info" in doc string.
(erc-tls): Capitalize "info" in doc string.
Andrea Corallo [Mon, 13 Feb 2023 15:40:02 +0000 (16:40 +0100)]
Rename native-comp-deferred-compilation-deny-list
* lisp/emacs-lisp/comp.el (native-comp-jit-compilation-deny-list)
(native-compile-async-skip-p): Rename
native-comp-deferred-compilation-deny-list into
native-comp-jit-compilation-deny-list.
(native-comp-deferred-compilation-deny-list): Mark it obsolete.
Ulrich Müller [Sun, 12 Feb 2023 19:57:49 +0000 (20:57 +0100)]
Fix spurious display of eclipses in Calendar
* lisp/calendar/lunar.el (eclipse-check): Don't show an eclipse
unless the phase is new moon or full moon. (bug#61460)
* test/lisp/calendar/lunar-tests.el (lunar-test-eclipse-check)
(lunar-test-phase-list): Update tests.