unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Markup formatting during keyboard input depending on template
@ 2014-09-17 12:33 hack writer
  0 siblings, 0 replies; 2+ messages in thread
From: hack writer @ 2014-09-17 12:33 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Markup formatting during keyboard input depending on template
       [not found] <mailman.9052.1410988771.1147.help-gnu-emacs@gnu.org>
@ 2014-09-18  3:35 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 2+ messages in thread
From: Pascal J. Bourguignon @ 2014-09-18  3:35 UTC (permalink / raw)
  To: help-gnu-emacs

hack writer <GNU@bookhacker.org> writes:

> 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:

Perhaps you might be inspired by one of the screenplay modes?

http://www.emacswiki.org/emacs-test/?action=browse;oldid=ScreenPlay;id=Screenplay


-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-18  3:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.9052.1410988771.1147.help-gnu-emacs@gnu.org>
2014-09-18  3:35 ` Markup formatting during keyboard input depending on template Pascal J. Bourguignon
2014-09-17 12:33 hack writer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).