Printing in Windows
I'm using vim 7.0.076 on Windows and I'm trying to print the current buffer. Doing a ':ha' doesn't work because it is trying to copy the file to LPT1: C:\WINDOWS\system32\cmd.exe /c copy C:\WINDOWS\TEMP\VIp1C.tmp LPT1: C:\WINDOWS\TEMP\VIo1D.tmp 21 which on my system doesn't work because I use a networked printer. According to ':help ha' a dialog is supposed to be displayed to allow selection of printer, paper size, etc. Unfortunately this isn't happening, is there something I'm missing? Chris -- Chris Sutcliffe http://ir0nh34d.googlepages.com http://ir0nh34d.blogspot.com http://emergedesktop.org
Re: Printing in Windows
On Wednesday 30 August 2006 07:09, you wrote: I'm using vim 7.0.076 on Windows and I'm trying to print the current buffer. Doing a ':ha' doesn't work because it is trying to copy the file to LPT1: C:\WINDOWS\system32\cmd.exe /c copy C:\WINDOWS\TEMP\VIp1C.tmp LPT1: C:\WINDOWS\TEMP\VIo1D.tmp 21 which on my system doesn't work because I use a networked printer. According to ':help ha' a dialog is supposed to be displayed to allow selection of printer, paper size, etc. Unfortunately this isn't happening, is there something I'm missing? Chris Go to your printer and fax settings. Right-click on the printer and select properties. Click the Ports tab. Click on LPT1 and save your settings. Now it should work just fine. Noel -- Noel Henson www.noels-lab.com Chips, firmware and embedded systems www.vimoutliner.org Work fast. Think well.
Re: Printing in Windows
According to ':help ha' a dialog is supposed to be displayed to allow selection of printer, paper size, etc. Unfortunately this isn't happening, is there something I'm missing? Go to your printer and fax settings. Right-click on the printer and select properties. Click the Ports tab. Click on LPT1 and save your settings. Now it should work just fine. It will work. The problem is I have mulitple network printers and depending on where I am I will have to set the LPT1 port each time. I'm just curious since the help states that the print dialog should be displayed why it is not. Thanx! Chris -- Chris Sutcliffe http://ir0nh34d.googlepages.com http://ir0nh34d.blogspot.com http://emergedesktop.org
Re: Printing in Windows
It will work. The problem is I have mulitple network printers and depending on where I am I will have to set the LPT1 port each time. I'm just curious since the help states that the print dialog should be displayed why it is not. You are correct...or your expectations are. :) It does work as advertised here on my local Windows box...a dialog comes up prompting me to choose my printer, just as it does in about every other windows app. Though you didn't specify whether you're using vim or gvim, I don't know if using non-gvim would exhibit odd behaviors like you describe. Additionally, are you using the default build, or perhaps something like a cygwin build? Don't know if that has anything to do with it. Additionally helpful information would include the results of :set pdev? popt? pexpr? pfn? pheader? (okay...the last two aren't likely helpful, but one never knows) Just a few ideas to help folks track down the root of the problem. -tim
Re: Printing in Windows
Though you didn't specify whether you're using vim or gvim, I don't know if using non-gvim would exhibit odd behaviors like you describe. Additionally, are you using the default build, or perhaps something like a cygwin build? Don't know if that has anything to do with it. I'm using gvim compiled from source with MinGW. I've tried using 'Print' from the 'File' menu as well as ':ha' and they both behave the same. FWIW, ':browse w' and ':browse e' work fine. Additionally helpful information would include the results of :set pdev? printdevice= popt? printoptions= pexpr? printexpr=system('copy' . ' ' . v:fname_in . (printdevice == '' ? 'LPT1:' : (' ' . printdevice . ''))) . delete(v:fname_in) pfn? printfont=Courier_New:h10 pheader? printheader=%%f%h%m%=Page %N Thanx! Chris -- Chris Sutcliffe http://ir0nh34d.googlepages.com http://ir0nh34d.blogspot.com http://emergedesktop.org
Re: Printing in Windows
I'm using gvim compiled from source with MinGW. I've tried using 'Print' from the 'File' menu as well as ':ha' and they both behave the same. Under the covers, they should be the same thing, so I'm not surprised you get the same behavior. :) pexpr? printexpr=system('copy' . ' ' . v:fname_in . (printdevice == '' ? 'LPT1:' : (' ' . printdevice . ''))) . delete(v:fname_in) What happens if you reset this option: :set pexpr= and set it to nothing? Additionally, the Compilation section of the output from :version might give further hints. Particularly information about being linked to comdlg32.lib, comctl32.lib, gdi32.lib, shell32.lib, and winspool.lib (though others might be helpful). Just a few more ideas... -tim
Re: Printing in Windows
:set pexpr= I get E15: Invalid expression errors. Additionally, the Compilation section of the output from :version might give further hints. Particularly information about being linked to comdlg32.lib, comctl32.lib, gdi32.lib, shell32.lib, and winspool.lib (though others might be helpful). kernel32, user32, gdi32, advapi32, comdlg32, comctl32, version, wsock32, oleaut32, stdc++, ole32 and uuid. Interestingly enough, winspool is missing, not sure if that's an issue or not. Just as a last-ditch effort, you might try one of the following: :set pexpr :set pexprvi :set pexprvim (see :help :set-default if you've not seen this syntax before...it's not in my active vocabulary, so I had to look it up) and see if it becomes anything other than what it was previously. I suspect that for some reason this isn't a 100% windows build. It may be as simple as a missing build/configure option. Strangely, I get an error about pexpr not being available in my default win32 build (I don't have +postscript built in). Maybe having +postscript precludes the use of the Win32 common print dialog? I'm not one of the masochists who try that little building stunt, so perhaps some of the folks more well-versed in building Vim can point you at what distinguishes a mingw build (or whatever options you may have used) from the official win32 build available for packaged distribution. yet more fuel for your fire... -tim
Re: Printing in Windows
Solved!!! Strangely, I get an error about pexpr not being available in my default win32 build (I don't have +postscript built in). Maybe having +postscript precludes the use of the Win32 common print dialog? That is indeed the issue. I disabled postscript and now the print dialog displays when I do a ':ha'. I'm not sure if this is by design or if this is a bug, anyone? Thanx! Chris -- Chris Sutcliffe http://ir0nh34d.googlepages.com http://ir0nh34d.blogspot.com http://emergedesktop.org
Re: Printing in Windows
Chris Sutcliffe wrote: Solved!!! Strangely, I get an error about pexpr not being available in my default win32 build (I don't have +postscript built in). Maybe having +postscript precludes the use of the Win32 common print dialog? That is indeed the issue. I disabled postscript and now the print dialog displays when I do a ':ha'. I'm not sure if this is by design or if this is a bug, anyone? Thanx! Chris I think it is by design: 8 *pexpr-option* 'printexpr' 'pexpr' String (default: see below) global Expression that is evaluated to print the PostScript produced with |:hardcopy|. 8 IMHO the :help :hardcopy section should make it more explicit: On MS-Windows, *unless +postscript has been compiled-in, which is usually not the case,* a dialog is displayed (etc.) On other systems, PostScript is written (etc.) and, if 'printexpr' is indeed not present on -postscript systems, :help 'printexpr' should IMHO include {only available when compiled with the |+postscript| feature} Of course, as mentioned at the top of that helpfile (print.txt), nothing that relates to printing is available without +printer compiled-in. Best regards, Tony.