diff options
| author | Boris Goldowsky | 1994-10-24 14:19:37 +0000 |
|---|---|---|
| committer | Boris Goldowsky | 1994-10-24 14:19:37 +0000 |
| commit | 591d257e04b9bdf20b594e9282dd0171691eedda (patch) | |
| tree | 17d21523cf213bfb233af290899d867b3cfd1ae1 | |
| parent | 2db6c9ecda59dc0cdd3a1fda6618c100c6b15ff2 (diff) | |
| download | emacs-591d257e04b9bdf20b594e9282dd0171691eedda.tar.gz emacs-591d257e04b9bdf20b594e9282dd0171691eedda.zip | |
Initial revision
| -rw-r--r-- | etc/enriched.doc | 331 |
1 files changed, 331 insertions, 0 deletions
diff --git a/etc/enriched.doc b/etc/enriched.doc new file mode 100644 index 00000000000..afd1df88436 --- /dev/null +++ b/etc/enriched.doc | |||
| @@ -0,0 +1,331 @@ | |||
| 1 | <param>-*-enriched-*-width:86 | ||
| 2 | </param><center><bold><x-bg-color><param>gray</param><x-color><param>blue</param>Enriched: | ||
| 3 | |||
| 4 | A WYSIWYG enriched-text editing environment for GNU Emacs | ||
| 5 | |||
| 6 | |||
| 7 | </x-color></x-bg-color></bold></center><bold>INTRODUCTION | ||
| 8 | |||
| 9 | |||
| 10 | </bold><indent>This package, along with the <bold>facemenu</bold> package, is the beginning of a WYSIWYG | ||
| 11 | ("what you see is what you get") Emacs mode for editing <italic>enriched text: </italic>text with | ||
| 12 | different faces, colors, etc. Facemenu allows you to add faces (such as | ||
| 13 | <bold>boldface</bold>, <italic>italics</italic>, and <underline>underlining</underline>) your documents, while <bold>enriched</bold> allows you to | ||
| 14 | save the documents with those "text properties" included. The format in which | ||
| 15 | they are saved is called <italic>text/enriched</italic>, and is defined as part of the MIME | ||
| 16 | standard, so that your documents are transportable (even through email) to many | ||
| 17 | other systems. | ||
| 18 | |||
| 19 | |||
| 20 | Not all systems will be able to recreate all of the features of your document, | ||
| 21 | but they will get as close as possible. For systems that do not understand it at | ||
| 22 | all, the text of the document should still be legible; the reader can simply | ||
| 23 | ignore the annotations specifying face changes and the like. | ||
| 24 | |||
| 25 | |||
| 26 | </indent><bold>INSTALLATION and STARTUP </bold> | ||
| 27 | |||
| 28 | |||
| 29 | <indent>The <fixed>enriched.el</fixed> file should be installed somewhere that emacs will find it (ie, | ||
| 30 | one of the directories on emacs's <fixed>load-path </fixed>variable), and byte-compiled for | ||
| 31 | speed. | ||
| 32 | |||
| 33 | |||
| 34 | The documentation below assumes that you have my <fixed>facemenu.el</fixed> (which is included | ||
| 35 | in recent versions of emacs). You may also find it useful to have Jim Thompson's | ||
| 36 | <fixed>ps-print.el</fixed>, which will allow you to print out buffers including their faces | ||
| 37 | (unfortunately it is not currently able to deal with merged faces; hopefully it | ||
| 38 | will be revised soon.) These two files should also be installed into your lisp | ||
| 39 | directory and byte-compiled. | ||
| 40 | |||
| 41 | |||
| 42 | Put the following code into your .emacs file to automatically load enriched when | ||
| 43 | needed: | ||
| 44 | |||
| 45 | |||
| 46 | <indent><fixed>(autoload 'enriched-mode "enriched" nil t)</fixed></indent> | ||
| 47 | |||
| 48 | |||
| 49 | <bold>Enriched </bold>puts an identifying header into files it writes, which allows it to | ||
| 50 | recognize any emacs-generated <italic>text/enriched</italic> file and put itself into the proper | ||
| 51 | mode. If you get a file from some other source, however, such as through the | ||
| 52 | mail, you may have to enter enriched-mode manually: | ||
| 53 | |||
| 54 | |||
| 55 | <indent><fixed>M-x enriched-mode</fixed></indent> | ||
| 56 | |||
| 57 | |||
| 58 | You may be asked a couple of questions at this point: | ||
| 59 | |||
| 60 | |||
| 61 | <italic>Does the buffer need to be translated now?</italic> If the buffer contains <italic>text/enriched | ||
| 62 | </italic>data which needs to be translated into a readable document with fonts and such, | ||
| 63 | then answer "yes". If you are putting a new document into text/enriched format | ||
| 64 | for the first time, then say "no". | ||
| 65 | |||
| 66 | |||
| 67 | <italic>Reformat for current display width?</italic> If emacs knows that the document was created | ||
| 68 | with the same display width that is currently in effect, it will trust the line | ||
| 69 | breaks that are in the file, which saves some time. If it was saved at a | ||
| 70 | different width, or emacs doesn't know what width it was saved at, then it may | ||
| 71 | ask whether it should reformat. Actually it does not ask by default; it just | ||
| 72 | goes ahead and fills. But if you want it to ask, you can set the variable | ||
| 73 | <fixed>enriched-fill-after-visiting</fixed> to <fixed>'ask</fixed>. | ||
| 74 | |||
| 75 | |||
| 76 | In the future, other modes such as mail and news may recognize messages that are | ||
| 77 | enriched text, and automatically call on <bold>enriched</bold> to display them for you. | ||
| 78 | |||
| 79 | |||
| 80 | </indent><bold>WHAT IS ENCODED</bold> | ||
| 81 | |||
| 82 | |||
| 83 | <indent>Aside from the text itself, various properties are saved. More will eventually | ||
| 84 | be added, so that you will be able to save and read just about anything that can | ||
| 85 | be displayed in an emacs frame. Following is the list of properties that are | ||
| 86 | currently understood; each is covered in more detail below. | ||
| 87 | |||
| 88 | |||
| 89 | <bold>Faces:</bold> default, <bold>bold</bold>, <italic>italic</italic>, <underline>underline</underline>, <fixed>fixed</fixed>, etc. | ||
| 90 | |||
| 91 | <bold>Colors:</bold> <x-color><param>red</param><x-bg-color><param>DarkSlateGray</param>any</x-bg-color></x-color><x-bg-color><param>DarkSlateGray</param><x-color><param>orange</param>thing</x-color> <x-color><param>yellow</param>your</x-color><x-color><param>green</param> screen</x-color><x-color><param>blue</param> </x-color><x-color><param>light blue</param>can</x-color><x-color><param>violet</param> display... </x-color></x-bg-color> | ||
| 92 | |||
| 93 | <bold>Newlines:</bold> <indent>Which ones are real ("hard") newlines, and which can be changed to fit | ||
| 94 | lines into the ma</indent>rgins. | ||
| 95 | |||
| 96 | <bold>Margins:</bold> can be indented on the left or right. | ||
| 97 | |||
| 98 | <bold>Justification </bold><indent>(whether lines should be flush with the left margin, the right | ||
| 99 | margin, fully justified, centered, or left alo</indent>ne). | ||
| 100 | |||
| 101 | <bold>Excerpts: "</bold><excerpt>For quoted material." </excerpt> | ||
| 102 | |||
| 103 | <bold>Read-only</bold> regions. | ||
| 104 | |||
| 105 | |||
| 106 | </indent><bold>FACES | ||
| 107 | |||
| 108 | |||
| 109 | </bold><indent>The easiest way to add a face to a region is to use the <bold>facemenu </bold>package. This | ||
| 110 | defines a menu obtained by clicking the right mouse button while holding the | ||
| 111 | control key. For example, to make a word boldface, you could select the word by | ||
| 112 | double-clicking on it, then hold C-mouse-3 and select <italic>Bold</italic> from the <italic>Face | ||
| 113 | </italic></indent>sub-menu<indent>. Selecting a face from the menu when the region is not active will apply | ||
| 114 | that face to whatever you type next. | ||
| 115 | |||
| 116 | |||
| 117 | </indent><bold>NEWLINES and PARAGRAPHS | ||
| 118 | |||
| 119 | |||
| 120 | </bold><indent><italic>Text/enriched</italic> format distinguishes between <underline>hard</underline> newlines and <underline>soft </underline>newlines. Hard | ||
| 121 | newlines are used to separate paragraphs, or items in a list, or anywhere that | ||
| 122 | must be a line break no matter what the margins are. Soft newlines are the ones | ||
| 123 | inserted in order to fit text between the margins. Auto-fill-mode and | ||
| 124 | enriched-mode's fill functions insert soft newlines as necessary, but hard | ||
| 125 | newlines are only inserted by direct request, such as using the return key or the | ||
| 126 | <fixed>C-o (open-line)</fixed> function. | ||
| 127 | |||
| 128 | |||
| 129 | </indent><bold>INDENTATION | ||
| 130 | |||
| 131 | |||
| 132 | </bold><indent>Indentation of regions of the document can be flexibly controlled. The face menu | ||
| 133 | contains an <italic>Indent</italic> item, which indents the region by the width of 4 characters | ||
| 134 | and an <italic>UnIndent </italic>item which removes 4 character-widths of indentation. All of the | ||
| 135 | text paragraphs in this file are singly indented relative to the headings, for | ||
| 136 | example. In addition, you can indent and unindent the <italic>right </italic>margin though use of | ||
| 137 | the <italic>IndentRight</italic> and <italic>UnindentRight </italic>menu items. The indentation commands can be | ||
| 138 | used repeatedly to get further levels of indentation. There are also shortcut | ||
| 139 | commands to set the left and right margins directly. | ||
| 140 | |||
| 141 | The basic editing commands in enriched-mode have been modified as necessary to | ||
| 142 | maintain proper indentation, but if it gets messed up, you can use <fixed>C-q</fixed> to | ||
| 143 | reformat the current paragraph. This may be necessary, for example, after | ||
| 144 | yanking or pasting text into the buffer. Eventually all commands should respect | ||
| 145 | indentation. <flushleft><indentright><indentright><indentright><indentright> | ||
| 146 | |||
| 147 | |||
| 148 | </indentright>Not <indent>only whole paragraphs can be indented, but in fact any region. | ||
| 149 | This makes it possible to have hanging-indents on paragraphs like | ||
| 150 | this one: it was accomplished by selecting the region starting | ||
| 151 | after the first word of the paragraph and going to the end of the | ||
| 152 | paragraph, and indenting that. </indent></indentright></indentright></indentright><indent>Also notice that this paragraph had been | ||
| 153 | indented on the right until the beginning of this sentence, when it resumed | ||
| 154 | normal w</indent>i</flushleft></indent><flushleft>dth. | ||
| 155 | |||
| 156 | |||
| 157 | <bold>JUSTIFICATION<indent> | ||
| 158 | |||
| 159 | |||
| 160 | </indent></bold></flushleft><indent><nofill>Several styles of justification are possible, the simplest being <italic>unfilled. | ||
| 161 | </italic>This means that your lines will be left as you write them. | ||
| 162 | This paragraph, for instance, is unfilled. | ||
| 163 | It was written with one sentence on a line. | ||
| 164 | <bold>Enriched </bold>will not change that, no matter what size display it is shown on. | ||
| 165 | There is no hard/soft newline distinction in unfilled text. | ||
| 166 | |||
| 167 | The most common (for English) style is <italic>FlushLeft. </italic>This means | ||
| 168 | lines are aligned at the left margin but left uneven at the | ||
| 169 | right. | ||
| 170 | |||
| 171 | </nofill><italic><flushright>FlushRight</flushright></italic><flushright>, as you may have guessed, makes each line flush with the right margin, | ||
| 172 | but not necessarily the left. | ||
| 173 | |||
| 174 | This is usually, but by no means necessarily, used for headings. | ||
| 175 | |||
| 176 | This paragraph is FlushRight. | ||
| 177 | |||
| 178 | |||
| 179 | </flushright><italic><flushboth>FlushBoth </flushboth></italic><flushboth>regions, which are sometimes called "fully justified" (or, confusingly, | ||
| 180 | "right justified") are aligned evenly on both edges, so that the text on the page | ||
| 181 | has a smooth appearance as in a book or newspaper article. Unfortunately this | ||
| 182 | does not look as nice with a fixed-width font as it does in a | ||
| 183 | proportionally-spaced printed document; the extra spaces that are needed on the | ||
| 184 | screen can make it hard to read. <indentright><indentright><indentright><indentright> | ||
| 185 | |||
| 186 | |||
| 187 | <indent><indent><indent><indent>The narrower the column, the uglier <italic>FlushBoth | ||
| 188 | </italic>text will be. If you think <italic>flushboth </italic>paragraphs | ||
| 189 | look pretty, though, you can set | ||
| 190 | <fixed>enriched-default-justification </fixed>to <fixed>'both </fixed>to | ||
| 191 | justify everything that is not otherwise | ||
| 192 | specified. | ||
| 193 | |||
| 194 | |||
| 195 | </indent></indent></indent></indent></indentright></indentright></indentright></indentright></flushboth><bold><center>Center | ||
| 196 | |||
| 197 | </center></bold><center>You can probably guess what <italic>center </italic>justification is for. | ||
| 198 | |||
| 199 | The normal center-paragraph key, M-S, can be used to turn on center justification | ||
| 200 | in enriched-mode. M-j also brings up a justification menu. | ||
| 201 | |||
| 202 | |||
| 203 | </center><flushboth>Note that justification can only be changed for complete paragraphs (ie, a | ||
| 204 | justified region must start and end at hard newlines). The menu items in the | ||
| 205 | "Justification" menu will all operate on the current paragraph, or, if the region | ||
| 206 | is active, on all paragraphs which are inside or overlapping the region. | ||
| 207 | |||
| 208 | |||
| 209 | </flushboth></indent><bold>EXCERPTS</bold> | ||
| 210 | |||
| 211 | |||
| 212 | <excerpt><indent>This is an example of an excerpt. You can use them for quoted parts of other | ||
| 213 | people's email messages and the like. Currently it just displays as italics | ||
| 214 | (unless some <bold>other</bold> style is in effect), but this can be changed (see | ||
| 215 | <underline>Customization</underline> below). </indent></excerpt> | ||
| 216 | |||
| 217 | |||
| 218 | <bold>DEBUGGING</bold> | ||
| 219 | |||
| 220 | |||
| 221 | <indent>The function <fixed>enriched-show-codes</fixed> can be helpful in figuring out what is going if | ||
| 222 | things don't seem to be working. The function can highlight (with a blue or gray | ||
| 223 | background) various items of interest. </indent>Type <fixed>C<indent>-c C-s</indent></fixed><indent>, then what should be | ||
| 224 | highlighted: | ||
| 225 | |||
| 226 | |||
| 227 | <indent><bold>indent:<indent> </indent></bold><indent>Highlight the indentation at the beginning of each line. </indent> | ||
| 228 | |||
| 229 | <bold>margin: </bold>Highlight regions that are indented. | ||
| 230 | |||
| 231 | <bold>newline: </bold>Highlight hard newlines. | ||
| 232 | |||
| 233 | <bold>none: </bold>Turn off all highlighting. <bold><excerpt> | ||
| 234 | |||
| 235 | |||
| 236 | </excerpt></bold></indent></indent><bold>CUSTOMIZATION | ||
| 237 | |||
| 238 | |||
| 239 | </bold><indent>-<indent> Set the default faces to things you like. The faces named <fixed>fixed </fixed>and <excerpt>excerpt, | ||
| 240 | </excerpt>especially, can be set to your liking. </indent> | ||
| 241 | |||
| 242 | - <indent>User-preference variables: <fixed>enriched-default-right-margin, | ||
| 243 | enriched-default-justification, enriched-verbose, | ||
| 244 | enriched-auto-save-interval</fixed><bold>, </bold>and <fixed>enriched-fill-after-visiting </fixed>(mentioned | ||
| 245 | above)<bold>. </bold>See their documentation for det</indent>ails. | ||
| 246 | |||
| 247 | - <indent>You can add annotations for your own text properties by making additions to | ||
| 248 | <fixed>enriched-annotation-alist</fixed>. Note that the standard requires you to name your | ||
| 249 | annotation starting<italic> "x-" </italic>(as in <italic>"x-read-only"</italic>). Please send me any such | ||
| 250 | additions that you think might be of general interest so that I can include | ||
| 251 | them in the distribution. | ||
| 252 | |||
| 253 | </indent>- <indent>My eventual hope is that people will use the basic code in this file to | ||
| 254 | implement more of the various file formats that are in common use, so that | ||
| 255 | emacs will understand them all and be able to edit them with a common | ||
| 256 | interface. If you are interested in taking on the project of implementing a | ||
| 257 | format, let me know. The code attempts to be as general as possible; a lot | ||
| 258 | of different formats can be defined just by setting up the lists of | ||
| 259 | properties to save and how to represent them in the file. | ||
| 260 | |||
| 261 | |||
| 262 | </indent></indent><bold>TO-DO LIST | ||
| 263 | |||
| 264 | |||
| 265 | </bold><indent><italic>[Feel free to work on these and send me the results!] </italic> | ||
| 266 | |||
| 267 | - Be more tolerant of malformed files. | ||
| 268 | |||
| 269 | - Make the indentation work more seamlessly and robustly: | ||
| 270 | |||
| 271 | <indent>+ Create<indent> an aggressive auto-fill function that will keep the paragraph | ||
| 272 | properly filled all the time, without slowing down editing too much. </indent> | ||
| 273 | |||
| 274 | + Refill after yank. | ||
| 275 | |||
| 276 | + <indent>Make deleting a newline also delete the indentation following it. </indent> | ||
| 277 | |||
| 278 | + Never let point enter indentation?? | ||
| 279 | |||
| 280 | +<indent> Optional never-let-things-get-unfilled (ok for fast terminals). </indent> | ||
| 281 | |||
| 282 | </indent>- Do the right thing for insert-file. | ||
| 283 | |||
| 284 | - Notice and re-fill when window changes widths (optionally). - Nicer formatting | ||
| 285 | for excerpts. | ||
| 286 | |||
| 287 | - Interface w/ GNUS, VM, RMAIL. | ||
| 288 | |||
| 289 | - For documentation, make INFO aware of text/enriched format. | ||
| 290 | |||
| 291 | -<indent> Have another set of alists for reading and writing RTF, etc (this will take | ||
| 292 | work not only on the alists, of course, but also on the code for interpreting | ||
| 293 | them). | ||
| 294 | |||
| 295 | |||
| 296 | |||
| 297 | </indent></indent><bold>Final Notes: | ||
| 298 | |||
| 299 | |||
| 300 | </bold><indent>The MIME standard is defined in internet RFC 1521; text/enriched is defined in | ||
| 301 | RFC 1563. Details on obtaining these documents via FTP or email may be obtained | ||
| 302 | by sending an email message to <fixed>rfc-info@isi.edu</fixed> with the message body: | ||
| 303 | |||
| 304 | <indent> <fixed>help: ways_to_get_rfcs </fixed> </indent> | ||
| 305 | |||
| 306 | |||
| 307 | This code and documentation is under development. The most current version | ||
| 308 | should always be available from: | ||
| 309 | |||
| 310 | <indent><fixed>/anonymous@cs.rochester.edu:pub/boris/enriched.shar</fixed> | ||
| 311 | |||
| 312 | </indent>It is helpful to make sure you have the newest version before reporting a bug. | ||
| 313 | |||
| 314 | </indent>Please send any and all comments to: | ||
| 315 | |||
| 316 | |||
| 317 | <bold><x-color><param>blue</param>Boris Goldowsky </x-color></bold><fixed><<boris@cs.rochester.edu></fixed><x-color><param>blue</param> | ||
| 318 | |||
| 319 | October 1994 | ||
| 320 | |||
| 321 | |||
| 322 | |||
| 323 | |||
| 324 | |||
| 325 | |||
| 326 | |||
| 327 | |||
| 328 | |||
| 329 | |||
| 330 | |||
| 331 | </x-color> | ||