emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/jka-compr.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/jka-compr.el,v
Date: Wed, 28 May 2008 17:35:36 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/05/28 17:35:35

Index: jka-compr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/jka-compr.el,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- jka-compr.el        6 May 2008 07:57:41 -0000       1.98
+++ jka-compr.el        28 May 2008 17:35:34 -0000      1.99
@@ -257,16 +257,12 @@
         (info (jka-compr-get-compression-info visit-file))
         (magic (and info (jka-compr-info-file-magic-bytes info))))
 
-    ;; If START is nil, use the whole buffer.
-    (if (null start)
-       (setq start 1 end (1+ (buffer-size))))
-
     ;; If we uncompressed this file when visiting it,
     ;; then recompress it when writing it
     ;; even if the contents look compressed already.
     (if (and jka-compr-really-do-compress
-            (eq start 1)
-            (eq end (1+ (buffer-size))))
+             (or (null start)
+                 (= (- end start) (buffer-size))))
        (setq magic nil))
 
     (if (and info
@@ -277,9 +273,10 @@
                       (equal (if (stringp start)
                                  (substring start 0 (min (length start)
                                                          (length magic)))
-                               (buffer-substring start
-                                                 (min end
-                                                      (+ start (length 
magic)))))
+                                (let ((from (or start (point-min)))
+                                      (to (min (or end (point-max))
+                                               (+ from (length magic)))))
+                                  (buffer-substring from to)))
                              magic))))
        (let ((can-append (jka-compr-info-can-append info))
              (compress-program (jka-compr-info-compress-program info))




reply via email to

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