comparison lisp/vc.el @ 83530:46b1096093f5

Merged from emacs@sv.gnu.org. Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-294 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-295 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-296 Update from CVS: admin/FOR-RELEASE: Update refcard section. * emacs@sv.gnu.org/emacs--devo--0--patch-297 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-298 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-299 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-300 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-301 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-302 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-303 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-304 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-103 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-104 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-570
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 12 Jun 2006 07:27:12 +0000
parents 5d328dadd0f4 4d648a3d282d
children a387c138b28e
comparison
equal deleted inserted replaced
83529:0d9e16eab053 83530:46b1096093f5
892 (if (not (vc-backend buffer-file-name)) 892 (if (not (vc-backend buffer-file-name))
893 (error "File %s is not under version control" buffer-file-name))))) 893 (error "File %s is not under version control" buffer-file-name)))))
894 894
895 (defun vc-process-filter (p s) 895 (defun vc-process-filter (p s)
896 "An alternative output filter for async process P. 896 "An alternative output filter for async process P.
897 The only difference with the default filter is to insert S after markers." 897 One difference with the default filter is that this inserts S after markers.
898 Another is that undo information is not kept."
898 (with-current-buffer (process-buffer p) 899 (with-current-buffer (process-buffer p)
899 (save-excursion 900 (save-excursion
900 (let ((inhibit-read-only t)) 901 (let ((buffer-undo-list t)
902 (inhibit-read-only t))
901 (goto-char (process-mark p)) 903 (goto-char (process-mark p))
902 (insert s) 904 (insert s)
903 (set-marker (process-mark p) (point)))))) 905 (set-marker (process-mark p) (point))))))
904 906
905 (defun vc-setup-buffer (&optional buf) 907 (defun vc-setup-buffer (&optional buf)
912 (kill-all-local-variables) 914 (kill-all-local-variables)
913 (set (make-local-variable 'vc-parent-buffer) camefrom) 915 (set (make-local-variable 'vc-parent-buffer) camefrom)
914 (set (make-local-variable 'vc-parent-buffer-name) 916 (set (make-local-variable 'vc-parent-buffer-name)
915 (concat " from " (buffer-name camefrom))) 917 (concat " from " (buffer-name camefrom)))
916 (setq default-directory olddir) 918 (setq default-directory olddir)
917 (let ((inhibit-read-only t)) 919 (let ((buffer-undo-list t)
920 (inhibit-read-only t))
918 (erase-buffer)))) 921 (erase-buffer))))
919 922
920 (defun vc-exec-after (code) 923 (defun vc-exec-after (code)
921 "Eval CODE when the current buffer's process is done. 924 "Eval CODE when the current buffer's process is done.
922 If the current buffer has no process, just evaluate CODE. 925 If the current buffer has no process, just evaluate CODE.
1001 ;;(set-process-sentinel proc (lambda (p msg) (delete-process p))) 1004 ;;(set-process-sentinel proc (lambda (p msg) (delete-process p)))
1002 (set-process-filter proc 'vc-process-filter) 1005 (set-process-filter proc 'vc-process-filter)
1003 (vc-exec-after 1006 (vc-exec-after
1004 `(unless (active-minibuffer-window) 1007 `(unless (active-minibuffer-window)
1005 (message "Running %s in the background... done" ',command)))) 1008 (message "Running %s in the background... done" ',command))))
1006 (setq status (apply 'process-file command nil t nil squeezed)) 1009 (let ((buffer-undo-list t))
1010 (setq status (apply 'process-file command nil t nil squeezed)))
1007 (when (and (not (eq t okstatus)) 1011 (when (and (not (eq t okstatus))
1008 (or (not (integerp status)) 1012 (or (not (integerp status))
1009 (and okstatus (< okstatus status)))) 1013 (and okstatus (< okstatus status))))
1010 (pop-to-buffer (current-buffer)) 1014 (pop-to-buffer (current-buffer))
1011 (goto-char (point-min)) 1015 (goto-char (point-min))