emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 7f8f19da24: Fix 'hack-local-variables' when EOL conversion is inh


From: Eli Zaretskii
Subject: master 7f8f19da24: Fix 'hack-local-variables' when EOL conversion is inhibited
Date: Mon, 6 Feb 2023 11:29:10 -0500 (EST)

branch: master
commit 7f8f19da2492cd11b984c67259bfb645984d9c06
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    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)
---
 lisp/files.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/files.el b/lisp/files.el
index 9da8244611..b0ec6bb09d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]