[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mode for Manuscripts?

From: gebser
Subject: Re: Mode for Manuscripts?
Date: Sun, 30 Nov 2003 12:15:25 -0500 (EST)

At 09:14 (UTC+0200) on 30 Nov 2003 Eli Zaretskii said:

= > From:
= > Newsgroups:
= > Date: Sat, 29 Nov 2003 23:11:10 -0500
= > 
= > ...
= Does it take anything beyond binding RET to a function that inserts a
= newline and then calls newline-and-indent?
= ...

Yes, I think it would.  Here's (most of) the original posting of the
question again (and how the text should look in emacs):


     Here are the specifications explicitly stated: Text must be

double-spaced. Owing to the need for margins, text should wrap. There 

should be one space, not two, between sentences. Automatic tabs to 

indicate breaks between paragraphs. I think by this they mean a ^I 

character must begin a paragraph. Use regular double spaces between 

paragraphs (as you see here at the beginning and end of paragraphs. Use

only one space, not two spaces, between sentences.

     So does such a mode already exist for emacs? Of course I'd want C-n

and C-p to move the cursor to a text line and not to a blank line in

between text lines. I know that "pr -d" will do the double-spacing for

me after I write up the whole thing, but it would be nicer for emacs to

do the double-spacing for me as I go along. The M-a and M-e keys should

get me to the beginning and end of sentences and M-q should reformat 

stuff I screw up by editing.

     Finally, it would be best to have a separate (minor?) mode for this

sort of format-- this, so I wouldn't have to set and unset a lot of 

variables every time I go in and out of editing in this mode.


I found paragraph-indent-text-mode, copied it into .emacs, and modified 
it so:

(defun paragraph-indent-text-mode ()
  "Major mode for editing text, with leading spaces starting a 
In this mode, you do not need blank lines between paragraphs
when the first line of the following paragraph starts with whitespace.
Special commands:
Turning on Paragraph-Indent Text mode runs the normal hooks
`text-mode-hook' and `paragraph-indent-text-mode-hook'."
  (use-local-map text-mode-map)
  (setq mode-name "Parindent")
  (setq major-mode 'paragraph-indent-text-mode)
  (setq local-abbrev-table text-mode-abbrev-table)
  (setq sentence-end "[.?!][]\"')]*\\($\\|\t\\| \\)[ \t\n]*")
  (setq sentence-end-double-space' nil)
  (setq paragraph-start "\t.+$")
  (setq paragraph-separate "\n\n\t")
  (set-syntax-table text-mode-syntax-table)
  (run-hooks 'text-mode-hook 'paragraph-indent-text-mode-hook))

However, M-a and M-e will go to locations which aren't really the 
begin/end of sentences, where the word following punctuation isn't 
capitalized such as "foo, etc.) bar" where "bar" isn't the begin of a 
new sentence.  Can't we specify that the begin of a sentence should be 
an uppercase character?  How?  (Regexps baffle me sometimes.)

Also my defs for paragraph-start and paragraph-separate don't work;  
ESC-{ and ESC-} move the cursor to the begin and end of the file
respectively.  I'm guessing this is the reason that M-q turns a lot of
(tab-indented) paragraphs into one, big paragraph.  The Info on these
variables demands too much of my pre-mavenistic understanding.

To reply to Eli's question specifically, given that I'm looking for 
double-line spacing ("blank" lines in between text lines), I don't think 
it would be enough to remap RET to RET RET TAB because this would insert 
blank lines only between paragraphs, not between every line of text.  
Can emacs even do double-line spacing at all?

Anyone know how to get at this mode?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]