From 1f4f0f46bd36f660afd8061061f12dc98cb7f469 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 1 Feb 2013 00:44:10 -0800 Subject: [PATCH] * vc/vc-hooks.el (vc-menu-map): Disable vc-rollback menu item if the backend is known not to support it. --- lisp/ChangeLog | 3 +++ lisp/vc/vc-hooks.el | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e2bb42b62a1..b6f1fb74b99 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-02-01 Glenn Morris + * vc/vc-hooks.el (vc-menu-map): Disable vc-rollback menu item + if the backend is known not to support it. + * imenu.el (imenu-default-create-index-function): Tweak infinite loop test to check for forward motion as well as none. diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 99436303fa2..541b0c04b0b 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -976,6 +976,10 @@ current, and kill the buffer that visits the link." ")) (bindings--define-key map [undo] '(menu-item "Undo Last Check-In" vc-rollback + :enable (let ((backend (if buffer-file-name + (vc-backend buffer-file-name)))) + (or (not backend) + (vc-find-backend-function backend 'rollback))) :help "Remove the most recent changeset committed to the repository")) (bindings--define-key map [vc-revert] '(menu-item "Revert to Base Version" vc-revert -- 2.39.5