aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2023-09-30 13:50:07 -0400
committerEli Zaretskii2023-09-30 13:50:07 -0400
commit46978fa1eff286ea15248ee358fe62608ca070c5 (patch)
treea9cce889b60229e11006585e276a018719e5fdad
parente6dd64aaba55b93340de1d7e0d6783da6de2af2f (diff)
parent4776d90c31b3d5bc4117ca7ecde95444adf402ac (diff)
downloademacs-46978fa1eff286ea15248ee358fe62608ca070c5.tar.gz
emacs-46978fa1eff286ea15248ee358fe62608ca070c5.zip
Merge from origin/emacs-29
4776d90c31b Add new Tramp test ca5b48fd76d Fix tmm-mid-prompt :type (Bug#66179) 7447d3df94e Fix tree-sitter indentation conflict with multiple languages bee18e52737 Fix bug#66093 in Tramp 7d5fee0feaa Support regeneration of ja-dic.el under '--with-small-ja-... Conflicts: make-dist
-rw-r--r--.gitignore1
-rw-r--r--java/org/gnu/emacs/EmacsDesktopNotification.java2
-rw-r--r--leim/Makefile.in9
-rw-r--r--lisp/international/ja-dic-cnv.el2
-rw-r--r--lisp/net/tramp-sshfs.el4
-rw-r--r--lisp/net/tramp.el11
-rw-r--r--lisp/tmm.el3
-rw-r--r--lisp/treesit.el4
-rwxr-xr-xmake-dist5
-rw-r--r--test/lisp/net/tramp-tests.el61
10 files changed, 88 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore
index 0a68121009d..81abc4c90ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -127,6 +127,7 @@ lisp/cedet/semantic/grammar-wy.el
127lisp/eshell/esh-groups.el 127lisp/eshell/esh-groups.el
128lisp/finder-inf.el 128lisp/finder-inf.el
129lisp/leim/ja-dic/ 129lisp/leim/ja-dic/
130leim/small-ja-dic-option
130lisp/leim/leim-list.el 131lisp/leim/leim-list.el
131lisp/leim/quail/4Corner.el 132lisp/leim/quail/4Corner.el
132lisp/leim/quail/ARRAY30.el 133lisp/leim/quail/ARRAY30.el
diff --git a/java/org/gnu/emacs/EmacsDesktopNotification.java b/java/org/gnu/emacs/EmacsDesktopNotification.java
index 56ed984d497..4a6bbf7a606 100644
--- a/java/org/gnu/emacs/EmacsDesktopNotification.java
+++ b/java/org/gnu/emacs/EmacsDesktopNotification.java
@@ -137,7 +137,7 @@ public final class EmacsDesktopNotification
137 priority = Notification.PRIORITY_HIGH; 137 priority = Notification.PRIORITY_HIGH;
138 break; 138 break;
139 } 139 }
140 140
141 notification = (new Notification.Builder (context) 141 notification = (new Notification.Builder (context)
142 .setContentTitle (title) 142 .setContentTitle (title)
143 .setContentText (content) 143 .setContentText (content)
diff --git a/leim/Makefile.in b/leim/Makefile.in
index 4c6c3179283..f7dfdf66f30 100644
--- a/leim/Makefile.in
+++ b/leim/Makefile.in
@@ -26,6 +26,7 @@ SHELL = @SHELL@
26# Here are the things that we expect ../configure to edit. 26# Here are the things that we expect ../configure to edit.
27srcdir=@srcdir@ 27srcdir=@srcdir@
28top_builddir = @top_builddir@ 28top_builddir = @top_builddir@
29top_srcdir = @top_srcdir@
29 30
30# Where the generated files go. 31# Where the generated files go.
31leimdir = ${srcdir}/../lisp/leim 32leimdir = ${srcdir}/../lisp/leim
@@ -134,9 +135,15 @@ ${leimdir}/leim-list.el: ${srcdir}/leim-ext.el ${TIT_MISC}
134 135
135${leimdir}/ja-dic/ja-dic.el: | $(leimdir)/ja-dic 136${leimdir}/ja-dic/ja-dic.el: | $(leimdir)/ja-dic
136 137
138# This is used to support regeneration of ja-dic when the SMALL_JA_DIC
139# option is flipped by the configure-time option.
140small-ja-dic-option: ../config.status
141 $(AM_V_GEN)echo "Small ja-dic option: $(SMALL_JA_DIC)" > $@.$$$$ && \
142 ${top_srcdir}/build-aux/move-if-change $@.$$$$ $@
143
137.PHONY: generate-ja-dic 144.PHONY: generate-ja-dic
138generate-ja-dic: ${leimdir}/ja-dic/ja-dic.el 145generate-ja-dic: ${leimdir}/ja-dic/ja-dic.el
139${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L 146${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L small-ja-dic-option
140 $(AM_V_GEN)$(RUN_EMACS) -batch -l ja-dic-cnv \ 147 $(AM_V_GEN)$(RUN_EMACS) -batch -l ja-dic-cnv \
141 -f batch-skkdic-convert -dir "$(leimdir)/ja-dic" $(JA_DIC_NO_REDUCTION_OPTION) "$<" 148 -f batch-skkdic-convert -dir "$(leimdir)/ja-dic" $(JA_DIC_NO_REDUCTION_OPTION) "$<"
142 149
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index 5477473ae8c..81d5a1acdf4 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -346,6 +346,8 @@ If NO-REDUCTION is non-nil, do not reduce the dictionary vocabulary."
346 (erase-buffer) 346 (erase-buffer)
347 (buffer-disable-undo) 347 (buffer-disable-undo)
348 (generate-lisp-file-heading ja-dic-filename 'skkdic-convert :code nil) 348 (generate-lisp-file-heading ja-dic-filename 'skkdic-convert :code nil)
349 (insert (format ";; Generated with small ja-dic option: %s\n\n"
350 (if no-reduction "no" "yes")))
349 (insert ";; Original SKK dictionary file: " 351 (insert ";; Original SKK dictionary file: "
350 (file-relative-name (expand-file-name filename) dirname) 352 (file-relative-name (expand-file-name filename) dirname)
351 "\n\n" 353 "\n\n"
diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el
index 131f632a0fe..102ba637f55 100644
--- a/lisp/net/tramp-sshfs.el
+++ b/lisp/net/tramp-sshfs.el
@@ -60,7 +60,7 @@
60 ;; These are for remote processes. 60 ;; These are for remote processes.
61 (tramp-login-program "ssh") 61 (tramp-login-program "ssh")
62 (tramp-login-args (("-q") ("-l" "%u") ("-p" "%p") 62 (tramp-login-args (("-q") ("-l" "%u") ("-p" "%p")
63 ("-e" "none") ("-t" "-t") 63 ("-e" "none") ("%a" "%a")
64 ("%h") ("%l"))) 64 ("%h") ("%l")))
65 (tramp-direct-async t) 65 (tramp-direct-async t)
66 (tramp-remote-shell ,tramp-default-remote-shell) 66 (tramp-remote-shell ,tramp-default-remote-shell)
@@ -326,7 +326,7 @@ arguments to pass to the OPERATION."
326 ?h (or (tramp-file-name-host v) "") 326 ?h (or (tramp-file-name-host v) "")
327 ?u (or (tramp-file-name-user v) "") 327 ?u (or (tramp-file-name-user v) "")
328 ?p (or (tramp-file-name-port v) "") 328 ?p (or (tramp-file-name-port v) "")
329 ?l command)) 329 ?a "-t" ?l command))
330 330
331 ;; Synchronize stderr. 331 ;; Synchronize stderr.
332 (when tmpstderr 332 (when tmpstderr
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 782582e1daf..8f5ca9b3c2d 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -240,9 +240,9 @@ pair of the form (KEY VALUE). The following KEYs are defined:
240 \"%\" followed by a letter are expanded in the arguments as 240 \"%\" followed by a letter are expanded in the arguments as
241 follows: 241 follows:
242 242
243 - \"%h\" is replaced by the host name 243 - \"%h\" is replaced by the host name.
244 - \"%u\" is replaced by the user name 244 - \"%u\" is replaced by the user name.
245 - \"%p\" is replaced by the port number 245 - \"%p\" is replaced by the port number.
246 - \"%%\" can be used to obtain a literal percent character. 246 - \"%%\" can be used to obtain a literal percent character.
247 247
248 If a sub-list containing \"%h\", \"%u\" or \"%p\" is 248 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:
271 - \"%z\" is replaced by the `tramp-scp-direct-remote-copying' 271 - \"%z\" is replaced by the `tramp-scp-direct-remote-copying'
272 argument if it is supported. 272 argument if it is supported.
273 - \"%d\" is replaced by the device detected by `tramp-adb-get-device'. 273 - \"%d\" is replaced by the device detected by `tramp-adb-get-device'.
274 - \"%a\" adds the pseudo-terminal allocation argument \"-t\" in
275 asynchronous processes, if the connection type is not `pipe'.
274 276
275 The existence of `tramp-login-args', combined with the 277 The existence of `tramp-login-args', combined with the
276 absence of `tramp-copy-args', is an indication that the 278 absence of `tramp-copy-args', is an indication that the
@@ -4870,6 +4872,7 @@ a connection-local variable."
4870 (when adb-file-name-handler-p 4872 (when adb-file-name-handler-p
4871 (tramp-compat-funcall 4873 (tramp-compat-funcall
4872 'tramp-adb-get-device v))) 4874 'tramp-adb-get-device v)))
4875 (pta (unless (eq connection-type 'pipe) "-t"))
4873 login-args p) 4876 login-args p)
4874 4877
4875 ;; Replace `login-args' place holders. Split 4878 ;; Replace `login-args' place holders. Split
@@ -4885,7 +4888,7 @@ a connection-local variable."
4885 v 'tramp-login-args 4888 v 'tramp-login-args
4886 ?h (or host "") ?u (or user "") ?p (or port "") 4889 ?h (or host "") ?u (or user "") ?p (or port "")
4887 ?c (format-spec (or options "") (format-spec-make ?t tmpfile)) 4890 ?c (format-spec (or options "") (format-spec-make ?t tmpfile))
4888 ?d (or device "") ?l "")))) 4891 ?d (or device "") ?a (or pta "") ?l ""))))
4889 p (make-process 4892 p (make-process
4890 :name name :buffer buffer 4893 :name name :buffer buffer
4891 :command (append `(,login-program) login-args command) 4894 :command (append `(,login-program) login-args command)
diff --git a/lisp/tmm.el b/lisp/tmm.el
index a4058594622..b587b416a35 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -79,7 +79,8 @@ See the documentation for `tmm-prompt'."
79 "String to insert between shortcut and menu item. 79 "String to insert between shortcut and menu item.
80If nil, there will be no shortcuts. It should not consist only of spaces, 80If nil, there will be no shortcuts. It should not consist only of spaces,
81or else the correct item might not be found in the `*Completions*' buffer." 81or else the correct item might not be found in the `*Completions*' buffer."
82 :type 'string) 82 :type '(choice (const :tag "No shortcuts" nil)
83 string))
83 84
84(defvar tmm-mb-map nil 85(defvar tmm-mb-map nil
85 "A place to store minibuffer map.") 86 "A place to store minibuffer map.")
diff --git a/lisp/treesit.el b/lisp/treesit.el
index fd8c8482fc8..402417c6ca9 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1692,8 +1692,8 @@ Return (ANCHOR . OFFSET). This function is used by
1692 bol (car local-parsers))) 1692 bol (car local-parsers)))
1693 ((eq 1 (length (treesit-parser-list nil nil t))) 1693 ((eq 1 (length (treesit-parser-list nil nil t)))
1694 (treesit-node-at bol)) 1694 (treesit-node-at bol))
1695 ((treesit-language-at (point)) 1695 ((treesit-language-at bol)
1696 (treesit-node-at bol (treesit-language-at (point)))) 1696 (treesit-node-at bol (treesit-language-at bol)))
1697 (t (treesit-node-at bol)))) 1697 (t (treesit-node-at bol))))
1698 (root (treesit-parser-root-node 1698 (root (treesit-parser-root-node
1699 (treesit-node-parser smallest-node))) 1699 (treesit-node-parser smallest-node)))
diff --git a/make-dist b/make-dist
index a3b7219af3a..2c4b6a79500 100755
--- a/make-dist
+++ b/make-dist
@@ -356,8 +356,9 @@ possibly_non_vc_files="
356 $top_level_ChangeLog 356 $top_level_ChangeLog
357 MANIFEST aclocal.m4 configure 357 MANIFEST aclocal.m4 configure
358 admin/charsets/jisx2131-filter 358 admin/charsets/jisx2131-filter
359 src/config.in exec/configure 359 src/config.in
360 exec/config.h.in 360 exec/configure exec/config.h.in
361 leim/small-ja-dic-option
361"$( 362"$(
362 find admin doc etc lisp \ 363 find admin doc etc lisp \
363 \( -name '*.el' -o -name '*.elc' -o -name '*.map' -o -name '*.stamp' \ 364 \( -name '*.el' -o -name '*.elc' -o -name '*.map' -o -name '*.stamp' \
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 69d31a54644..e382d044275 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -7886,7 +7886,7 @@ process sentinels. They shall not disturb each other."
7886 (shell-command-to-string "read -s -p Password: pass")))) 7886 (shell-command-to-string "read -s -p Password: pass"))))
7887 7887
7888 (let ((pass "secret") 7888 (let ((pass "secret")
7889 (mock-entry (copy-sequence (assoc "mock" tramp-methods))) 7889 (mock-entry (copy-tree (assoc "mock" tramp-methods)))
7890 mocked-input tramp-methods) 7890 mocked-input tramp-methods)
7891 ;; We must mock `read-string', in order to avoid interactive 7891 ;; We must mock `read-string', in order to avoid interactive
7892 ;; arguments. 7892 ;; arguments.
@@ -7933,6 +7933,65 @@ process sentinels. They shall not disturb each other."
7933 (let ((auth-sources `(,netrc-file))) 7933 (let ((auth-sources `(,netrc-file)))
7934 (should (file-exists-p ert-remote-temporary-file-directory))))))))) 7934 (should (file-exists-p ert-remote-temporary-file-directory)))))))))
7935 7935
7936(ert-deftest tramp-test46-read-otp-password ()
7937 "Check Tramp one-time password handling."
7938 :tags '(:expensive-test)
7939 (skip-unless (tramp--test-mock-p))
7940 ;; Not all read commands understand argument "-s" or "-p".
7941 (skip-unless
7942 (string-empty-p
7943 (let ((shell-file-name "sh"))
7944 (shell-command-to-string "read -s -p Password: pass"))))
7945
7946 (let ((pass "secret")
7947 (mock-entry (copy-tree (assoc "mock" tramp-methods)))
7948 mocked-input tramp-methods)
7949 ;; We must mock `read-string', in order to avoid interactive
7950 ;; arguments.
7951 (cl-letf* (((symbol-function #'read-string)
7952 (lambda (&rest _args) (pop mocked-input))))
7953 (setcdr
7954 (assq 'tramp-login-args mock-entry)
7955 `((("-c")
7956 (,(tramp-shell-quote-argument
7957 (concat
7958 "read -s -p 'Verification code: ' pass; echo; "
7959 "(test \"pass$pass\" != \"pass" pass "\" && "
7960 "echo \"Login incorrect\" || sh -i)"))))))
7961 (setq tramp-methods `(,mock-entry))
7962
7963 ;; Reading password from stdin works.
7964 (tramp-cleanup-connection tramp-test-vec 'keep-debug)
7965 ;; We don't want to invalidate the password.
7966 (setq mocked-input `(,(copy-sequence pass)))
7967 (should (file-exists-p ert-remote-temporary-file-directory))
7968
7969 ;; Don't entering a password returns in error.
7970 (tramp-cleanup-connection tramp-test-vec 'keep-debug)
7971 (setq mocked-input nil)
7972 (should-error (file-exists-p ert-remote-temporary-file-directory))
7973
7974 ;; A wrong password doesn't work either.
7975 (tramp-cleanup-connection tramp-test-vec 'keep-debug)
7976 (setq mocked-input `(,(concat pass pass)))
7977 (should-error (file-exists-p ert-remote-temporary-file-directory))
7978
7979 ;; The password shouldn't be read from auth-source.
7980 ;; Macro `ert-with-temp-file' was introduced in Emacs 29.1.
7981 (with-no-warnings (when (symbol-plist 'ert-with-temp-file)
7982 (tramp-cleanup-connection tramp-test-vec 'keep-debug)
7983 (setq mocked-input nil)
7984 (auth-source-forget-all-cached)
7985 (ert-with-temp-file netrc-file
7986 :prefix "tramp-test" :suffix ""
7987 :text (format
7988 "machine %s port mock password %s"
7989 (file-remote-p ert-remote-temporary-file-directory 'host)
7990 pass)
7991 (let ((auth-sources `(,netrc-file)))
7992 (should-error
7993 (file-exists-p ert-remote-temporary-file-directory)))))))))
7994
7936;; This test is inspired by Bug#29163. 7995;; This test is inspired by Bug#29163.
7937(ert-deftest tramp-test48-auto-load () 7996(ert-deftest tramp-test48-auto-load ()
7938 "Check that Tramp autoloads properly." 7997 "Check that Tramp autoloads properly."