tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Missing trailing spaces in yes-or-no-p calls


From: Tim Landscheidt
Subject: Missing trailing spaces in yes-or-no-p calls
Date: Tue, 09 May 2023 13:01:06 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi,

one of the differences between y-or-n-p and yes-or-no-p is
that the former adds " (y or n) " to the prompt, while the
latter only appends "(yes or no) ", so prompts passed to
yes-or-no-p need to end with a space.  The attached patch
fixes those cases in TRAMP where they did not already.

Tim
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index 276b65fcfb3..a897a2f1988 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -525,7 +525,7 @@ tramp-crypt-remove-directory
              tramp-crypt-encfs-config
              (directory-files name nil directory-files-no-dot-files-regexp))
             (yes-or-no-p
-             "There exist encrypted files, do you want to continue?"))
+             "There exist encrypted files, do you want to continue? "))
     (setq tramp-crypt-directories (delete name tramp-crypt-directories))
     (tramp-register-file-name-handlers)))
 
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index d020615af07..ff3cbff7dda 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1833,7 +1833,7 @@ tramp-sh-handle-add-name-to-file
                  (and (numberp ok-if-already-exists)
                       (not (yes-or-no-p
                             (format
-                             "File %s already exists; make it a link anyway?"
+                             "File %s already exists; make it a link anyway? "
                              v2-localname)))))
              (tramp-error v2 'file-already-exists newname)
            (delete-file newname)))
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 1182501e820..3022402e3b1 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -383,7 +383,7 @@ tramp-smb-handle-add-name-to-file
                (and (numberp ok-if-already-exists)
                     (not (yes-or-no-p
                           (format
-                           "File %s already exists; make it a link anyway?"
+                           "File %s already exists; make it a link anyway? "
                            v2-localname)))))
            (tramp-error v2 'file-already-exists newname)
          (delete-file newname)))
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index e41a4a590e2..76e298a5ff0 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -206,7 +206,7 @@ tramp-sudoedit-handle-add-name-to-file
                  (and (numberp ok-if-already-exists)
                       (not (yes-or-no-p
                             (format
-                             "File %s already exists; make it a link anyway?"
+                             "File %s already exists; make it a link anyway? "
                              v2-localname)))))
              (tramp-error v2 'file-already-exists newname)
            (delete-file newname)))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 3eb2dd13cbc..6977e4cdfdd 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3759,7 +3759,7 @@ tramp-skeleton-handle-make-symbolic-link
                 (and (numberp ,ok-if-already-exists)
                      (not (yes-or-no-p
                            (format
-                            "File %s already exists; make it a link anyway?"
+                            "File %s already exists; make it a link anyway? "
                             localname)))))
             (tramp-error v 'file-already-exists localname)
           (delete-file ,linkname)))
@@ -3987,7 +3987,7 @@ tramp-handle-add-name-to-file
              (and (numberp ok-if-already-exists)
                   (not (yes-or-no-p
                         (format
-                         "File %s already exists; make it a link anyway?"
+                         "File %s already exists; make it a link anyway? "
                          localname)))))
          (tramp-error v 'file-already-exists newname)
        (delete-file newname)))
@@ -4392,7 +4392,7 @@ tramp-handle-find-backup-file-name
                          (yes-or-no-p
                           (concat
                            "Backup file on local temporary directory, "
-                           "do you want to continue?")))))
+                           "do you want to continue? ")))))
          (tramp-error v 'file-error "Unsafe backup file name"))))))
 
 (defun tramp-handle-insert-directory
@@ -4776,7 +4776,7 @@ tramp-handle-lock-file
                            (yes-or-no-p
                             (concat
                              "Lock file on local temporary directory, "
-                             "do you want to continue?")))))
+                             "do you want to continue? ")))))
            (tramp-error v 'file-error "Unsafe lock file name")))
 
        ;; Do the lock.
@@ -5272,13 +5272,13 @@ tramp-handle-shell-command
        ((eq async-shell-command-buffer 'confirm-kill-process)
        ;; If will kill a process, query first.
        (if (yes-or-no-p
-            "A command is running in the default buffer.  Kill it?")
+            "A command is running in the default buffer.  Kill it? ")
            (kill-process p)
          (tramp-user-error p "Shell command in progress")))
        ((eq async-shell-command-buffer 'confirm-new-buffer)
        ;; If will create a new buffer, query first.
        (if (yes-or-no-p
-            "A command is running in the default buffer.  Use a new buffer?")
+            "A command is running in the default buffer.  Use a new buffer? ")
             (setq output-buffer (generate-new-buffer bname))
          (tramp-user-error p "Shell command in progress")))
        ((eq async-shell-command-buffer 'new-buffer)
@@ -5287,7 +5287,7 @@ tramp-handle-shell-command
        ((eq async-shell-command-buffer 'confirm-rename-buffer)
        ;; If will rename the buffer, query first.
        (if (yes-or-no-p
-            "A command is running in the default buffer.  Rename it?")
+            "A command is running in the default buffer.  Rename it? ")
            (progn
              (with-current-buffer output-buffer
                (rename-uniquely))
@@ -6561,7 +6561,7 @@ tramp-handle-make-auto-save-file-name
                          (yes-or-no-p
                           (concat
                            "Autosave file on local temporary directory, "
-                           "do you want to continue?")))))
+                           "do you want to continue? ")))))
          (tramp-error v 'file-error "Unsafe autosave file name"))))))
 
 (defun tramp-subst-strs-in-string (alist string)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]