[net.emacs] slight bug in nroff-mode

nz@wucs.UUCP (05/19/86)

	I just got in the newest version of GNU Emacs, 17.64, and
was using it to edit a manual page.  Lo and behold, the
electric-nroff-mode minor mode did not work the same way it did when
I originally wrote it and posted it to the net, way back around 
version 16.60.

	The main problem is with nroff request-pair matching.  
When you type
		.DS<LF>
you should
get
		.DS
		_
		.DE
but you 
instead get
		.DS
		.DE
		_
which does not
do you much good.
Apply the following diff to gemacs/lisp/nroff-mode.el and recompile it.
Hope this is helpful.
-----------
*** nroff-mode.el	Mon May 19 14:51:55 1986
--- new-nroff-mode.el	Mon May 19 14:54:05 1986
***************
*** 107,112
      (".(f" . ".)f")
      (".DS" . ".DE")
      (".KS" . ".KE")
      (".de" . "..")))
  
  (defun electric-nroff-newline (arg)

--- 107,116 -----
      (".(f" . ".)f")
      (".DS" . ".DE")
      (".KS" . ".KE")
+     (".KF" . ".KE")
+     (".RS" . ".RE")
+     (".TS" . ".TE")
+     (".EQ" . ".EN")
      (".de" . "..")))
  
  
***************
*** 109,114
      (".KS" . ".KE")
      (".de" . "..")))
  
  (defun electric-nroff-newline (arg)
    "Insert newline for nroff mode; special if electric-nroff mode.
  In electric-nroff-mode, if ending a line containing an nroff opening request,

--- 113,119 -----
      (".EQ" . ".EN")
      (".de" . "..")))
  
+ 
  (defun electric-nroff-newline (arg)
    "Insert newline for nroff mode; special if electric-nroff mode.
  In electric-nroff-mode, if ending a line containing an nroff opening request,
***************
*** 124,130
  				       nroff-brace-table))))))
      (if (null completion)
  	(newline (prefix-numeric-value arg))
!       (insert "\n" completion "\n"))))
  
  (defun electric-nroff-mode (arg)
    "Toggle nroff-electric-newline minor mode

--- 129,142 -----
  				       nroff-brace-table))))))
      (if (null completion)
  	(newline (prefix-numeric-value arg))
!       (let ((inside-pair-point (+ 1 (dot))))
! 	(insert "\n\n" completion "\n")
! 	(goto-char inside-pair-point)
!       )
!     )
!   )
! )
! 
  
  (defun electric-nroff-mode (arg)
    "Toggle nroff-electric-newline minor mode

-- 
...nz (Neal Ziring at WU ECL  -  we're here to provide superior computing.)

	{seismo,ihnp4,cbosgd}!wucs!nz   OR   nz@wucs.UUCP

    "You could get an infinite number of wires into this !*$$#!?! junction 
                         box, but we usually don't go that far in practice"
				--   Employee of London Electricity Board, 1959

quiroz@rochester.UUCP (05/22/86)

Expires:

Sender:

Followup-To:



     While at that, you can also add the .PS-.PE macros (from pic(1)) and
whatever ideal(1) uses too.  After applying nz@wucs's patch, you can
just do a |patch -d <your GNU emacs dist directory>/lisp on this
message.  (And recompile, of course.

*** nroff-mode.el.~3~	Thu May 22 16:30:36 1986
--- nroff-mode.el	Thu May 22 16:32:19 1986
***************
*** 111,116
      (".RS" . ".RE")
      (".TS" . ".TE")
      (".EQ" . ".EN")
      (".de" . "..")))
  
  

--- 111,117 -----
      (".RS" . ".RE")
      (".TS" . ".TE")
      (".EQ" . ".EN")
+     (".PS" . ".PE")
      (".de" . "..")))
  
  

Enjoy,
Cesar
-- 
Cesar Augusto  Quiroz Gonzalez
Department of Computer Science     {allegra|seismo}!rochester!quiroz
University of Rochester            or
Rochester,  NY 14627               quiroz@ROCHESTER