emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NT] Problem with `man' function


From: David Abrahams
Subject: Re: [NT] Problem with `man' function
Date: Thu, 11 May 2006 07:44:22 -0400
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (windows-nt)

David Abrahams <address@hidden> writes:

>> But if you do manage to run Awk without an error message, just add a
>> `message' line that displays its output after it returns.
>
> Okay.

Problem(s) diagnosed:

1. awk.exe is just a cygwin symlink for me, and since I'm not running
   emacs under cygwin... boom!

2. quoting for awk needs to use double quotes, not single quotes for
   some reason

3. CMD doesn't cope, no way, no how, with newlines in the command line
   (at least, not in any way I've found)

Recipe for a fix in my environment, in Man-filter-list:

a. replace "awk" with "gawk"
b. remove all newlines from the gawk arguments
c. backslash-escape existing double quotes in the gawk arguments
d. replace single quotes in the gawk arguments with double quotes


(setq Man-filter-list (quote (("sed" "" "-e '/^[-][-]*$/d'" "-e 
'/[789]/s///g'" "-e '/Reformatting page.  Wait/d'" "-e '/Reformatting entry.  
Wait/d'" "-e '/^[    ]*Hewlett-Packard[      ]Company[       ]*-[    ][0-9]*[   
     ]-/d'" "-e '/^[         ]*Hewlett-Packard[      ]*-[    ][0-9]*[        
]-.*$/d'" "-e '/^[      ][      ]*-[    ][0-9]*[        ]-[     
]*Formatted:.*[0-9]$/d'" "-e '/^[       ]*Page[         ][0-9]*.*(printed[      
][0-9\\/]*)$/d'" "-e '/^Printed[        ][0-9].*[0-9]$/d'" "-e '/^[     ]*X[    
]Version[       ]1[01].*Release[        ][0-9]/d'" "-e '/^[A-Za-z].*Last[       
]change:/d'" "-e '/^Sun[        ]Release[       ][0-9].*[0-9]$/d'" "-e '/[      
]*Copyright [0-9]* UNIX System Laboratories, Inc.$/d'" "-e '/^[         
]*Rev\\..*Page [0-9][0-9]*$/d'") ("gawk" "\"" "BEGIN { blankline=0; 
anonblank=0; }" "/^$/ { if (anonblank==0) next; }" "{ anonblank=1; }" "/^$/ { 
blankline++; next; }" "{ if (blankline>0) { print \\\"\\\"; blankline=0; } 
print $0; }" "\"")))

Regards,

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]