Discussion:
Vim command doesn't work in Windows 7
(too old to reply)
Stan Brown
2018-04-14 14:30:15 UTC
Permalink
Raw Message
I've just posted an article "':ha' not working in Vim 7.2" in
comp.editors. The gist is that the :ha command works on my Windows
8.1 work computer but not my Windows 7 home computer.

I didn't crosspost it, because I figured most people here don't know
Vim and wouldn't want to read that discussion here. Also I doubt very
much that the problem is in Windows 7 itself. But if you _do_ know
Vim, please take a look at that article, and it would be very nice if
you could provide a solution there. Thanks!
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://BrownMath.com/
http://OakRoadSystems.com/
Shikata ga nai...
Paul
2018-04-15 00:55:34 UTC
Permalink
Raw Message
Post by Stan Brown
I've just posted an article "':ha' not working in Vim 7.2" in
comp.editors. The gist is that the :ha command works on my Windows
8.1 work computer but not my Windows 7 home computer.
I didn't crosspost it, because I figured most people here don't know
Vim and wouldn't want to read that discussion here. Also I doubt very
much that the problem is in Windows 7 itself. But if you _do_ know
Vim, please take a look at that article, and it would be very nice if
you could provide a solution there. Thanks!
https://bioinformatics.uconn.edu/vim-guide/

:ha # prints entire file

So that's not really an internal command. That's something which
attempt to call a printing hook on the host OS. Which isn't
going to work, if the OS happens to change the hook. Then
the author of the code plays whack-a-mole, adding #ifelse
for 6.1, 6.2, 6.3, 10.0 and so on.

Find the source for the version you're using, and have a look.

http://vimdoc.sourceforge.net/htmldoc/print.html

:ha On MS-Windows a dialog is displayed to
allow selection of printer, paper size etc.

:ha >filename On MS-Windows use the "print to file"
feature of the printer driver.

*******

OK, I'll take a long-shot on this, and tell you to use
the Compatibility interface to an EXE and change the
runtime compatibility to some older OS. There's an example
of the dialog around 40% of the way down this page.

https://www.howtogeek.com/228689/how-to-make-old-programs-work-on-windows-10/

Paul
Stan Brown
2018-04-17 00:21:37 UTC
Permalink
Raw Message
Post by Paul
OK, I'll take a long-shot on this, and tell you to use
the Compatibility interface to an EXE and change the
runtime compatibility to some older OS. There's an example
of the dialog around 40% of the way down this page.
Thanks for replying, Paul. It _was_ a long shot. I said to myself,
"self, if the program works okay in Windows 8 why would it need a
compatibility setting for Windows 7? But Paul's smart guy, so it's
worth trying."

