From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: *vc-diff* keeps undo information Date: 03 Jun 2006 08:30:55 -0400 Message-ID: References: <17535.23719.576201.366323@rgrjr.dyndns.org> <87bqtbj4b9.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1149337890 29930 80.91.229.2 (3 Jun 2006 12:31:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Jun 2006 12:31:30 +0000 (UTC) Cc: rogers-emacs@rgrjr.dyndns.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 03 14:31:27 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FmVHi-0004Go-0t for ged-emacs-devel@m.gmane.org; Sat, 03 Jun 2006 14:31:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FmVHh-0003E9-GC for ged-emacs-devel@m.gmane.org; Sat, 03 Jun 2006 08:31:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FmVHP-0003Dc-LD for emacs-devel@gnu.org; Sat, 03 Jun 2006 08:30:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FmVHN-0003DJ-1m for emacs-devel@gnu.org; Sat, 03 Jun 2006 08:30:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FmVHM-0003DG-UE for emacs-devel@gnu.org; Sat, 03 Jun 2006 08:30:56 -0400 Original-Received: from [67.59.132.6] (helo=mail.agora-net.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FmVO3-0004zN-SF for emacs-devel@gnu.org; Sat, 03 Jun 2006 08:37:51 -0400 Original-Received: from ttn by mail.agora-net.com with local (Exim 4.50) id 1FmVHL-0005Bf-Jm; Sat, 03 Jun 2006 08:30:55 -0400 Original-To: emacs-devel@gnu.org In-Reply-To: Original-Lines: 75 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:55663 Archived-At: Richard Stallman 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))))