changeset 54784:494d96bf5f98

(vc-print-log): Use condition-case to check for backward compatibility.
author André Spiegel <spiegel@gnu.org>
date Sun, 11 Apr 2004 15:05:18 +0000
parents 507f2c946725
children 1fff9cffd37c
files lisp/vc.el
diffstat 1 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc.el	Sun Apr 11 15:03:21 2004 +0000
+++ b/lisp/vc.el	Sun Apr 11 15:05:18 2004 +0000
@@ -7,7 +7,7 @@
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
 ;; Keywords: tools
 
-;; $Id: vc.el,v 1.373 2004/03/26 16:17:12 monnier Exp $
+;; $Id: vc.el,v 1.374 2004/03/28 22:00:19 monnier Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -2348,13 +2348,23 @@
     ;; Don't switch to the output buffer before running the command,
     ;; so that any buffer-local settings in the vc-controlled
     ;; buffer can be accessed by the command.
-    (if (> (length (vc-arg-list (vc-backend file) 'print-log)) 1)
+    (condition-case err
         (progn
           (vc-call print-log file "*vc-change-log*")
           (set-buffer "*vc-change-log*"))
-      ;; for backward compatibility
-      (vc-call print-log file)
-      (set-buffer "*vc*"))
+      (wrong-number-of-arguments
+       ;; If this error came from the above call to print-log, try again
+       ;; without the optional buffer argument (for backward compatibility).
+       ;; Otherwise, resignal.
+       (if (or (not (eq (cadr err)
+                        (indirect-function 
+                         (vc-find-backend-function (vc-backend file) 
+                                                   'print-log))))
+               (not (eq (caddr err) 2)))
+           (signal wrong-number-of-arguments err)
+         ;; for backward compatibility
+         (vc-call print-log file)
+         (set-buffer "*vc*"))))
     (pop-to-buffer (current-buffer))
     (log-view-mode)
     (vc-exec-after