diff options
Diffstat (limited to 'lisp/vc/vc-hooks.el')
-rw-r--r-- | lisp/vc/vc-hooks.el | 84 |
1 files changed, 39 insertions, 45 deletions
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index ee295b17c73..7f0d9e4d862 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -99,7 +99,7 @@ interpreted as hostnames." :type 'regexp :group 'vc) -(defcustom vc-handled-backends '(RCS CVS SVN SCCS SRC Bzr Git Hg Mtn) +(defcustom vc-handled-backends '(RCS CVS SVN SCCS SRC Bzr Git Hg) ;; RCS, CVS, SVN, SCCS, and SRC come first because they are per-dir ;; rather than per-tree. RCS comes first because of the multibackend ;; support intended to use RCS for local commits (with a remote CVS server). @@ -141,7 +141,8 @@ confirmation whether it should follow the link. If nil, the link is visited and a warning displayed." :type '(choice (const :tag "Ask for confirmation" ask) (const :tag "Visit link and warn" nil) - (const :tag "Follow link" t)) + (const :tag "Follow link" t)) + :safe #'null :group 'vc) (defcustom vc-display-status t @@ -555,15 +556,6 @@ this function." templates)))) -;; 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." @@ -639,9 +631,10 @@ Before doing that, check if there are any old backups and get rid of them." (cond ((null backend)) ((eq (vc-checkout-model backend (list file)) 'implicit) - ;; If the file was saved in the same second in which it was + ;; If the file was saved at the same time that it was ;; checked out, clear the checkout-time to avoid confusion. - (if (equal (vc-file-getprop file 'vc-checkout-time) + (if (time-equal-p + (vc-file-getprop file 'vc-checkout-time) (file-attribute-modification-time (file-attributes file))) (vc-file-setprop file 'vc-checkout-time nil)) (if (vc-state-refresh file backend) @@ -798,9 +791,10 @@ In the latter case, VC mode is deactivated for this buffer." (add-hook 'vc-mode-line-hook #'vc-mode-line nil t) (let (backend) (cond - ((setq backend (with-demoted-errors (vc-backend buffer-file-name))) - ;; Let the backend setup any buffer-local things he needs. - (vc-call-backend backend 'find-file-hook) + ((setq backend (with-demoted-errors "VC refresh error: %S" + (vc-backend buffer-file-name))) + ;; Let the backend setup any buffer-local things he needs. + (vc-call-backend backend 'find-file-hook) ;; Compute the state and put it in the mode line. (vc-mode-line buffer-file-name backend) (unless vc-make-backup-files @@ -861,34 +855,34 @@ In the latter case, VC mode is deactivated for this buffer." ;; Autoloading works fine, but it prevents shortcuts from appearing ;; in the menu because they don't exist yet when the menu is built. ;; (autoload 'vc-prefix-map "vc" nil nil 'keymap) -(defvar vc-prefix-map - (let ((map (make-sparse-keymap))) - (define-key map "a" #'vc-update-change-log) - (define-key map "b" #'vc-switch-backend) - (define-key map "d" #'vc-dir) - (define-key map "g" #'vc-annotate) - (define-key map "G" #'vc-ignore) - (define-key map "h" #'vc-region-history) - (define-key map "i" #'vc-register) - (define-key map "l" #'vc-print-log) - (define-key map "L" #'vc-print-root-log) - (define-key map "I" #'vc-log-incoming) - (define-key map "O" #'vc-log-outgoing) - (define-key map "ML" #'vc-log-mergebase) - (define-key map "MD" #'vc-diff-mergebase) - (define-key map "m" #'vc-merge) - (define-key map "r" #'vc-retrieve-tag) - (define-key map "s" #'vc-create-tag) - (define-key map "u" #'vc-revert) - (define-key map "v" #'vc-next-action) - (define-key map "+" #'vc-update) - ;; I'd prefer some kind of symmetry with vc-update: - (define-key map "P" #'vc-push) - (define-key map "=" #'vc-diff) - (define-key map "D" #'vc-root-diff) - (define-key map "~" #'vc-revision-other-window) - (define-key map "x" #'vc-delete-file) - map)) +(defvar-keymap vc-prefix-map + "a" #'vc-update-change-log + "b c" #'vc-create-branch + "b l" #'vc-print-branch-log + "b s" #'vc-switch-branch + "d" #'vc-dir + "g" #'vc-annotate + "G" #'vc-ignore + "h" #'vc-region-history + "i" #'vc-register + "l" #'vc-print-log + "L" #'vc-print-root-log + "I" #'vc-log-incoming + "O" #'vc-log-outgoing + "M L" #'vc-log-mergebase + "M D" #'vc-diff-mergebase + "m" #'vc-merge + "r" #'vc-retrieve-tag + "s" #'vc-create-tag + "u" #'vc-revert + "v" #'vc-next-action + "+" #'vc-update + ;; I'd prefer some kind of symmetry with vc-update: + "P" #'vc-push + "=" #'vc-diff + "D" #'vc-root-diff + "~" #'vc-revision-other-window + "x" #'vc-delete-file) (fset 'vc-prefix-map vc-prefix-map) (define-key ctl-x-map "v" 'vc-prefix-map) @@ -963,7 +957,7 @@ In the latter case, VC mode is deactivated for this buffer." (defalias 'vc-menu-map vc-menu-map) -(declare-function vc-responsible-backend "vc" (file)) +(declare-function vc-responsible-backend "vc" (file &optional no-error)) (defun vc-menu-map-filter (orig-binding) (if (and (symbolp orig-binding) (fboundp orig-binding)) |