Re: tramp (HEAD/b20b7910b413c13352213d37cac8e948ad554dc3); CR-LF woes again — PATCH ATTACHED

Michael Albinus <[email protected]>
Newsgroups gmane.emacs.tramp
Message-ID <[email protected]>
Dominique Quatravaux <[email protected]> writes:

Hi Dominique,

> When accessing some file over the /kubernetes: Tramp connection type,
> browsing goes sideways the instant I am done typing in the “hostname”
> (i.e. in this case, the pod name). It appears that for some reason or
> other, the CR/LF situation is being handled poorly.

Yes. This happens, because Tramp tries do read something early (during
completion), when the CRLF handling hasn't been established yet. I believe.

> diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
> index 186ef127..769138dc 100644
> --- a/lisp/tramp-sh.el
> +++ b/lisp/tramp-sh.el
> @@ -5540,7 +5540,7 @@ raises an error."
>  		     (unless noerror signal-hook-function)))
>  		(read (current-buffer)))
>  	    ;; Error handling.
> -	    (when (search-forward-regexp (rx (not blank)) (line-end-position) t)
> +	    (when (search-forward-regexp (rx (not (or "\r" blank))) (line-end-position) t)
>  	      (error nil)))
>  	(error (unless noerror
>  		 (tramp-error

Thanks for the patch, it looks fine. However, perhaps it is more simple
to use 'space' instead of 'blank', this includes also characters like
CR, LF, FF, you name it. For all characters with whitespace syntax, see
<https://en.wikipedia.org/wiki/Whitespace_character>.
            
--8<---------------cut here---------------start------------->8---
	    (when (search-forward-regexp (rx (not space)) (line-end-position) t)
--8<---------------cut here---------------end--------------->8---

Could you, please, test in your environment?

>  Dominique Quatravaux

Best regards, Michael.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.