changeset 82120:cb9f54321c74

Merge from emacs--rel--22 Patches applied: * emacs--rel--22 (patch 70-73) - Update from CVS 2007-07-25 Glenn Morris <rgm@gnu.org> * Relicense all FSF files to GPLv3 or later. 2007-07-25 Stefan Monnier <monnier@iro.umontreal.ca> * lisp/pcvs.el (cvs-temp-buffer): Undo last ill-conceived change. Replace it with another one which disables undo before calling erase-buffer and then turns it back on if needed. 2007-07-24 Stefan Monnier <monnier@iro.umontreal.ca> * lisp/pcvs.el (cvs-temp-buffer): Disable undo in temp buffers. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-828
author Miles Bader <miles@gnu.org>
date Thu, 26 Jul 2007 05:18:03 +0000
parents d8cdd93afcc4 (current diff) 9510a7231ed7 (diff)
children 4b32c8c81cd4
files
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/pcvs.el	Thu Jul 26 02:03:46 2007 +0000
+++ b/lisp/pcvs.el	Thu Jul 26 05:18:03 2007 +0000
@@ -19,7 +19,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -392,7 +392,11 @@
     (with-current-buffer buf
       (setq buffer-read-only nil)
       (setq default-directory dir)
-      (unless nosetup (erase-buffer))
+      (unless nosetup
+        ;; Disable undo before calling erase-buffer since it may generate
+        ;; a very large and unwanted undo record.
+        (buffer-disable-undo)
+        (erase-buffer))
       (set (make-local-variable 'cvs-buffer) cvs-buf)
       ;;(cvs-minor-mode 1)
       (let ((lbd list-buffers-directory))
@@ -400,7 +404,8 @@
 	(when lbd (set (make-local-variable 'list-buffers-directory) lbd)))
       (cvs-minor-mode 1)
       ;;(set (make-local-variable 'cvs-buffer) cvs-buf)
-      (unless normal
+      (if normal
+          (buffer-enable-undo)
 	(setq buffer-read-only t)
 	(buffer-disable-undo))
       buf)))