]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tramp-sh-handle-insert-directory
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 5 Mar 2023 16:31:26 +0000 (17:31 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 5 Mar 2023 16:31:26 +0000 (17:31 +0100)
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Remove also
//DIRED-OPTIONS// line when there is no //DIRED// line.

lisp/net/tramp-sh.el

index ec8437176db2a46179b9202e2866cbd13de216eb..392a654df21f5cd7fcf4e78e5c0bb508d845ed3e 100644 (file)
@@ -2742,8 +2742,8 @@ The method used must be an out-of-band method."
                      ;; End is followed by \n or by " -> ".
                      (put-text-property start end 'dired-filename t))))))
          ;; Remove trailing lines.
-         (beginning-of-line)
-         (while (looking-at "//")
+         (goto-char (point-max))
+         (while (re-search-backward (rx bol "//") nil 'noerror)
            (forward-line 1)
            (delete-region (match-beginning 0) (point))))
        ;; Reset multibyte if needed.