]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 3 Apr 2021 16:25:27 +0000 (18:25 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 3 Apr 2021 16:25:27 +0000 (18:25 +0200)
Fix code finding //DIRED//.

lisp/net/tramp-sh.el

index 255314a99eac8531abf9e407847188c768e951c9..c3e1745d2f294912df03ef9f92c33ed2f2a51e28 100644 (file)
@@ -2584,12 +2584,9 @@ The method used must be an out-of-band method."
        (save-restriction
          (narrow-to-region beg-marker end-marker)
          ;; Check for "--dired" output.
-         (forward-line -2)
-         (when (looking-at-p "//SUBDIRED//")
-           (forward-line -1))
-         (when (looking-at "//DIRED//\\s-+")
-           (let ((beg (match-end 0))
-                 (end (point-at-eol)))
+         (when (re-search-backward "^//DIRED//\\s-+\\(.+\\)$" nil 'noerror)
+           (let ((beg (match-beginning 1))
+                 (end (match-end 0)))
              ;; Now read the numeric positions of file names.
              (goto-char beg)
              (while (< (point) end)
@@ -2599,7 +2596,7 @@ 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.
-         (goto-char (point-at-bol))
+         (beginning-of-line)
          (while (looking-at "//")
            (forward-line 1)
            (delete-region (match-beginning 0) (point))))