1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

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/eshell/esh-groups.el
lisp/finder-inf.el lisp/finder-inf.el
lisp/leim/ja-dic/ lisp/leim/ja-dic/
leim/small-ja-dic-option
lisp/leim/leim-list.el lisp/leim/leim-list.el
lisp/leim/quail/4Corner.el lisp/leim/quail/4Corner.el
lisp/leim/quail/ARRAY30.el lisp/leim/quail/ARRAY30.el

View file

@ -137,7 +137,7 @@ public final class EmacsDesktopNotification
priority = Notification.PRIORITY_HIGH; priority = Notification.PRIORITY_HIGH;
break; break;
} }
notification = (new Notification.Builder (context) notification = (new Notification.Builder (context)
.setContentTitle (title) .setContentTitle (title)
.setContentText (content) .setContentText (content)

View file

@ -26,6 +26,7 @@ SHELL = @SHELL@
# Here are the things that we expect ../configure to edit. # Here are the things that we expect ../configure to edit.
srcdir=@srcdir@ srcdir=@srcdir@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# Where the generated files go. # Where the generated files go.
leimdir = ${srcdir}/../lisp/leim 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 ${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 .PHONY: generate-ja-dic
generate-ja-dic: ${leimdir}/ja-dic/ja-dic.el 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 \ $(AM_V_GEN)$(RUN_EMACS) -batch -l ja-dic-cnv \
-f batch-skkdic-convert -dir "$(leimdir)/ja-dic" $(JA_DIC_NO_REDUCTION_OPTION) "$<" -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) (erase-buffer)
(buffer-disable-undo) (buffer-disable-undo)
(generate-lisp-file-heading ja-dic-filename 'skkdic-convert :code nil) (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: " (insert ";; Original SKK dictionary file: "
(file-relative-name (expand-file-name filename) dirname) (file-relative-name (expand-file-name filename) dirname)
"\n\n" "\n\n"

View file

@ -60,7 +60,7 @@
;; These are for remote processes. ;; These are for remote processes.
(tramp-login-program "ssh") (tramp-login-program "ssh")
(tramp-login-args (("-q") ("-l" "%u") ("-p" "%p") (tramp-login-args (("-q") ("-l" "%u") ("-p" "%p")
("-e" "none") ("-t" "-t") ("-e" "none") ("%a" "%a")
("%h") ("%l"))) ("%h") ("%l")))
(tramp-direct-async t) (tramp-direct-async t)
(tramp-remote-shell ,tramp-default-remote-shell) (tramp-remote-shell ,tramp-default-remote-shell)
@ -326,7 +326,7 @@ arguments to pass to the OPERATION."
?h (or (tramp-file-name-host v) "") ?h (or (tramp-file-name-host v) "")
?u (or (tramp-file-name-user v) "") ?u (or (tramp-file-name-user v) "")
?p (or (tramp-file-name-port v) "") ?p (or (tramp-file-name-port v) "")
?l command)) ?a "-t" ?l command))
;; Synchronize stderr. ;; Synchronize stderr.
(when tmpstderr (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 \"%\" followed by a letter are expanded in the arguments as
follows: follows:
- \"%h\" is replaced by the host name - \"%h\" is replaced by the host name.
- \"%u\" is replaced by the user name - \"%u\" is replaced by the user name.
- \"%p\" is replaced by the port number - \"%p\" is replaced by the port number.
- \"%%\" can be used to obtain a literal percent character. - \"%%\" can be used to obtain a literal percent character.
If a sub-list containing \"%h\", \"%u\" or \"%p\" is 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' - \"%z\" is replaced by the `tramp-scp-direct-remote-copying'
argument if it is supported. argument if it is supported.
- \"%d\" is replaced by the device detected by `tramp-adb-get-device'. - \"%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 The existence of `tramp-login-args', combined with the
absence of `tramp-copy-args', is an indication that 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 (when adb-file-name-handler-p
(tramp-compat-funcall (tramp-compat-funcall
'tramp-adb-get-device v))) 'tramp-adb-get-device v)))
(pta (unless (eq connection-type 'pipe) "-t"))
login-args p) login-args p)
;; Replace `login-args' place holders. Split ;; Replace `login-args' place holders. Split
@ -4885,7 +4888,7 @@ a connection-local variable."
v 'tramp-login-args v 'tramp-login-args
?h (or host "") ?u (or user "") ?p (or port "") ?h (or host "") ?u (or user "") ?p (or port "")
?c (format-spec (or options "") (format-spec-make ?t tmpfile)) ?c (format-spec (or options "") (format-spec-make ?t tmpfile))
?d (or device "") ?l "")))) ?d (or device "") ?a (or pta "") ?l ""))))
p (make-process p (make-process
:name name :buffer buffer :name name :buffer buffer
:command (append `(,login-program) login-args command) :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. "String to insert between shortcut and menu item.
If nil, there will be no shortcuts. It should not consist only of spaces, 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." 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 (defvar tmm-mb-map nil
"A place to store minibuffer map.") "A place to store minibuffer map.")

View file

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

View file

@ -356,8 +356,9 @@ possibly_non_vc_files="
$top_level_ChangeLog $top_level_ChangeLog
MANIFEST aclocal.m4 configure MANIFEST aclocal.m4 configure
admin/charsets/jisx2131-filter admin/charsets/jisx2131-filter
src/config.in exec/configure src/config.in
exec/config.h.in exec/configure exec/config.h.in
leim/small-ja-dic-option
"$( "$(
find admin doc etc lisp \ find admin doc etc lisp \
\( -name '*.el' -o -name '*.elc' -o -name '*.map' -o -name '*.stamp' \ \( -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")))) (shell-command-to-string "read -s -p Password: pass"))))
(let ((pass "secret") (let ((pass "secret")
(mock-entry (copy-sequence (assoc "mock" tramp-methods))) (mock-entry (copy-tree (assoc "mock" tramp-methods)))
mocked-input tramp-methods) mocked-input tramp-methods)
;; We must mock `read-string', in order to avoid interactive ;; We must mock `read-string', in order to avoid interactive
;; arguments. ;; arguments.
@ -7933,6 +7933,65 @@ process sentinels. They shall not disturb each other."
(let ((auth-sources `(,netrc-file))) (let ((auth-sources `(,netrc-file)))
(should (file-exists-p ert-remote-temporary-file-directory))))))))) (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. ;; This test is inspired by Bug#29163.
(ert-deftest tramp-test48-auto-load () (ert-deftest tramp-test48-auto-load ()
"Check that Tramp autoloads properly." "Check that Tramp autoloads properly."