[PLUG] More Emacs.

Russell Senior seniorr at aracnet.com
Tue May 21 18:22:24 UTC 2002


>>>>> "Jeme" == Jeme A Brelin <jeme at brelin.net> writes:

Jeme> Gah!

Jeme> OK.  First, to restate yesterday's question in a real-world
Jeme> example:

Jeme> Somebody sent me a text file that is english prose.  The
Jeme> beginning of each paragraph started with many spaces.  I wanted
Jeme> to quickly convert all the spaces at the beginning of a line
Jeme> that began with more than three spaces into a single tab.

Jeme> I ended up using vi and typing the familiar: %s/ */^I/ and that
Jeme> did the trick nicely.

Jeme> How would this be done in emacs?

Here's what I'd do.

M-x replace-regexp

At 'Replace regexp:' prompt: ^[ ]+\([^ ]\)
At `with:' prompt type C-q C-i (inserting a tab character), then: \1

Jeme> Second, I'm having trouble finding a mode that does what I
Jeme> expect it to do with english prose.

Jeme> For example, this same file has newlines only at the ends of
Jeme> paragraphs and between sections (where you'll find two or more
Jeme> consecutive newlines, one delimiting the paragraph, the next the
Jeme> section).  The wrapping in text-mode is not using word breaks as
Jeme> the wrap point.  So I type M-q to try and reset the paragraph
Jeme> using the current line break setting of 70 characters and I get
Jeme> the entire section indented one tab and lines broken on
Jeme> less-than-70-char word breaks with a complete loss of paragraph
Jeme> delineation.

Jeme> Is there a mode for english prose or, more specifically,
Jeme> fiction?

I don't quite parse your description.  It sounds like you are saying
there are single new-lines between paragraphs and double new-lines
between sections.  If so, you'll probably want to replace single
new-lines with double new-lines.  Maybe something like:

  M-x replace-string
  at the "Replace string:' prompt, type C-q C-j
  at the "with:" prompt, type C-q C-j C-q C-j

That will provide the necessary spacing for M-q to do its work.

BTW, I wasn't aware that "english prose" had a standard format, beyond
text-mode, such that a special mode could be designed for it.  You
don't say what you intend to do with the material.  Does it need to go
back into that format before it goes back to your friend?

Jeme> Lastly, if someone could actually point me in the right
Jeme> direction to begin using Gnus with my existing mbox files and
Jeme> gpg, that'd be fantastic.  I'm really interested to use that
Jeme> thing.

There is a section in the Gnus info document (well hidden) that
describes the steps to go through.  I'll see if I can dig it up.

-- 
Russell Senior         ``The two chiefs turned to each other.        
seniorr at aracnet.com      Bellison uncorked a flood of horrible       
                         profanity, which, translated meant, `This is
                         extremely unusual.' ''                      




More information about the PLUG mailing list