emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Dan Nicolaescu
Subject: [Emacs-diffs] Changes to emacs/lisp/vc.el,v
Date: Mon, 17 Mar 2008 16:25:17 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Dan Nicolaescu <dann>   08/03/17 16:25:16

Index: vc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v
retrieving revision 1.548
retrieving revision 1.549
diff -u -b -r1.548 -r1.549
--- vc.el       11 Mar 2008 02:58:58 -0000      1.548
+++ vc.el       17 Mar 2008 16:25:11 -0000      1.549
@@ -2800,6 +2800,9 @@
     map)
   "Keymap for VC status")
 
+(defun vc-default-extra-status-menu (backend)
+  nil)
+
 (defun vc-status-menu-map-filter (orig-binding)
   (if (boundp 'vc-ignore-menu-filter)
       orig-binding
@@ -2889,6 +2892,29 @@
     ;; We are done, turn of the in progress message in the mode-line.
     (setq mode-line-process nil)))
 
+(defun vc-add-to-vc-status-buffer (entry buffer)
+  ;; Add one ENTRY to the vc-status buffer BUFFER.  
+  ;; This will be used to automatically add files with the "modified"
+  ;; state when saving them.
+
+  ;; ENTRY is (FILENAME . STATE)
+  (with-current-buffer buffer
+    (let ((crt (ewoc-nth vc-status 0))
+         (fname (car entry)))
+      ;; First try to see if there's already an entry with that name
+      ;; in the ewoc.
+      (while (and crt (not (string= (vc-status-fileinfo->name 
+                                    (ewoc-data crt)) fname)))
+       (setq crt (ewoc-next vc-status crt)))
+      (if crt
+         (progn 
+           ;; Found the file, just update the status.
+           (setf (vc-status-fileinfo->state (ewoc-data crt)) (cdr entry))
+           (ewoc-invalidate vc-status crt))
+       ;; Could not find the file, insert a new entry.
+       (ewoc-enter-last
+        vc-status (vc-status-create-fileinfo (cdr entry) (car entry)))))))
+
 (defun vc-status-refresh ()
   "Refresh the contents of the VC status buffer."
   (interactive)




reply via email to

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