From 6a75b6fcb10725fb1e352dec506b84e795baa7c8 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 18 Mar 2021 05:55:16 +0100 Subject: Don't pre-load facemenu * lisp/facemenu.el (facemenu-add-face-function): Move to avoid a compilation warning. (facemenu-color-alist): Made obsolete. * lisp/faces.el (read-color): Don't use it. * lisp/loadup.el ("emacs-lisp/syntax"): Don't load facemenu. * lisp/wid-edit.el (color): Don't use facemenu-color-alist. (widget-color--choose-action): Require facemenu. (widget-color-action): Ditto. * lisp/progmodes/cperl-mode.el (facemenu): Require. * lisp/textmodes/sgml-mode.el (facemenu): Require. --- lisp/facemenu.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lisp/facemenu.el') diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 6290b02add2..2d06658b55c 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -169,6 +169,14 @@ it will remove any faces not explicitly in the list." (defalias 'facemenu-background-menu facemenu-background-menu) (put 'facemenu-background-menu 'menu-enable '(facemenu-enable-faces-p)) +(defcustom facemenu-add-face-function nil + "Function called at beginning of text to change or nil. +This function is passed the FACE to set and END of text to change, and must +return a string which is inserted. It may set `facemenu-end-add-face'." + :type '(choice (const :tag "None" nil) + function) + :group 'facemenu) + ;;; Condition for enabling menu items that set faces. (defun facemenu-enable-faces-p () ;; Enable the facemenu if facemenu-add-face-function is defined @@ -260,14 +268,6 @@ requested in `facemenu-keybindings'.") (defalias 'facemenu-keymap facemenu-keymap) -(defcustom facemenu-add-face-function nil - "Function called at beginning of text to change or nil. -This function is passed the FACE to set and END of text to change, and must -return a string which is inserted. It may set `facemenu-end-add-face'." - :type '(choice (const :tag "None" nil) - function) - :group 'facemenu) - (defcustom facemenu-end-add-face nil "String to insert or function called at end of text to change or nil. This function is passed the FACE to set, and must return a string which is @@ -291,6 +291,7 @@ May also be t meaning to use `facemenu-add-face-function'." (defvar facemenu-color-alist nil "Alist of colors, used for completion. If this is nil, then the value of (defined-colors) is used.") +(make-obsolete-variable 'facemenu-color-alist nil "28.1") (defun facemenu-update () "Add or update the \"Face\" menu in the menu bar. -- cgit v1.2.1