unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#744: nroff-mode auto-fill-mode not on directives
@ 2008-08-19 22:30 ` Kevin Ryde
  2008-08-20  4:01   ` Werner LEMBERG
  2008-08-20 22:30   ` bug#744: marked as done (nroff-mode auto-fill-mode not on directives) Emacs bug Tracking System
  0 siblings, 2 replies; 5+ messages in thread
From: Kevin Ryde @ 2008-08-19 22:30 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

In nroff-mode it'd be good if auto-fill-mode didn't fill when you're
entering a long directive line like

    .IP some long line going past your normal fill width ...

Almost always *roff directives have to be a single line.  I struck the
problem with a groff .URL with a long url doubled-up to both display
literally and be clickable in -Thtml.

I've been using the regexp below, which suppresses auto-fill on .IP and
the like, but continues to auto-fill the comment directives (no change)

    .\"    traditional
    .\#    groff extension
    '''    another traditional, apparently

And of course non-directive lines ("." or "'") are still auto-filled
(either ordinary text, or comments starting \" and \#).


2008-08-18  Kevin Ryde  <user42@zip.com.au>

	* textmodes/nroff-mode.el (nroff-mode): Set auto-fill-inhibit-regexp
	so as not to auto-fill on directive lines, other than comment
	directives.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nroff-mode.el.auto-fill.diff --]
[-- Type: text/x-diff, Size: 974 bytes --]

*** nroff-mode.el	08 May 2008 11:29:50 +1000	1.40
--- nroff-mode.el	18 Aug 2008 20:29:55 +1000	
***************
*** 144,149 ****
--- 144,160 ----
         (concat "[.']\\|" paragraph-start))
    (set (make-local-variable 'paragraph-separate)
         (concat "[.']\\|" paragraph-separate))
+ 
+   ;; Don't auto-fill directive lines starting . or ' since they normally
+   ;; have to be one line.  But do auto-fill comments .\" .\# and '''
+   ;;
+   ;; Comment directives (those starting . or ') are [.'][ \t]*\\[#"] or a
+   ;; ''', and this regexp is everything except those.  So [.'] followed by
+   ;; not backslash and not ' or followed by backslash but then not # or "
+   ;;
+   (set (make-local-variable 'auto-fill-inhibit-regexp)
+        "[.'][ \t]*\\([^ \t\\']\\|\\\\[^#\"]\\)")
+ 
    ;; comment syntax added by mit-erl!gildea 18 Apr 86
    (set (make-local-variable 'comment-start) "\\\" ")
    (set (make-local-variable 'comment-start-skip) "\\\\[\"#][ \t]*")

[-- Attachment #3: Type: text/plain, Size: 110 bytes --]


-- 
The Copenhagen Interpretation elucidated for the layman:
  You can't be sure until you see for yourself.

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

* bug#744: nroff-mode auto-fill-mode not on directives
  2008-08-19 22:30 ` bug#744: nroff-mode auto-fill-mode not on directives Kevin Ryde
@ 2008-08-20  4:01   ` Werner LEMBERG
  2008-08-23  0:29     ` Kevin Ryde
  2008-08-20 22:30   ` bug#744: marked as done (nroff-mode auto-fill-mode not on directives) Emacs bug Tracking System
  1 sibling, 1 reply; 5+ messages in thread
From: Werner LEMBERG @ 2008-08-20  4:01 UTC (permalink / raw)
  To: user42, 744; +Cc: bug-gnu-emacs


> I've been using the regexp below, which suppresses auto-fill on .IP
> and the like, but continues to auto-fill the comment directives (no
> change)
> 
>     .\"    traditional
>     .\#    groff extension

The real groff extension is that `\#' at the beginning of a line
completely removes it:

  This is a
  \# comment
  test.

    -> This is a test.

Auto-fill would be possible for .IP and friends too, provided you end
the line with `\'.

  .IP This is a long title \
  continued on the next line.


      Werner






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

* bug#744: marked as done (nroff-mode auto-fill-mode not on directives)
  2008-08-19 22:30 ` bug#744: nroff-mode auto-fill-mode not on directives Kevin Ryde
  2008-08-20  4:01   ` Werner LEMBERG
@ 2008-08-20 22:30   ` Emacs bug Tracking System
  1 sibling, 0 replies; 5+ messages in thread
From: Emacs bug Tracking System @ 2008-08-20 22:30 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 845 bytes --]


Your message dated Wed, 20 Aug 2008 18:25:01 -0400
with message-id <87r68jiate.fsf@cyd.mit.edu>
and subject line Re: nroff-mode auto-fill-mode not on directives
has caused the Emacs bug report #744,
regarding nroff-mode auto-fill-mode not on directives
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
744: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=744
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 4398 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 905 bytes --]

In nroff-mode it'd be good if auto-fill-mode didn't fill when you're
entering a long directive line like

    .IP some long line going past your normal fill width ...

Almost always *roff directives have to be a single line.  I struck the
problem with a groff .URL with a long url doubled-up to both display
literally and be clickable in -Thtml.

