diff options
| author | Lars Ingebrigtsen | 2021-03-18 05:55:16 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-03-18 05:55:16 +0100 |
| commit | 6a75b6fcb10725fb1e352dec506b84e795baa7c8 (patch) | |
| tree | 76e677f5f5cb941d8554e03eb3b1064933b9b311 | |
| parent | 1e9c9ebee3e13773400fe93bf26db923a880be6d (diff) | |
| download | emacs-6a75b6fcb10725fb1e352dec506b84e795baa7c8.tar.gz emacs-6a75b6fcb10725fb1e352dec506b84e795baa7c8.zip | |
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.
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/facemenu.el | 17 | ||||
| -rw-r--r-- | lisp/faces.el | 11 | ||||
| -rw-r--r-- | lisp/loadup.el | 1 | ||||
| -rw-r--r-- | lisp/progmodes/cperl-mode.el | 1 | ||||
| -rw-r--r-- | lisp/textmodes/sgml-mode.el | 1 | ||||
| -rw-r--r-- | lisp/wid-edit.el | 8 |
7 files changed, 29 insertions, 16 deletions
| @@ -2278,6 +2278,12 @@ directory instead of the default directory. | |||
| 2278 | 2278 | ||
| 2279 | * Incompatible Lisp Changes in Emacs 28.1 | 2279 | * Incompatible Lisp Changes in Emacs 28.1 |
| 2280 | 2280 | ||
| 2281 | ** 'facemenu-color-alist' is now obsolete, and is not used. | ||
| 2282 | |||
| 2283 | ** 'facemenu.el' is no longer preloaded. | ||
| 2284 | To use functions/variables from the package, you now have to say | ||
| 2285 | '(require 'facemenu)' or similar. | ||
| 2286 | |||
| 2281 | ** 'pcomplete-ignore-case' is now an obsolete alias of 'completion-ignore-case'. | 2287 | ** 'pcomplete-ignore-case' is now an obsolete alias of 'completion-ignore-case'. |
| 2282 | 2288 | ||
| 2283 | ** 'completions-annotations' face is not used when the caller puts own face. | 2289 | ** 'completions-annotations' face is not used when the caller puts own face. |
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." | |||
| 169 | (defalias 'facemenu-background-menu facemenu-background-menu) | 169 | (defalias 'facemenu-background-menu facemenu-background-menu) |
| 170 | (put 'facemenu-background-menu 'menu-enable '(facemenu-enable-faces-p)) | 170 | (put 'facemenu-background-menu 'menu-enable '(facemenu-enable-faces-p)) |
| 171 | 171 | ||
| 172 | (defcustom facemenu-add-face-function nil | ||
| 173 | "Function called at beginning of text to change or nil. | ||
| 174 | This function is passed the FACE to set and END of text to change, and must | ||
| 175 | return a string which is inserted. It may set `facemenu-end-add-face'." | ||
| 176 | :type '(choice (const :tag "None" nil) | ||
| 177 | function) | ||
| 178 | :group 'facemenu) | ||
| 179 | |||
| 172 | ;;; Condition for enabling menu items that set faces. | 180 | ;;; Condition for enabling menu items that set faces. |
| 173 | (defun facemenu-enable-faces-p () | 181 | (defun facemenu-enable-faces-p () |
| 174 | ;; Enable the facemenu if facemenu-add-face-function is defined | 182 | ;; Enable the facemenu if facemenu-add-face-function is defined |
| @@ -260,14 +268,6 @@ requested in `facemenu-keybindings'.") | |||
| 260 | (defalias 'facemenu-keymap facemenu-keymap) | 268 | (defalias 'facemenu-keymap facemenu-keymap) |
| 261 | 269 | ||
| 262 | 270 | ||
| 263 | (defcustom facemenu-add-face-function nil | ||
| 264 | "Function called at beginning of text to change or nil. | ||
| 265 | This function is passed the FACE to set and END of text to change, and must | ||
| 266 | return a string which is inserted. It may set `facemenu-end-add-face'." | ||
| 267 | :type '(choice (const :tag "None" nil) | ||
| 268 | function) | ||
| 269 | :group 'facemenu) | ||
| 270 | |||
| 271 | (defcustom facemenu-end-add-face nil | 271 | (defcustom facemenu-end-add-face nil |
| 272 | "String to insert or function called at end of text to change or nil. | 272 | "String to insert or function called at end of text to change or nil. |
| 273 | This function is passed the FACE to set, and must return a string which is | 273 | 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'." | |||
| 291 | (defvar facemenu-color-alist nil | 291 | (defvar facemenu-color-alist nil |
| 292 | "Alist of colors, used for completion. | 292 | "Alist of colors, used for completion. |
| 293 | If this is nil, then the value of (defined-colors) is used.") | 293 | If this is nil, then the value of (defined-colors) is used.") |
| 294 | (make-obsolete-variable 'facemenu-color-alist nil "28.1") | ||
| 294 | 295 | ||
| 295 | (defun facemenu-update () | 296 | (defun facemenu-update () |
| 296 | "Add or update the \"Face\" menu in the menu bar. | 297 | "Add or update the \"Face\" menu in the menu bar. |
diff --git a/lisp/faces.el b/lisp/faces.el index 573428f1d34..7c6d749120e 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1917,12 +1917,11 @@ Interactively, or with optional arg MSG non-nil, print the | |||
| 1917 | resulting color name in the echo area." | 1917 | resulting color name in the echo area." |
| 1918 | (interactive "i\np\ni\np") ; Always convert to RGB interactively. | 1918 | (interactive "i\np\ni\np") ; Always convert to RGB interactively. |
| 1919 | (let* ((completion-ignore-case t) | 1919 | (let* ((completion-ignore-case t) |
| 1920 | (colors (or facemenu-color-alist | 1920 | (colors (append '("foreground at point" "background at point") |
| 1921 | (append '("foreground at point" "background at point") | 1921 | (if allow-empty-name '("")) |
| 1922 | (if allow-empty-name '("")) | 1922 | (if (display-color-p) |
| 1923 | (if (display-color-p) | 1923 | (defined-colors-with-face-attributes) |
| 1924 | (defined-colors-with-face-attributes) | 1924 | (defined-colors)))) |
| 1925 | (defined-colors))))) | ||
| 1926 | (color (completing-read | 1925 | (color (completing-read |
| 1927 | (or prompt "Color (name or #RGB triplet): ") | 1926 | (or prompt "Color (name or #RGB triplet): ") |
| 1928 | ;; Completing function for reading colors, accepting | 1927 | ;; Completing function for reading colors, accepting |
diff --git a/lisp/loadup.el b/lisp/loadup.el index 863afe427bd..4a0b8f508c7 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el | |||
| @@ -253,7 +253,6 @@ | |||
| 253 | (load "startup") | 253 | (load "startup") |
| 254 | (load "term/tty-colors") | 254 | (load "term/tty-colors") |
| 255 | (load "font-core") | 255 | (load "font-core") |
| 256 | (load "facemenu") | ||
| 257 | (load "emacs-lisp/syntax") | 256 | (load "emacs-lisp/syntax") |
| 258 | (load "font-lock") | 257 | (load "font-lock") |
| 259 | (load "jit-lock") | 258 | (load "jit-lock") |
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 734797b3ad2..cc7614dd107 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el | |||
| @@ -92,6 +92,7 @@ | |||
| 92 | (concat msg ": "))))) | 92 | (concat msg ": "))))) |
| 93 | 93 | ||
| 94 | (eval-when-compile (require 'cl-lib)) | 94 | (eval-when-compile (require 'cl-lib)) |
| 95 | (require 'facemenu) | ||
| 95 | 96 | ||
| 96 | (defvar msb-menu-cond) | 97 | (defvar msb-menu-cond) |
| 97 | (defvar gud-perldb-history) | 98 | (defvar gud-perldb-history) |
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 876347bc81e..7de5317b025 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | 34 | ||
| 35 | (require 'dom) | 35 | (require 'dom) |
| 36 | (require 'seq) | 36 | (require 'seq) |
| 37 | (require 'facemenu) | ||
| 37 | (eval-when-compile (require 'subr-x)) | 38 | (eval-when-compile (require 'subr-x)) |
| 38 | (eval-when-compile | 39 | (eval-when-compile |
| 39 | (require 'skeleton) | 40 | (require 'skeleton) |
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 35e7b9ce7e1..e71290c7ef9 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -4034,7 +4034,7 @@ is inline." | |||
| 4034 | (mapcar #'length (defined-colors)))) | 4034 | (mapcar #'length (defined-colors)))) |
| 4035 | :tag "Color" | 4035 | :tag "Color" |
| 4036 | :value "black" | 4036 | :value "black" |
| 4037 | :completions (or facemenu-color-alist (defined-colors)) | 4037 | :completions (defined-colors) |
| 4038 | :sample-face-get 'widget-color-sample-face-get | 4038 | :sample-face-get 'widget-color-sample-face-get |
| 4039 | :notify 'widget-color-notify | 4039 | :notify 'widget-color-notify |
| 4040 | :match #'widget-color-match | 4040 | :match #'widget-color-match |
| @@ -4049,7 +4049,10 @@ is inline." | |||
| 4049 | :tag " Choose " :action 'widget-color--choose-action) | 4049 | :tag " Choose " :action 'widget-color--choose-action) |
| 4050 | (widget-insert " ")) | 4050 | (widget-insert " ")) |
| 4051 | 4051 | ||
| 4052 | (declare-function list-colors-display "facemenu") | ||
| 4053 | |||
| 4052 | (defun widget-color--choose-action (widget &optional _event) | 4054 | (defun widget-color--choose-action (widget &optional _event) |
| 4055 | (require 'facemenu) | ||
| 4053 | (list-colors-display | 4056 | (list-colors-display |
| 4054 | nil nil | 4057 | nil nil |
| 4055 | (let ((cbuf (current-buffer)) | 4058 | (let ((cbuf (current-buffer)) |
| @@ -4072,8 +4075,11 @@ is inline." | |||
| 4072 | (list (cons 'foreground-color value)) | 4075 | (list (cons 'foreground-color value)) |
| 4073 | 'default))) | 4076 | 'default))) |
| 4074 | 4077 | ||
| 4078 | (declare-function facemenu-read-color "facemenu") | ||
| 4079 | |||
| 4075 | (defun widget-color-action (widget &optional event) | 4080 | (defun widget-color-action (widget &optional event) |
| 4076 | "Prompt for a color." | 4081 | "Prompt for a color." |
| 4082 | (require 'facemenu) | ||
| 4077 | (let* ((tag (widget-apply widget :menu-tag-get)) | 4083 | (let* ((tag (widget-apply widget :menu-tag-get)) |
| 4078 | (prompt (concat tag ": ")) | 4084 | (prompt (concat tag ": ")) |
| 4079 | (answer (facemenu-read-color prompt))) | 4085 | (answer (facemenu-read-color prompt))) |