;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:39:55 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/enriched.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`enriched.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\302\301\303\304\305\306%\207" [provide enriched custom-declare-group nil "Read and save files in text/enriched format" :group wp] 6)
#@67 *If non-nil, give status messages when reading and writing files.
(custom-declare-variable 'enriched-verbose 't '(#$ . -777) :type 'boolean :group 'enriched)
(byte-code "\303\304\305\306\307\310%\210\303\311\312\313\307\310%\210\302B\314	!\206 \315 \211\316\317\320 S\321\"I\207" [current-load-list standard-display-table enriched-display-table custom-declare-face fixed ((t (:bold t))) "Face used for text that must be shown in fixed width.\nCurrently, emacs can only display fixed-width fonts, but this may change.\nThis face is used for text specifically marked as fixed-width, for example\nin text/enriched files." :group enriched excerpt ((t (:italic t))) "Face used for text that is an excerpt from another document.\nThis is used in enriched-mode for text explicitly marked as an excerpt." copy-sequence make-display-table 12 make-vector frame-width 45] 7)
#@120 Text-properties that usually apply to whole paragraphs.
These are set front-sticky everywhere except at hard newlines.
(defconst enriched-par-props '(left-margin right-margin justification) (#$ . 1652))
#@191 What to insert at the start of a text/enriched file.
If this is a string, it is inserted.  If it is a list, it should be a lambda
expression, which is evaluated to get the string to insert.
(defconst enriched-initial-annotation #[nil "\301\302\"\207" [fill-column format "Content-Type: text/enriched\nText-Width: %d\n\n"] 3] (#$ . 1862))
#@46 General format of enriched-text annotations.
(defconst enriched-annotation-format "<%s%s>" (#$ . 2207))
#@56 Regular expression matching enriched-text annotations.
(defconst enriched-annotation-regexp "<\\(/\\)?\\([-A-Za-z0-9]+\\)>" (#$ . 2317))
#@149 List of definitions of text/enriched annotations.
See `format-annotate-region' and `format-deannotate-region' for the definition
of this structure.
(defconst enriched-translations '((face (bold-italic "bold" "italic") (bold "bold") (italic "italic") (underline "underline") (fixed "fixed") (excerpt "excerpt") (default) (nil enriched-encode-other-face)) (left-margin (4 "indent")) (right-margin (4 "indentright")) (justification (none "nofill") (right "flushright") (left "flushleft") (full "flushboth") (center "center")) (PARAMETER (t "param")) (FUNCTION (enriched-decode-foreground "x-color") (enriched-decode-background "x-bg-color") (enriched-decode-display-prop "x-display")) (read-only (t "x-read-only")) (display (nil enriched-handle-display-prop)) (unknown (nil format-annotate-value))) (#$ . 2461))
#@176 Properties that are OK to ignore when saving text/enriched files.
Any property that is neither on this list nor dealt with by
`enriched-translations' will generate a warning.
(defconst enriched-ignore '(front-sticky rear-nonsticky hard) (#$ . 3277))
#@34 True if Enriched mode is in use.
(defvar enriched-mode nil (#$ . 3533))
(byte-code "\301\302!\210\303\302\304\305#\210\302\236\204 \306B\301\207" [minor-mode-alist make-variable-buffer-local enriched-mode put permanent-local t (enriched-mode " Enriched")] 4)
#@257 Functions to run when entering Enriched mode.
If you set variables in this hook, you should arrange for them to be restored
to their old values if you leave Enriched mode.  One way to do this is to add
them and their old values to `enriched-old-bindings'.
(custom-declare-variable 'enriched-mode-hook 'nil '(#$ . 3803) :type 'hook :group 'enriched)
#@111 Store old variable values that we change when entering mode.
The value is a list of (VAR VALUE VAR VALUE...).
(defvar enriched-old-bindings nil (#$ . 4159))
(make-variable-buffer-local 'enriched-old-bindings)
#@360 Minor mode for editing text/enriched files.
These are files with embedded formatting information in the MIME standard
text/enriched format.
Turning the mode on runs `enriched-mode-hook'.

More information about Enriched mode is available in the file 
etc/enriched.doc  in the Emacs distribution directory.

Commands:

\<enriched-mode-map>\{enriched-mode-map}
(defalias 'enriched-mode #[(&optional arg) "\306 \307	!\310X\204 \n\203- 	\204- \311\312\313\"\f\203\211 \f@\fA@L\210\fAA\211\202 \n\204\211 \314\315\303\313\"\210\305\316\317\257\320\316!\210\320\317!\210\321\322\323\311\"\210\324\325\"\203v \315\326@\"\210A\211\204f \203\204 \327\325#*\330\331!\210\332!\210\333 )\207" [mod arg enriched-mode buffer-file-format enriched-old-bindings buffer-display-table buffer-modified-p prefix-numeric-value 0 nil delq text/enriched t add-to-list indent-line-function default-text-properties make-local-variable indent-to-left-margin use-hard-newlines 1 plist-get front-sticky sticky plist-put run-hooks enriched-mode-hook set-buffer-modified-p force-mode-line-update enriched-display-table enriched-par-props p] 7 (#$ . 4375) "P"])
#@27 Keymap for Enriched mode.
(defvar enriched-mode-map nil (#$ . 5556))
(byte-code "\204 \300\302 \211M\210\303	\236\204 \303B	B\304\305\306#\210\304\307\310#\210\304\311\310#\210\304\312\313#\210\304\314\315#\210\304\316\317#\210\304\320\321#\210\304\322\323#\207" [enriched-mode-map minor-mode-map-alist make-sparse-keymap enriched-mode define-key "" beginning-of-line-text "" reindent-then-newline-and-indent "\n" "\352" facemenu-justification-menu "\323" set-justification-center "	" increase-left-margin "\f" set-left-margin "" set-right-margin] 4)
#@378 Apply a function to regions of the buffer based on a text property.
For each contiguous region of the buffer for which the value of PROPERTY is
eq, the FUNCTION will be called.  Optional arguments FROM and TO specify the
region over which to scan.

The specified function receives three arguments: the VALUE of the property in
the region, and the START and END of each region.
(defalias 'enriched-map-property-regions #[(prop func &optional from to) "\212\214\203\n e}\210	\206 eb\210`\306\307 \310`\n\"\311d\n$\211\203F \f\306\223\210\f\312\f!#\210\312\f!\310\f\n\"\202 dW\205T \fd#.\207" [to from prop val marker end nil make-marker get-text-property text-property-not-all marker-position begin func] 6 (#$ . 6134)])
(put 'enriched-map-property-regions 'lisp-indent-hook 1)
#@45 Indent and justify each line in the region.
(defalias 'enriched-insert-indentation #[(&optional from to) "\212\214\203\n e}\210	\206 eb\210n\204 \302y\210m?\2051 l\204+ \303 j\210\304\305\306\305#\210\302y\210\202 *\207" [to from 1 current-left-margin justify-current-line t nil] 4 (#$ . 6944)])
(defalias 'enriched-encode #[(from to orig-buf) "\203 \306\307!\210\214	\n}\210\310 \210\311 \210	b\210\312\313!\210\314\315	d\316\f%!\210	b\210;\2030 \202= \212\203: q\210 )c\210\317\320\321`\322$\210\203N \306\322!\210d)\207" [enriched-verbose from to enriched-translations enriched-ignore enriched-initial-annotation message "Enriched: encoding document..." delete-to-left-margin unjustify-region format-replace-strings (("<" . "<<")) format-insert-annotations format-annotate-region enriched-make-annotation enriched-map-property-regions hard #[(v b e) "\205 	f\302U\205 	b\210\303c\207" [v b 10 "\n"] 2] nil orig-buf] 7])
#@127 Format an annotation called NAME.
If POSITIVE is non-nil, this is the opening annotation, if nil, this is the
matching close.
(defalias 'enriched-make-annotation #[(name positive) ";\203 \305	\n\203 \306\202 \307#\207\n\203* @A\305	\306\f#\310\311\306#P*\207\305	\307@#\207" [name enriched-annotation-format positive params item format "" "/" mapconcat #[(i) "\301\302Q\207" [i "<param>" "</param>"] 3]] 5 (#$ . 7893)])
#@119 Generate annotations for random face change.
One annotation each for foreground color, background color, italic, etc.
(defalias 'enriched-encode-other-face #[(old new) "\205 \302!	\205 \302	!B\207" [old new enriched-face-ans] 3 (#$ . 8332)])
#@37 Return annotations specifying FACE.
(defalias 'enriched-face-ans #[(face) ":\203 @\306=\203 \307ADC\207:\203$ @\310=\203$ \311ADC\207:\203U @9\203U \312@!\204U \313\313\211\203Q @\314	\315\n!\"A\211\204@ *	)\207\316\317\320!\"\203h \307\320!\321\313ODC\207\316\322\320!\"\203{ \311\320!\321\313ODC\207\323\324\"\323\325\"\326\327\"\330\300\313$A\f\331=\204\241 \307\fD	B\331=\204\255 \311D	B	,\207" [face ans elt #1=#:--dolist-temp--97269 fg bg foreground-color "x-color" background-color "x-bg-color" keywordp nil append enriched-face-ans string-match "^fg:" symbol-name 3 "^bg:" face-attribute :foreground :background face-font t format-annotate-single-property-change unspecified props enriched-translations] 5 (#$ . 8584)])
(defalias 'enriched-decode #[(from to) "\203 \306\307!\210\310\311\312\"\210\212\214	\n}\210	b\210\313 \314 \210\315\316\317\320#\2036 \321 \203- \322\323!\210\324\325\224`\"\210\202 \326	d\f\327$\210\203Q \203K \306\330!\210\331 \210\202^ \203Y \306\332!\210\333ed\"\210\203f \306\317!\210)d*\207" [enriched-verbose from to file-width enriched-translations fill-column message "Enriched: decoding document..." use-hard-newlines 1 never enriched-get-file-width enriched-remove-header search-forward-regexp "\n\n+" nil t current-justification delete-char -1 set-hard-newline-properties 0 format-deannotate-region enriched-next-annotation "Indenting..." enriched-insert-indentation "Filling paragraphs..." fill-region] 5])
#@170 Find and return next text/enriched annotation.
Any "<<" strings encountered are converted to "<".
Return value is (begin end name positive-p), or nil if none was found.
(defalias 'enriched-next-annotation #[nil "\305\306\307\310#\203, \311\224b\210\312!\204, \310u\210`f\313U\203# \314\310!\210\202  \315\316`S\"\210\202  m?\205H \311\224\311\225\317\224\317\225{\227\310\224?	\n\fF,\207" [enriched-annotation-regexp beg end name pos search-forward "<" nil 1 0 looking-at 60 delete-char message "Warning: malformed annotation in file at %s" 2] 4 (#$ . 10090)])
#@47 Look for file width information on this line.
(defalias 'enriched-get-file-width #[nil "\212\300\301`\302\\\303#\205 \304p!)\207" [search-forward "Text-Width: " 1000 t read] 4 (#$ . 10663)])
#@37 Remove file-format header at point.
(defalias 'enriched-remove-header #[nil "\300\301!\203 `\302\225|\210\202  \300\303!\205 \304\305!\207" [looking-at "^[-A-Za-z]+: .*\n" 0 "^\n" delete-char 1] 2 (#$ . 10861)])
(defalias 'enriched-decode-foreground #[(from to &optional color) "\304\305P!\204 \306\307!\210\202- \310	!\204- \311 \203\" \312	!\204- \313	!\203- \306\314\"\210\n\301	F)\207" [color face from to intern "fg:" message "Warning: no color specified for <x-color>" facep display-color-p facemenu-get-face make-face "Warning: color `%s' can't be displayed"] 4])
(defalias 'enriched-decode-background #[(from to &optional color) "\304\305P!\204 \306\307!\210\202- \310	!\204- \311 \203\" \312	!\204- \313	!\203- \306\314\"\210\n\301	F)\207" [color face from to intern "bg:" message "Warning: no color specified for <x-bg-color>" facep display-color-p facemenu-get-face make-face "Warning: color `%s' can't be displayed"] 4])
#@309 Return a list of annotations for a change in the `display' property.
OLD is the old value of the property, NEW is the new value.  Value
is a list `(CLOSE OPEN)', where CLOSE is a list of annotations to
close and OPEN a list of annotations to open.  Each of these lists
has the form `(ANNOTATION PARAM ...)'.
(defalias 'enriched-handle-display-prop #[(old new) "\306\307\206 	!\310\211\204 \310\fDD\202 \fDC,\207" [old new open close param annotation "x-display" prin1-to-string nil] 4 (#$ . 11815)])
#@244 Decode a `display' property for text between START and END.
PARAM is a `<param>' found for the property.
Value is a list `(START END SYMBOL VALUE)' with START and END denoting
the range of text to assign text property SYMBOL with value VALUE 
(defalias 'enriched-decode-display-prop #[(start end &optional param) ";\205	 \304\305\306\217\211\204 \307\310\"\210\n\311	F)\207" [param prop start end nil (byte-code "\301!@\207" [param read-from-string] 2) ((error)) message "Warning: invalid <x-display> parameter %s" display] 5 (#$ . 12333)])
