Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!imagen!atari!portal!cup.portal.com!DMasterson From: DMasterson@cup.portal.com Newsgroups: comp.sources.d Subject: Re: less v97 edit +linenumber Message-ID: <9755@cup.portal.com> Date: 5 Oct 88 06:38:17 GMT References: <159@libove.UUCP> Organization: The Portal System (TM) Lines: 28 XPortal-User-Id: 1.1001.2888 >Less v73 would only give to +linenumber argument to the editor if the >editor was vi or ex, but v97 gives it anyway, and in the case of (the >admittedly brain damaged) microemacs (v3.9e) the command "emacs +l f" >edits two files, +l and f, and only starts the display screen with +l >open. > >Does anyone have a fix for this? (or know what file I should hack >through?) Thanks- > The simple fix is to build a shell script front end to emacs that converts the '+1' argument into a '-g1' argument and then execs the real emacs. It slows it down a little, but not that much. Benefit is that you get less interfaced to emacs just like it would be to vi. The long fix is to check the linenumber code within less and convert the sprintf function that builds the command that less will execute to start up the editor (grep for 'system(' in the .c files). Have it check the name of the editor and construct the system() string appropriately. Alternatively, you could modify the main() routine in microemacs to accept a '+' argument as well as '-' arguments. Not exactly straightforward, but not too hard. Recommend going with the first idea, even if you have to right a small program to do it. It's probably the quickest. David Masterson DMasterson@cup.portal.com