all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* nroff-mode don't auto-fill directives
@ 2007-10-12  0:58 Kevin Ryde
  2007-10-12 15:59 ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Ryde @ 2007-10-12  0:58 UTC (permalink / raw)
  To: emacs-devel

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

This is my idea for not auto-filling nroff directive lines.  I struck it
on a long .URL line (a groff extension).  I think comment lines like .\"
should still auto-fill, as the do now, though they don't actually come
out quite right yet (neither before nor after this change).

2007-10-12  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: 913 bytes --]

*** nroff-mode.el	14 Sep 2007 10:50:21 +1000	1.35
--- nroff-mode.el	12 Oct 2007 10:51:35 +1000	
***************
*** 127,132 ****
--- 127,141 ----
         (concat "[.']\\|" paragraph-start))
    (set (make-local-variable 'paragraph-separate)
         (concat "[.']\\|" paragraph-separate))
+ 
+   ;; Don't auto-fill directives, since they normally have to be one line,
+   ;; but do auto-fill comments .\" .\# and '''
+   ;; Comment directive pattern would be [.'][ \t]*[\\][#"], and this regexp
+   ;; is everything other than that, so not a backslash (and not a '' as in
+   ;; '''), or a 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: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: nroff-mode don't auto-fill directives
  2007-10-12  0:58 nroff-mode don't auto-fill directives Kevin Ryde
@ 2007-10-12 15:59 ` Richard Stallman
  2007-10-12 21:52   ` Kevin Ryde
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2007-10-12 15:59 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: emacs-devel

    I think comment lines like .\"
    should still auto-fill, as the do now, though they don't actually come
    out quite right yet (neither before nor after this change).

It is ok for them to auto-fill if they do so in a way that
marks all the lines as comments.  Does it do that?

Otherwise it is better if they don't auto-fill at all.
At least that way they will remain comments.

Can you make that work right, one way or the other?

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

* Re: nroff-mode don't auto-fill directives
  2007-10-12 15:59 ` Richard Stallman
@ 2007-10-12 21:52   ` Kevin Ryde
  2007-10-13  6:41     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Ryde @ 2007-10-12 21:52 UTC (permalink / raw)
  To: emacs-devel

Richard Stallman <rms@gnu.org> writes:
>
> It is ok for them to auto-fill if they do so in a way that
> marks all the lines as comments.  Does it do that?

Yes.  But it's not as pretty as it could be.  You get say

.\" this is a comment
. \" and this is auto
. \" filled subsequent
. \" comment lines

Nroff is happy with the extra space after the dot, even if you mightn't
want your source looking that way.  Like I say, this is so now with or
without what I propose for non-comment directives.

> Can you make that work right, one way or the other?

I went a few rounds wrestling with comments filling, without yet getting
to how I think it should work.

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

* Re: nroff-mode don't auto-fill directives
  2007-10-12 21:52   ` Kevin Ryde
@ 2007-10-13  6:41     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2007-10-13  6:41 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: emacs-devel

    Yes.  But it's not as pretty as it could be.  You get say

    .\" this is a comment
    . \" and this is auto
    . \" filled subsequent
    . \" comment lines

At least it isn't incorrect.
I was worried that it would produce incorrect input.

So don't worry about it (unless you want to).

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

end of thread, other threads:[~2007-10-13  6:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-12  0:58 nroff-mode don't auto-fill directives Kevin Ryde
2007-10-12 15:59 ` Richard Stallman
2007-10-12 21:52   ` Kevin Ryde
2007-10-13  6:41     ` Richard Stallman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.