(let ((map (make-sparse-keymap "Background Color")))
(define-key map "o" (cons "Other..." 'facemenu-set-background))
map)
- "Menu keymap for background colors")
+ "Menu keymap for background colors.")
;;;###autoload
(defalias 'facemenu-background-menu facemenu-background-menu)
(defcustom facemenu-add-face-function nil
- "Function called at beginning of text to change or `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)
:group 'facemenu)
(defcustom facemenu-end-add-face nil
- "String to insert or function called at end of text to change or `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
inserted."
:type '(choice (const :tag "None" nil)
(defcustom facemenu-remove-face-function nil
"When non-nil, this is a function called to remove faces.
This function is passed the START and END of text to change.
-May also be `t' meaning to use `facemenu-add-face-function'."
+May also be t meaning to use `facemenu-add-face-function'."
:type '(choice (const :tag "None" nil)
(const :tag "Use add-face" t)
function)
;;;###autoload
(defun facemenu-set-foreground (color &optional start end)
- "Set the foreground color of the region or next character typed.
+ "Set the foreground COLOR of the region or next character typed.
The color is prompted for. A face named `fg:color' is used \(or created).
If the region is active, it will be set to the requested face. If
it is inactive \(even if mark-even-if-inactive is set) the next
;;;###autoload
(defun facemenu-set-background (color &optional start end)
- "Set the background color of the region or next character typed.
+ "Set the background COLOR of the region or next character typed.
The color is prompted for. A face named `bg:color' is used \(or created).
If the region is active, it will be set to the requested face. If
it is inactive \(even if mark-even-if-inactive is set) the next
;;;###autoload
(defun facemenu-set-face-from-menu (face start end)
- "Set the face of the region or next character typed.
+ "Set the FACE of the region or next character typed.
This function is designed to be called from a menu; the face to use
is the menu item's name.
(defun facemenu-add-face (face &optional start end)
"Add FACE to text between START and END.
-If START is `nil' or START to END is empty, add FACE to next typed character
+If START is nil or START to END is empty, add FACE to next typed character
instead. For each section of that region that has a different face property,
FACE will be consed onto it, and other faces that are completely hidden by
that will be removed from the list.
(defun facemenu-get-face (symbol)
"Make sure FACE exists.
-If not, create it and add it to the appropriate menu. Return the symbol.
+If not, create it and add it to the appropriate menu. Return the SYMBOL.
If a window system is in use, and this function creates a face named
`fg:color', then it sets the foreground to that color. Likewise, `bg:color'
no color is set and a warning is issued."
(let ((name (symbol-name symbol))
foreground)
- (cond ((internal-find-face symbol))
+ (cond ((facep symbol))
((and (display-color-p)
(or (setq foreground (string-match "^fg:" name))
(string-match "^bg:" name)))
(nreverse (face-list)))
list))
-(defun facemenu-iterate (func iterate-list)
+(defun facemenu-iterate (func list)
"Apply FUNC to each element of LIST until one returns non-nil.
Returns the non-nil value it found, or nil if all were nil."
- (while (and iterate-list (not (funcall func (car iterate-list))))
- (setq iterate-list (cdr iterate-list)))
- (car iterate-list))
+ (while (and list (not (funcall func (car list))))
+ (setq list (cdr list)))
+ (car list))
(facemenu-update)