From b322f63a7c3dfe584c9814dc33c6a38ffcbcd770 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 11 Sep 2011 03:55:09 +0200 Subject: [PATCH] * facemenu.el: Disable the remove-* commands if the mark isn't active. Fixes: debbugs:9162 --- lisp/ChangeLog | 5 +++++ lisp/facemenu.el | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 50ae33a7d6e..79dc1996455 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-09-11 Lars Magne Ingebrigtsen + + * facemenu.el: Disable the remove-* commands if the mark isn't + active (bug#9162). + 2011-09-10 Chong Yidong * buff-menu.el (Buffer-menu-switch-other-window): Use second arg diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 1b42aa9ea73..a18b892efe8 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -241,10 +241,12 @@ it will remove any faces not explicitly in the list." (define-key map [df] (cons (purecopy "Display Faces") 'list-faces-display)) (define-key map [dp] (cons (purecopy "Describe Properties") 'describe-text-properties)) - (define-key map [ra] (cons (purecopy "Remove Text Properties") - 'facemenu-remove-all)) - (define-key map [rm] (cons (purecopy "Remove Face Properties") - 'facemenu-remove-face-props)) + (define-key map [ra] (list 'menu-item (purecopy "Remove Text Properties") + 'facemenu-remove-all + :enable 'mark-active)) + (define-key map [rm] (list 'menu-item (purecopy "Remove Face Properties") + 'facemenu-remove-face-props + :enable 'mark-active)) (define-key map [s1] (list (purecopy "--")))) (let ((map facemenu-menu)) (define-key map [in] (cons (purecopy "Indentation") -- 2.11.4.GIT