Homepage | Project |
Extraxt text from other files and insert it in a main file. This is done using the following commands:
Installation: Put (require 'excerpt) (excerpt-install) into your startup/user init file.
In the source file these text portions are marked as
<format-string NAME><comment-string>(<start-string> ID) text to be reported <comment-string>(<end-string> ID)
In elisp-mode this would be:
<format-string NAME><comment-string>(<start-string> ID) text to be reported <comment-string>(<end-string> ID)
NAME ... a string -- may not contain ")"
FORMAT-STRING is mode sensitive but can be changed via buffer local
variables. It is possible to use tags like LaTeX' \index
.
START-STRING and END-STRING are global but can be changed via buffer local variables.
In the main file text to be reported is marked as
<prefix><comment-string>(:excerpt NAME [:id ID]) <prefix><comment-string>(:excerpt-source FILE-NAME) <prefix>[excerpted text] <prefix><comment-string>(:excerpt-end [ID])
This text is inserted with one `excerpt-insert' commands and automatically updated when setting the buffer/file-local variable `excerpt-update-flag' to t or when calling one of the `excerpt--update' commands -- preferably via the pop-up menu.
A local keymap covers the excerpt. Pressing Enter
jumps to the source
file; Space
updates the excerpt if `excerpt-bind-space-to-update-flag'
is non-nil; pressing Mouse-2
(or rather `excerpt-mouse-button') opens
a pop-up menu.
If no ID is given, all occurances of category NAME are being excerpted. (Hm. To be honest, I'm not sure if this is true, if I planned to implement such a feature, and if I've already done so.)
The whole excerpt will be prefixed with the first line's PREFIX. This is a convenient way for inserting excerpts as comments.
The file/buffer local variable `excerpt-sources' defines where sources are normally located. The default file for `excerpt-insert' is either built on the value of this variable or the current buffer's file name.
Using regular expressions for finding excerpt sources and excerpt
targets is of course a fragile solution. There are many ways to confuse
excerpt.el
. Here are some tips.
Headless excerpt won't be visible as excerpts when the properties file is missing. Once the data of the properties file gets out of sync with the text, it's pretty hard to restore a headless excerpt properly. You can force the use of file-local variables by modifying `excerpt-use-file-local-variable', though.
When copying an excerpt, the overlays/extents are only maintained if the whole excerpt was selected. This is escpecially important with headless excerpts.
For hiding excerpt marks to the compiler, text formatter, preprocessor,
or whatsoever, these marks are enclosed with COMMENT-START
and
COMMENT-END
. This means of course that these variables have to be
defined somewhere. Normally this is done by the major mode. If this is
not the case, you could use file local variables or you could use some
project management package that sets these variables for files in a
certain directory.
The following variables overwrite global settings if defined as local variables:
For setting these variables for all files in a specific directory, use some project management package. (You could also use CompEmacsFilesets, defining some custom :open function.)
At the moment there are two "types" of excerpts:
*FILE*
is generated.
In addition, there are two pseudo excerpts, which can be inserted with
the `excerpt-insert-pseudo' command: *FUNCTION*
and *VARIABLE*
.
Evaluation and formatting of pseudo excerpts' sources is defined by
three user options/variables: excerpt-allow-eval-functions,
excerpt-allow-eval-variables, excerpt-pseudo-excerpt-list. Evaluation of
functions is of course unsafe.
*FUNCTION*
and *VARIABLE*
as category
names is rather pointless.
Requirements: tellib, file properties
v0.3.1: excerpt.el.gz
0.3
0.2
0.1
(c) 2003 Thomas Link (last updated Mar 20 2003) | home | top |