emacs-devel
[Top][All Lists]
Advanced

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

Re: *vc-diff* keeps undo information


From: Thien-Thi Nguyen
Subject: Re: *vc-diff* keeps undo information
Date: 03 Jun 2006 08:30:55 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Richard Stallman <address@hidden> writes:

> That is a good point.  So the thing to do is turn off undo
> temporarily while the diff is being received, then turn it on
> with an empty undo list.

the following patch does this.  i am not confident about it
because i had to change several places, and suspect other diff
cases (or other commands) may not behave as desired.

thi

_________________________________
cvs -f diff -c vc.el
Index: vc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc.el,v
retrieving revision 1.418
diff -c -r1.418 vc.el
*** vc.el       13 Apr 2006 13:35:55 -0000      1.418
--- vc.el       3 Jun 2006 12:25:22 -0000
***************
*** 897,903 ****
  The only difference with the default filter is to insert S after markers."
    (with-current-buffer (process-buffer p)
      (save-excursion
!       (let ((inhibit-read-only t))
        (goto-char (process-mark p))
        (insert s)
        (set-marker (process-mark p) (point))))))
--- 897,904 ----
  The only difference with the default filter is to insert S after markers."
    (with-current-buffer (process-buffer p)
      (save-excursion
!       (let ((buffer-undo-list t)
!             (inhibit-read-only t))
        (goto-char (process-mark p))
        (insert s)
        (set-marker (process-mark p) (point))))))
***************
*** 914,920 ****
      (set (make-local-variable 'vc-parent-buffer-name)
         (concat " from " (buffer-name camefrom)))
      (setq default-directory olddir)
!     (let ((inhibit-read-only t))
        (erase-buffer))))
  
  (defun vc-exec-after (code)
--- 915,922 ----
      (set (make-local-variable 'vc-parent-buffer-name)
         (concat " from " (buffer-name camefrom)))
      (setq default-directory olddir)
!     (let ((buffer-undo-list t)
!           (inhibit-read-only t))
        (erase-buffer))))
  
  (defun vc-exec-after (code)
***************
*** 1003,1009 ****
              (vc-exec-after
               `(unless (active-minibuffer-window)
                    (message "Running %s in the background... done" 
',command))))
!         (setq status (apply 'process-file command nil t nil squeezed))
          (when (and (not (eq t okstatus))
                       (or (not (integerp status))
                           (and okstatus (< okstatus status))))
--- 1005,1012 ----
              (vc-exec-after
               `(unless (active-minibuffer-window)
                    (message "Running %s in the background... done" 
',command))))
!         (let ((buffer-undo-list t))
!             (setq status (apply 'process-file command nil t nil squeezed)))
          (when (and (not (eq t okstatus))
                       (or (not (integerp status))
                           (and okstatus (< okstatus status))))




reply via email to

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