Merge from origin/emacs-29

4776d90c31 Add new Tramp test
ca5b48fd76 Fix tmm-mid-prompt :type (Bug#66179)
7447d3df94 Fix tree-sitter indentation conflict with multiple languages
bee18e5273 Fix bug#66093 in Tramp
7d5fee0fea Support regeneration of ja-dic.el under '--with-small-ja-...

Conflicts:
	make-dist
This commit is contained in:
Eli Zaretskii 2023-09-30 13:50:07 -04:00
commit 46978fa1ef
10 changed files with 88 additions and 14 deletions

1
.gitignore vendored
View file

@ -127,6 +127,7 @@ lisp/cedet/semantic/grammar-wy.el
lisp/eshell/esh-groups.el
lisp/finder-inf.el
lisp/leim/ja-dic/
leim/small-ja-dic-option
lisp/leim/leim-list.el
lisp/leim/quail/4Corner.el
lisp/leim/quail/ARRAY30.el

View file

@ -137,7 +137,7 @@ else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
priority = Notification.PRIORITY_HIGH;
break;
}
notification = (new Notification.Builder (context)
.setContentTitle (title)
.setContentText (content)

View file

@ -26,6 +26,7 @@ SHELL = @SHELL@
# Here are the things that we expect ../configure to edit.
srcdir=@srcdir@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# Where the generated files go.
leimdir = ${srcdir}/../lisp/leim
@ -134,9 +135,15 @@ ${leimdir}/leim-list.el: ${srcdir}/leim-ext.el ${TIT_MISC}
${leimdir}/ja-dic/ja-dic.el: | $(leimdir)/ja-dic
# This is used to support regeneration of ja-dic when the SMALL_JA_DIC
# option is flipped by the configure-time option.
small-ja-dic-option: ../config.status
$(AM_V_GEN)echo "Small ja-dic option: $(SMALL_JA_DIC)" > $@.$$$$ && \
${top_srcdir}/build-aux/move-if-change $@.$$$$ $@
.PHONY: generate-ja-dic
generate-ja-dic: ${leimdir}/ja-dic/ja-dic.el
${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L
${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L small-ja-dic-option
$(AM_V_GEN)$(RUN_EMACS) -batch -l ja-dic-cnv \
-f batch-skkdic-convert -dir "$(leimdir)/ja-dic" $(JA_DIC_NO_REDUCTION_OPTION) "$<"

View file

@ -346,6 +346,8 @@ If NO-REDUCTION is non-nil, do not reduce the dictionary vocabulary."
(erase-buffer)
(buffer-disable-undo)
(generate-lisp-file-heading ja-dic-filename 'skkdic-convert :code nil)
(insert (format ";; Generated with small ja-dic option: %s\n\n"
(if no-reduction "no" "yes")))
(insert ";; Original SKK dictionary file: "
(file-relative-name (expand-file-name filename) dirname)
"\n\n"

View file

@ -60,7 +60,7 @@
;; These are for remote processes.
(tramp-login-program "ssh")
(tramp-login-args (("-q") ("-l" "%u") ("-p" "%p")
("-e" "none") ("-t" "-t")
("-e" "none") ("%a" "%a")
("%h") ("%l")))
(tramp-direct-async t)
(tramp-remote-shell ,tramp-default-remote-shell)
@ -326,7 +326,7 @@ arguments to pass to the OPERATION."
?h (or (tramp-file-name-host v) "")
?u (or (tramp-file-name-user v) "")
?p (or (tramp-file-name-port v) "")
?l command))
?a "-t" ?l command))
;; Synchronize stderr.
(when tmpstderr

View file

@ -240,9 +240,9 @@ pair of the form (KEY VALUE). The following KEYs are defined:
\"%\" followed by a letter are expanded in the arguments as
follows:
- \"%h\" is replaced by the host name
- \"%u\" is replaced by the user name
- \"%p\" is replaced by the port number
- \"%h\" is replaced by the host name.
- \"%u\" is replaced by the user name.
- \"%p\" is replaced by the port number.
- \"%%\" can be used to obtain a literal percent character.
If a sub-list containing \"%h\", \"%u\" or \"%p\" is
@ -271,6 +271,8 @@ pair of the form (KEY VALUE). The following KEYs are defined:
- \"%z\" is replaced by the `tramp-scp-direct-remote-copying'
argument if it is supported.
- \"%d\" is replaced by the device detected by `tramp-adb-get-device'.
- \"%a\" adds the pseudo-terminal allocation argument \"-t\" in
asynchronous processes, if the connection type is not `pipe'.
The existence of `tramp-login-args', combined with the
absence of `tramp-copy-args', is an indication that the
@ -4870,6 +4872,7 @@ a connection-local variable."
(when adb-file-name-handler-p
(tramp-compat-funcall
'tramp-adb-get-device v)))
(pta (unless (eq connection-type 'pipe) "-t"))
login-args p)
;; Replace `login-args' place holders. Split
@ -4885,7 +4888,7 @@ a connection-local variable."
v 'tramp-login-args
?h (or host "") ?u (or user "") ?p (or port "")
?c (format-spec (or options "") (format-spec-make ?t tmpfile))
?d (or device "") ?l ""))))
?d (or device "") ?a (or pta "") ?l ""))))
p (make-process
:name name :buffer buffer
:command (append `(,login-program) login-args command)

View file

@ -79,7 +79,8 @@ See the documentation for `tmm-prompt'."
"String to insert between shortcut and menu item.
If nil, there will be no shortcuts. It should not consist only of spaces,
or else the correct item might not be found in the `*Completions*' buffer."
:type 'string)
:type '(choice (const :tag "No shortcuts" nil)
string))
(defvar tmm-mb-map nil
"A place to store minibuffer map.")

View file

@ -1692,8 +1692,8 @@ Return (ANCHOR . OFFSET). This function is used by
bol (car local-parsers)))
((eq 1 (length (treesit-parser-list nil nil t)))
(treesit-node-at bol))
((treesit-language-at (point))
(treesit-node-at bol (treesit-language-at (point))))
((treesit-language-at bol)
(treesit-node-at bol (treesit-language-at bol)))
(t (treesit-node-at bol))))
(root (treesit-parser-root-node
(treesit-node-parser smallest-node)))

View file

@ -356,8 +356,9 @@ possibly_non_vc_files="
$top_level_ChangeLog
MANIFEST aclocal.m4 configure
admin/charsets/jisx2131-filter
src/config.in exec/configure
exec/config.h.in
src/config.in
exec/configure exec/config.h.in
leim/small-ja-dic-option
"$(
find admin doc etc lisp \
\( -name '*.el' -o -name '*.elc' -o -name '*.map' -o -name '*.stamp' \

View file

@ -7886,7 +7886,7 @@ process sentinels. They shall not disturb each other."
(shell-command-to-string "read -s -p Password: pass"))))
(let ((pass "secret")
(mock-entry (copy-sequence (assoc "mock" tramp-methods)))
(mock-entry (copy-tree (assoc "mock" tramp-methods)))
mocked-input tramp-methods)
;; We must mock `read-string', in order to avoid interactive
;; arguments.
@ -7933,6 +7933,65 @@ process sentinels. They shall not disturb each other."
(let ((auth-sources `(,netrc-file)))
(should (file-exists-p ert-remote-temporary-file-directory)))))))))
(ert-deftest tramp-test46-read-otp-password ()
"Check Tramp one-time password handling."
:tags '(:expensive-test)
(skip-unless (tramp--test-mock-p))
;; Not all read commands understand argument "-s" or "-p".
(skip-unless
(string-empty-p
(let ((shell-file-name "sh"))
(shell-command-to-string "read -s -p Password: pass"))))
(let ((pass "secret")
(mock-entry (copy-tree (assoc "mock" tramp-methods)))
mocked-input tramp-methods)
;; We must mock `read-string', in order to avoid interactive
;; arguments.
(cl-letf* (((symbol-function #'read-string)
(lambda (&rest _args) (pop mocked-input))))
(setcdr
(assq 'tramp-login-args mock-entry)
`((("-c")
(,(tramp-shell-quote-argument
(concat
"read -s -p 'Verification code: ' pass; echo; "
"(test \"pass$pass\" != \"pass" pass "\" && "
"echo \"Login incorrect\" || sh -i)"))))))
(setq tramp-methods `(,mock-entry))
;; Reading password from stdin works.
(tramp-cleanup-connection tramp-test-vec 'keep-debug)
;; We don't want to invalidate the password.
(setq mocked-input `(,(copy-sequence pass)))
(should (file-exists-p ert-remote-temporary-file-directory))
;; Don't entering a password returns in error.
(tramp-cleanup-connection tramp-test-vec 'keep-debug)
(setq mocked-input nil)
(should-error (file-exists-p ert-remote-temporary-file-directory))
;; A wrong password doesn't work either.
(tramp-cleanup-connection tramp-test-vec 'keep-debug)
(setq mocked-input `(,(concat pass pass)))
(should-error (file-exists-p ert-remote-temporary-file-directory))
;; The password shouldn't be read from auth-source.
;; Macro `ert-with-temp-file' was introduced in Emacs 29.1.
(with-no-warnings (when (symbol-plist 'ert-with-temp-file)
(tramp-cleanup-connection tramp-test-vec 'keep-debug)
(setq mocked-input nil)
(auth-source-forget-all-cached)
(ert-with-temp-file netrc-file
:prefix "tramp-test" :suffix ""
:text (format
"machine %s port mock password %s"
(file-remote-p ert-remote-temporary-file-directory 'host)
pass)
(let ((auth-sources `(,netrc-file)))
(should-error
(file-exists-p ert-remote-temporary-file-directory)))))))))
;; This test is inspired by Bug#29163.
(ert-deftest tramp-test48-auto-load ()
"Check that Tramp autoloads properly."