[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Markup formatting during keyboard input depending on template
From: |
hack writer |
Subject: |
Markup formatting during keyboard input depending on template |
Date: |
Wed, 17 Sep 2014 14:33:53 +0200 |
User-agent: |
RoundCube Webmail/0.2-beta |
Hi everyone,
I hope this is the right place to get some help writing an Emacs mode. I
would like to create a mode that behaves the following way:
When starting a new paragraph, Emacs asks in a buffer window, which
template to use:
buffer window:
1 - standard (default)
2 - person
3 - insertion
4 - location
5 - header
Just <ENTER> selects 1 - standard (default).
Whenever two captital letters are put in, everything till the next space
or line ending should be in capitals:
PErson -> PERSON
PErson NAmed CHuck -> PERSON NAMED CHUCK
The standard-template works something like this:
A standard paragraph starts with a person. After the person, there may or
may not follow some ():
If (), then follows a line break:
input (note the missing <SPACE>):
PErson(doing something).bla bla bla.
output:
PERSON <i>(doing something)</i>.
bla bla bla.
If no ():
input:
PErson.bla bla bla.
output:
PERSON. bla bla bla.
For demonstrating what should happened depending on the chosen template,
here are some sample inputs:
Choose "1 - standard" + input:
PErson(doing something. Something else. Something else).bla bla
bla<ENTER>bla bla bla<ENTER>bla bla bla.<ENTER><ENTER>
should become:
output:
<standard>PERSON <i>(doing something. Something else. Something else)</i>.
bla bla bla
bla bla bla
bla bla bla.</standard>
Choose "2 - person" + input:
Description of a place. PErson NAmed CHuck walks around the corner.<ENTER>
output:
<person><i>Description of a place.</i> PERSON NAMED CHUCK <i>walks around
the corner.</i></person>
Choose "3 - insertion" + input:
Something happens. Something can be heard. Something can be seen.<ENTER>
output:
<insertion><i>(Something happens. Something can be heard. Something can be
seen.)</i></insertion>
Note:
Depending on the selected template, a paragraph ends with <ENTER> or
<ENTER><ENTER>.
The final markup file (html, xml, whatever) should be used in LibreOffice
for further processing.
I already wrote an Emacs mode some time ago. Very simple thing. But with
this here, I would be grateful for every hint you can offer (even if it's
only an other place where I can discuss this).
Thank you,
hack
- Markup formatting during keyboard input depending on template,
hack writer <=