From: Michael Albinus Date: Sun, 5 Mar 2023 16:31:26 +0000 (+0100) Subject: Fix tramp-sh-handle-insert-directory X-Git-Tag: emacs-29.0.90~241 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b8e0b31548;p=emacs.git 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. --- 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.