;ELC
;;; Compiled by cyd@localhost on Mon Apr 23 22:25:16 2007
;;; from file /home/cyd/emacs/lisp/textmodes/enriched.el
;;; in Emacs version 22.0.99
;;; 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 '(#$ . -733) :type 'boolean :group 'enriched)
(byte-code "\303\304\305\306\307\310%\210\303\311\312\313\307\310%\210\302B\314\315 !\206 \316 !\210\n\317\320\321 S\322\"I\207" [current-load-list standard-display-table enriched-display-table custom-declare-face fixed ((t (:weight bold))) "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 (:slant italic))) "Face used for text that is an excerpt from another document.\nThis is used in Enriched mode for text explicitly marked as an excerpt." (lambda (#1=#:defconst-tmp-var) (defconst enriched-display-table #1#)) copy-sequence make-display-table 12 make-vector frame-width 45] 6)
#@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) (#$ . 1694))
#@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] (#$ . 1904))
#@46 General format of enriched-text annotations.
(defconst enriched-annotation-format "<%s%s>" (#$ . 2249))
#@56 Regular expression matching enriched-text annotations.
(defconst enriched-annotation-regexp "<\\(/\\)?\\([-A-Za-z0-9]+\\)>" (#$ . 2359))
#@149 List of definitions of text/enriched annotations.
See `format-annotate-region' and `format-deannotate-region' for the definition
of this structure.
(defvar 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))) (#$ . 2503))
#@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) (#$ . 3317))
#@258 Hook run after entering/leaving 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 '(#$ . 3574) :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 (#$ . 3931))
(byte-code "\301\302!\210\303B\304\303!\204 \305\303\306\"\210\307B\304\307!\204\" \305\307\310\"\210\311\312\313\306#\207" [current-load-list make-variable-buffer-local enriched-old-bindings enriched-default-text-properties-local-flag default-boundp set-default t enriched-rerun-flag nil put enriched-mode permanent-local] 4)
#@95 Non-nil if Enriched mode is enabled.
Use the command `enriched-mode' to change this variable.
(defvar enriched-mode nil (#$ . 4426))
(make-variable-buffer-local 'enriched-mode)
#@345 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 or off 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}
(defalias 'enriched-mode #[(&optional arg) "\306=\203 ?\202% \203 \307!\310V\202% \204 \311\202% \312\313\301\"\210\314\211\204Y \315\316\n\"\203B \211A@\211A@L\210\202/ \f\204J \317\320!\210\317\304!\210
\204\310 \305\310!\210\202\310 \316\n>\203d $\203\310 \321\302\316\"\210\322\320\305
\257\323\304!\210\324\320!\323\320!\210%\305\325$\205\214 \326\"\210\327\330\"&''\314(\211)\203\270 )@(\321\331(\"\210)A\211)\204\244 *\203\307 \332\330#*\333\334 \203\322 \335\202\323 \336\"\210\337 \203\347 \312\340 \203\344 \341\202\345 \342\"\210\343 \210 \207" [arg enriched-mode buffer-file-format enriched-old-bindings enriched-default-text-properties-local-flag use-hard-newlines toggle prefix-numeric-value 0 t message "Toggling %s off; better pass an explicit argument." nil delq text/enriched kill-local-variable default-text-properties add-to-list buffer-display-table make-local-variable local-variable-p 1 never plist-get front-sticky sticky plist-put run-hooks enriched-mode-hook enriched-mode-on-hook enriched-mode-off-hook called-interactively-p "Enriched mode %sabled" "en" "dis" force-mode-line-update enriched-rerun-flag enriched-display-table enriched-par-props p x #1=#:--cl-dolist-temp--] 7 (#$ . 4610) (list (or current-prefix-arg 'toggle))])
(byte-code "\300\301\302\303\304!\205 \304J#\207" [add-minor-mode enriched-mode " Enriched" boundp enriched-mode-map] 5)
(defalias 'enriched-before-change-major-mode #[nil "\205 \205 \211A@ \211A@L\210\202 \207" [enriched-mode enriched-old-bindings] 3])
(add-hook 'change-major-mode-hook 'enriched-before-change-major-mode)
(defalias 'enriched-after-change-major-mode #[nil "\205\n \302\300\303!)\207" [enriched-mode enriched-rerun-flag t 1] 2])
(add-hook 'after-change-major-mode-hook 'enriched-after-change-major-mode)
#@27 Keymap for Enriched mode.
(defvar enriched-mode-map nil (#$ . 6798))
(byte-code "\204 \300\302 \211M\210\303 \236\204 \303B 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 "[" 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\"\311d\n$\211\203F \f
\306\223\210\f\312\f!#\210\312\f!\310\f\n\"\202 dW\205T \fd#.\207" [to from prop val marker end nil make-marker get-text-property text-property-not-all marker-position begin func] 6 (#$ . 7375)])
(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 (#$ . 8185)])
(defalias 'enriched-encode #[(from to orig-buf) "\203 \306\307!\210\310\214\n}\210\311 \210\312 \210\nb\210\313\314!\210\315\316\nd\f\317
%!\210\nb\210;\2034 \202B \212\203> q\210 )c\210\320\321\322`\323$\210\203S \306\323!\210d*\207" [enriched-verbose inhibit-read-only from to enriched-translations enriched-ignore message "Enriched: encoding document..." t 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 enriched-initial-annotation orig-buf] 7])
#@199 Format an annotation INTERNAL-ANN.
INTERNAL-ANN may be a string, for a flag, or a list of the form (PARAM VALUE).
If POSITIVE is non-nil, this is the opening annotation;
if nil, the matching close.
(defalias 'enriched-make-annotation #[(internal-ann positive) ";\203 \305 \n\203 \306\202 \307#\207\n\203* @A\305 \306\f#\310\311\306#P*\207\305 \307@#\207" [internal-ann enriched-annotation-format positive params item format "" "/" mapconcat #[(i) "\301\302Q\207" [i "" ""] 3]] 5 (#$ . 9165)])
#@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 (#$ . 9692)])
#@199 Return annotations specifying FACE.
FACE may be a list of faces instead of a single face;
it can also be anything allowed as an element of a list
which can be the value of the `face' text property.
(defalias 'enriched-face-ans #[(face) ":\203 @\306=\203 \307ADC\207:\203$ @\310=\203$ \311ADC\207<\203: @\312=\203: \307\211A@)DC\207<\203P @\313=\203P \311\211A@)DC\207<\203] \314\315\316\317\"\"\207\320\312\"\320\313\"\321\322\"\323\300\324\f
$A\n\325=\204\203 \307\nDB\325=\204\221 \311DB,\207" [face x fg bg props enriched-translations foreground-color "x-color" background-color "x-bg-color" :foreground :background apply append mapcar enriched-face-ans face-attribute face-font t format-annotate-single-property-change nil unspecified ans] 6 (#$ . 9945)])
(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 (#$ . 11481)])
#@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 (#$ . 12054)])
#@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 (#$ . 12252)])
(defalias 'enriched-decode-foreground #[(from to &optional color) "\203\f \n\303\304DF\207\305\306!\210\307\207" [color from to face :foreground message "Warning: no color specified for " nil] 5])
(defalias 'enriched-decode-background #[(from to &optional color) "\203\f \n\303\304DF\207\305\306!\210\307\207" [color from to face :background message "Warning: no color specified for " nil] 5])
#@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) "\304\305\206 !\204 \306\nDCB\202 \nDC\306B*\207" [old new param annotation "x-display" prin1-to-string nil] 3 (#$ . 12894)])
#@244 Decode a `display' property for text between START and END.
PARAM is a `' 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 parameter %s" display] 5 (#$ . 13397)])