From 4b90b6e7ce9be06087e727f7c6305a2a545660fc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 10 Aug 2025 11:45:31 +0300 Subject: ; * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Doc fix (bug#79206). --- lisp/emacs-lisp/cl-generic.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 3aa26fba3c3..7e0f115ebcb 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -230,9 +230,11 @@ SPECIALIZERS-FUNCTION takes as first argument a tag value TAG (defmacro cl-defgeneric (name args &rest options-and-methods) "Create a generic function NAME. DOC-STRING is the base documentation for this class. A generic -function has no body, as its purpose is to decide which method body -is appropriate to use. Specific methods are defined with `cl-defmethod'. -With this implementation the ARGS are currently ignored. +function usually has no body, as its purpose is to decide which +method body is appropriate to use; ARGS are currently ignored if +there's no body. If BODY is present, it provides the default +implementation. +Specific implementation methods are defined with `cl-defmethod'. OPTIONS-AND-METHODS currently understands: - (:documentation DOCSTRING) - (declare DECLARATIONS) -- cgit v1.2.1 From 1514695b7d10f67279aeaa14e1cc398d8a07cf08 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 14 Aug 2025 04:24:11 -0400 Subject: ; Update lisp/ldefs-boot.el. Do not merge to master. --- lisp/ldefs-boot.el | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'lisp') diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 57790632047..6a56cb08a43 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -6,7 +6,8 @@ ;;; Commentary: ;; This file will be copied to ldefs-boot.el and checked in -;; periodically. +;; periodically. Note: When checking in ldefs-boot.el, don't include +;; changes to any other files in the commit. ;;; Code: @@ -7556,8 +7557,9 @@ Also see the `diff-entire-buffers' variable. (autoload 'diff-mode "diff-mode" "\ Major mode for viewing/editing context diffs. -Supports unified and context diffs as well as (to a lesser extent) -normal diffs. +Supports unified and context diffs as well as, to a lesser extent, diffs +in the old \"normal\" format. (Unified diffs have become the standard, +most commonly encountered format.) When the buffer is read-only, the ESC prefix is not necessary. If you edit the buffer manually, `diff-mode' will try to update the hunk @@ -8439,8 +8441,8 @@ switch on the minor mode in all major modes), nil (meaning don't switch on in any major mode), a list of modes (meaning switch on only in those modes and their descendants), or a list (not MODES...), meaning switch on in any major mode except MODES. The value can also -mix all of these forms, see the info node `Defining Minor Modes' for -details. The :predicate key causes the macro to create a user option +mix all of these forms, see the Info node `(elisp)Defining Minor Modes' +for details. The :predicate key causes the macro to create a user option named the same as MODE, but ending with \"-modes\" instead of \"-mode\". That user option can then be used to customize in which modes this globalized minor mode will be switched on. @@ -12903,7 +12905,7 @@ is non-nil, signal an error instead. (fn FUNCTION &optional LISP-ONLY)") (autoload 'find-function "find-func" "\ -Find the definition of the FUNCTION near point. +Find the definition of the Emacs Lisp FUNCTION near point. Finds the source file containing the definition of the function near point (selected by `function-called-at-point') in a buffer and @@ -12912,6 +12914,9 @@ Set mark before moving, if the buffer already existed. See also `find-function-recenter-line' and `find-function-after-hook'. +Use \\[xref-find-definitions] to find definitions of functions and variables +that are not part of Emacs. + (fn FUNCTION)" t) (autoload 'find-function-other-window "find-func" "\ Find, in another window, the definition of FUNCTION near point. @@ -18022,8 +18027,9 @@ Toggle thumbnails in front of marked file names in the Dired buffer. If no file is marked, toggle display of thumbnail on the current file's line. ARG, if non-nil (interactively, the prefix argument), specifies the files whose thumbnail display to toggle instead of the marked files: if ARG is an -integer, use the next ARG (or previous -ARG, if ARG<0) files; any other -value of ARG means toggle thumbnail display of the current line's file. +integer, use the next ARG (or previous -ARG, if ARG<0) files; if ARG is +the symbol `marked', use only the marked files, if any; any other value of +ARG means toggle thumbnail display of the current line's file. (fn &optional ARG)" '(dired-mode)) (autoload 'image-dired-jump-thumbnail-buffer "image-dired-dired" "\ @@ -33816,7 +33822,7 @@ Add archive file name handler to `file-name-handler-alist'." (when (and tramp-ar ;;; Generated autoloads from net/trampver.el -(push (purecopy '(tramp 2 7 3 -1)) package--builtin-versions) +(push (purecopy '(tramp 2 7 3 30 2)) package--builtin-versions) (register-definition-prefixes "trampver" '("tramp-")) -- cgit v1.2.1 From f8a206937c9f548bd810153bf29f4f4a32d84c95 Mon Sep 17 00:00:00 2001 From: Zhengyi Fu Date: Thu, 14 Aug 2025 17:08:36 +0200 Subject: executable-interpret: Handle remote file names * lisp/progmodes/executable.el (executable-interpret): Use `file-local-name' to get the local file name component from `buffer-file-name'. (Bug#79233) Copyright-paperwork-exempt: yes --- lisp/progmodes/executable.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index b003b75b0e4..aa3a74d30fa 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el @@ -180,7 +180,7 @@ command to find the next error. The buffer is also in `comint-mode' and `compilation-shell-minor-mode', so that you can answer any prompts." (interactive (list (read-string "Run script: " (or executable-command - buffer-file-name)))) + (file-local-name buffer-file-name))))) (require 'compile) (save-some-buffers (not compilation-ask-about-save)) (setq-local executable-command command) -- cgit v1.2.1 From 4a3b6daf76c385fc58759d57aeb4d34e8acc31e5 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 16 Aug 2025 12:26:19 +0200 Subject: Sync with Tramp 2.7.4-pre * doc/misc/trampver.texi: * lisp/net/trampver.el (tramp-version): Adapt Tramp versions. * lisp/net/tramp-cmds.el (tramp-cleanup-connection): Use read syntax #' for `tramp-timeout-session', * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection): Set "connected" property in time. * lisp/net/tramp-sh.el (tramp-timeout-session): Add ;;;###tramp-autoload cookie. * lisp/net/tramp.el (tramp-barf-if-file-missing): Do not raise an error when not connected. (Bug#78572) (tramp-file-name-handler): Do not force the backtrace. (tramp-connectable-p): Check also, whether initial handshake is finished. (tramp-skeleton-directory-files) (tramp-skeleton-directory-files-and-attributes) (tramp-skeleton-set-file-modes-times-uid-gid): Rearrange sending `file-missing' error. (tramp-handle-access-file, tramp-handle-unlock-file): Use `tramp-connectable-p'. (tramp-skeleton-file-name-all-completions): Filter out "" hits. (Bug#79173) * test/lisp/net/tramp-tests.el (project-mode-line-format) (project-mode-line): Declare. (tramp-test48-session-timeout): New test. (tramp-test49-auto-load, tramp-test49-delay-load) (tramp-test49-recursive-load, tramp-test49-remote-load-path) (tramp-test50-without-remote-files, tramp-test51-unload): Rename. --- lisp/net/tramp-cmds.el | 2 +- lisp/net/tramp-gvfs.el | 8 +- lisp/net/tramp-rclone.el | 8 +- lisp/net/tramp-sh.el | 2 + lisp/net/tramp.el | 187 +++++++++++++++++++++++------------------------ lisp/net/trampver.el | 6 +- 6 files changed, 105 insertions(+), 108 deletions(-) (limited to 'lisp') diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index f03fa5cf404..18f5d12277e 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -122,7 +122,7 @@ When called interactively, a Tramp connection has to be selected." ;; Cancel timer. (dolist (timer timer-list) - (when (and (eq (timer--function timer) 'tramp-timeout-session) + (when (and (eq (timer--function timer) #'tramp-timeout-session) (tramp-file-name-equal-p vec (car (timer--args timer)))) (cancel-timer timer))) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 9530aa3733a..efbf9935573 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -2345,11 +2345,11 @@ connection if a previous connection has died for some reason." ;; Save the password. (ignore-errors (and (functionp tramp-password-save-function) - (funcall tramp-password-save-function))) + (funcall tramp-password-save-function)))))) - ;; Mark it as connected. - (tramp-set-connection-property - (tramp-get-connection-process vec) "connected" t)))))) + ;; Mark it as connected. + (tramp-set-connection-property + (tramp-get-connection-process vec) "connected" t))) (defun tramp-gvfs-gio-tool-p (vec) "Check, whether the gio tool is available." diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 07dd80deb9a..17ae36f94e8 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -411,11 +411,11 @@ connection if a previous connection has died for some reason." (tramp-get-method-parameter vec 'tramp-mount-args)) (while (not (file-exists-p (tramp-make-tramp-file-name vec 'noloc))) (tramp-cleanup-connection vec 'keep-debug 'keep-password)) + (add-to-list 'tramp-fuse-mount-points (tramp-file-name-unify vec))) - ;; Mark it as connected. - (add-to-list 'tramp-fuse-mount-points (tramp-file-name-unify vec)) - (tramp-set-connection-property - (tramp-get-connection-process vec) "connected" t)))) + ;; Mark it as connected. + (tramp-set-connection-property + (tramp-get-connection-process vec) "connected" t))) ;; In `tramp-check-cached-permissions', the connection properties ;; "{uid,gid}-{integer,string}" are used. We set them to proper values. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index cae6d52f14c..287b46fc72e 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -5128,6 +5128,7 @@ Goes through the list `tramp-inline-compress-commands'." (t "-3"))) +;;;###tramp-autoload (defun tramp-timeout-session (vec) "Close the connection VEC after a session timeout. If there is just some editing, retry it after 5 seconds." @@ -5147,6 +5148,7 @@ If there is just some editing, retry it after 5 seconds." Does not do anything if a connection is already open, but re-opens the connection if a previous connection has died for some reason." ;; During completion, don't reopen a new connection. + ;; Same for slide-in timer or process-{filter,sentinel}. (unless (tramp-connectable-p vec) (throw 'non-essential 'non-essential)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e0e080021c7..c72ccc1738f 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2098,10 +2098,11 @@ does not exist, otherwise propagate the error." (declare (indent 2) (debug (symbolp form body))) (let ((err (make-symbol "err"))) `(condition-case ,err - (progn ,@body) + (let (signal-hook-function) ,@body) (error (if (not (or (file-exists-p ,filename) (file-symlink-p ,filename))) - (tramp-error ,vec 'file-missing ,filename) + (when (tramp-connectable-p ,vec) + (tramp-error ,vec 'file-missing ,filename)) (signal (car ,err) (cdr ,err))))))) ;; This function provides traces in case of errors not triggered by @@ -2542,7 +2543,7 @@ Fall back to normal file name handler if no Tramp file name handler exists." (tramp-message v 5 "Non-essential received in operation %s" (cons operation args)) - (let ((tramp-verbose 10)) (tramp-backtrace v)) + (tramp-backtrace v) (tramp-run-real-handler operation args)) ((eq result 'suppress) (let ((inhibit-message t)) @@ -2759,13 +2760,15 @@ They are completed by `M-x TAB' only if the current buffer is remote." "Check if it is possible to connect the remote host without side-effects. This is true, if either the remote host is already connected, or if we are not in completion mode." - (let ((tramp-verbose 0) - (vec (tramp-ensure-dissected-file-name vec-or-filename))) - (or ;; We check this for the process related to - ;; `tramp-buffer-name'; otherwise `make-process' wouldn't run - ;; ever when `non-essential' is non-nil. - (process-live-p (tramp-get-process vec)) - (not non-essential)))) + (or (not non-essential) + ;; We check this for the process related to `tramp-buffer-name'; + ;; otherwise `make-process' wouldn't run ever when + ;; `non-essential' is non-nil. + (and-let* ((tramp-verbose 0) + (vec (tramp-ensure-dissected-file-name vec-or-filename)) + (p (tramp-get-process vec)) + ((process-live-p p)) + ((tramp-get-connection-property p "connected")))))) (defun tramp-completion-handle-expand-file-name (filename &optional directory) "Like `expand-file-name' for partial Tramp files." @@ -2863,7 +2866,7 @@ not in completion mode." BODY is the backend specific code." (declare (indent 2) (debug t)) `(ignore-error file-missing - (delete-dups (delq nil + (delete-dups (delq nil (delete "" (let* ((case-fold-search read-file-name-completion-ignore-case) (result (progn ,@body))) ;; Some storage systems do not return "." and "..". @@ -2880,7 +2883,7 @@ BODY is the backend specific code." (dolist (elt completion-regexp-list x) (unless (string-match-p elt x) (throw 'match nil)))))) result) - result)))))) + result))))))) (defvar tramp--last-hop-directory nil "Tracks the directory from which to run login programs.") @@ -3434,79 +3437,69 @@ BODY is the backend specific code." "Skeleton for `tramp-*-handle-directory-files'. BODY is the backend specific code." (declare (indent 5) (debug t)) - `(or - (with-parsed-tramp-file-name (expand-file-name ,directory) nil - (tramp-barf-if-file-missing v ,directory - (when (file-directory-p ,directory) - (setf ,directory - (file-name-as-directory (expand-file-name ,directory))) - (let ((temp - (with-tramp-file-property v localname "directory-files" ,@body)) - result item) - (while temp - (setq item (directory-file-name (pop temp))) - (when (or (null ,match) (string-match-p ,match item)) - (push (if ,full (concat ,directory item) item) - result))) - (unless ,nosort - (setq result (sort result #'string<))) - (when (and (natnump ,count) (> ,count 0)) - (setq result (tramp-compat-ntake ,count result))) - result)))) - - ;; Error handling. - (if (not (file-exists-p ,directory)) - (tramp-error - (tramp-dissect-file-name ,directory) 'file-missing ,directory) - nil))) + `(with-parsed-tramp-file-name (expand-file-name ,directory) nil + (tramp-barf-if-file-missing v ,directory + (if (not (file-directory-p ,directory)) + ;; Trigger the `file-missing' error. + (signal 'error nil) + (setf ,directory + (file-name-as-directory (expand-file-name ,directory))) + (let ((temp + (with-tramp-file-property v localname "directory-files" ,@body)) + result item) + (while temp + (setq item (directory-file-name (pop temp))) + (when (or (null ,match) (string-match-p ,match item)) + (push (if ,full (concat ,directory item) item) + result))) + (unless ,nosort + (setq result (sort result #'string<))) + (when (and (natnump ,count) (> ,count 0)) + (setq result (tramp-compat-ntake ,count result))) + result))))) (defmacro tramp-skeleton-directory-files-and-attributes (directory &optional full match nosort id-format count &rest body) "Skeleton for `tramp-*-handle-directory-files-and-attributes'. BODY is the backend specific code." (declare (indent 6) (debug t)) - `(or - (with-parsed-tramp-file-name (expand-file-name ,directory) nil - (tramp-barf-if-file-missing v ,directory - (when (file-directory-p ,directory) - (let ((temp - (copy-tree - (mapcar - (lambda (x) - (cons - (car x) - (tramp-convert-file-attributes - v (expand-file-name (car x) localname) - ,id-format (cdr x)))) - (with-tramp-file-property - v localname "directory-files-and-attributes" - ,@body)))) - result item) - - (while temp - (setq item (pop temp)) - (when (or (null ,match) (string-match-p ,match (car item))) - (when ,full - (setcar item (expand-file-name (car item) ,directory))) - (push item result))) - - (unless ,nosort - (setq result - (sort result (lambda (x y) (string< (car x) (car y)))))) - - (when (and (natnump ,count) (> ,count 0)) - (setq result (tramp-compat-ntake ,count result))) - - (or result - ;; The scripts could fail, for example with huge file size. - (tramp-handle-directory-files-and-attributes - ,directory ,full ,match ,nosort ,id-format ,count)))))) - - ;; Error handling. - (if (not (file-exists-p ,directory)) - (tramp-error - (tramp-dissect-file-name ,directory) 'file-missing ,directory) - nil))) + `(with-parsed-tramp-file-name (expand-file-name ,directory) nil + (tramp-barf-if-file-missing v ,directory + (if (not (file-directory-p ,directory)) + ;; Trigger the `file-missing' error. + (signal 'error nil) + (let ((temp + (copy-tree + (mapcar + (lambda (x) + (cons + (car x) + (tramp-convert-file-attributes + v (expand-file-name (car x) localname) + ,id-format (cdr x)))) + (with-tramp-file-property + v localname "directory-files-and-attributes" + ,@body)))) + result item) + + (while temp + (setq item (pop temp)) + (when (or (null ,match) (string-match-p ,match (car item))) + (when ,full + (setcar item (expand-file-name (car item) ,directory))) + (push item result))) + + (unless ,nosort + (setq result + (sort result (lambda (x y) (string< (car x) (car y)))))) + + (when (and (natnump ,count) (> ,count 0)) + (setq result (tramp-compat-ntake ,count result))) + + (or result + ;; The scripts could fail, for example with huge file size. + (tramp-handle-directory-files-and-attributes + ,directory ,full ,match ,nosort ,id-format ,count))))))) (defcustom tramp-use-file-attributes t "Whether to use \"file-attributes\" connection property for check. @@ -3810,20 +3803,23 @@ BODY is the backend specific code." BODY is the backend specific code." (declare (indent 1) (debug t)) `(with-parsed-tramp-file-name (expand-file-name ,filename) nil - (when (not (file-exists-p ,filename)) - (tramp-error v 'file-missing ,filename)) - (with-tramp-saved-file-properties - v localname - ;; We cannot add "file-attributes", "file-executable-p", - ;; "file-ownership-preserved-p", "file-readable-p", - ;; "file-writable-p". - '("file-directory-p" "file-exists-p" "file-symlink-p" "file-truename") - (tramp-flush-file-properties v localname)) - (condition-case err - (progn ,@body) - (error (if tramp-inhibit-errors-if-setting-file-attributes-fail - (display-warning 'tramp (error-message-string err)) - (signal (car err) (cdr err))))))) + (tramp-barf-if-file-missing v ,filename + (if (not (file-exists-p ,filename)) + ;; Trigger the `file-missing' error. + (signal 'error nil) + (with-tramp-saved-file-properties + v localname + ;; We cannot add "file-attributes", "file-executable-p", + ;; "file-ownership-preserved-p", "file-readable-p", + ;; "file-writable-p". + '("file-directory-p" "file-exists-p" + "file-symlink-p" "file-truename") + (tramp-flush-file-properties v localname)) + (condition-case err + (progn ,@body) + (error (if tramp-inhibit-errors-if-setting-file-attributes-fail + (display-warning 'tramp (error-message-string err)) + (signal (car err) (cdr err))))))))) (defmacro tramp-skeleton-write-region (start end filename append visit lockname mustbenew &rest body) @@ -4013,9 +4009,7 @@ Let-bind it when necessary.") (tramp-dont-suspend-timers t)) (with-tramp-timeout (timeout - (unless (and-let* ((p (tramp-get-connection-process v)) - ((process-live-p p)) - ((tramp-get-connection-property p "connected")))) + (unless (and (not non-essential) (tramp-connectable-p v)) (tramp-cleanup-connection v 'keep-debug 'keep-password)) (tramp-error v 'file-error @@ -4901,6 +4895,7 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.") ;; functions like `kill-buffer' would try to reestablish the ;; connection. See Bug#61663. (if-let* ((v (tramp-dissect-file-name file)) + ((tramp-connectable-p v)) ((process-live-p (tramp-get-process v))) (lockname (tramp-compat-make-lock-file-name file))) (delete-file lockname) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 2b2fdf94a49..af6d52c4ae6 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -7,7 +7,7 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.7.3.30.2 +;; Version: 2.7.4-pre ;; Package-Requires: ((emacs "27.1")) ;; Package-Type: multi ;; URL: https://www.gnu.org/software/tramp/ @@ -40,7 +40,7 @@ ;; ./configure" to change them. ;;;###tramp-autoload -(defconst tramp-version "2.7.3.30.2" +(defconst tramp-version "2.7.4-pre" "This version of Tramp.") ;;;###tramp-autoload @@ -76,7 +76,7 @@ ;; Check for Emacs version. (let ((x (if (not (string-version-lessp emacs-version "27.1")) "ok" - (format "Tramp 2.7.3.30.2 is not fit for %s" + (format "Tramp 2.7.4-pre is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x))) -- cgit v1.2.1 From 6a018a2d7e4fd53e5c2340e8ba159667e4244cec Mon Sep 17 00:00:00 2001 From: Toru TSUNEYOSHI Date: Sat, 16 Aug 2025 12:56:09 +0200 Subject: Improve use of "touch" in Tramp * lisp/net/tramp-sh.el (tramp-get-remote-touch): Set connection property "touch-h". (tramp-sh-handle-set-file-times): Use it. --- lisp/net/tramp-sh.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 287b46fc72e..80ae71dfc64 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1601,7 +1601,10 @@ of." "-t %s" (format-time-string "%Y%m%d%H%M.%S" (tramp-defined-time time) t)) "") - (if (eq flag 'nofollow) "-h" "") + (if (and (eq flag 'nofollow) + (tramp-get-connection-property v "touch-h")) + "-h" + "") (tramp-shell-quote-argument localname)))))) (defun tramp-sh-handle-get-home-directory (vec &optional user) @@ -5892,6 +5895,14 @@ Nonexistent directories are removed from spec." result (format-time-string "%Y%m%d%H%M.%S") (tramp-file-local-name tmpfile)))) + (tramp-set-connection-property + vec "touch-h" + (tramp-send-command-and-check + vec + (format + "%s -h %s" + result + (tramp-file-local-name tmpfile)))) (delete-file tmpfile)) result))) -- cgit v1.2.1 From 964741d40e00334ec7b8dbe85c15c3f5af2296e7 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 16 Aug 2025 12:59:06 +0200 Subject: * lisp/net/tramp-sh.el (tramp-get-remote-touch): Simplify. --- lisp/net/tramp-sh.el | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'lisp') diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 80ae71dfc64..f7dfedbd88d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -5880,12 +5880,12 @@ Nonexistent directories are removed from spec." "Determine remote `touch' command." (with-tramp-connection-property vec "touch" (tramp-message vec 5 "Finding a suitable `touch' command") - (let ((result (tramp-find-executable - vec "touch" (tramp-get-remote-path vec))) - (tmpfile (tramp-make-tramp-temp-name vec))) - ;; Busyboxes do support the "-t" option only when they have been - ;; built with the DESKTOP config option. Let's check it. - (when result + (when-let* ((result (tramp-find-executable + vec "touch" (tramp-get-remote-path vec))) + (tmpfile (tramp-make-tramp-temp-name vec))) + (prog1 result + ;; Busyboxes do support the "-t" option only when they have + ;; been built with the DESKTOP config option. Let's check it. (tramp-set-connection-property vec "touch-t" (tramp-send-command-and-check @@ -5895,16 +5895,13 @@ Nonexistent directories are removed from spec." result (format-time-string "%Y%m%d%H%M.%S") (tramp-file-local-name tmpfile)))) + ;; The touch command included in busybox (version 1.30.1-6) on + ;; OpenWrt does not have the option "-h". (tramp-set-connection-property vec "touch-h" (tramp-send-command-and-check - vec - (format - "%s -h %s" - result - (tramp-file-local-name tmpfile)))) - (delete-file tmpfile)) - result))) + vec (format "%s -h %s" result (tramp-file-local-name tmpfile)))) + (delete-file tmpfile))))) (defun tramp-get-remote-df (vec) "Determine remote `df' command." -- cgit v1.2.1