[comp.sources.d] Patch to less97 to solve my uEmacs +ln problem

root@libove.UUCP (Jay M. Libove) (10/10/88)

Here is my patch to less v97 to solve my microemacs linenumber problem.

The default (and only in fact, it is not configurable in the distribution)
way to tell your editor to start with the cursor on a line other than the
first one is to give it +linenumber, which is great for vi, but not for
much else. JPAT.0 contains code that will be compiled in _only_ if the
symbol "JMLmod" is defined at compile time, and which will look in the
environment for "LESSEDLIN" to contain the appropriate editor command
line argument. Thus, "setenv LESSEDLIN -g" will tell less to use -g# which
is the microemacs flag, else it defaults back to +#.

[ due to fascism in postnews, I had to indent this... chop out indents
  and enjoy, please... damn fascist software... ]

	30a31,33
	> #ifdef JMLmod
	> extern char *getenv();
	> #endif /* JMLmod */
	443a447,451
	> #ifdef JMLmod
	> # ifdef EDITOR
	> 	char *edtolinflag;
	> # endif /* EDITOR */
	> #endif /* JMLmod */
	735a744
	> #ifndef JMLmod
	737a747,761
	> #else /* JMLmod */
	> 				{
	> 				edtolinflag=getenv("LESSEDLIN");
	> 				if (edtolinflag==(char *)NULL)
	> 					{
	> 					sprintf(cmdbuf, "%s +%d %s",
	> 						editor, c, current_file);
	> 					}
	> 				else
	> 					{
	> 					sprintf(cmdbuf, "%s %s%d %s", editor,
	> 					 edtolinflag, c, current_file);
	> 					};
	> 				};
	> #endif /* JMLmod */

-- 
Jay Libove		ARPA:	jl42@andrew.cmu.edu or libove@cs.cmu.edu
5731 Centre Ave, Apt 3	BITnet:	jl42@andrew or jl42@drycas
Pittsburgh, PA 15206	UUCP:	uunet!nfsun!libove!libove or
(412) 362-8983		UUCP:	psuvax1!pitt!darth!libove!libove