Re: UTF-8 Hardcopy in Windows, what works!

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: UTF-8 Hardcopy in Windows, what works!

Duke Winsor
[Response in thread.  I'm just posting it, not knowing the preferred

 >...and before. Windows 3.1 already had a version of Notepad, albeit not
 >necessarily a Unicode-enabled one.

I'll take your word for it.  I haven't had a running 3.1 for about 5 years.

>Try to modify your "start" command so that it is not detached from its calling
>process. Not sure how to do it but maybe "start /?" could tell you. Come back
>if it doesn't work.

Windows once had documentation embedded in the commands (like Linux).  That no longer appears to be the case.  What I could find was here: start
The /wait and /b options look possible.  Unfortunately, both are rejected in Windows 2000.

>>2. Tell me how to suppress the printing of the message, preferably
>>temporarily, since it seems superfluous.

>see ":help :silent" maybe?

BINGO!  That does it.  I now have a script that prints without error messages:

command Ha silent! call system('start /min notepad /p "' . bufname('%') . '"')

>2>&1 is a redirection too: in Unix-like shells, it means to redirect stderr
>(handle 2) to wherever stdout (handle 1) is going. (You see there the parency
>between Dos 2.0 and higher, and Unix: in both, file descriptors 0-2 are stdin,
>stdout and stderr in that order. Or maybe it traces back via Dos 1.0 and CP/M,
>I'm not sure.)

>If stdout is later redirected, stderr does not follow it, so to redirect both
>you would use "program > filename.log 2>&1". This is exactly what happens in
>your case, albeit with a more complicated output filename.

I have now tried the command string with  ">file.txt 2>&1" included, and the command window executes it without complaint.  The result is a file of zero length.  It is possible that Vim gets unhappy when it tries to open the output file, because it gets an immediate end-of-file.  

>see above, and also the various shell-something options
> :set wildmenu
> :help 'shell<Tab>    or
> :help 'shell<Ctrl-D>
>where each <> notation means one keystroke.
>Checking those lets me believe that you have 'shellredir' set to ">%s 2>&1"; I
>don't know whether cmd.exe recognises it.

Indeed, :help 'shell<Tab> produces a list of items, one of which is 'shellredir', so I can presumably change that if I wish (or need) to.

>Are you sure you aren't using a Unix-like Vim (such as Vim for Cygwin) with a
>Dos-like shell (such as cmd.exe)? Check
> :echo has("unix")

I am using whatever comes with "cream."  I first found it on April 26.  The result of ":echo has("unix")" is 0.

>Best regards,

Thanks VERY much!  I really appreciate the quality and depth of your reply!


While the ink was still drying on the United States Constitution in 1787, Benjamin Franklin observed: "Only a moral and virtuous people are capable of freedom; the more corrupt and vicious a society becomes, the more it has need of masters."
-- Pat Boone 5/5/2007