emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/longlines.el,v [EMACS_22_BASE]


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/longlines.el,v [EMACS_22_BASE]
Date: Tue, 07 Aug 2007 16:08:40 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Chong Yidong <cyd>      07/08/07 16:08:39

Index: longlines.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/longlines.el,v
retrieving revision 1.33.2.3
retrieving revision 1.33.2.4
diff -u -b -r1.33.2.3 -r1.33.2.4
--- longlines.el        25 Jul 2007 04:47:14 -0000      1.33.2.3
+++ longlines.el        7 Aug 2007 16:08:39 -0000       1.33.2.4
@@ -79,11 +79,13 @@
 (defvar longlines-wrap-end nil)
 (defvar longlines-wrap-point nil)
 (defvar longlines-showing nil)
+(defvar longlines-decoded nil)
 
 (make-variable-buffer-local 'longlines-wrap-beg)
 (make-variable-buffer-local 'longlines-wrap-end)
 (make-variable-buffer-local 'longlines-wrap-point)
 (make-variable-buffer-local 'longlines-showing)
+(make-variable-buffer-local 'longlines-decoded)
 
 ;; Mode
 
@@ -128,7 +130,9 @@
           ;; longlines-wrap-lines that we'll never encounter from here
          (save-restriction
            (widen)
+           (unless longlines-decoded
            (longlines-decode-buffer)
+             (setq longlines-decoded t))
            (longlines-wrap-region (point-min) (point-max)))
           (set-buffer-modified-p mod))
         (when (and longlines-show-hard-newlines
@@ -161,9 +165,11 @@
     (let ((buffer-undo-list t)
          (after-change-functions nil)
           (inhibit-read-only t))
+      (if longlines-decoded
       (save-restriction
        (widen)
-       (longlines-encode-region (point-min) (point-max))))
+           (longlines-encode-region (point-min) (point-max))
+           (setq longlines-decoded nil))))
     (remove-hook 'change-major-mode-hook 'longlines-mode-off t)
     (remove-hook 'after-change-functions 'longlines-after-change-function t)
     (remove-hook 'post-command-hook 'longlines-post-command-function t)




reply via email to

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