Subject: bug#77444: Allow install package from git repo when autocrlf is true

From: Eli Zaretskii <[email-masked]>
Date: Wed, 02 Apr 2025 15:12:09 +0300

> Date: Wed, 2 Apr 2025 09:17:16 +0800
> From:  "Yue Yi" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
> index 111d512ef59..9cac77eb524 100644
> --- a/lisp/emacs-lisp/lisp-mnt.el
> +++ b/lisp/emacs-lisp/lisp-mnt.el
> @@ -261,7 +261,7 @@ lm-header
>  		(if (save-excursion
>  		      (skip-chars-backward "^$" (match-beginning 0))
>  		      (= (point) (match-beginning 0)))
> -		    "[^\n]+" "[^$\n]+")))
> +		    "[^\r\n]+" "[^$\r\n]+")))
>        (match-string-no-properties 0))))
>  
>  (defun lm-header-multiline (header)
> 
> However, at this point, the ^M characters in the buffer will affect the
> docstring, leading to numerous errors during byte compilation.
> 
> Warning: docstring contains control char #x0d (position xxx)

Also, any lone ^M characters will be taken as EOL.  So only a *M
before a newline should be considered EOL.

> For this issue, is it a better choice to set autocrlf to input or false
> rather than modifying the code in package-vc?

Personally, I think using Git with autocrlf set to anything but false
is asking for trouble.  EOL conversions is a Git feature one should
never use if one wants to stay sane.  So my recommendation would be to
force autocrlf = false.