Fix 'hack-local-variables' when EOL conversion is inhibited
* lisp/files.el (hack-local-variables--find-variables): Replace CRs with newlines only if the original buffer is under explicit selective-display. (Bug#61321)
This commit is contained in:
parent
013655811a
commit
7f8f19da24
1 changed files with 3 additions and 1 deletions
|
@ -4017,6 +4017,7 @@ major-mode."
|
|||
(forward-line 1)
|
||||
(let ((startpos (point))
|
||||
endpos
|
||||
(selective-p (eq selective-display t))
|
||||
(thisbuf (current-buffer)))
|
||||
(save-excursion
|
||||
(unless (let ((case-fold-search t))
|
||||
|
@ -4033,7 +4034,8 @@ major-mode."
|
|||
(with-temp-buffer
|
||||
(insert-buffer-substring thisbuf startpos endpos)
|
||||
(goto-char (point-min))
|
||||
(subst-char-in-region (point) (point-max) ?\^m ?\n)
|
||||
(if selective-p
|
||||
(subst-char-in-region (point) (point-max) ?\r ?\n))
|
||||
(while (not (eobp))
|
||||
;; Discard the prefix.
|
||||
(if (looking-at prefix)
|
||||
|
|
Loading…
Add table
Reference in a new issue