;ELC   
;;; compiled by rms@psilocin.gnu.ai.mit.edu on Mon Jun 10 17:38:16 1996
;;; from file /home/fsf/rms/e19/lisp/facemenu.el
;;; emacs version 19.31.2.
;;; bytecomp version FSF 2.10
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`facemenu.el' was compiled for Emacs 19.29 or later"))


(provide (quote facemenu))
#@42 Prefix key to use for facemenu commands.
(defvar facemenu-key "" (#$ . 502))
#@591 Alist of interesting faces and keybindings. 
Each element is itself a list: the car is the name of the face,
the next element is the key to use as a keyboard equivalent of the menu item;
the binding is made in facemenu-keymap.

The faces specifically mentioned in this list are put at the top of
the menu, in the order specified.  All other faces which are defined,
except for those in `facemenu-unlisted-faces', are listed after them, 
but get no keyboard equivalents.

If you change this variable after loading facemenu.el, you will need to call
`facemenu-update' to make it take effect.
(defvar facemenu-keybindings (quote ((default . "d") (bold . "b") (italic . "i") (bold-italic . "l") (underline . "u"))) (#$ . 587))
#@154 Where in the menu to insert newly-created faces.
This should be nil to put them at the top of the menu, or t to put them
just before "Other" at the end.
(defvar facemenu-new-faces-at-end t (#$ . 1317))
#@513 List of faces not to include in the Face menu.
You can set this list before loading facemenu.el, or add a face to it before
creating that face if you do not want it to be listed.  If you change the
variable so as to eliminate faces that have already been added to the menu,
call `facemenu-update' to recalculate the menu contents.