I've been using the regexp below, which suppresses auto-fill on .IP and
the like, but continues to auto-fill the comment directives (no change)

    .\"    traditional
    .\#    groff extension
    '''    another traditional, apparently

And of course non-directive lines ("." or "'") are still auto-filled
(either ordinary text, or comments starting \" and \#).


2008-08-18  Kevin Ryde  <user42@zip.com.au>

	* textmodes/nroff-mode.el (nroff-mode): Set auto-fill-inhibit-regexp
	so as not to auto-fill on directive lines, other than comment
	directives.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2.1.2: nroff-mode.el.auto-fill.diff --]
[-- Type: text/x-diff, Size: 974 bytes --]

*** nroff-mode.el	08 May 2008 11:29:50 +1000	1.40
--- nroff-mode.el	18 Aug 2008 20:29:55 +1000	
***************
*** 144,149 ****
--- 144,160 ----
         (concat "[.']\\|" paragraph-start))
    (set (make-local-variable 'paragraph-separate)
         (concat "[.']\\|" paragraph-separate))
+ 
+   ;; Don't auto-fill directive lines starting . or ' since they normally
+   ;; have to be one line.  But do auto-fill comments .\" .\# and '''
+   ;;
+   ;; Comment directives (those starting . or ') are [.'][ \t]*\\[#"] or a
+   ;; ''', and this regexp is everything except those.  So [.'] followed by
+   ;; not backslash and not ' or followed by backslash but then not # or "
+   ;;
+   (set (make-local-variable 'auto-fill-inhibit-regexp)
+        "[.'][ \t]*\\([^ \t\\']\\|\\\\[^#\"]\\)")
+ 
    ;; comment syntax added by mit-erl!gildea 18 Apr 86
    (set (make-local-variable 'comment-start) "\\\" ")
    (set (make-local-variable 'comment-start-skip) "\\\\[\"#][ \t]*")

[-- Attachment #2.1.3: Type: text/plain, Size: 110 bytes --]


-- 
The Copenhagen Interpretation elucidated for the layman:
  You can't be sure until you see for yourself.

[-- Attachment #3: Type: message/rfc822, Size: 1105 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: Kevin Ryde <user42@zip.com.au>
Cc: 744-done@emacsbugs.donarmstrong.com
Subject: Re: nroff-mode auto-fill-mode not on directives
Date: Wed, 20 Aug 2008 18:25:01 -0400
Message-ID: <87r68jiate.fsf@cyd.mit.edu>

> In nroff-mode it'd be good if auto-fill-mode didn't fill when you're
> entering a long directive line

Thanks.  I've checked your patch in.


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

* bug#744: nroff-mode auto-fill-mode not on directives
  2008-08-20  4:01   ` Werner LEMBERG
@ 2008-08-23  0:29     ` Kevin Ryde
  2008-08-23  5:00       ` Werner LEMBERG
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Ryde @ 2008-08-23  0:29 UTC (permalink / raw)
  To: Werner LEMBERG; +Cc: bug-gnu-emacs

Werner LEMBERG <wl@gnu.org> writes:
>
> The real groff extension is that `\#' at the beginning of a line
> completely removes it:

Ah yes, so I guess .\# ends up as another flavour of empty directive.

>   .IP This is a long title \
>   continued on the next line.

I guess you'd definitely want that for very long lines.  Might be a bit
scary doing it all the time though :-).  makefile-mode has a
backslashing fill-paragraph for long variables lines, maybe something
similar could be worked in for a fill of a long directive line ...







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

* bug#744: nroff-mode auto-fill-mode not on directives
  2008-08-23  0:29     ` Kevin Ryde
@ 2008-08-23  5:00       ` Werner LEMBERG
  0 siblings, 0 replies; 5+ messages in thread
From: Werner LEMBERG @ 2008-08-23  5:00 UTC (permalink / raw)
  To: user42; +Cc: bug-gnu-emacs


> > The real groff extension is that `\#' at the beginning of a line
> > completely removes it:
> 
> Ah yes, so I guess .\# ends up as another flavour of empty
> directive.

Yep.  No guessing necessary :-)

> >   .IP This is a long title \
> >   continued on the next line.
> 
> I guess you'd definitely want that for very long lines.  Might be a bit
> scary doing it all the time though :-).

Scary?  Why do you think so?

> makefile-mode has a backslashing fill-paragraph for long variables
> lines, maybe something similar could be worked in for a fill of a
> long directive line ...

If you can implement this, please do.  BTW, to check whether
nroff-mode properly supports groff, you might have a look at, say,
`an-old.tmac'.


    Werner







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

end of thread, other threads:[~2008-08-23  5:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87r68jiate.fsf@cyd.mit.edu>
2008-08-19 22:30 ` bug#744: nroff-mode auto-fill-mode not on directives Kevin Ryde
2008-08-20  4:01   ` Werner LEMBERG
2008-08-23  0:29     ` Kevin Ryde
2008-08-23  5:00       ` Werner LEMBERG
2008-08-20 22:30   ` bug#744: marked as done (nroff-mode auto-fill-mode not on directives) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).