emacs-diffs
[Top][All Lists]
Advanced

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

emacs-28 b228ec9: Fix reading the tail of a file in shorthands.el


From: Eli Zaretskii
Subject: emacs-28 b228ec9: Fix reading the tail of a file in shorthands.el
Date: Sun, 3 Oct 2021 07:34:56 -0400 (EDT)

branch: emacs-28
commit b228ec9fab8ea5e09da4d3c3f41d7859d88afb7d
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix reading the tail of a file in shorthands.el
    
    * lisp/shorthands.el (hack-elisp-shorthands): Fix reading past
    3000-character limit from EOF.  (Bug#50946)
---
 lisp/shorthands.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/shorthands.el b/lisp/shorthands.el
index b8204d6..6162efd 100644
--- a/lisp/shorthands.el
+++ b/lisp/shorthands.el
@@ -40,7 +40,10 @@ except for extraction of the buffer-local value of
     (with-temp-buffer
       (while (and (< (buffer-size) 3000) (>= from 0))
         (insert-file-contents fullname nil from to)
-        (setq to from from (- from 100)))
+        (setq to from
+              from (cond
+                    ((= from 0) -1)
+                    (t (max 0 (- from 100))))))
       ;; FIXME: relies on the `hack-local-variables--find-variables'
       ;; detail of files.el.  That function should be exported,
       ;; possibly be refactored into two parts, since we're only



reply via email to

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