Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

vimdev · Vim (Vi IMproved) text editor developers list

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 30211 - 30240 of 69738   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#30211 From: Bram Moolenaar <Bram@...>
Date: Fri Nov 1, 2002 2:11 pm
Subject: Re: configure and Makefile
Bram@...
Send Email Send Email
 
Zvi Har'El wrote:

> You wrote:
> > I have always wondered what is so special about configure that people
> > don't run it from the Makefile, like everything else.  The recommended
> > way for Vim is to uncomment a few lines in the Makefile and then run
> > "make".  No need to write a shell script to remember the configure
> > arguments.
>
> I believe that people are used to the fact that most packages are
> shipped with no Makefiles at all. If you look at the autoconf info
> file,
>
>    The configuration scripts that Autoconf produces are by convention
> called `configure'.  When run, `configure' creates several files,
> replacing configuration parameters in them with appropriate values.
> The files that `configure' creates are:
[...]

Yeah, I know how autocof is often used.  But I don't like it.  It
involves creating a bunch of template files, which are then transformed
into the actual Makefiles by configure.  Thus you have an extra file
format, the Makefile template.  And a lot of extra files when building
an application.

> Therefore, the standard procedure is to run
>
> ./configure
> make
> make install (as root)

You can still do that with Vim, if you want.  When you need arguments
for configure you must remember them for each time you run it.  Most
people write a shell script to do this, thus creating yet another file.

> I suppose from now on I'll have to use for Vim the commands
>
> vim +'g/with-features=big/s/^#//' +x -e src/Makefile
> make
> make install
>
> where the first one will uncomment the correct feature line, if it is still
> commented out,

This indeed isn't a nice solution.  The best would probably be to leave
the Makefile alone, and include a separate Makefile_arg that contains the
definitions that you want to use.  You can copy these from the Makefile.
When upgrading to a new version you still have your Makefile_arg.  You
only need to check if one of the arguments you use has changed (which
hardly ever happens).

This is similar to the way config files in /etc are used on FreeBSD.
One of the big advantages is that examples and explanations can be put
together.  I'm trying to use this scheme with A-A-P as well.

--
The war between Emacs and Vi is over.  Vi has won with 3 to 1.
			 http://www.ssc.com/lg/issue30/raymond.html

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30212 From: "Charles E. Campbell" <cec@...>
Date: Fri Nov 1, 2002 4:49 pm
Subject: Re: configure and Makefile
cec@...
Send Email Send Email
 
On Fri, Nov 01, 2002 at 03:11:25PM +0100, Bram Moolenaar wrote:
>...snip...
> This indeed isn't a nice solution.  The best would probably be to leave
> the Makefile alone, and include a separate Makefile_arg that contains the
> definitions that you want to use.
>...snip...
  ---------------------------------------------------------------------

How about a make/environment variable:  say, VIMCONFIG.  Then the <Makefile>
would have

     configure ${VIMCONFIG}

which will normally expand to nothing, but if set will allow
user-specified options to the configure.

export VIMCONFIG="--with-features=huge"
make

Regards,
Chip Campbell

--
         Charles E Campbell, Jr, PhD            _   __   __
         Goddard Space Flight Center           / /_/\_\_/ /
         cec@...      /_/  \/_//_/
   PGP public key: http://www.erols.com/astronaut/pgp.html

#30213 From: Bram Moolenaar <Bram@...>
Date: Fri Nov 1, 2002 8:00 pm
Subject: Latest runtime files available for download
Bram@...
Send Email Send Email
 
For those of you who wish to obtain the latest version of everything,
here is something you will like.

Now that A-A-P is reasonably stable, I'm starting to use it for what
it's been made for: distributing software.  I made a recipe to upload
all the latest runtime files to:

	 ftp://ftp.vim.org/pub/vim/runtime

There are about 700 files there.  Since you probably only want to
download those files that have been updated, an A-A-P recipe can be used
to get them.  This uses MD5 checksums to find out which file differs
from the version on the ftp site.

The instructions to use it are here:

	 http://www.vim.org/runtime.php

Since all this is relatively new I decided to let the developers have a
go at it first.  Let me know if there is a problem.  If it works well
I'll announce it generally.


In case you are interested, here is the recipe I'm using to upload the
files.  It's executed simply by running "aap" in my "runtime" directory.
Don't try running this yourself, you can't upload to the ftp server.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# A-A-P recipe for uploading the latest scripts and docs to ftp.vim.org.

FILES =
	 `glob("*.vim")`
	 procset.ps
	 `glob("doc/*.txt")`
	 doc/vim.1
	 doc/vimtutor.1
	 doc/tags
	 `glob("syntax/*.vim")`
	 syntax/README.txt
	 `glob("ftplugin/*.vim")`
	 `glob("compiler/*.vim")`
	 `glob("colors/*.vim")`
	 `glob("indent/*.vim")`
	 indent/README.txt
	 `glob("keymap/*.vim")`
	 keymap/README.txt
	 `glob("lang/*.vim")`
	 lang/README.txt
	 `glob("plugin/*.vim")`
	 plugin/README.txt
	 `glob("tutor/*.txt")`
	 `glob("tutor/*.vim")`
	 tutor/tutor
	 `glob("tutor/tutor.??")`
	 `glob("tutor/tutor.??.*[^~]")`

# Set the URL to use for uploading and use it to add a "publish"
# attribute to the files.
UPDIR = scp://bramm@ftp.vim.org/ftp/pub/vim/runtime
:attr {publish = $UPDIR/%file%} $FILES

# Set the URL where the files can be downloaded from later and add a
# "fetch" attribut to the files for ":mkdownload" below.
DOWNDIR = ftp://ftp.vim.org/pub/vim/runtime
:attr {fetch = $DOWNDIR/%file%} $FILES

# The default target does:
# 1. publish all the files (upload them to the Vim ftp site)
# 2. Generate a recipe with MD5 checksums to download them
# 3. publish the generated recipe
all: publish
	 :mkdownload download.aap {fetch = $DOWNDIR/main.aap} $FILES
	 :publish {publish = $UPDIR/main.aap} download.aap
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

--
ARTHUR: Charge!
    [They all charge with swords drawn towards the RABBIT.  A tremendous twenty
    second fight with Peckinpahish shots and borrowing heavily also on the
    Kung Fu and karate-type films ensues, in which some four KNIGHTS are
    comprehensively killed.]
ARTHUR: Run away!  Run away!
                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30214 From: Bram Moolenaar <Bram@...>
Date: Fri Nov 1, 2002 10:19 pm
Subject: Re: user_fullname()
Bram@...
Send Email Send Email
 
Nikolai Weibull wrote:

> finally, here it is, the function we've all had wet dreams about!
> the function to put an end to all other functions!
> for only $9.95 it can be yours!
>
> seriously, i got around to writing some code for the function
> 'user_fullname()' which may actually be rather useful in quite a few
> scripts. most notably it goes perfect with the ftplugin/changelog.vim
> file that i maintain. a patch to src/eval.c and to runtime/doc/eval.txt
> is included.

Hmm, I wonder how useful this is.  It only works on Unix (and not all
kinds of it).  Could use a shell command on these systems.

If it's really to be included, it requires a few #ifdefs.  For example,
see the use of getpwuid() in os_unix.c.

> P.S.
> i also fixed some bugs in runtime/doc/eval.txt. (see the patch for what
> was fixed.)

I'll include these right away.

--
"When I die, I want a tombstone that says "GAME OVER" - Ton Richters

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30215 From: Bram Moolenaar <Bram@...>
Date: Fri Nov 1, 2002 10:19 pm
Subject: Re: configure and Makefile
Bram@...
Send Email Send Email
 
Charles Campbell wrote:

> On Fri, Nov 01, 2002 at 03:11:25PM +0100, Bram Moolenaar wrote:
> >...snip...
> > This indeed isn't a nice solution.  The best would probably be to leave
> > the Makefile alone, and include a separate Makefile_arg that contains the
> > definitions that you want to use.
> >...snip...
>  ---------------------------------------------------------------------
>
> How about a make/environment variable:  say, VIMCONFIG.  Then the <Makefile>
> would have
>
>     configure ${VIMCONFIG}
>
> which will normally expand to nothing, but if set will allow
> user-specified options to the configure.
>
> export VIMCONFIG="--with-features=huge"
> make

Hmm, then you would need to set VIMCONFIG in your ~/.shrc file, which is
not really related to building Vim.  Typing it doesn't make sense, you
might as well run configure right away then.

--
Lose weight, NEVER Diet again with
                   The "Invisible Weight Loss Patch"
						 (spam e-mail)

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30216 From: Bram Moolenaar <Bram@...>
Date: Fri Nov 1, 2002 10:19 pm
Subject: Re: Make Vim run as a MDI Child window in Micosoft Visual Studio.
Bram@...
Send Email Send Email
 
Zibo Zhao wrote:

> I'm a newbie for the VIM dev group.
> I just did a little patch on the VIM 6.1 srouce code to make it run as
> a MDI child window instead of a pop up window.
> There are 2 ways to do that:
> 1. I added a command line option -P to run the VIM as a MDI Child of
> MSDev. This way you can just install VIM as a customized tool to run
> it.
> 2. Use VisVim.dll. This one will go through the OLE interface to
> enable the MDI Child creation for the MSDev. This one is more
> convenient, I think.
>
> Hope this is helpful.
>
> One of the drawback is that the menu is gone, I could not figure out
> how to get it out.  But you can use command :te <menu name> to show
> the menu as separate window.
>
> Debugging with VIM is not working now. Sorry.
>
> The attached is the patch based on VIM 6.1 source.

Several people have been asking for this.  Looks like a nice solution.
Perhaps some people can try it out and tell us for what version(s) of
devstudio this works.

--
    [Another hideous roar.]
BEDEVERE: That's it!
ARTHUR:   What?
BEDEVERE: It's The Legendary Black Beast of Aaaaarrrrrrggghhh!
                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30217 From: David Bustos <david@...>
Date: Sat Nov 2, 2002 9:10 am
Subject: bufhidden in explorer buffers
david@...
Send Email Send Email
 
I'd like to keep my explorer buffers in the buffer list.  I.e., I want
them to have bufhidden set to something other than delete.  I tried
doing this by adding a BufEnter autocommand to the fileExplorer group in
my .vimrc, but vim complained

   E216: No such event: fileExplorer BufEnter ...

I realized that .vimrc is being executed before the explorer plugin, so
(a) the fileExplorer group doesn't exist yet, so while vim can
legitimately complain, I think it's complaining about the wrong thing,
and (b) when explorer.vim is executed, it clears out all of the
autocommands in the fileExplorer group.

So, what's the best way to do this?  Does explorer.vim needs a new
option, or is there something I'm missing?  Or should I just keep
a modified copy in my home directory?


David

#30218 From: "Dan Sharp" <dwsharp@...>
Date: Sat Nov 2, 2002 9:51 pm
Subject: A bug fix and an upgraded Make_cyg.mak to test.
dwsharp@...
Send Email Send Email
 
The attached main.c diff fixes a problem with a Cygwin-compiled gvim.exe
where paths like D:/test.txt get converted to D:/cygdrive/d/test.txt,
causing the file not to be found (with the occasional nasty side-effect of
replacing D:/test.txt with a zero-byte file).  Please check that the fix
works okay for you.

The attached Make_cyg.mak is the fun part :)  I have done a huge upgrade on
this makefile to give it capabilities on par with the other Win32 makefile.
With the attached Make_cyg.mak, you can now use Cygwin to compile a
(g)vim.exe with all the features of the official binaries, with the
exception of MBYTE_IME, since Cygwin does not appear to have IME support.

Highlights include:
Executables can be compiled that do not rely on cygwin1.dll
Dynamically loaded Perl, Python, Ruby, and TCL
OLE support
Dynamic Iconv and Gettext
Debug build

Bugs:
Non-dynamically loaded Ruby and Python builds do not work
OLE requires a patch to work around a Cygwin / Mingw bug **
Anything else that you may report

Please test this makefile and make sure it works for you, and of course all
comments / criticism is welcome.

Dan Sharp

** Cygwin and Mingw's oleauto.h header gives a prototype for
DeregisterTypeLib(), but the oleaut32.a library supplies an implementation
for UnRegisterTypeLib(), the function used by Vim.  You must patch
if_ole.cpp with the prototype for UnRegisterTypeLib() to get OLE support.
The attached if_ole.cpp.zip supplies this patch.

_________________________________________________________________
Choose an Internet access plan right for you -- try MSN!
http://resourcecenter.msn.com/access/plans/default.asp

#30219 From: Wichert Akkerman <wichert@...>
Date: Sat Nov 2, 2002 11:35 pm
Subject: Re: syntax/modconf.vim
wichert@...
Send Email Send Email
 
Previously Nikolai :: lone-star :: Weibull wrote:
> to match:
>
> au BufNewFile,BufRead   /etc/modules.conf     setf modconf
> au BufNewFile,BufRead   /etc/conf.modules     setf modconf

For Debian systems also add /etc/modutils/** (but make sure you do that
after checking for things like sh scripts which can also be in there).

Wichert.

--
   _________________________________________________________________
  /wichert@...         This space intentionally left occupied \
| wichert@...                    http://www.wiggy.net/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |

#30220 From: Wichert Akkerman <wichert@...>
Date: Sat Nov 2, 2002 11:37 pm
Subject: Re: Vim Crypto package
wichert@...
Send Email Send Email
 
Previously Glenn Maynard wrote:
> You can flag memory as unswappable on any secure OS.  GPG probably does
> this, though probably only for Unix.

You can lock memory with mlock() for this purpose, but you have to be
root to do that (it makes for a nice resource starvation problem if you
try to mlock() lots of things).

Wichert.

--
   _________________________________________________________________
  /wichert@...         This space intentionally left occupied \
| wichert@...                    http://www.wiggy.net/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |

#30221 From: Benji Fisher <fisherbb@...>
Date: Sun Nov 3, 2002 3:03 am
Subject: Re: configure and Makefile
fisherbb@...
Send Email Send Email
 
Bram Moolenaar wrote:
>
> Charles Campbell wrote:
>
> > How about a make/environment variable:  say, VIMCONFIG.  Then the <Makefile>
> > would have
> >
> >     configure ${VIMCONFIG}
> >
> > which will normally expand to nothing, but if set will allow
> > user-specified options to the configure.
> >
> > export VIMCONFIG="--with-features=huge"
> > make
>
> Hmm, then you would need to set VIMCONFIG in your ~/.shrc file, which is
> not really related to building Vim.  Typing it doesn't make sense, you
> might as well run configure right away then.

      You could put the Chip's two lines in a shell script.

      I remember being confused when I first compiled vim.  There are
some options (perl support is one, I think) that can only be compiled in
via a configure argument, and some (such as features) that are supposed
to be set from the Makefile.  Maybe I did not read the docs carefully
enough, or maybe they could be made more clear.  I think it will be a
Good Thing if we can decide on a recommended way to compile vim, whether
it be "configure; make" or just "make" or some other suggestion.  The
recommendation should include a solution to the current discussion, how
to avoid typing in configure arguments each time you build.

					 --Benji Fisher

#30222 From: Bram Moolenaar <Bram@...>
Date: Sun Nov 3, 2002 1:04 pm
Subject: Re: syntax/modconf.vim
Bram@...
Send Email Send Email
 
Wichert Akkerman wrote:

> Previously Nikolai :: lone-star :: Weibull wrote:
> > to match:
> >
> > au BufNewFile,BufRead   /etc/modules.conf     setf modconf
> > au BufNewFile,BufRead   /etc/conf.modules     setf modconf
>
> For Debian systems also add /etc/modutils/** (but make sure you do that
> after checking for things like sh scripts which can also be in there).

Using something ending in a "*" is always a bit dangerous, it might pick
up more than expected.  Can the pattern be made a bit more specific?
What file names should it pick up?

--
BRIDGEKEEPER: What is the air-speed velocity of an unladen swallow?
ARTHUR:       What do you mean?  An African or European swallow?
BRIDGEKEEPER: Er ...  I don't know that ... Aaaaarrrrrrggghhh!
    BRIDGEKEEPER is cast into the gorge.
                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30223 From: Bram Moolenaar <Bram@...>
Date: Sun Nov 3, 2002 1:04 pm
Subject: Re: A bug fix and an upgraded Make_cyg.mak to test.
Bram@...
Send Email Send Email
 
Dan Sharp wrote:

> The attached main.c diff fixes a problem with a Cygwin-compiled gvim.exe
> where paths like D:/test.txt get converted to D:/cygdrive/d/test.txt,
> causing the file not to be found (with the occasional nasty side-effect of
> replacing D:/test.txt with a zero-byte file).  Please check that the fix
> works okay for you.
>
> The attached Make_cyg.mak is the fun part :)  I have done a huge upgrade on
> this makefile to give it capabilities on par with the other Win32 makefile.
> With the attached Make_cyg.mak, you can now use Cygwin to compile a
> (g)vim.exe with all the features of the official binaries, with the
> exception of MBYTE_IME, since Cygwin does not appear to have IME support.

Thanks for making this.  If there are no complaints I'll include this
and send out a patch.

--
It is illegal for anyone to try and stop a child from playfully jumping over
puddles of water.
		 [real standing law in California, United States of America]

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30224 From: Bram Moolenaar <Bram@...>
Date: Sun Nov 3, 2002 1:04 pm
Subject: Re: configure and Makefile
Bram@...
Send Email Send Email
 
Benji Fisher wrote:

>      I remember being confused when I first compiled vim.  There are
> some options (perl support is one, I think) that can only be compiled in
> via a configure argument, and some (such as features) that are supposed
> to be set from the Makefile.  Maybe I did not read the docs carefully
> enough, or maybe they could be made more clear.  I think it will be a
> Good Thing if we can decide on a recommended way to compile vim, whether
> it be "configure; make" or just "make" or some other suggestion.  The
> recommendation should include a solution to the current discussion, how
> to avoid typing in configure arguments each time you build.

The recommended way is to edit src/Makefile and run "make".  I thought
this was mentioned in a few places.

Obviously you can take over these changes to a Makefile of a new
version, but you have to do a bit of work for it.  When using CVS it's
simple, changes in the new version will be merged in and conflicts are
reported.  When unpacking a new version from archives you might want to
use diff and patch.

I think this is not perfect, but easy enough for someone to figure out
himself.

--
BEDEVERE: How do you know so much about swallows?
ARTHUR:   Well you have to know these things when you're a king, you know.
                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30225 From: Wichert Akkerman <wichert@...>
Date: Sun Nov 3, 2002 5:07 pm
Subject: Re: syntax/modconf.vim
wichert@...
Send Email Send Email
 
Previously Bram Moolenaar wrote:
> Using something ending in a "*" is always a bit dangerous, it might pick
> up more than expected.  Can the pattern be made a bit more specific?
> What file names should it pick up?

The strict rules would be: everything that does not end in .chandev,
or is exectuable.

Wichert.

--
   _________________________________________________________________
  /wichert@...         This space intentionally left occupied \
| wichert@...                    http://www.wiggy.net/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |

#30226 From: Bram Moolenaar <Bram@...>
Date: Sun Nov 3, 2002 7:12 pm
Subject: Re: syntax/modconf.vim
Bram@...
Send Email Send Email
 
Wichert Akkerman wrote:

> Previously Bram Moolenaar wrote:
> > Using something ending in a "*" is always a bit dangerous, it might pick
> > up more than expected.  Can the pattern be made a bit more specific?
> > What file names should it pick up?
>
> The strict rules would be: everything that does not end in .chandev,
> or is exectuable.

Thus also foo.sh, foo.vim, foo.c, etc.?  Sounds a bit unlikely.  Please
suggest an autocommand that works.

--
Any sufficiently advanced technology is indistinguishable from magic.
					 Arthur C. Clarke

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30227 From: Christian Wolfgang Hujer <Christian.Hujer@...>
Date: Sun Nov 3, 2002 7:26 pm
Subject: Strange ab behavior (perhaps a bug), suggestions for ab
Christian.Hujer@...
Send Email Send Email
 
Hello dear list members,


I have just encountered a strange behaviour when using abbreviations.

I use vim 6.1.247

I have defined the following to abbreviations:
ab <a <a href=""></a><LEFT><LEFT><LEFT><LEFT><LEFT><LEFT>
ab <li> <li></li><LEFT><LEFT><LEFT><LEFT><LEFT>

When I type <li>< it expands to <li><|</li> where the cursor's position is
marked with |.
Now when I type a followed by a space, the sum of both ab's does not expand,
as I'd expect, to
<li><a href=" |"></a></li>
but to
<li<a href=" |"></a></li>
So the > of <li> is missing, it vanishes.

If I use these abbreviations alone, they work fine. Only when using one right
after another they do not work.
You might also try typing <li><li><li><li> followed by a space and see what
happens:
<li> </li></li></li></li>
is the result insetad of
<li><li><li><li> </li></li></li></li>

Is this a bug or did I miss the point with these abbreviations?
Some versions ago they worked, by the way.



Something else:
Why is the following ab not possible:
ab <?xml <?xml version="1.0" encoding="utf-8"?>
but the following are possible:
ab <a <a href=""></a><LEFT><LEFT><LEFT><LEFT><LEFT><LEFT>
ab <?xml> <?xml version="1.0" encoding="utf-8"?>
ab <?xml?> <?xml version="1.0" encoding="utf-8"?>


Third topic:
I suggest a new extension for abbreviations.
<CURSOR>
with :ab <a <a href="<CURSOR>"></a> the cursor should be at the
<CURSOR>-position after the abbreviation is expanded.


Greetings

Christian
--
ITCQIS GmbH
Christian Wolfgang Hujer
Geschäftsführender Gesellschafter
Telefon: +49  (0)89  27 37 04 37
Telefax: +49  (0)89  27 37 04 39
E-Mail: Christian.Hujer@...
WWW: http://www.itcqis.com/

#30228 From: Wichert Akkerman <wichert@...>
Date: Sun Nov 3, 2002 7:34 pm
Subject: Re: syntax/modconf.vim
wichert@...
Send Email Send Email
 
Previously Bram Moolenaar wrote:
> Thus also foo.sh, foo.vim, foo.c, etc.?  Sounds a bit unlikely.  Please
> suggest an autocommand that works.

foo.sh would be an executable. But if someone sticks foo.vim in
/etc/modutils he/she will have broken his Debian system anyway so I
don't see why vim can't mis-guess here either (might even be a good
hint that something is wrong).

Wichert.

--
   _________________________________________________________________
  /wichert@...         This space intentionally left occupied \
| wichert@...                    http://www.wiggy.net/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |

#30229 From: "Nikolai :: lone-star :: Weibull" <lone-star@...>
Date: Sun Nov 3, 2002 8:01 pm
Subject: Re: user_fullname()
lone-star@...
Send Email Send Email
 
On Fri, 01 Nov 2002 23:19:51 +0000, Bram Moolenaar wrote:
>
> Nikolai Weibull wrote:
>
> > finally, here it is, the function we've all had wet dreams about!
> > the function to put an end to all other functions!
> > for only $9.95 it can be yours!
> >
> > seriously, i got around to writing some code for the function
> > 'user_fullname()' which may actually be rather useful in quite a few
> > scripts. most notably it goes perfect with the ftplugin/changelog.vim
> > file that i maintain. a patch to src/eval.c and to runtime/doc/eval.txt
> > is included.
>
> Hmm, I wonder how useful this is.  It only works on Unix (and not all
> kinds of it).  Could use a shell command on these systems.
>
true. sadly i haven't found a way to do it on other systems. should be
possible on some forms of Windows based platforms, and i'm sure some
versions of Mac OS have some functionality for this as well. i was
hoping that people would fill in the blanks sort of. I have two plugins
that would benefit from this functionality. first,
ftplugin/changelog.vim that uses the fullname in the log header. and
second, plugin/pcpheader.vim that uses the fullname of the user when
creating headers from template files where the Author:/Maintainer: needs to
be set. Ok, it's not as useful as substitute() or many other functions,
but i believe it has its uses.
>
> If it's really to be included, it requires a few #ifdefs.  For example,
> see the use of getpwuid() in os_unix.c.
>
done. for systems that don't provide the getpwuid() functionality, then
at least the NAME environment variable is checked.

> > P.S.
> > i also fixed some bugs in runtime/doc/eval.txt. (see the patch for what
> > was fixed.)
>
> I'll include these right away.
>
ok, good.

--
::: name: Nikolai Weibull       :: aliases: pcp / lone-star    :::
::: born: Chicago, IL USA       :: loc now: Gothenburg, Sweden :::
::: page: http://pcppopper.org/ :: top ref: google "pcp rocks" :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Index: src/eval.c
===================================================================
RCS file: /cvsroot/vim/vim/src/eval.c,v
retrieving revision 1.92
diff -c -r1.92 eval.c
*** src/eval.c 14 Oct 2002 23:54:35 -0000 1.92
--- src/eval.c 3 Nov 2002 19:51:30 -0000
***************
*** 303,308 ****
--- 303,309 ----
   static void f_tempname __ARGS((VAR argvars, VAR retvar));
   static void f_tolower __ARGS((VAR argvars, VAR retvar));
   static void f_toupper __ARGS((VAR argvars, VAR retvar));
+ static void f_user_fullname __ARGS((VAR argvars, VAR retvar));
   static void f_type __ARGS((VAR argvars, VAR retvar));
   static void f_virtcol __ARGS((VAR argvars, VAR retvar));
   static void f_visualmode __ARGS((VAR argvars, VAR retvar));
***************
*** 2448,2453 ****
--- 2449,2455 ----
       {"tempname", 0, 0, f_tempname},
       {"tolower",  1, 1, f_tolower},
       {"toupper",  1, 1, f_toupper},
+     {"user_fullname", 0, 1, f_user_fullname},
       {"type",  1, 1, f_type},
       {"virtcol",  1, 1, f_virtcol},
       {"visualmode", 0, 0, f_visualmode},
***************
*** 6379,6384 ****
--- 6381,6452 ----
  	 retvar->var_val.var_number = 0;
       else
  	 retvar->var_val.var_number = 1;
+ }
+
+ /*
+  * "user_fullname(expr)" function
+  */
+     static void
+ f_user_fullname(argvars, retvar)
+     VAR  argvars;
+     VAR  retvar;
+ {
+ #define USER_DEFAULT_FULLNAME "unknown"
+     char_u *fullname;
+     char_u *p;
+ #if defined(HAVE_PWD_H) && defined(HAVE_GETPWUID)
+     struct passwd *pw = NULL;
+     char_u *q;
+
+     /* get the pw struct */
+     switch (argvars[0].var_type) {
+     case VAR_NUMBER:
+  pw = getpwuid(get_var_number(&argvars[0]));
+  break;
+     case VAR_STRING:
+  pw = getpwnam(get_var_string(&argvars[0]));
+  break;
+     default:
+  pw = getpwuid(getuid());
+  break;
+     }
+
+     /* now, try to figure out the users full name */
+     if (pw == NULL) {
+  p = USER_DEFAULT_FULLNAME;
+     } else {
+  p = (pw->pw_gecos != NULL) ? pw->pw_gecos : pw->pw_name;
+     }
+
+     q = (char_u *)getenv("NAME");
+     if (q != NULL) {
+  p = q;
+     }
+
+     /* only keep part up to first comma */
+     q = vim_strchr(p, ',');
+     fullname = vim_strnsave(p, (q != NULL) ? q - p : strlen(p));
+
+     /* expand & in the fullname to the login name of the user */
+     q = vim_strchr(fullname, '&');
+     if (q != NULL) {
+  p = fullname;
+  fullname = (char_u *)alloc(strlen(p) + strlen(pw->pw_name) + 1);
+  STRNCPY(fullname, p, q - p);
+  strcat((char *)fullname, pw->pw_name);
+  fullname[q - p] = TOUPPER_LOC(fullname[q - p]);
+  strcat(fullname, q + 1);
+  vim_free(p);
+     }
+ #else
+     q = (char_u *)getenv("NAME");
+     if (q == NULL) {
+  q = USER_DEFAULT_FULLNAME;
+     }
+     fullname = vim_strsame(USER_DEFAULT_FULLNAME);
+ #endif
+     retvar->var_type = VAR_STRING;
+     retvar->var_val.var_string = fullname;
   }

   /*
Index: runtime/doc/eval.txt
===================================================================
RCS file: /cvsroot/vim/vim/runtime/doc/eval.txt,v
retrieving revision 1.62
diff -c -r1.62 eval.txt
*** runtime/doc/eval.txt 8 Sep 2002 05:29:52 -0000 1.62
--- runtime/doc/eval.txt 3 Nov 2002 19:51:31 -0000
***************
*** 788,795 ****
   getline( {lnum})  String line {lnum} from current buffer
   getwinposx() 	 Number X coord in pixels of GUI vim window
   getwinposy() 	 Number Y coord in pixels of GUI vim window
! getwinvar( {nr}, {varname}  variable {varname} in window {nr}
! glob( {expr}]) 	 String expand file wildcards in {expr}
   globpath( {path}, {expr}) String do glob({expr}) for all dirs in {path}
   has( {feature}) 	 Number TRUE if feature {feature} supported
   hasmapto( {what} [, {mode}]) Number TRUE if mapping to {what} exists
--- 788,795 ----
   getline( {lnum})  String line {lnum} from current buffer
   getwinposx() 	 Number X coord in pixels of GUI vim window
   getwinposy() 	 Number Y coord in pixels of GUI vim window
! getwinvar( {nr}, {varname})  variable {varname} in window {nr}
! glob( {expr}) 	 String expand file wildcards in {expr}
   globpath( {path}, {expr}) String do glob({expr}) for all dirs in {path}
   has( {feature}) 	 Number TRUE if feature {feature} supported
   hasmapto( {what} [, {mode}]) Number TRUE if mapping to {what} exists
***************
*** 862,867 ****
--- 862,868 ----
   tolower( {expr})  String the String {expr} switched to lowercase
   toupper( {expr})  String the String {expr} switched to uppercase
   type( {name}) 	 Number type of variable {name}
+ user_fullname ( [{expr}]) String the full name of a user
   virtcol( {expr})  Number screen column of cursor or mark
   visualmode() 	 String last visual mode used
   winbufnr( {nr}) 	 Number buffer number of window {nr}
***************
*** 2336,2341 ****
--- 2337,2357 ----
  		 The result is a Number:
  			 0 if {expr} has the type Number
  			 1 if {expr} has the type String
+
+ user_fullname([{expr}]) 			 *user_fullname()*
+ 	 The result is a String, which is the full name of the user
+ 	 identified by {expr}. It is extracted from the environment
+ 	 variable $NAME if available, or from the system file
+ 	 /etc/passwd otherwise. If neither of these work, the result
+ 	 will be the string "unknown". {expr} identifies the user to
+ 	 get the full name of. If {expr} is a number, it will be used
+ 	 as the UID of the user. If {expr} is a string, it will be used
+ 	 as the login name of the user. If {expr} is omitted, the UID
+ 	 of the user that started Vim.
+ 	 Examples: >
+ 		 :let name1 = user_fullname(1000)
+ 		 :let name2 = user_fullname("games")
+ 		 :let name3 = user_fullname()

   virtcol({expr}) 				 *virtcol()*
  		 The result is a Number, which is the screen column of the file

#30230 From: Bram Moolenaar <Bram@...>
Date: Sun Nov 3, 2002 9:32 pm
Subject: Re: syntax/modconf.vim
Bram@...
Send Email Send Email
 
Wichert Akkerman wrote:

> Previously Bram Moolenaar wrote:
> > Thus also foo.sh, foo.vim, foo.c, etc.?  Sounds a bit unlikely.  Please
> > suggest an autocommand that works.
>
> foo.sh would be an executable. But if someone sticks foo.vim in
> /etc/modutils he/she will have broken his Debian system anyway so I
> don't see why vim can't mis-guess here either (might even be a good
> hint that something is wrong).

Well, perhaps this autocommand would work then:

au BufNewFile,BufRead /etc/modutils/* if executable(expand(<afile>)) != 1 | setf
modconf | endif

Can you try this out?

--
Kisses may last for as much as, but no more than, five minutes.
		 [real standing law in Iowa, United States of America]

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30231 From: Bram Moolenaar <Bram@...>
Date: Sun Nov 3, 2002 9:32 pm
Subject: Re: Strange ab behavior (perhaps a bug), suggestions for ab
Bram@...
Send Email Send Email
 
Christian Wolfgang Hujer wrote:

> I have just encountered a strange behaviour when using abbreviations.
>
> I use vim 6.1.247
>
> I have defined the following to abbreviations:
> ab <a <a href=""></a><LEFT><LEFT><LEFT><LEFT><LEFT><LEFT>
> ab <li> <li></li><LEFT><LEFT><LEFT><LEFT><LEFT>
>
> When I type <li>< it expands to <li><|</li> where the cursor's position is
> marked with |.
> Now when I type a followed by a space, the sum of both ab's does not expand,
> as I'd expect, to
> <li><a href=" |"></a></li>
> but to
> <li<a href=" |"></a></li>
> So the > of <li> is missing, it vanishes.

It doesn't expand at all for me, just like "><a " doesn't expand.
That's because abbreviations only work for whole words, not when there
is something before it.  Perhaps you have < and > in 'iskeyword'?

> If I use these abbreviations alone, they work fine. Only when using one right
> after another they do not work.
> You might also try typing <li><li><li><li> followed by a space and see what
> happens:
> <li> </li></li></li></li>
> is the result insetad of
> <li><li><li><li> </li></li></li></li>

I do get the expected result.  Can't guess why it works wrong for you.

> Is this a bug or did I miss the point with these abbreviations?
> Some versions ago they worked, by the way.
>
> Something else:
> Why is the following ab not possible:
> ab <?xml <?xml version="1.0" encoding="utf-8"?>
> but the following are possible:
> ab <a <a href=""></a><LEFT><LEFT><LEFT><LEFT><LEFT><LEFT>
> ab <?xml> <?xml version="1.0" encoding="utf-8"?>
> ab <?xml?> <?xml version="1.0" encoding="utf-8"?>


Do read the part about full-id and non-id types.  It's at ":help
abbreviations".

> Third topic:
> I suggest a new extension for abbreviations.
> <CURSOR>
> with :ab <a <a href="<CURSOR>"></a> the cursor should be at the
> <CURSOR>-position after the abbreviation is expanded.

That's not really what abbreviations were to be used for.  You can use a
mapping and/or a function instead.

--
It is illegal to rob a bank and then shoot at the bank teller with a water
pistol.
		 [real standing law in Louisana, United States of America]

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30232 From: Christian Wolfgang Hujer <Christian.Hujer@...>
Date: Sun Nov 3, 2002 9:49 pm
Subject: Problem with visual and vim 6.1.247 on KDE 3.0.4?
Christian.Hujer@...
Send Email Send Email
 
Hello dear list members,


I have the following problem with vim. Shortly after typing v, shift-v or
control-v for starting to highlight in one of the visual modes, vim abruptly
dies after approx. 0.5 secs with the following error message:
XIO:  fatal IO error 14 (Ungültige Adresse) on X server ":0.0"
after 140 requests (139 known processed) with 0 events remaining.

"Ungültige Adresse" probably translates to "Invalid address".

I compile vim with the following options:

I can reproduce this error on xterm and konsole.
$ xterm -version
XFree86 4.2.0(165)
$ konsole -version
Qt: 3.0.5
KDE: 3.0.4
Konsole: 1.1.3

When starting vim as gvim this error does not occur.

I compile vim using the following script:
cd vim
export CVS_RSH=ssh
cvs update
./configure \
     --prefix=/usr/local/dist \
     --enable-perlinterp \
     --enable-pythoninterp \
     --enable-tclinterp \
     --enable-rubyinterp \
     --enable-cscope \
     --enable-workshop \
     --enable-sniff \
     --enable-multibyte \
     --enable-xim \
     --enable-fontset \
     --with-x \

make
make install

I thought my sources were wrong but I have reproduced the problem with a fresh
cvs checkout.


The problem does not occur when the DISPLAY variable is not set.
Access to the X-Server is basically possible, it is possible to start X
programs from xterm or konsole.



My system: S.u.S.E. Linux 8.1.

The problem occurs when using KDE.
The problem does NOT occur with GNOME, Enlightenment or failsafe, even when
using the KDE program Konsole with these window managers.

Has anyone else experienced this strange behaviour?

Does someone has an idea of how I can try to reproduce this error with another
program so I can exclude it's the fault of vim?

Is this a known bug in KDE?


My current workaround is to compile vim without any GUI support.
This workaround does for me since except for web surfing, gaming, mail,
addressbook and calendar I only work in console, and I could compile a second
vim for GUI only when I'd really need gvim.


Bye
--
ITCQIS GmbH
Christian Wolfgang Hujer
Geschäftsführender Gesellschafter
Telefon: +49  (0)89  27 37 04 37
Telefax: +49  (0)89  27 37 04 39
E-Mail: Christian.Hujer@...
WWW: http://www.itcqis.com/

#30233 From: Vince Negri <vnegri@...>
Date: Mon Nov 4, 2002 1:32 pm
Subject: RE: Latest runtime files available for download
vnegri@...
Send Email Send Email
 
It works! :-) I think ;-)

A note for the instructions page.. on win32
you have to type:

python <path to "aap"> fetch

since of course the cmd.exe shell doesn't
understand the magic first line of the "aap" file.


Vince
Legal Disclaimer: Any views expressed by the sender of this message are
not necessarily those of Application Solutions Ltd. Information in this
e-mail may be confidential and is for the use of the intended recipient
only, no mistake in transmission is intended to waive or compromise such
privilege. Please advise the sender if you receive this e-mail by mistake.

#30234 From: "Kontra, Gergely" <kgergely@...>
Date: Mon Nov 4, 2002 1:59 pm
Subject: set scb diff
kgergely@...
Send Email Send Email
 
Hi!

I sometimes need to see diffs in vim. It is quite usable and pretty.
One thing I miss:
when you change to one window to another, the cursor can go to a quite
different place. Is it possible to sychronize cursor positions?

Gergo

+-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
|         Email: kgergely@...,  kgergely@...          |
|  URL:   turul.eet.bme.hu/~kgergely    Mobile: (+36 20) 356 9656     |
+-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
.
Magyar php mirror es magyar php dokumentacio: http://hu.php.net

#30235 From: Bram Moolenaar <Bram@...>
Date: Mon Nov 4, 2002 4:00 pm
Subject: RE: Latest runtime files available for download
Bram@...
Send Email Send Email
 
Vince Negri wrote:

> It works! :-) I think ;-)

Good to hear it works.  I never tried it on MS-Windows.

> A note for the instructions page.. on win32
> you have to type:
>
> python <path to "aap"> fetch
>
> since of course the cmd.exe shell doesn't
> understand the magic first line of the "aap" file.

I have added a remark on the web page.

Perhaps I should make an aap.bat file, so that you can type "aap fetch"
like on other systems.  Actually sounds like the same problem that we
have with Vim, you can't make symbolic links on MS-Windows.

How do other Python programs do this anyway?

--
Females are strictly forbidden to appear unshaven in public.
		 [real standing law in New Mexico, United States of America]

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30236 From: Mike Steed <msteed@...>
Date: Mon Nov 4, 2002 4:14 pm
Subject: RE: Latest runtime files available for download
msteed@...
Send Email Send Email
 
On Mon, 4 Nov 2002 at 5:00pm, Bram Moolenaar wrote:

>
> Vince Negri wrote:
>
> > It works! :-) I think ;-)
>
> Good to hear it works.  I never tried it on MS-Windows.
>
> > A note for the instructions page.. on win32
> > you have to type:
> >
> > python <path to "aap"> fetch
> >
> > since of course the cmd.exe shell doesn't
> > understand the magic first line of the "aap" file.
>
> I have added a remark on the web page.
>
> Perhaps I should make an aap.bat file, so that you can type "aap
> fetch" like on other systems.  Actually sounds like the same problem
> that we have with Vim, you can't make symbolic links on MS-Windows.
>
> How do other Python programs do this anyway?

If I understand the problem, one way to solve it is to add .py to the
value of PATHEXT in the environment.  Then CMD will also match "fetch"
with "fetch.py".

#30237 From: Bram Moolenaar <Bram@...>
Date: Mon Nov 4, 2002 4:33 pm
Subject: RE: Latest runtime files available for download
Bram@...
Send Email Send Email
 
Mike Steed wrote:

> > > A note for the instructions page.. on win32
> > > you have to type:
> > >
> > > python <path to "aap"> fetch
> > >
> > > since of course the cmd.exe shell doesn't
> > > understand the magic first line of the "aap" file.
> >
> > I have added a remark on the web page.
> >
> > Perhaps I should make an aap.bat file, so that you can type "aap
> > fetch" like on other systems.  Actually sounds like the same problem
> > that we have with Vim, you can't make symbolic links on MS-Windows.
> >
> > How do other Python programs do this anyway?
>
> If I understand the problem, one way to solve it is to add .py to the
> value of PATHEXT in the environment.  Then CMD will also match "fetch"
> with "fetch.py".

If I understand it correctly, adding ".py" to PATHEXT has the effect of
being able to type "aap" as a command instead of "aap.py".  But this
doesn't tell CMD where to find Python or how to execute a .py file.  How
does it know that?

Does PATHEXT only work on MS-Windows NT/XP or also on Win 9x?

--
A special cleaning ordinance bans housewives from hiding dirt and dust under a
rug in a dwelling.
		 [real standing law in Pennsylvania, United States of America]

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

#30238 From: Mike Steed <msteed@...>
Date: Mon Nov 4, 2002 4:48 pm
Subject: RE: Latest runtime files available for download
msteed@...
Send Email Send Email
 
On Mon, 4 Nov 2002 at 5:33pm, Bram Moolenaar wrote:

>
> Mike Steed wrote:
>
> > > > A note for the instructions page.. on win32
> > > > you have to type:
> > > >
> > > > python <path to "aap"> fetch
> > > >
> > > > since of course the cmd.exe shell doesn't
> > > > understand the magic first line of the "aap" file.
> > >
> > > I have added a remark on the web page.
> > >
> > > Perhaps I should make an aap.bat file, so that you can type "aap
> > > fetch" like on other systems.  Actually sounds like the same
> > > problem that we have with Vim, you can't make symbolic links on
> > > MS-Windows.
> > >
> > > How do other Python programs do this anyway?
> >
> > If I understand the problem, one way to solve it is to add .py to
> > the value of PATHEXT in the environment.  Then CMD will also match
> > "fetch" with "fetch.py".
>
> If I understand it correctly, adding ".py" to PATHEXT has the effect
> of being able to type "aap" as a command instead of "aap.py".  But
> this doesn't tell CMD where to find Python or how to execute a .py
> file.  How does it know that?

Right (sorry, I missed that aap is the Python script, not fetch).  In
order for this to work, there must be an association between the .py
extension and python.exe.  This is normally set up by the Python
installer.  You can query the association in cmd by typing "assoc .py".
If you have Python installed you should get something like
".py=Python.File".  The path to python.exe is somewhere in the registry.

> Does PATHEXT only work on MS-Windows NT/XP or also on Win 9x?

I think this works only on NT-based systems, but I'm not sure.

#30239 From: Ross Presser <rpresser@...>
Date: Mon Nov 4, 2002 7:02 pm
Subject: RE: Latest runtime files available for download
rpresser@...
Send Email Send Email
 
> Right (sorry, I missed that aap is the Python script, not fetch).  In
> order for this to work, there must be an association between the .py
> extension and python.exe.  This is normally set up by the Python
> installer.  You can query the association in cmd by typing
> "assoc .py".
> If you have Python installed you should get something like
> ".py=Python.File".  The path to python.exe is somewhere in
> the registry.

It's accessed with the FTYPE command, another cmd.exe builtin. The help
messages produced by FTYPE /? and ASSOC /? are attached.


> > Does PATHEXT only work on MS-Windows NT/XP or also on Win 9x?
>
> I think this works only on NT-based systems, but I'm not sure.

Correct.  Available only for NT/2000/XP, not 95/98/ME.
Displays or modifies file types used in file extension associations

FTYPE [fileType[=[openCommandString]]]

   fileType  Specifies the file type to examine or change
   openCommandString Specifies the open command to use when launching files
                     of this type.

Type FTYPE without parameters to display the current file types that
have open command strings defined.  FTYPE is invoked with just a file
type, it displays the current open command string for that file type.
Specify nothing for the open command string and the FTYPE command will
delete the open command string for the file type.  Within an open
command string %0 or %1 are substituted with the file name being
launched through the assocation.  %* gets all the parameters and %2
gets the 1st parameter, %3 the second, etc.  %~n gets all the remaining
parameters starting with the nth parameter, where n may be between 2 and 9,
inclusive.  For example:

     ASSOC .pl=PerlScript
     FTYPE PerlScript=perl.exe %1 %*

would allow you to invoke a Perl script as follows:

     script.pl 1 2 3

If you want to eliminate the need to type the extensions, then do the
following:

     set PATHEXT=.pl;%PATHEXT%

and the script could be invoked as follows:

     script 1 2 3
Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

   .ext      Specifies the file extension to associate the file type with
   fileType  Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current
file association for that file extension.  Specify nothing for the file
type and the command will delete the association for the file extension.

#30240 From: Bram Moolenaar <Bram@...>
Date: Mon Nov 4, 2002 8:22 pm
Subject: RE: Latest runtime files available for download
Bram@...
Send Email Send Email
 
Mike Steed wrote:

> > > > How do other Python programs do this anyway?
> > >
> > > If I understand the problem, one way to solve it is to add .py to
> > > the value of PATHEXT in the environment.  Then CMD will also match
> > > "fetch" with "fetch.py".
> >
> > If I understand it correctly, adding ".py" to PATHEXT has the effect
> > of being able to type "aap" as a command instead of "aap.py".  But
> > this doesn't tell CMD where to find Python or how to execute a .py
> > file.  How does it know that?
>
> Right (sorry, I missed that aap is the Python script, not fetch).  In
> order for this to work, there must be an association between the .py
> extension and python.exe.  This is normally set up by the Python
> installer.  You can query the association in cmd by typing "assoc .py".
> If you have Python installed you should get something like
> ".py=Python.File".  The path to python.exe is somewhere in the registry.

Strange that the Python installer does make the association but does not
add .py to PATHEXT.  Making the association sounds more complicated to
me.

> > Does PATHEXT only work on MS-Windows NT/XP or also on Win 9x?
>
> I think this works only on NT-based systems, but I'm not sure.

I do have Win98, thus I can try it out (when I have time, later).

--
ARTHUR: If you do not open these doors, we will take this castle by force ...
    [A bucket of slops land on ARTHUR.  He tries to retain his dignity.]
                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

  ///  Bram Moolenaar -- Bram@... -- http://www.moolenaar.net  \\\
///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///

Messages 30211 - 30240 of 69738   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help