aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Spiegel2004-03-26 06:06:39 +0000
committerAndré Spiegel2004-03-26 06:06:39 +0000
commit4392edabd49419a405cc5dabeedac9382f5d5fe1 (patch)
tree0241a9c4d160a8c8f0d41538d85d461c50cfd80b
parentbe21b9259261d1da0983913d3fb2656fabadc920 (diff)
downloademacs-4392edabd49419a405cc5dabeedac9382f5d5fe1.tar.gz
emacs-4392edabd49419a405cc5dabeedac9382f5d5fe1.zip
(vc-arg-list): New function, which handles both compiled and
uncompiled code. (vc-default-workfile-unchanged-p): Use it.
-rw-r--r--lisp/vc-hooks.el26
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index be39f7d9d5c..2f4dc71590f 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -6,7 +6,7 @@
6;; Author: FSF (see vc.el for full credits) 6;; Author: FSF (see vc.el for full credits)
7;; Maintainer: Andre Spiegel <spiegel@gnu.org> 7;; Maintainer: Andre Spiegel <spiegel@gnu.org>
8 8
9;; $Id: vc-hooks.el,v 1.162 2004/03/21 15:44:39 spiegel Exp $ 9;; $Id: vc-hooks.el,v 1.163 2004/03/23 20:59:19 monnier Exp $
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12 12
@@ -267,6 +267,15 @@ It is usually called via the `vc-call' macro."
267 ;; BEWARE!! `file' is evaluated twice!! 267 ;; BEWARE!! `file' is evaluated twice!!
268 `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args)) 268 `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args))
269 269
270(defun vc-arg-list (backend fun)
271 "Return the argument list of BACKEND function FUN."
272 (let ((f (symbol-function (vc-find-backend-function backend fun))))
273 (if (listp f)
274 ;; loaded from .el file
275 (cadr f)
276 ;; loaded from .elc file
277 (aref f 0))))
278
270 279
271(defsubst vc-parse-buffer (pattern i) 280(defsubst vc-parse-buffer (pattern i)
272 "Find PATTERN in the current buffer and return its Ith submatch." 281 "Find PATTERN in the current buffer and return its Ith submatch."
@@ -463,15 +472,12 @@ and does not employ any heuristic at all."
463(defun vc-default-workfile-unchanged-p (backend file) 472(defun vc-default-workfile-unchanged-p (backend file)
464 "Check if FILE is unchanged by diffing against the master version. 473 "Check if FILE is unchanged by diffing against the master version.
465Return non-nil if FILE is unchanged." 474Return non-nil if FILE is unchanged."
466 (let ((diff-args-length 475 (zerop (if (> (length (vc-arg-list backend 'diff)) 4)
467 (length (cadr (symbol-function 476 ;; If the implementation supports it, let the output
468 (vc-find-backend-function backend 'diff)))))) 477 ;; go to *vc*, not *vc-diff*, since this is an internal call.
469 (zerop (if (> diff-args-length 4) 478 (vc-call diff file nil nil "*vc*")
470 ;; If the implementation supports it, let the output 479 ;; for backward compatibility
471 ;; go to *vc*, not *vc-diff*, since this is an internal call. 480 (vc-call diff file))))
472 (vc-call diff file nil nil "*vc*")
473 ;; for backward compatibility
474 (vc-call diff file)))))
475 481
476(defun vc-workfile-version (file) 482(defun vc-workfile-version (file)
477 "Return the version level of the current workfile FILE. 483 "Return the version level of the current workfile FILE.