🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #188737

Re: How to set gin-left-hang-indent-re in gin-mode ?

#188737
From: Martin Neitzel
Date: Mon, 24 Jun 1991 13:21
41 lines
2290 bytes
Rachel, your regexp is OK.  Reformatting a paragraph with a hanging
indent is simply sort of buggy with gin-mode.  I know, because I wrote
it.  Here is another, probably related, problem:

*    foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar
     foo bar foo bar foo bar foo bar foo bar
     foo bar foo bar foo bar foo bar foo bar.

gets formatted into:

* foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo
     bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo
     bar foo bar.

Technical details follow.

On M-q, gin-mode just guesses the paragraph's fill-prefix, in this
case "    ", and calls ordinary fill-paragraph.  This function
searches backwards for the first line not having the fill-prefix,
regards it as a start of a paragraph with a hanging indent --which is
indeed the case-- and reformats it according to its own rules -- which
are not the ones we really want here.

One fix would be to modify (can I say bug-fix?) gin-mode to do the
following on M-q:

Guess fill-prefix, jump back before the paragraph, if looking-at
gin-left-hang-indent-re, substitute it temporarily with fill-prefix,
fill-paragraph (but make sure that not another preceding line gets
involved) and substitute the hanging indent back into the first line.

These are the ideas.  I have currently not the time to check them out
and fix the code myself.  If somebody in gnuemacs.society does, please
mail me the diffs and I'll incorporate them into the official master
version of gin-mode and post it to gnu.emacs.sources & LCD.  Please
help us to prevent the chaos resulting from disintegrating versions...


						Martin
						neitzel@infbs.uucp
Technical Details
Message-ID: <3823@infbs.UUCP>
Path: arc1-ca.pugleaf.net!gmdzi!unido!infbs!neitzel@infbs.uucp
References: <RACHEL.91Jun21150454@tiger.cs.man.ac.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,dc4ba73762768926
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-06-24 08:19:27 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!infbs!neitzel@infbs.uucp
From: neitzel@infbs.uucp (Martin Neitzel)
Newsgroups: gnu.emacs.help
Subject: Re: How to set gin-left-hang-indent-re in gin-mode ?
Message-ID: <3823@infbs.UUCP>
Date: 24 Jun 91 13:21:25 GMT
References: <RACHEL.91Jun21150454@tiger.cs.man.ac.uk>
Sender: neitzel@infbs.UUCP
Distribution: gnu
Organization: TU Braunschweig, CS Dept., FRG
Lines: 41