[sac-dev] [patch] Use a pager to show the help files

Brian Savage savage at uri.edu
Sun Sep 14 10:00:15 PDT 2008


Kuang He,


ANSI C it is. Unless someone else has any objections.

To add in a check for "less" and or "more" see:
Autoconf: Generic Program Checks
http://www.gnu.org/software/autoconf/manual/autoconf-2.57/ 
html_chapter/autoconf_5.html#SEC41
Either one of these should work. You can give a list of programs to  
check for in the order you would like
Macro: AC_CHECK_PROGS (variable, progs-to-check-for, [value-if-not- 
found], [path])
Macro: AC_PATH_PROGS (variable, progs-to-check-for, [value-if-not- 
found], [path])
This should go into the configure.in file, then the bootstrap needs  
to be re-run.

Isolating the original pager code inside src/sac/wrhelp.c is probably  
the best place for it.

Cheers
Brian

On Sep 14, 2008, at 12:32 PM, Kuang He wrote:

> Dear Brian,
>
> On Sun, Sep 14, 2008 at 12:04 PM, Brian Savage <savage at uri.edu> wrote:
>> Kuang He
>>
>> Looking over the patches I have a couple of suggestions/comments.
>>
>> Could we use ANSI C syntax rather than K&R for function  
>> declarations.  This
>> would allow for the easy creation of header files by copying and  
>> it is a
>> current/standard notation.
>
> Sure, I actually prefer ANSI C syntax myself. I used K&R style
> function declarations just to conform to the existing code base. I'll
> use ANSI C style from now on.
>
>> Pager use: We need to check the system for the less command on  
>> compilation.
>>  In fact we could check for less, then more, then fallback to the  
>> original
>> code in sac.
>
> This is a good idea, but I'm not sure how to do it, so could you help
> me with this?
>
>> A change like this might allow for syntax highlighting in the help  
>> files.
>
> Exactly, and we get to search within help files.
>
>> This would mean the current paging code needs to be made into a
>> seperate function.  The pager value could always be checked for to  
>> override
>> the default.
>
> I can try isolating the current paging code to a separate function.
> Where do you think I should put it, in src/ucf/wrhelp.c?
>
>
> Best regards,
>
> -- 
> Kuang He
> Department of Physics
> University of Connecticut
> Storrs, CT 06269-3046
>
> Tel: +1.860.486.4919
> Web: http://www.phys.uconn.edu/~he/
> _______________________________________________
> sac-dev mailing list
> sac-dev at iris.washington.edu
> http://www.iris.washington.edu/mailman/listinfo/sac-dev



More information about the sac-dev mailing list