From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: gebser@speakeasy.net Newsgroups: gmane.emacs.help Subject: Re: Mode for Manuscripts? Date: Sun, 30 Nov 2003 12:15:25 -0500 (EST) Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: Reply-To: gebser@speakeasy.net NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1070212761 22131 80.91.224.253 (30 Nov 2003 17:19:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2003 17:19:21 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 30 18:19:18 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQVE5-0004XC-00 for ; Sun, 30 Nov 2003 18:19:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AQW8h-000293-Al for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Nov 2003 13:17:47 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AQW8N-00028m-ND for help-gnu-emacs@gnu.org; Sun, 30 Nov 2003 13:17:27 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AQW7r-0001xj-B8 for help-gnu-emacs@gnu.org; Sun, 30 Nov 2003 13:17:26 -0500 Original-Received: from [66.93.11.17] (helo=mousecar.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AQW7q-0001xI-OK for help-gnu-emacs@gnu.org; Sun, 30 Nov 2003 13:16:54 -0500 Original-Received: from localhost (ken@localhost) by mousecar.net (8.11.6/8.11.6) with ESMTP id hAUHFPp14916; Sun, 30 Nov 2003 12:15:26 -0500 X-Authentication-Warning: heidegger.mousecar.net: ken owned process doing -bs Original-To: Eli Zaretskii In-Reply-To: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14750 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14750 At 09:14 (UTC+0200) on 30 Nov 2003 Eli Zaretskii said: = > From: gebser@speakeasy.net = > Newsgroups: gnu.emacs.help = > 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 paragraph. In this mode, you do not need blank lines between paragraphs when the first line of the following paragraph starts with whitespace. Special commands: \\{text-mode-map} Turning on Paragraph-Indent Text mode runs the normal hooks `text-mode-hook' and `paragraph-indent-text-mode-hook'." (interactive) (kill-all-local-variables) (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? tia, ken