X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/bd358779861f265a7acff31ead40172735af693e..259a0b6d3bc6ffe0d5d24368e415fa46f439a844:/lisp/vc/vc-hooks.el diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 5c8a4515b7..df660d193e 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -1,6 +1,6 @@ ;;; vc-hooks.el --- resident support for version-control -;; Copyright (C) 1992-1996, 1998-2013 Free Software Foundation, Inc. +;; Copyright (C) 1992-1996, 1998-2014 Free Software Foundation, Inc. ;; Author: FSF (see vc.el for full credits) ;; Maintainer: Andre Spiegel @@ -128,7 +128,7 @@ See also variable `vc-consult-headers'." This avoids slow queries over the network and instead uses heuristics and past information to determine the current status of a file. -If value is the symbol `only-file' `vc-dir' will connect to the +If value is the symbol `only-file', `vc-dir' will connect to the server, but heuristics will be used to determine the status for all other VC operations. @@ -190,7 +190,12 @@ individually should stay local." (make-variable-buffer-local 'vc-mode) (put 'vc-mode 'permanent-local t) -(defun vc-mode (&optional arg) +;;; We signal this error when we try to do something a VC backend +;;; doesn't support. Two arguments: the method that's not supported +;;; and the backend +(define-error 'vc-not-supported "VC method not implemented for backend") + +(defun vc-mode (&optional _arg) ;; Dummy function for C-h m "Version Control minor mode. This minor mode is automatically activated whenever you visit a file under @@ -268,10 +273,10 @@ It is usually called via the `vc-call' macro." (setq f (vc-find-backend-function backend function-name)) (push (cons function-name f) (get backend 'vc-functions))) (cond - ((null f) - (error "Sorry, %s is not implemented for %s" function-name backend)) - ((consp f) (apply (car f) (cdr f) args)) - (t (apply f args))))) + ((null f) + (signal 'vc-not-supported (list function-name backend))) + ((consp f) (apply (car f) (cdr f) args)) + (t (apply f args))))) (defmacro vc-call (fun file &rest args) "A convenience macro for calling VC backend functions. @@ -628,10 +633,17 @@ this function." (throw 'found trial)))) templates)))) -(define-obsolete-function-alias - 'vc-toggle-read-only 'toggle-read-only "24.1") -(defun vc-default-make-version-backups-p (backend file) +;; toggle-read-only is obsolete since 24.3, but since vc-t-r-o was made +;; obsolete earlier, it is ok for the latter to be an alias to the former, +;; since the latter will be removed first. We can't just make it +;; an alias for read-only-mode, since that is not 100% the same. +(defalias 'vc-toggle-read-only 'toggle-read-only) +(make-obsolete 'vc-toggle-read-only + "use `read-only-mode' instead (or `toggle-read-only' in older versions of Emacs)." + "24.1") + +(defun vc-default-make-version-backups-p (_backend _file) "Return non-nil if unmodified versions should be backed up locally. The default is to switch off this feature." nil) @@ -834,7 +846,7 @@ current, and kill the buffer that visits the link." (set-buffer true-buffer) (kill-buffer this-buffer)))) -(defun vc-default-find-file-hook (backend) +(defun vc-default-find-file-hook (_backend) nil) (defun vc-find-file-hook () @@ -918,6 +930,7 @@ current, and kill the buffer that visits the link." (define-key map "c" 'vc-rollback) (define-key map "d" 'vc-dir) (define-key map "g" 'vc-annotate) + (define-key map "G" 'vc-ignore) (define-key map "h" 'vc-insert-headers) (define-key map "i" 'vc-register) (define-key map "l" 'vc-print-log) @@ -1002,6 +1015,9 @@ current, and kill the buffer that visits the link." (bindings--define-key map [vc-register] '(menu-item "Register" vc-register :help "Register file set into a version control system")) + (bindings--define-key map [vc-ignore] + '(menu-item "Ignore File..." vc-ignore + :help "Ignore a file under current version control system")) (bindings--define-key map [vc-dir] '(menu-item "VC Dir" vc-dir :help "Show the VC status of files in a directory")) @@ -1029,7 +1045,7 @@ current, and kill the buffer that visits the link." '((ext-menu-separator "--")) ext-binding)))) -(defun vc-default-extra-menu (backend) +(defun vc-default-extra-menu (_backend) nil) (provide 'vc-hooks)