Unfortunately, when I set the program to be compatible with Vista (XP
wasn't available), exactly the same thing happened as before. Thanks
anyway, for trying.
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://BrownMath.com/
http://OakRoadSystems.com/
Shikata ga nai...
Paul
2018-04-17 03:02:41 UTC
Permalink
Raw Message
Post by Stan Brown
Post by Paul
OK, I'll take a long-shot on this, and tell you to use
the Compatibility interface to an EXE and change the
runtime compatibility to some older OS. There's an example
of the dialog around 40% of the way down this page.
Thanks for replying, Paul. It _was_ a long shot. I said to myself,
"self, if the program works okay in Windows 8 why would it need a
compatibility setting for Windows 7? But Paul's smart guy, so it's
worth trying."
Unfortunately, when I set the program to be compatible with Vista (XP
wasn't available), exactly the same thing happened as before. Thanks
anyway, for trying.
If the source is available, you could work on it.

When the program makes a call, there's got to be
a returned status code somewhere that indicates
the program is not happy.

Paul
Paul
2018-04-17 06:35:40 UTC
Permalink
Raw Message
Post by Paul
Post by Stan Brown
Post by Paul
OK, I'll take a long-shot on this, and tell you to use
the Compatibility interface to an EXE and change the
runtime compatibility to some older OS. There's an example
of the dialog around 40% of the way down this page.
Thanks for replying, Paul. It _was_ a long shot. I said to myself,
"self, if the program works okay in Windows 8 why would it need a
compatibility setting for Windows 7? But Paul's smart guy, so it's
worth trying."
Unfortunately, when I set the program to be compatible with Vista (XP
wasn't available), exactly the same thing happened as before. Thanks
anyway, for trying.
If the source is available, you could work on it.
When the program makes a call, there's got to be
a returned status code somewhere that indicates
the program is not happy.
Paul
ftp://ftp.vim.org/pub/vim/pc/vim72src.zip
hardcopy.c ???

It seems to have the ability to deliver error messages.

EMSG(_("E673: Incompatible multi-byte encoding and character set."));

********** message.txt on FTP site **********

-- older versions --

8953966 gvim72.exe V7.2 complete self-installing package

7194365 vim72rt.zip V7.2 runtime files
1399386 vim72lang.zip V7.2 language files
980100 gvim72.zip V7.2 GUI bin for Windows 95/NT and later
1051406 gvim72ole.zip V7.2 GUI bin with OLE and VisVim
949997 gvim72_s.zip V7.2 GUI bin for Windows 3.1 with Win32s
879774 vim72w32.zip V7.2 bin Windows NT/XP console
969187 vim72d32.zip V7.2 bin 32 bit MS-DOS prot. mode
2460134 vim72src.zip V7.2 sources packed for MS-DOS

1844224 gvim72.pdb debugging info for gvim72ole.zip
3279872 gvim72ole.pdb debugging info for gvim72w32.zip
2780160 vim72w32.pdb debugging info for gvim72.zip

There is no 16 bit binary for Vim 7.2 and later
********** message.txt on FTP site **********

If you can't see the error messages while in gvim72,
maybe you could try the console version ?

If VIM doesn't throw an error message, that means the printing
subsystem gave an "OK" status to VIM, then the printing
or spooler portion of Windows burped. Check your print spooler
status, for evidence of burping.

Paul
VanguardLH
2018-04-15 07:49:34 UTC
Permalink
Raw Message
Post by Stan Brown
I've just posted an article "':ha' not working in Vim 7.2" in
comp.editors. The gist is that the :ha command works on my Windows
8.1 work computer but not my Windows 7 home computer.
I didn't crosspost it, because I figured most people here don't know
Vim and wouldn't want to read that discussion here. Also I doubt very
much that the problem is in Windows 7 itself. But if you _do_ know
Vim, please take a look at that article, and it would be very nice if
you could provide a solution there. Thanks!
http://vimdoc.sourceforge.net/htmldoc/print.html

Since ghostscript was mentioned, does the Windows VIM installer include
its own copy of ghostscript or it gets a download of it to include in
the install? If so, does the installer put that copy of ghostscript in
a private folder under the VIM install path or does is store ghostscript
in a global path usable by any program that wants to use ghostscript?
Stan Brown
2018-04-19 02:45:48 UTC
Permalink
Raw Message
Post by Paul
Post by Stan Brown
I've just posted an article "':ha' not working in Vim 7.2" in
comp.editors. The gist is that the :ha command works on my Windows
8.1 work computer but not my Windows 7 home computer.
I didn't crosspost it, because I figured most people here don't know
Vim and wouldn't want to read that discussion here. Also I doubt very
much that the problem is in Windows 7 itself. But if you _do_ know
Vim, please take a look at that article, and it would be very nice if
you could provide a solution there. Thanks!
http://vimdoc.sourceforge.net/htmldoc/print.html
Since ghostscript was mentioned, does the Windows VIM installer include
its own copy of ghostscript or it gets a download of it to include in
the install? If so, does the installer put that copy of ghostscript in
a private folder under the VIM install path or does is store ghostscript
in a global path usable by any program that wants to use ghostscript?
Thanks, but I don't think Ghostscript is an issue. The first
paragraph of the URL you gave says that Postscript applies to "other
systems' than MS Windows, and even on those systems Ghostscript is
needed only for "other printers" than Postscript ones.
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://BrownMath.com/
http://OakRoadSystems.com/
Shikata ga nai...
Paul
2018-04-17 11:16:48 UTC
Permalink
Raw Message
Post by Stan Brown
I've just posted an article "':ha' not working in Vim 7.2" in
comp.editors. The gist is that the :ha command works on my Windows
8.1 work computer but not my Windows 7 home computer.
I didn't crosspost it, because I figured most people here don't know
Vim and wouldn't want to read that discussion here. Also I doubt very
much that the problem is in Windows 7 itself. But if you _do_ know
Vim, please take a look at that article, and it would be very nice if
you could provide a solution there. Thanks!
You can apparently build the software with a "+postscript"
option, which causes the Windows print dialog to not appear.

(Likely a USENET post...)

http://vim.1045645.n5.nabble.com/Printing-in-Windows-td1153810.html

"Maybe having +postscript precludes the use of
the Win32 common printdialog?
"

*******

Otherwise, when I run on Win7 here, I see a ProcessIsolationHost running,
and a couple different "...spl" executables of some sort (as
seen in Procmon). I'll get more serious about a capture, once
I figure out a way to get the dialog to not prompt me to type
in a filename. I want to hit :ha and get a concentrated trace
right after that, with little "noise" to have to filter out.

https://blogs.technet.microsoft.com/askperf/2007/06/19/basic-printing-architecture/

Paul
Stan Brown
2018-04-19 03:02:37 UTC
Permalink
Raw Message
Post by Paul
You can apparently build the software with a "+postscript"
option, which causes the Windows print dialog to not appear.
(Likely a USENET post...)
http://vim.1045645.n5.nabble.com/Printing-in-Windows-td1153810.html
"Maybe having +postscript precludes the use of
the Win32 common printdialog?
Thank you, Paul! You solved the mystery.

I read further in the thread, and it seems that
'+postscript' in compile options is indeed the problem.

On the other hand:

The help file says that the way to change that (or other options) is
to recompile. I don't have the needed compiler, unfortunately. On my
work computer (where the dialog appears), the compile options include
'-postscript'.

On the gripping hand:

I truly thought I had the same version on both computers, but I was
wrong. Home computer has 7.2 as I said, but work computer has 7.4. At
a guess, a bug report was entered at some point against the Windows
build of 7.2, and it was fixed by the time 7.4 was compiled. So my
answer is to install 7.4 on the home computer, double-check the
compile options, and that should be that.
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://BrownMath.com/
http://OakRoadSystems.com/
Shikata ga nai...
Stan Brown
2018-04-21 18:47:02 UTC
Permalink
Raw Message
Post by Paul
Post by Stan Brown
I've just posted an article "':ha' not working in Vim 7.2" in
comp.editors. The gist is that the :ha command works on my Windows
8.1 work computer but not my Windows 7 home computer.
I didn't crosspost it, because I figured most people here don't know
Vim and wouldn't want to read that discussion here. Also I doubt very
much that the problem is in Windows 7 itself. But if you _do_ know
Vim, please take a look at that article, and it would be very nice if
you could provide a solution there. Thanks!
You can apparently build the software with a "+postscript"
option, which causes the Windows print dialog to not appear.
(Likely a USENET post...)
http://vim.1045645.n5.nabble.com/Printing-in-Windows-td1153810.html
"Maybe having +postscript precludes the use of
the Win32 common printdialog?
"
As I posted on the 17th, it looked like Paul has solved the mystery.
I can now confirm that. I installed a version of Vim with -postscript
instead of +postscript, and :ha now brings up the printer dialog, as
it's supposed to.

Thanks again, Paul!
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://BrownMath.com/
http://OakRoadSystems.com/
Shikata ga nai...
Loading...