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
Po Lu [Sun, 27 Nov 2022 11:17:38 +0000 (19:17 +0800)]
Make frame synchronization more robust
* src/xterm.c (x_sync_wait_for_frame_drawn_event)
(x_sync_handle_frame_drawn): Only cancel frame synchronization
if hanging twice or more in a row.
* src/xterm.h (struct x_output, FRAME_X_DRAW_JUST_HUNG): New
flag.
* lisp/progmodes/csharp-mode.el (c-basic-matchers-before): Remove
invalid string check for Emacs 27.
(version=): Remove compatibility hack for string handling in CC Mode
in Emacs 27.1. (Bug#59602)
Stefan Kangas [Sun, 27 Nov 2022 06:29:54 +0000 (07:29 +0100)]
Improve describe-text-properties display
* lisp/descr-text.el (describe-property-list): Don't propertize white
space with the 'help-argument-name' face. This improves display
slightly when that face has an underline.
Yuan Fu [Sat, 26 Nov 2022 23:32:57 +0000 (15:32 -0800)]
Make typescript-ts-mode not fallback to js-mode
1. js-mode might not be able to handle typescript file
2. Now that we use separate modes for tree-sitter modes, not falling
back makes tree-sitter modes more consistent
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode): Remove
the fallback code.
Yuan Fu [Sat, 26 Nov 2022 23:31:48 +0000 (15:31 -0800)]
Make bash-ts-mode fall back to sh-mode if the file isn't in Bash
* lisp/progmodes/sh-script.el (sh--guess-shell): Take out into a new
function.
(sh-base-mode): Use the new function.
(bash-ts-mode): Update docstring.
(sh--redirect-recursing): New variable.
(sh--redirect-bash-ts-mode): New function.
Yuan Fu [Sat, 26 Nov 2022 22:54:55 +0000 (14:54 -0800)]
Add treesit-font-lock-level
This replaces font-lock-maximum-decoration and allows us to disable
the busiest fontification level by default.
* lisp/treesit.el (treesit-font-lock-level): New variable.
(treesit-font-lock-feature-list)
(treesit-font-lock-settings): Change docstring.
(treesit-font-lock-recompute-features): Use the new variable.
Jim Porter [Fri, 25 Nov 2022 19:13:06 +0000 (11:13 -0800)]
Improve robustness of server.el tests
* lisp/emacs-lisp/ert.el (ert--insert-infos): Allow 'message' to be a
function that is called when inserting the info.
(ert-info): Update docstring to describe using a function for
MESSAGE-FORM.
* lisp/server.el (server-start): Log when the server is starting.
* test/lisp/server-tests.el (server-tests/can-create-frames-p): New
constant. Use it to skip tests that need to create frames.
(server-tests/start-emacsclient): Rename to...
(server-tests/start-client): ... this, and set the process's buffer.
(server-tests/with-server): Put the server file in a temporary
directory so we don't conflict with real Emacs servers.
(server-tests/with-client): New macro...
(server-tests/server-start/stop-prompt-with-client)
(server-tests/emacsclient/server-edit)
(server-tests/emacsclient/create-frame)
(server-tests/emacsclient/create-frame): ... use it.
(server-tests/server-start/stop-prompt-with-client): Simplify.
Eric Abrahamsen [Sat, 26 Nov 2022 20:12:50 +0000 (12:12 -0800)]
Remove mentions of create-directory nnmaildir setting
* lisp/gnus/nnmaildir.el (nnmaildir-open-server): The
'create-directory server parameter should have been removed entirely,
and supplanted by 'target-prefix. Remove check for old parameter.
* doc/misc/gnus.texi (Maildir): Delete mention from manual.
Eli Zaretskii [Sat, 26 Nov 2022 10:59:06 +0000 (12:59 +0200)]
Fix generation of autoloads on MS-Windows
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--file-load-name): Handle the case when FILE and
OUTFILE don't share any common ancestor directory. (Bug#59507)
Po Lu [Sat, 26 Nov 2022 10:57:34 +0000 (18:57 +0800)]
Reduce wasted cycles in x*.c
* src/xfns.c (compute_tip_xy, Fx_show_tip):
* src/xselect.c (x_own_selection, x_get_local_selection)
(x_clear_frame_selections): Call CAR and CDR, not Fcar and Fcdr.
Stefan Kangas [Sat, 26 Nov 2022 08:37:48 +0000 (09:37 +0100)]
Use substitute-command-keys in Info-index error
* lisp/info.el (info--ensure-not-in-directory-node): New helper
function using substitute-command-keys for error message.
(Info-index, Info-virtual-index): Use it.
* lisp/progmodes/typescript-ts-mode.el: Rename from 'ts-mode' to
'typescript-ts-mode'. Rename all symbols to match new prefix.
* etc/NEWS: Mention the new mode name.
Ref: https://lists.gnu.org/r/emacs-devel/2022-11/msg01587.html
Dmitry Gutov [Sat, 5 Mar 2022 02:28:31 +0000 (04:28 +0200)]
Drop project--value-in-dir
Drop the project--value-in-dir mechanics, where the user could edit
the value in .dir-locals.el and have it applied instantly without
reverting the current buffer. It made working in remote buffers with
enable-remote-dir-locals non-nil slower, which doesn't seem worth it
for a minor improvement of an infrequent operation. Also less
compexity overall.
* lisp/progmodes/project.el (project-try-vc, project-files)
(project--vc-list-files, project-ignores, project-buffers):
Use the user options directly.
(project--vc-merge-submodules-p, project--value-in-dir):
Delete functions.
F. Jason Park [Fri, 25 Nov 2022 05:03:03 +0000 (21:03 -0800)]
Disable auth-source-pass-extra-query-keywords by default
* doc/misc/auth.texi: Mention subdomain matching in
`auth-source-pass-extra-query-keywords' section.
* etc/NEWS: Mention the loss of traditional auth-source-pass features
when `auth-source-pass-extra-query-keywords' is enabled.
* lisp/auth-source-pass (auth-source-pass-extra-query-keywords): Set
default to nil. Mention domain matching in doc string.
(auth-source-pass--match-regexp): Allow username to contain "@".
* lisp/erc/erc-compat.el:
(erc-compat--29-auth-source-pass--retrieve-parsed): Adjust regexp.
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-extra-query-keywords--suffixed-user): make plain
username more email-like.
(Bug#58985.)
Alan Mackenzie [Fri, 25 Nov 2022 09:49:02 +0000 (09:49 +0000)]
CC Mode: Fix the "asymmetry rule" for fontifying a type followed by *
This fixes bug #59427. We now handle correctly the case when a parenthesis
follows the * which is ambiguously a multiplication or indirection operator.
Also, we don't recognise a type thus found as a found type - the evidence is
too weak.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): Fix CASE 17.5 as
above.
Jim Porter [Mon, 21 Nov 2022 19:47:08 +0000 (11:47 -0800)]
Don't explicitly delete client frames when killing Emacs anyway
This eliminates a useless error prompt when killing Emacs from a
client frame when there are no other frames (bug#58877).
* lisp/server.el (server-running-external): New error.
(server--file-name): New function...
(server-eval-at): ... use it.
(server-start): Factor out server stopping code into...
(server-stop): ... here.
(server-force-stop): Use 'server-stop', and tell it not to delete
frames.
* test/lisp/server-tests.el
(server-tests/server-force-stop/keeps-frames): New test.
Jim Porter [Fri, 25 Nov 2022 01:22:53 +0000 (17:22 -0800)]
; Fix up some NEWS entries for Eshell
* etc/NEWS (Incompatible changes in Emacs 29.1): Move an entry from
here...
(Changes in Specialized Modes and Packages in Emacs 29.1): ... to
here. Additionally, improve wording of another entry to be more
precise.
Ackerley Tng [Fri, 25 Nov 2022 00:58:33 +0000 (02:58 +0200)]
Add support for window-local xref history
* lisp/progmodes/xref.el (xref-history-storage):
New user option (bug#59381).
(xref--make-xref-history): New function.
(xref--history): Use it.
(xref-global-history, xref-window-local-history): New function.
(xref--get-history): New function.
(xref--push-backward, xref--push-forward)
(xref-push-marker-stack, xref-go-back, xref-go-forward)
(xref-clear-marker-stack, xref-marker-stack-empty-p)
(xref-forward-history-empty-p): Use it.
Ulf Jasper [Thu, 24 Nov 2022 17:56:50 +0000 (18:56 +0100)]
icalendar: Adjust tests after fixing parsing of sexp entries (bug#56241)
* test/lisp/calendar/icalendar-tests.el
(icalendar-export-bug-56241-nested-sexps): New.
* test/lisp/calendar/icalendar-tests.el (icalendar-real-world):
Disable testcase for exporting sexp entries that has now become invalid.
Some servers avoid reporting completion items that
require "additionalTextEdits" capability. Actually,
'eglot-completion-at-point' function supports such
feature so it can be advertised to LSP server.
* lisp/progmodes/eglot.el (eglot-client-capabilities): Advertise
resolveSupport. (bug#59465)
Po Lu [Thu, 24 Nov 2022 12:10:14 +0000 (20:10 +0800)]
Fix reentrancy problem/crash in xterm.c
* src/xterm.c (x_ignore_errors_for_next_request)
(x_stop_ignoring_errors): Be paranoid and block input inside the
protected section.
(x_focus_frame): Block input around critical section.
* lisp/files.el (move-file-to-trash): When trashing a directory with
the same name as something that's already in the trash, copy it into
the trash folder and then delete it, rather than using rename-file.
Tassilo Horn [Thu, 24 Nov 2022 09:47:54 +0000 (10:47 +0100)]
Fix face issues in show-paren context overlay (bug#59527)
* lisp/paren.el (show-paren--show-context-in-overlay): Use
show-paren-priority as overlay priority (fixes problem 2 of
bug#59527).
* lisp/simple.el (blink-paren-open-paren-line-string): Ensure the
context lines are font-locked before taking the
buffer-substring (fixes problem 1 of bug#59527).
Eli Zaretskii [Thu, 24 Nov 2022 09:09:51 +0000 (11:09 +0200)]
Avoid assertion violations in treesit.c when editing non-ASCII
* src/treesit.c (make_treesit_parser): Use byte positions when
initializing 'lisp_parser'. This avoids assertion violations when
the buffer has non-ASCII characters.
Dmitry Gutov [Thu, 24 Nov 2022 02:33:01 +0000 (04:33 +0200)]
project-switch-project: Use a different fix for bug#58784
* lisp/progmodes/project.el (project-current-inhibit-prompt):
Rename to 'project-current-directory-override', and make it a
string value.
(project-current): Refer to it.
(project-switch-project): Bind it. Drop the temp buffer (bug#58784).
F. Jason Park [Mon, 21 Nov 2022 03:01:32 +0000 (19:01 -0800)]
Add test scenarios for local ERC modules
* test/lisp/erc/erc-scenarios-base-local-modules.el: New file.
* test/lisp/erc/resources/base/local-modules/first.eld: New file.
* test/lisp/erc/resources/base/local-modules/fourth.eld: New file
* test/lisp/erc/resources/base/local-modules/second.eld: New file.
* test/lisp/erc/resources/base/local-modules/third.eld: New file.
(Bug#57955.)
F. Jason Park [Sun, 13 Nov 2022 09:52:48 +0000 (01:52 -0800)]
Accept functions in place of passwords in ERC
* lisp/erc/erc-backend.el (erc-session-password): Add comment
explaining type is now string, nil, or function.
* lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search):
Use obfuscation from auth-source function when available.
* lisp/erc/erc-sasl.el (erc-sasl--read-password,
erc-server-AUTHENTICATE): Use `erc--unfun'.
* lisp/erc/erc-services.el (erc-nickserv-get-password,
erc-nickserv-send-identify): Use `erc--unfun'.
* lisp/erc/erc.el (erc--unfun): New function for unwrapping a
password couched in a getter.
(erc--debug-irc-protocol-mask-secrets): Add variable to indicate
whether to mask passwords in debug logs.
(erc--mask-secrets): New function to swap masked secret with question
marks in debug logs.
(erc-log-irc-protocol): Conditionally mask secrets when
`erc--debug-irc-protocol-mask-secrets' is non-nil.
(erc--auth-source-search): Don't unwrap secret from function before
returning.
(erc-server-join-channel, erc-login): Use `erc--unfun'.
* test/lisp/erc/erc-services-tests.el
(erc-services-tests--wrap-search): Add helper for `erc--unfun'.
(erc-services-tests--auth-source-standard,
erc-services-tests--auth-source-announced,
erc-services-tests--auth-source-overrides, erc-nickserv-get-password):
Use `erc--unfun'.
* test/lisp/erc/erc-tests.el (erc--debug-irc-protocol-mask-secrets):
Add test for masking secrets with `erc--unfun' and friends.
F. Jason Park [Mon, 12 Jul 2021 10:44:28 +0000 (03:44 -0700)]
Add non-IRCv3 SASL module to ERC
* doc/misc/erc.texi: Add SASL section in Advanced Usage chapter to
document the new SASL module.
* etc/ERC-NEWS: Mention addition of erc-sasl module for SASL support.
* lisp/erc/erc-compat.el
(erc-compat--29-sasl-scram-construct-gs2-header,
erc-compat--29-sasl-scram-client-first-message,
erc-compat--29-sasl-scram--client-final-message): Fix encoding bug and
add minimal authorization support with copies of SASL functions
introduced in Emacs 29.
* lisp/erc/erc.el (erc-modules): Add `sasl'.
* lisp/erc/erc-sasl.el: New file (bug#29108).
* test/lisp/erc/erc-sasl-tests.el: New file.
* test/lisp/erc/erc-scenarios-sasl.el: New file.
* test/lisp/erc/resources/sasl/plain-failed.eld: New file.
* test/lisp/erc/resources/sasl/plain.eld: New file.
* test/lisp/erc/resources/sasl/scram-sha-1.eld: New file.
* test/lisp/erc/resources/sasl/scram-sha-256.eld: New file.
* test/lisp/erc/resources/sasl/external.eld: New file.
F. Jason Park [Sun, 18 Sep 2022 08:49:23 +0000 (01:49 -0700)]
Call erc-login indirectly via new generic wrapper
* lisp/erc/erc-backend (erc--register-connection): Add new internal
generic function that defers to `erc-login' by default.
(erc-process-sentinel, erc-server-connect): Call
`erc--register-connection' instead of `erc-login'.