From 5b8e0b31548feb7450d73a6ee33e10e6ed9796ee Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Mar 2023 17:31:26 +0100 Subject: [PATCH] Fix tramp-sh-handle-insert-directory * 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index ec8437176db..392a654df21 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -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. -- 2.39.2