TIP: Click on subject to list as thread! ANSI
echo: qedit
to: ALL
from: ERIC STORK
date: 1997-06-26 07:51:00
subject: Re: Macro tidbit

From: Eric Stork 
At 03:43 PM 6/25/97 -0400, Jim Sewall offered a solution for:
>  If you have
>ever accidentally WrapPara'd your C program then this is for you.  Many
>times my fingers do what they want and hit wrong keys and I really hate
>paragraph-wrapped programs! 
>
Jim's solution looks good as far as it goes -- but one can have this problem
with _any_ file, not just with ".c", ".cpp", ".s", ".si", ".ui" files.  For
that reason, since QEDIT days. I've used the following pair of macros:  The
first saves my file _before_ wrapping a paragraph, and the second lets me
restore that file as it was just prior to an undesired wrap.  The key
assignments are the one's I use; change to suit you.
/
/
proc mReformPara()   // mapped to @Grey*
      SaveFile()
      WrapPara()
      ScrollToRow(Query(WindowRows)/2) // MakeCtrOfScreen
end mReformPara_Plain
/
/
proc mRestoreFile()   // mapped to @[
      BegFile()
      MarkLine()
      EndFile()
      MarkLine()
      DelBlock()
      InsertFile(CurrFilename())
      UnMarkBlock()
end mRestoreFile
/
/
The below is Jim's approach, for reference:
>proc mWrapPara()
>  string ext[25]
>
>  ext=CurrExt()
>  case (Lower(ext))
>    when ".c", ".cpp", ".s", ".si", ".ui"
>      return()
>    endcase
>
>  WrapPara()
>end
>
> mWrapPara()
>
Eric
----------
Eric Stork
e-mail address: estork@erols.com
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.