If this variable is t, no faces will be added to the menu.  This is useful for
temporarily turning off the feature that automatically adds faces to the menu
when they are created.
(defvar facemenu-unlisted-faces (quote (modeline region secondary-selection highlight scratch-face)) (#$ . 1526))
#@24 Menu keymap for faces.
(defvar facemenu-face-menu (byte-code "!\nB#\n)" [make-sparse-keymap "Face" map define-key "o" "Other..." facemenu-set-face] 5) (#$ . 2158))
(defalias (quote facemenu-face-menu) facemenu-face-menu)
#@36 Menu keymap for foreground colors.
(defvar facemenu-foreground-menu (byte-code "!\nB#\n)" [make-sparse-keymap "Foreground Color" map define-key "o" "Other..." facemenu-set-foreground] 5) (#$ . 2394))
(defalias (quote facemenu-foreground-menu) facemenu-foreground-menu)
#@35 Menu keymap for background colors
(defvar facemenu-background-menu (byte-code "!\nB#\n)" [make-sparse-keymap "Background Color" map define-key "o" "Other..." facemenu-set-background] 5) (#$ . 2678))
(defalias (quote facemenu-background-menu) facemenu-background-menu)
#@43 Menu keymap for non-face text-properties.
(defvar facemenu-special-menu (byte-code "!\nB#\nB#\nB#\nB#\n)" [make-sparse-keymap "Special" map define-key [115] "Remove Special" facemenu-remove-special [116] "Intangible" facemenu-set-intangible [118] "Invisible" facemenu-set-invisible [114] "Read-Only" facemenu-set-read-only] 5) (#$ . 2961))
(defalias (quote facemenu-special-menu) facemenu-special-menu)
#@42 Submenu for text justification commands.
(defvar facemenu-justification-menu (byte-code "!\nB#\nB#\nB#\nB#\nB#\n)" [make-sparse-keymap "Justification" map define-key [99] "Center" set-justification-center [98] "Full" set-justification-full [114] "Right" set-justification-right [108] "Left" set-justification-left [117] "Unfilled" set-justification-none] 5) (#$ . 3394))
(defalias (quote facemenu-justification-menu) facemenu-justification-menu)
#@35 Submenu for indentation commands.
(defvar facemenu-indentation-menu (byte-code "!\nB#\nB#\nB#\nB#\n)" [make-sparse-keymap "Indentation" map define-key [decrease-right-margin] "Indent Right Less" decrease-right-margin [increase-right-margin] "Indent Right More" increase-right-margin [decrease-left-margin] "Indent Less" decrease-left-margin [increase-left-margin] "Indent More" increase-left-margin] 5) (#$ . 3875))
(defalias (quote facemenu-indentation-menu) facemenu-indentation-menu)
#@33 Facemenu top-level menu keymap.
(defvar facemenu-menu nil (#$ . 4392))
(byte-code "!B#B#B#B#B#C#)\nB#B#C#B#B#B#B#)\n\"" [make-sparse-keymap "Text Properties" facemenu-menu map define-key [dc] "Display Colors" list-colors-display [df] "Display Faces" list-faces-display [dp] "List Properties" list-text-properties-at [ra] "Remove All" facemenu-remove-all [rm] "Remove Properties" facemenu-remove-props [s1] "-----------------" [in] "Indentation" facemenu-indentation-menu [ju] "Justification" facemenu-justification-menu [s2] [sp] "Special Properties" facemenu-special-menu [bg] "Background Color" facemenu-background-menu [fg] "Foreground Color" facemenu-foreground-menu [fc] "Face" facemenu-face-menu defalias] 6)
#@137 Keymap for face-changing commands.
`Facemenu-update' fills in the keymap according to the bindings
requested in `facemenu-keybindings'.
(defvar facemenu-keymap (byte-code "!\nB#\n)" [make-sparse-keymap "Set face" map define-key "o" "Other..." facemenu-set-face] 5) (#$ . 5199))
(defalias (quote facemenu-keymap) facemenu-keymap)
#@206 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'.
(defvar facemenu-add-face-function nil (#$ . 5544))
#@157 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.
(defvar facemenu-end-add-face nil (#$ . 5808))
#@171 When non-`nil' 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'.
(defvar facemenu-remove-face-function nil (#$ . 6018))
#@83 Alist of colors, used for completion.
If null, `facemenu-read-color' will set it.
(defvar facemenu-color-alist nil (#$ . 6249))
#@138 Add or update the "Face" menu in the menu bar.
You can call this to update things if you change any of the menu configuration
variables.
(defalias 'facemenu-update #[nil "	#\f 	\f#	!\"" [define-key global-map [C-down-mouse-2] facemenu-menu facemenu-key facemenu-keymap facemenu-iterate facemenu-add-new-face facemenu-complete-face-list facemenu-keybindings] 4 (#$ . 6384) nil])
#@524 Add FACE to the region or next character typed.
It will be added to the top of the face list; any faces lower on the list that
will not show through at all will be removed.

Interactively, the face to be used is read with the minibuffer.

If the region is active and there is no prefix argument,
this command sets the region to the requested face.

Otherwise, this command specifies the face for the next character
inserted.  Moving point or switching buffers before
typing a character to insert cancels the specification.
(defalias 'facemenu-set-face #[(face &optional start end) " \n!' \f'     \n#*\n!" [barf-if-buffer-read-only facemenu-add-new-face face mark-active current-prefix-arg start region-beginning end region-end facemenu-add-face] 4 (#$ . 6783) (list (read-face-name "Use face: "))])
#@437 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
character that is typed (via `self-insert-command') will be set to
the selected face.  Moving point or switching buffers before
typing a character cancels the request.
(defalias 'facemenu-set-foreground #[(color &optional start end) "\nP!! \n\"	#)" [intern "fg:" color face facemenu-get-face error "Unknown color: %s" facemenu-set-face start end] 4 (#$ . 7615) (list (facemenu-read-color "Foreground color: "))])
#@437 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
character that is typed (via `self-insert-command') will be set to
the selected face.  Moving point or switching buffers before
typing a character cancels the request.
(defalias 'facemenu-set-background #[(color &optional start end) "\nP!! \n\"	#)" [intern "bg:" color face facemenu-get-face error "Unknown color: %s" facemenu-set-face start end] 4 (#$ . 8319) (list (facemenu-read-color "Background color: "))])
#@431 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.

If the region is active and there is no prefix argument,
this command sets the region to the requested face.

Otherwise, this command specifies the face for the next character
inserted.  Moving point or switching buffers before
typing a character to insert cancels the specification.
(defalias 'facemenu-set-face-from-menu #[(face start end) " \n! \n#\n!" [barf-if-buffer-read-only facemenu-get-face face start facemenu-add-face end] 4 (#$ . 9023) (list last-command-event (if (and mark-active (not current-prefix-arg)) (region-beginning)) (if (and mark-active (not current-prefix-arg)) (region-end)))])
#@118 Make the region invisible.
This sets the `invisible' text property; it can be undone with
`facemenu-remove-special'.
(defalias 'facemenu-set-invisible #[(start end) "	\n$" [put-text-property start end invisible t] 5 (#$ . 9793) "r"])
#@145 Make the region intangible: disallow moving into it.
This sets the `intangible' text property; it can be undone with
`facemenu-remove-special'.
(defalias 'facemenu-set-intangible #[(start end) "	\n$" [put-text-property start end intangible t] 5 (#$ . 10038) "r"])
#@121 Make the region unmodifiable.
This sets the `read-only' text property; it can be undone with
`facemenu-remove-special'.
(defalias 'facemenu-set-read-only #[(start end) "	\n$" [put-text-property start end read-only t] 5 (#$ . 10313) "r"])
#@59 Remove all text properties that facemenu added to region.
(defalias 'facemenu-remove-props #[(start end) "\f#)" [t inhibit-read-only remove-text-properties start end (face nil invisible nil intangible nil read-only nil category nil)] 4 (#$ . 10561) "*r"])
#@45 Remove all text properties from the region.
(defalias 'facemenu-remove-all #[(start end) "\f#)" [t inhibit-read-only set-text-properties start end nil] 4 (#$ . 10829) "*r"])
#@135 Remove all the "special" text properties from the region.
These special properties include `invisible', `intangible' and `read-only'.
(defalias 'facemenu-remove-special #[(start end) "\f#)" [t inhibit-read-only remove-text-properties start end (invisible nil intangible nil read-only nil)] 4 (#$ . 11016) "*r"])
#@54 Pop up a buffer listing text-properties at LOCATION.
(defalias 'list-text-properties-at #[(p) "	! ! AA8 @=8 	@A@$G W8 \" ̐	\"!c @=P A@@A@#!AAE \f \f!\f\"! @A@#!@= A@AAv +" [text-properties-at p nil str category props message "None" format "Text property at %d:  %s  %S" frame-width "%s" "*Text Properties*" princ "Text properties at %d:\n\n" "%-20s %S\n" symbol-plist "\nCategory %s:\n\n"] 7 (#$ . 11340) "d"])
#@36 Read a color using the minibuffer.
(defalias 'facemenu-read-color #[(&optional prompt) "	  \f  \"$\n˚?! \n)" [completing-read prompt "Color: " facemenu-color-alist window-system mapcar list x-defined-colors nil t col ""] 6 (#$ . 11840)])
#@236 Display names of defined colors, and show what they look like.
If the optional argument LIST is non-nil, it should be a list of
colors to display.  Otherwise, this command computes a list
of colors that the current display can handle.
(defalias 'list-colors-display #[(&optional list) "- 	-  A, @A@\"% AA A )Őq	\nx `	@cj	`@P!!$`	@ұ	`@P!!$A> +" [list window-system x-defined-colors l facemenu-color-equal "*Colors*" standard-output t nil s facemenu-unlisted-faces 20 put-text-property face facemenu-get-face intern "bg:" "  " "\n" "fg:"] 10 (#$ . 12105) nil])
#@257 Return t if colors A and B are the same color.
A and B should be strings naming colors.
This function queries the window-system server to find out what the
color names mean.  It returns nil if the colors differ or if it can't
determine the correct answer.
(defalias 'facemenu-color-equal #[(a b) "	 = = !	!7 =7 !7 	!7 !	!=" [a b t window-system x win32 x-color-values pc x-color-defined-p msdos-color-translate] 3 (#$ . 12740)])
#@628 Add FACE to text between START and END.
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.
If `facemenu-add-face-function' and maybe `facemenu-end-add-face' are non-`nil'
they are used to set the face information.

As a special case, if FACE is `default', then the region is left with NO face
text property.  Otherwise, selecting the default face would not have any
effect.  See `facemenu-remove-face-function'.
(defalias 'facemenu-add-face #[(face &optional start end) "=. \n=. \n \n\f\"\f% \fW% \f#	\nc ; b\fC \fb\"!)a ;\\ ` !c)\f \fW \fU? $\"  <  CB!$)t *\n= <  CB 	\n" [face default facemenu-remove-face-function t start end remove-text-properties (face default) self-insert-face this-command self-insert-face-command facemenu-add-face-function insert-before-markers facemenu-end-add-face nil part-end part-start next-single-property-change get-text-property prev put-text-property facemenu-active-faces last-command] 8 (#$ . 13207) "*xFace: \nr"])
#@363 Return from FACE-LIST those faces that would be used for display.
This means each face attribute is not specified in a face earlier in FACE-LIST
and such a face is therefore active when used to display text.
If the optional argument FRAME is given, use the faces in that frame; otherwise
use the selected frame.  If t, then the global, non-frame faces are used.
(defalias 'facemenu-active-faces #[(face-list &optional frame) "\n@\"!\n@C\nA\fG\n] \n@\"	\n	S	VK \n	H% \f	H% \f	̉I% +V \n@B\nA ," [copy-sequence internal-get-face face-list frame mask-atts active-list mask-len nil useful i face-atts 1 t] 5 (#$ . 14521)])
#@276 Make sure FACE exists.
If not, it is created.  If it is created and is of the form `fg:color', then
set the foreground to that color. If of the form `bg:color', set the
background.  In any case, add it to the appropriate menu.  Returns the face,
or nil if given a bad color.
(defalias 'facemenu-get-face #[(symbol) "	!K 	!	!O\"- \"\fG !G \"F \"\fG !G +L 	" [internal-find-face symbol make-face face symbol-name name 3 nil color string-match "^fg:" set-face-foreground window-system x-color-defined-p "^bg:" set-face-background t] 4 (#$ . 15192)])
#@91 Add a FACE to the appropriate Face menu.
Automatically called when a new face is created.
(defalias 'facemenu-add-new-face #[(face) "	!\n\" \nOǂ% \n\"$ \nOɂ% 	\"A= 	> s \nP!	DDFM\nB#\nB# KA\" 	!K GV \nBGZ8@$ \nB#-Ƈ" [symbol-name face name string-match "^fg:" 3 nil facemenu-foreground-menu "^bg:" facemenu-background-menu facemenu-face-menu menu assoc facemenu-keybindings key function menu-val facemenu-unlisted-faces t intern "facemenu-set-" lambda (interactive) facemenu-set-face quote define-key facemenu-keymap facemenu-iterate #[(m) "< @9 @\n\"" [m face-equal face] 3] vector facemenu-set-face-from-menu facemenu-new-faces-at-end define-key-after] 8 (#$ . 15789)])
#@251 Return list of all faces that look different.
Starts with given ALIST of faces, and adds elements only if they display 
differently from any face already on the list.
The faces on ALIST will end up at the end of the returned list, in reverse 
order.
(defalias 'facemenu-complete-face-list #[(&optional oldlist) "\n\" \")" [mapcar car oldlist list facemenu-iterate #[(new-face) "	>\n 	B" [new-face list nil] 2] face-list] 3 (#$ . 16596)])
#@123 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.
(defalias 'facemenu-iterate #[(func iterate-list) " 	@! A @" [iterate-list func] 3 (#$ . 17058)])
(facemenu-update)
