Re: why does :save not work with -stdin-

2007-06-06 Thread Bram Moolenaar

Edward L. Fox wrote:

 On 6/6/07, Mohsin [EMAIL PROTECTED] wrote:
  I usually do search like this:
 
  $ grep  Word *.* | vim -u myvimrc -
 
  $ cat myvimrc
 
 :autocmd StdinReadPost * :sav! /tmp/x
 
  but when I quit :q, vim always asks me to save the file again,
  why is the file marked as modified?
 
  I tried all combinations of flags, but can't get vim to
  mark the file as saved,
 
 It's a bug. Here is the patch. Please test it carefully, thanks very
 much for reporting this to me. I'll ask Bram to add it to the official
 release soon.
 
 Index: buffer.c
 ===
 --- buffer.c(revision 296)
 +++ buffer.c(working copy)
 @@ -171,14 +171,6 @@
 /* Put the cursor on the first line. */
 curwin-w_cursor.lnum = 1;
 curwin-w_cursor.col = 0;
 -#ifdef FEAT_AUTOCMD
 -# ifdef FEAT_EVAL
 -   apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
 -   curbuf, retval);
 -# else
 -   apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
 -# endif
 -#endif
 }
  }
 
 @@ -207,6 +199,18 @@
 unchanged(curbuf, FALSE);
  save_file_ff(curbuf);  /* keep this fileformat */
 
 +#ifdef FEAT_AUTOCMD
 +if (read_stdin)
 +{
 +# ifdef FEAT_EVAL
 +apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
 +   curbuf, retval);
 +# else
 +apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
 +# endif
 +}
 +#endif
 +
  /* require ! to overwrite the file, because it wasn't read completely 
 */
  #ifdef FEAT_EVAL
  if (aborting())

Instead of moving the autocommands, it might be better to move the call
to changed() to before the autocommands (with the if that checks for
read_stdin).  The readfile() call also invokes the ReadPost
autocommands, this keeps it consistent.

-- 
hundred-and-one symptoms of being an internet addict:
162. You go outside and look for a brightness knob to turn down the sun.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: VimWiki - released finally

2007-06-05 Thread Bram Moolenaar

Sebastian Menge wrote:

 [cross-posted to vim, vim-dev, vim-announce, wikia-l]
 
 Hi all
 
 Finally I have imported all the vim tips from http://vim.org/tips to 
 
 http://vim.wikia.com
 
 and set up a minimal infrastructure to keep things going. Not everything
 is perfect, but I think it is usable now.
 
 Thanks to all the support from [EMAIL PROTECTED] and especially to the very
 kind wikia community (#wikia on freenode and the mailing list,
 Greetings!).
 
 Some words on contribution: A good wiki depends on two main factors:
 Excellent content and a lively community. We have a lot of good content
 now, but to make it excellent we need You!
 
 If you ever posted a tip or a comment to the old tips database, please
 have a look at it on the wiki, and review the page. Every little bit
 helps!
 
 See you on the wiki, Sebastian.

Great!

Let's await comments for a few days, then I'll add a few links on
www.vim.org to the tips wiki.  That should give the wiki quite a bit
more traffic.

How about redirecting http://www.vim.org/tips/tip.php?tip_id=805
to http://vim.wikia.com/wiki/VimTip805  (where 805 is an arbitrary
number)?

The Tips pages appear to load a bit slow, but otherwise it looks like
all the info from the old pages is there.

-- 
I wish there was a knob on the TV to turn up the intelligence.
There's a knob called brightness, but it doesn't seem to work. 

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.1.002

2007-05-15 Thread Bram Moolenaar

Patch 7.1.002
Problem:Oracle Pro*C/C++ files are not detected.
Solution:   Add the missing star. (Micah J. Cowan)
Files:  runtime/filetype.vim


*** ../vim-7.1.001/runtime/filetype.vim Thu May 10 20:42:30 2007
--- runtime/filetype.vimTue May 15 09:12:06 2007
***
*** 1,7 
   Vim support file to detect file types
  
   Maintainer: Bram Moolenaar [EMAIL PROTECTED]
!  Last Change:2007 May 10
  
   Listen very carefully, I will say this only once
  if exists(did_load_filetypes)
--- 1,7 
   Vim support file to detect file types
  
   Maintainer: Bram Moolenaar [EMAIL PROTECTED]
!  Last Change:2007 May 15
  
   Listen very carefully, I will say this only once
  if exists(did_load_filetypes)
***
*** 1286,1292 
  au BufNewFile,BufRead *.it,*.ih   setf ppwiz
  
   Oracle Pro*C/C++
! au BufNewFile,BufRead .pc setf proc
  
   Privoxy actions file
  au BufNewFile,BufRead *.actionsetf privoxy
--- 1286,1292 
  au BufNewFile,BufRead *.it,*.ih   setf ppwiz
  
   Oracle Pro*C/C++
! au BufNewFile,BufRead *.pcsetf proc
  
   Privoxy actions file
  au BufNewFile,BufRead *.actionsetf privoxy
*** ../vim-7.1.001/src/version.cMon May 14 19:35:51 2007
--- src/version.c   Tue May 15 09:13:11 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 2,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
132. You come back and check this list every half-hour.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: [Patch] proper detection of ProC files.

2007-05-15 Thread Bram Moolenaar

Micah Cowan wrote:

 Fixes an apparent typo in filetype.vim.
 
 Per https://bugs.launchpad.net/ubuntu/+source/vim/+bug/86916.

Must have been there for a while.  Thanks for the fix!

-- 
In a world without fences, who needs Gates and Windows?

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Stable Vim version 7.1 has been released

2007-05-15 Thread Bram Moolenaar

Francois Pinard wrote:

 [Bram Moolenar]
 
 Hmm, in my POV a rule like:
 
  target: one two three
 
 means that one, two and three are build in sequence, not at the
 same time.  I suppose adding the -jN argument changes the semantics of
 the Makefile, and that causes it to break.
 
 In fact, so far that I know (and everything I know is debatable! :-), 
 the in sequence is not part of the semantic of Makefiles, and should 
 never be relied upon.  Of course, if you experiment with various make 
 implementations, you may observe that dependencies are usually build in 
 sequence, but this should be seen as an accident, and not as a proof.

So how do I tell make that I want to build three targets in sequence
then?  For generice make, not GNU make.

-- 
Birthdays are healthy.  The more you have them, the longer you live.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Stable Vim version 7.1 has been released

2007-05-14 Thread Bram Moolenaar

Edward L. Fox wrote:

 On 5/14/07, David Neèas (Yeti) [EMAIL PROTECTED] wrote:
  On Sun, May 13, 2007 at 09:28:11PM +0100, [EMAIL PROTECTED] wrote:
Umm, I suspect there's still an issue for us pesky OSX users with our
case-insensitive filesystems:
   
[long list of successful updates snipped]
svn: Failed to add file 'src/auto/config.h': object of the same name
already exists
  
   Gah. Scrub that. Manually removing the file in question and updating
   again has sorted it (that's the first time I've had Subversion complain
   over several updates).
  
   Sorry for the noise...
 
  Actually, this is a repository bug.  src/auto/config.h is
  fully generated therefore it should not be versioned.
 
 Yes, it's a bug. I can fix the problem, but not yet. Because I shall
 also need to delete the corresponding files in the CVS repository to
 keep the two repositories' consistency. If Bram would grant me such
 permission to delete these unnecessary files in the CVS and SVN
 repository, I'll do it right away. I already have the CVS writing
 privilege, so the only thing I need is just a permission. :-)

This is not a bug, an empty src/auto/config.h is included, because
otherwise make depend doesn't work.

The problem is that when running configure the file is overwritten by a
non-empty one.  When you update from CVS later it fails.  But that is
OK, just ignore the error.

It would be nicer if we have some way to avoid the error message, but I
don't know how.

-- 
hundred-and-one symptoms of being an internet addict:
125. You begin to wonder how often it REALLY is necessary to get up
 and shower or bathe.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: [PATCH] gvim: Fix compilation against GNOME 2.18

2007-05-14 Thread Bram Moolenaar

Mike Kelly wrote:

 Bram Moolenaar [EMAIL PROTECTED] wrote:
 
  
  Daniel Drake wrote:
  
   gvim with FEAT_GUI_GNOME fails to compile against GNOME 2.18. See 
   https://bugs.gentoo.org/show_bug.cgi?id=176566 for more info.
   
   This patch solves the problem.
  
  Thanks.  Looks safe to include now.
 
 Unfortunately, it looks like this patch didn't get applied correctly
 (you're missing an underscore). The attached patch against the 7.1
 source should fix this.

Darn.  Well, we had to have a first patch for 7.1 anyway.

Thanks Mike.

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Stable Vim version 7.1 has been released

2007-05-14 Thread Bram Moolenaar

David Necas wrote:

 (dropping [EMAIL PROTECTED] from cc)
 
 On Mon, May 14, 2007 at 07:36:30PM +0200, Bram Moolenaar wrote:
  
   This indeed works strangely; for instance `make -jN' with
   N  1 works with freshly unpacked sources, but it breaks
   completely after `make distclean' -- which one would expect
   to get the source tree to the same state.
  
  Well, figure out why it breaks
 
 The above report is incorrect, it just breaks always, I'm
 sorry.  I probably run configure so automatically that I
 accidentally made it work.
 
 It breaks because make starts making `scratch', `config' and
 `myself' simultaneously.  And that appears to be due to
 
   the first targets to make vim are: scratch config myself
 
 As these targets overwrite the same files with different
 content, it breaks one way or another.

Hmm, in my POV a rule like:

target: one two three

means that one, two and three are build in sequence, not at the
same time.  I suppose adding the -jN argument changes the semantics of
the Makefile, and that causes it to break.

The Vim makefile was written for a common version of all make programs.
So that it builds nearly everywhere.  I'm not sure supporting -jN is
possible without breaking it for some system.  Or including false
dependencies.

I don't think a parallel build helps much anyway, Vim builds rather fast
(compared to say, OpenOffice, which takes half a day).

 Explicite configure bootstraps the build system and thus
 makes -jN safe for normal compilation.
 
  and fix it...
 
 Unfortunately my view of how a build system should work is
 incompatible.  I can tell when something breaks and
 hopefully I can figure out how it happens, but I have no
 idea what fixed means here.

I know, in my view make should do everything.  Somehow people have
accepted that some part of the building should be done separately, with
the excuse that it's called configuration.  Big mistake in my opinion.
In quite a few programs you need to know the magic arguments to
configure to be able to build.  Ending up writing a shell script for it.
Now why didn't they put that in the Makefile?  Oh well...

-- 
Don't drink and drive.  You might hit a bump and spill your beer.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Stable Vim version 7.1 has been released

2007-05-13 Thread Bram Moolenaar

Edward L. Fox wrote:

 I finally committed the two missing files from the sf.net's shell
 server. Let's blame the Great Fire Wall built by the P.R.C.
 government.

Thanks for taking care of the SVN repository!  I verified that checking
out vim7 gives the same result as the CVS server and the tar archives.

-- 
hundred-and-one symptoms of being an internet addict:
119. You are reading a book and look for the scroll bar to get to
 the next page.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Vim 7.1 and aap?

2007-05-13 Thread Bram Moolenaar

Richard van der Leeden wrote:

 Currently using AAP is still downloading and installing verison 7.0 (and all
 the patches). Will this be updated to load 7.1 instead?

It's near the top of my todo list now.

 I have altered my local copy of main.aap to get 7.1 (and change the latest
 patch number to 000) which seems to work fine. 

Yeah, that should be all.  Using CVS it should already work.

-- 
hundred-and-one symptoms of being an internet addict:
121. You ask for e-mail adresses instead of telephone numbers.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Vim 7.1 and aap?

2007-05-13 Thread Bram Moolenaar

 Richard van der Leeden wrote:
 
  Currently using AAP is still downloading and installing verison 7.0 (and all
  the patches). Will this be updated to load 7.1 instead?
 
 It's near the top of my todo list now.

It's done.  I verified that this gets you Vim 7.1 now:

aap -f http://www.a-a-p.org/vim/main.aap CVS=no

Using CVS already worked (didn't verify this...):

aap -f http://www.a-a-p.org/vim/main.aap

Or, if you used aap before, it's really simple:

aap update

-- 
hundred-and-one symptoms of being an internet addict:
122. You ask if the Netaholics Anonymous t-shirt you ordered can be
 sent to you via e-mail.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Bug: .viminfo file gets deleted and re-created with 666 permissions

2007-05-12 Thread Bram Moolenaar

Micah Cowan wrote:

 Following description lifted from bug filed at
 https://bugs.launchpad.net/ubuntu/+source/vim/+bug/78960
 
 
 [EMAIL PROTECTED]:~$ rm .viminfo
 [EMAIL PROTECTED]:~$ ln -s /dev/null .viminfo
 [EMAIL PROTECTED]:~$ ls -l .viminfo
 lrwxrwxrwx 1 sa sa 9 2007-01-12 17:16 .viminfo - /dev/null
 [EMAIL PROTECTED]:~$ umask 007
 [EMAIL PROTECTED]:~$ /usr/bin/vim.basic -c 'quit'
 [EMAIL PROTECTED]:~$ ls -l .viminfo
 -rw-rw-rw- 1 sa sa 509 2007-01-12 17:16 .viminfo
 
 As you can see the .viminfo file gets deleted and re-created with
 permissions 666 by vim.
 
 Note that the use of -c 'quit' is just to simplify the bug for
 transcribing here -- I promise you the same thing happens if you use vim
 for editing/saving a document as well.
 
 I consider this a security bug. vim deletes a file without telling me,
 and not only that but when it re-creates it, it ignores my umask by
 making it world writable. This is not what I expected it to do.
 

Do you seriously believe that when you create a symlink to /dev/null
that things continue to work normally?  Come on...

The solution is simple: Don't create a link in place of the .viminfo
file.  And certainly not to /dev/null.

Background info: When Vim finds an existing .viminfo file, it writes the
new info into a temp file (since it's still reading from the existing
one it can't be overwritten).  When finished the temp file is moved in
place of the old .viminfo and owner and protection are set to match the
original.

Vim intentionally doesn't follow symlinks for .viminfo, because that can
be used for a symlink attack, a security issue.

-- 
hundred-and-one symptoms of being an internet addict:
111. You and your friends get together regularly on IRC, even though
 all of you live in the same city.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: WARNING! Don't update your local svn repository now!

2007-05-12 Thread Bram Moolenaar

Edward L. Fox wrote:

 On 5/12/07, Bram Moolenaar [EMAIL PROTECTED] wrote:
 
  Nicolas Weber wrote:
 
The directories structure of the Subversion repository has been
changed. Please use this command to checkout the latest sources:
   
svn co https://vim.svn.sourceforge.net/svnroot/vim/branches/vim7.1 vim7
   
If you had checked out a copy of the sources before, please run this
command in your source root directory to switch into the current
branch:
   
svn switch https://vim.svn.sourceforge.net/svnroot/vim/branches/vim7.1
  
   Can someone update http://www.vim.org/subversion.php to reflect these
   changes?
 
  I was still discussing what should actually be there, and making sure
  that SVN contains that.
 
  In my opinion vim7 should get you the latest stable version.  So far
  that is 7.0.243, thus 7.0 with patches.  As soon as Vim 7.1 is out of
  beta then vim7 should get you Vim 7.1.
 
  vim7.1 should get you the latest version of Vim 7.1.  So far that is
  the beta version.  After the release it will be the stable version, thus
  the same as vim7.
 
  Still need to check that it actually works this way.
 
 It's already this way.
 
  There might also be other ways to get one of these, but that is less
  relevant.
 
  In my opinion we should keep it easy for the downloader to select one of
  the available versions.  The download page would only need one or two
  alternatives.
 
  I have never maintained a SVN repository, thus have no idea how
  difficult or easy these things are!
 
 I've found an easy way to solve that problem. So now can we can announce?

Great.  Note that Vim 7.1 should go out today (fingers crossed), so be
ready to update it again.

I'll update the subversion page on www.vim.org now.

-- 
hundred-and-one symptoms of being an internet addict:
112. You are amazed that anyone uses a phone without a modem on it...let
 alone hear actual voices.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Stable Vim version 7.1 has been released

2007-05-12 Thread Bram Moolenaar


Announcing:  Vim (Vi IMproved) version 7.1


This is a stable release of Vim, version 7.1.  Since version 7.0 lots of
problems were fixed and runtime files were updated.  It has been one
year and five days since 7.0!

Most of Vim 7.1 was already available as patches for quite a while.  A
couple of test versions were made to spot problems in the distribution.
Therefore Vim 7.1 can be considered very stable.

If you are using an older version, it is highly recommended you install
Vim 7.1.  Several crashing bugs and a security issue were fixed.

Once you have installed Vim 7.1 you can find details about the
changes since Vim 7.0 with :help version-7.1.

I will not make an Amiga or OS/2 binary for Vim 7.1.  A Mac version is
hopefully available soon on http://macvim.org/


Where to get it
---

All files can be found below this directory:
ftp://ftp.vim.org/pub/vim/

Information about which files to download for what system:
http://www.vim.org/download.php

A list of mirror sites can be found here:
http://www.vim.org/mirrors.php

Vim 7.1 is also available from CVS and Subversion:
http://www.vim.org/cvs.php
http://www.vim.org/subversion.php


An overview of the files:

UNIX:
unix/vim-7.1.tar.bz2   sources + runtime files, bzip2 compressed

VARIOUS:
extra/vim-7.1-extra.tar.gz extra files
extra/vim-7.1-lang.tar.gz  multi-language files
doc/vim71html.zip  help files converted to HTML

MS-WINDOWS:
pc/gvim71.exe  self-installing, includes all runtime files
pc/vim71rt.zip runtime files for binaries below
pc/vim71lang.zip   files for translated messages and menus
pc/gvim71.zip  GUI binary for Windows 95/98/NT/2000/XP
pc/gvim71ole.zip   GUI binary with OLE support
pc/gvim71_s.zipGUI binary for Windows 3.1
pc/vim71d16.zip16 bit console version for MS-DOS
pc/vim71d32.zipconsole version for MS-DOS/Windows 95/98
pc/vim71w32.zipconsole version for Windows NT/2000/XP
pc/vim71src.zipsources for PC (with CR-LF)

DIFFS TO PREVIOUS RELEASE:
unix/vim-7.0-7.1.diff.gzsources + runtime files
extra/vim-7.0-7.1-extra.diff.gz extra files
extra/vim-7.0-7.1-lang.diff.gz  multi-language files

unstable/unix/vim-7.1b-7.1.diff.gz  sources + runtime files
unstable/extra/vim-7.1b-7.1-extra.diff.gz   extra files
unstable/extra/vim-7.1b-7.1-lang.diff.gzmulti-language files


Mailing lists
-

For user questions you can turn to the Vim mailing list.  There are a
lot of tips, scripts and solutions.  You can ask your Vim questions, but
only if you subscribe.  See http://www.vim.org/maillist.php#vim

If you want to help Vim development or get the latest patches, subscribe
to the vim-dev mailing list.  See http://www.vim.org/maillist.php#vim-dev

Subject specific lists:
Multi-byte issues: http://www.vim.org/maillist.php#vim-multibyte
Macintosh issues:  http://www.vim.org/maillist.php#vim-mac

Before you ask a question you should search the archives, someone may
already have given the answer.


Reporting bugs
--

Send them to [EMAIL PROTECTED].  Please describe the problem precisely.
All the time spent on answering mail is subtracted from the time that is
spent on improving Vim!  Always give a reproducible example and try to
find out which settings or other things influence the appearance of the
bug.  Try starting without your own vimrc file: vim -u NONE.  Try
different machines if possible.  See :help bugs in Vim.  Send me a
patch if you can!

If something needs discussing with other developers, send a message to the
vim-dev mailing list.  You need to subscribe first.


Happy Vimming!

-- 
hundred-and-one symptoms of being an internet addict:
114. You are counting items, you go 0,1,2,3,4,5,6,7,8,9,A,B,C,D

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: BUG: wrong recognition of words in Vim7.1b on Windows

2007-05-11 Thread Bram Moolenaar

Mikolaj Machowski wrote:

 Vim 7.1b on Windows XP doesn't properly recognizes words. It does not 
 count Polish diacritics in, so each one is treated as separate word.
 
 This is serious bug and with taking into account that Windows users can 
 have problems with getting patched versions it is IMO showstopper.
 
 In its nature it may be similar to bug fixed by 6.3.052 - not proper 
 recognition of non ASCII characters (but inserting works).
 
 On Linux everything works OK.
 
 gvim7.1b from ftp.vim.org
 v:lang = PL
 v:lc_time = Polish_Poland.1250
 encoding = cp1250

What do you mean with recognizing a word?  What commands do you use?

What version of Vim (console/GUI/...)?  Did you compile yourself or use
one of the distributed binaries?  What is the :version output?

What is 'iskeyword' set to and where was it set?  What if you use vim
-u NONE?

Very likely this is a problem in your setup, not in Vim.  So please
check your setup carefully before blaming Vim.

-- 
hundred-and-one symptoms of being an internet addict:
95. Only communication in your household is through email.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: BUG: wrong recognition of words in Vim7.1b on Windows

2007-05-11 Thread Bram Moolenaar

Mikolaj Machowski wrote:

   Vim 7.1b on Windows XP doesn't properly recognizes words. It does not
   count Polish diacritics in, so each one is treated as separate word.
   
   This is serious bug and with taking into account that Windows users can
   have problems with getting patched versions it is IMO showstopper.
   
   In its nature it may be similar to bug fixed by 6.3.052 - not proper
   recognition of non ASCII characters (but inserting works).
   
   On Linux everything works OK.
   
   gvim7.1b from ftp.vim.org
   v:lang = PL
   v:lc_time = Polish_Poland.1250
   encoding = cp1250
  
  What do you mean with recognizing a word?  What commands do you use?
 
 Eg. diw
 
 For example when using diw on '³±ka' (meadow) on 1st character it 
 removes only first two characters, the same for 2nd character, when 
 using on 3rd or 4th char it removes last 2 chars.
 
  
  What version of Vim (console/GUI/...)?  Did you compile yourself or use
  one of the distributed binaries?  What is the :version output?
 
 *G*vim binaries from ftp.vim.org
 
 VIM - Vi IMproved 7.1b BETA (2007 May 10, compiled May 10 2007 17:57:09)
 MS-Windows 32 bit GUI version
 Compiled by [EMAIL PROTECTED]
 Big version with GUI.  Features included (+) or not (-):
[...]
  
  What is 'iskeyword' set to and where was it set?
 When started normally
 @,48-57,_,128-167,224-235
 When -U NONE
 @,48-57,_

That @ means that Vim uses the library function isalpha().  Apparently
your environment is not setup properly for isalpha() to work with your
encoding cp1250.  Thus that is a problem with your
library/system/environment.

You can fix it by manually setting 'iskeyword'.  Vim has no other way to
find out what are word characters in your language and encoding.

Or you can use 'encoding' set to utf-8, because then Vim knows which
characters are word characters.

-- 
hundred-and-one symptoms of being an internet addict:
96. On Super Bowl Sunday, you followed the score by going to the
Yahoo main page instead of turning on the TV.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.1b.002

2007-05-11 Thread Bram Moolenaar

Patch 7.1b.002
Problem:When 'maxmem' is large there can be an overflow in computations.
(Thomas Wiegner)
Solution:   Use the same mechanism as in mch_total_mem(): first reduce the
multiplier as much as possible.
Files:  src/memfile.c


*** ../vim-7.1b.001/src/memfile.c   Thu May 10 21:17:23 2007
--- src/memfile.c   Fri May 11 19:50:12 2007
***
*** 190,196 
  mfp-mf_blocknr_min = -1;
  mfp-mf_neg_count = 0;
  mfp-mf_infile_count = mfp-mf_blocknr_max;
! mfp-mf_used_count_max = p_mm * 1024 / mfp-mf_page_size;
  
  return mfp;
  }
--- 190,214 
  mfp-mf_blocknr_min = -1;
  mfp-mf_neg_count = 0;
  mfp-mf_infile_count = mfp-mf_blocknr_max;
! 
! /*
!  * Compute maximum number of pages ('maxmem' is in Kbyte):
!  *'mammem' * 1Kbyte / page-size-in-bytes.
!  * Avoid overflow by first reducing page size as much as possible.
!  */
! {
!   int shift = 10;
!   unsignedpage_size = mfp-mf_page_size;
! 
!   while (shift  0  (page_size  1) == 0)
!   {
!   page_size = page_size  1;
!   --shift;
!   }
!   mfp-mf_used_count_max = (p_mm  shift) / page_size;
!   if (mfp-mf_used_count_max  10)
!   mfp-mf_used_count_max = 10;
! }
  
  return mfp;
  }
*** ../vim-7.1b.001/src/version.c   Thu May 10 22:19:40 2007
--- src/version.c   Fri May 11 20:09:22 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 2,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
99. The hum of a cooling fan and the click of keys is comforting to you.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: WARNING! Don't update your local svn repository now!

2007-05-11 Thread Bram Moolenaar

Nicolas Weber wrote:

  The directories structure of the Subversion repository has been
  changed. Please use this command to checkout the latest sources:
  
  svn co https://vim.svn.sourceforge.net/svnroot/vim/branches/vim7.1 vim7
  
  If you had checked out a copy of the sources before, please run this
  command in your source root directory to switch into the current
  branch:
  
  svn switch https://vim.svn.sourceforge.net/svnroot/vim/branches/vim7.1
 
 Can someone update http://www.vim.org/subversion.php to reflect these
 changes?

I was still discussing what should actually be there, and making sure
that SVN contains that.

In my opinion vim7 should get you the latest stable version.  So far
that is 7.0.243, thus 7.0 with patches.  As soon as Vim 7.1 is out of
beta then vim7 should get you Vim 7.1.

vim7.1 should get you the latest version of Vim 7.1.  So far that is
the beta version.  After the release it will be the stable version, thus
the same as vim7.

Still need to check that it actually works this way.

There might also be other ways to get one of these, but that is less
relevant.

In my opinion we should keep it easy for the downloader to select one of
the available versions.  The download page would only need one or two
alternatives.

I have never maintained a SVN repository, thus have no idea how
difficult or easy these things are!

-- 
In a world without walls and borders, who needs windows and gates?

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: [PATCH] gvim: Fix compilation against GNOME 2.18

2007-05-10 Thread Bram Moolenaar

Daniel Drake wrote:

 gvim with FEAT_GUI_GNOME fails to compile against GNOME 2.18. See 
 https://bugs.gentoo.org/show_bug.cgi?id=176566 for more info.
 
 This patch solves the problem.

Thanks.  Looks safe to include now.

-- 
There's no place like $(HOME)!

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


RE: 7.1a.001 OSX colour scheme errors?

2007-05-10 Thread Bram Moolenaar

Michael Wookey wrote:

   Has anyone else noticed this?
 
  You apparently are missing the runtime/rgb.txt file.  It's part of the
  extra archive.  Perhaps you didn't unpack it correctly?  You must have
  unpacked it, since it contains src/gui_mac.c.  And you must not change
  the directory structure, otherwise Vim.app can't be generated
  correctly.
 
 I have the rgb.txt in my build tree.  Its just that 'make install'
 doesn't copy it over when building Vim.App.  See further on in this
 thread with the subject [SOLVED] RE: 7.1a.001 OSX colour scheme
 errors?.
 
 Is it possible for you to change the Makefile to copy rgb.txt to
 $VIMRUNTIME during 'make install'?

OK, I was trying the Vim.app after building it.  Then it uses a link to
the runtime files, thus rgb.txt is there.

I'll add a specific line to copy rgb.txt.

-- 
I AM THANKFUL...
...for the clothes that fit a little too snug because it
means I have more than enough to eat.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: [PATCH] vim_is_xterm() and screen

2007-05-10 Thread Bram Moolenaar

Micah Cowan wrote:

  
  Sorry for the repost; but I realized I should've drawn more attention  to
  the message with the patch in it, both so other lurkers know the threa d
  now includes a proposed patch, and so that we know what message to go
  back to if we want to refer to the code we're discussing.
 
  I have made a slight adjustment to the patch, swapping the order of
  STRICMP and term_is_xterm within vim_uses_xterm_mouse(). I was using
  vim_is_xterm() instead of term_is_xterm at first, but afterwards
  replaced it for efficiency, but left the order as it was.
  
  Looks OK to me.
 
 Terrific! Does that mean it'll go in? :)

Probably, but not right now.

  If I understood your other message correctly then using xterm2 for
  'ttymouse' would not work for screen.
 
 Well... manually setting it to xterm2 will work fine (assuming screen
 is running under a supporting version of xterm): I get the full dragging
 effect, etc. But screen doesn't do t_RV, and I don't know how else you'd
 determine support for xterm2, so there doesn't seem to be a safe way
 to set ttymouse to it automatically, for screen.
 
 Towards a better solution: how straightforward do you think it'll be to
 talk the ncurses guys into adding support for some of screen's
 extensions? AFAIK, the only one I care about is the xterm mouse support;
 another interesting one is a boolean supports ansi
 setforeground/setbackground codes; but I usually infer this (if
 necessary) from the presence of setaf/setbf (not a given, but...).

I think you need to talk to more people than ncurses for changing the
termcap/terminfo entries.  But it's a good start.

- Bram

-- 
From know your smileys:
 :-FBucktoothed vampire with one tooth missing

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Two patches against the latest VIM 7.0.x

2007-05-10 Thread Bram Moolenaar

Martti Kuparinen wrote:

 I don't remember if I have already submitted these before... These two
 patches add some NetBSD specific keywords. Please include these in the
 official source code.

Please send patches for Vim scripts directly to their maintainers.  For
syntax/fstab.vim that is Radu Dineiu.

The change to filetype.vim was already included.

-- 
From know your smileys:
 [:-)   Frankenstein's monster

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: what feature is required to return to last editing position?

2007-05-10 Thread Bram Moolenaar

Micah Cowan wrote:

 Copying the dev list. The missing context is that running vim via sudo
 before having run it as regular user, causes permission problems with
 the created .viminfo file (and others?).
 
 Vincent BEFFARA wrote:
  Wonderful, the problem really is about permission of .viminfo!
 
  I noticed that you considered this to be a bug, but is this bug belon gs 
  to
  sudo or vim?
 
  i.e. for non-interactive su of root, vim will save at user $HOME  
  with
  root permission.
  FYI, this same issue was discussed at
  https://bugs.launchpad.net/ubuntu/+bug/58002
  
  From that discussion it would appear that it is a bug of neither, but
  rather of Ubuntu itself : sudo (as configured there) preserves $HOME,
  vim sees it and uses it to create .viminfo if it is not there. The
  natural fix is to put the right option in the sudo config file
  (always_set_home or something sounding like that).
 
 Except that this isn't always what is desired. And, if it's a bug of
 Ubuntu, it's also a bug of every other distribution I've ever known
 (thought there probably are some of which I'm aware, that set this).
 
 The biggest beef I would have with setting that option is that there
 doesn't appear to be a way to /disable/ it for individual cases :p
 ...still, I can't envision a reasonable case where the user couldn't
 simply type out his own home directory (~user instead of ~?), or if
 necessary set the environment himself within the sudo command, so it may
 be a reasonable solution.
 
  However, it would be nice of vim to always test that it owns the $HOME
  directory before creating files there. Would it break anything ?
 
 I think this would be a good idea as well. One could argue that if we
 reason this way for vim, we should reason this way about everything that
 ever creates config files in the user's home directory; however, not
 every such thing can be expected to be run as root, and editors--and
 most particularly vim--are extremely likely to be run as root, so I
 think it's not unreasonable to ask them to take on this responsibility.

And what if root always uses $HOME/.viminfo, where $HOME is the only
person who can be root?  It might be that there is no root home
directory.

Let's keep it simple: $HOME/.viminfo is the default viminfo file.  If
you want to use another file you have to tell Vim.

 Perhaps rather than simply avoiding file creation, in the case of root
 we could set the file's owner to the real id/gid, instead of the
 effective one. This option is unavailable when the user is sudoing as
 non-root, but this seems much less likely to happen before having run it
 normally, than running under sudo is.

Giving away a file is a big no-no for security reasons.  Root may yank
text in a register that a normal user is not supposed to see and this
ends up in the viminfo file.

 Another issue, which was touched on in that Ubuntu bug report, is that
 vim doesn't warn or anything when it can't open .viminfo. Perhaps it
 should distinguish between ENOENT and EPERM, and warn in the latter
 case? It should possibly also warn in the event that it decides to
 change ownership as above (if this is decided to be a good idea), or
 when it is not created because of non-root, non-HOME-owner effective
 user id.

:set verbose=1

When ACLs are used there are many ways reading a file can fail.  Just
mentioning that it failed should be sufficient, the user will have to
figure out why.  That's better than a wrong message.

-- 
From know your smileys:
 :-| :-|   Deja' vu!

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Vim version 7.1b BETA has been released

2007-05-10 Thread Bram Moolenaar


Announcing:  Vim (Vi IMproved) version 7.1b BETA


This is a BETA release of Vim 7.1.  It consists of Vim 7.0 plus all
patches, updated runtime files and a few fixes.

If you were using 7.1a please upgrade to 7.1b and verify it works well.
Please report every problem you find!  It will only be a couple of days
until the 7.1 release, so hurry.

Once you have installed Vim 7.1b BETA you can find details about the
changes since Vim 7.0 with :help version-7.1.

Changes since 7.1a:

- Lots of spelling mistakes fixed.
- Several runtime files updated.  Somehow people tend to send me updates
  _after_ doing a release...
- Bug in downloading a missing spell file fixed.  Could wipe out a
  buffer with your text when downloading failed.
- Building with MingW fixed (and now Win32s version also builds).
- Editing compressed files didn't work when folding enabled.


Testing
---

This is a BETA test version.  Please give it a good test and report
anything that isn't right.  That includes a crash but also a typo in the
documentation.

I will not make an Amiga or OS/2 binary for Vim 7.1b.  A Mac version is
hopefully available soon on http://macvim.org/


Where to get it
---

All files can be found below this directory:
ftp://ftp.vim.org/pub/vim/unstable/

Information about which files to download for what system (don't use the
links, they are still for Vim 7.0):
http://www.vim.org/download.php

A list of mirror sites can be found here:
http://www.vim.org/mirrors.php

Vim 7.1b is also available from CVS (soon, still checking in):
http://www.vim.org/develop.php


An overview of the files:

UNIX:
unix/vim-7.1b.tar.bz2   sources + runtime files, bzip2 compressed

VARIOUS:
extra/vim-7.1b-extra.tar.gz extra files
extra/vim-7.1b-lang.tar.gz  multi-language files
doc/vim71bhtml.zip  help files converted to HTML

MS-WINDOWS:
pc/gvim71b.exe  self-installing, includes all runtime files
pc/vim71brt.zip runtime files
pc/vim71blang.zip   files for translated messages and menus
pc/gvim71b.zip  GUI binary for Windows 95/98/NT/2000/XP
pc/gvim71bole.zip   GUI binary with OLE support
pc/gvim71b_s.zipGUI binary for Windows 3.1 (untested)
pc/vim71bd16.zip16 bit console version for MS-DOS
pc/vim71bd32.zipconsole version for MS-DOS/Windows 95/98
pc/vim71bw32.zipconsole version for Windows NT/2000/XP
pc/vim71bsrc.zipsources for PC (with CR-LF)

DIFFS TO PREVIOUS RELEASE:
unix/vim-7.1a-7.1b.diff.gz  sources + runtime files
extra/vim-7.1a-7.1b-extra.diff.gz   extra files
extra/vim-7.1a-7.1b-lang.diff.gzmulti-language files


Mailing lists
-

For user questions you can turn to the Vim mailing list.  There are a
lot of tips, scripts and solutions.  You can ask your Vim questions, but
only if you subscribe.  See http://www.vim.org/maillist.php#vim

If you want to help Vim development or get the latest patches, subscribe
to the vim-dev mailing list.  See http://www.vim.org/maillist.php#vim-dev

Subject specific lists:
Multi-byte issues: http://www.vim.org/maillist.php#vim-multibyte
Macintosh issues:  http://www.vim.org/maillist.php#vim-mac

Before you ask a question you should search the archives, someone may
already have given the answer.


Reporting bugs
--

Send them to [EMAIL PROTECTED].  Please describe the problem precisely.
All the time spent on answering mail is subtracted from the time that is
spent on improving Vim!  Always give a reproducible example and try to
find out which settings or other things influence the appearance of the
bug.  Try starting without your own vimrc file: vim -u NONE.  Try
different machines if possible.  See :help bugs in Vim.  Send me a
patch if you can!

If something needs discussing with other developers, send a message to the
vim-dev mailing list.  You need to subscribe first.


Happy Vimming!

-- 
From know your smileys:
 C=};*{)) Drunk, devilish chef with a toupee in an updraft,
   a mustache, and a double chin

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.1b.001

2007-05-10 Thread Bram Moolenaar

Patch 7.1b.001 (extra)
Problem:Random text in a source file.  No idea how it got there.
Solution:   Delete the text.
Files:  src/gui_w32.c


*** ../vim-7.1b.000/src/gui_w32.c   Thu May 10 20:18:47 2007
--- src/gui_w32.c   Thu May 10 22:03:22 2007
***
*** 1,4 
! s, if any./* vi:set ts=8 sts=4 sw=4:
   *
   * VIM - Vi IMproved  by Bram Moolenaar
   *GUI support by Robert Webb
--- 1,4 
! /* vi:set ts=8 sts=4 sw=4:
   *
   * VIM - Vi IMproved  by Bram Moolenaar
   *GUI support by Robert Webb
*** ../vim-7.1b.000/src/version.c   Thu May 10 20:25:06 2007
--- src/version.c   Thu May 10 22:18:04 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 1,
  /**/

-- 
From know your smileys:
 |-) Chinese
 |-( Chinese and doesn't like these kind of jokes

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: (Doc bug) Error in options.txt

2007-05-09 Thread Bram Moolenaar

Tony Mechelynck wrote:

 One word under :help 'ttymouse' was obviously forgotten when that
 option got more possible settings. See suggested patch, attached.

To avoid it being forgotten again, I'll simply remove the count.

-- 
From know your smileys:
 :-{}   Too much lipstick

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Could you please give me the most bleeding-edge sources?

2007-05-09 Thread Bram Moolenaar

Edward L Fox wrote:

 I noticed that you also maintained another CVS repository besides the
 sf.net's CVS repository. And many changes to that internal CVS won't
 be applied to the sf.net's CVS repository unless a large release is to
 be made.
 
 In my opinion, as the SVN repository is now standardized, could you
 please give me the most bleeding-edge sources so that I can commit
 them into the trunk/ directory of the SVN repository, and some users
 who wish to use the unstable experimental version then can help you to
 test the code.

I don't know what you are talking about.  The most recent version is the
distributed archives plus the patches plus updated runtime files.  In
CVS is that minus runtime file updates.

There are a few changes on my local harddisk, but they are not in a
patch yet for good reasons.

-- 
From know your smileys:
 =):-)  Uncle Sam

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: 7.1a.001 OSX colour scheme errors?

2007-05-09 Thread Bram Moolenaar

Michael Wookey wrote:

 I am running 7.1a.001 on OSX and have just noticed the following from
 console vim (running in Terminal.app and also occurs in iTerm.app).
 
 If I change the colour scheme I receive a lot of error output.  For
 example:
 
 :colorscheme desert
 
 Results in:
 
 Error detected while processing
 /Applications/Vim.app/Contents/Resources/vim/runtime/colors/desert.vim:
 line   27:
 E254: Cannot allocate color khaki
 E254: Cannot allocate color slategrey
 line   36:
 E254: Cannot allocate color gold
 line   37:
 E254: Cannot allocate color tan
 ...
 
 Other colour schemes produce similar output.  The error messages have
 only appeared for me in console vim on OSX (10.4.9 PPC).  They have not
 appeared in the linux or win32 console vims of 7.1a.001. GVim's on each
 of the platforms (OSX, linux, Win32) have worked fine.
 
 My console vim is symlinked as follows:
 
 $ ls -l `which vim`
 lrwxr-xr-x   1 root  wheel  40 Feb 28 14:33 /usr/bin/vim -
 /Applications/Vim.app/Contents/MacOS/Vim
 
 These errors did not occur before 7.1a.001 and occurs on builds from CVS
 and SVN.  The errors still occur even with starting vim with:
 
 vim -u NONE
 
 Has anyone else noticed this?

You apparently are missing the runtime/rgb.txt file.  It's part of the
extra archive.  Perhaps you didn't unpack it correctly?  You must have
unpacked it, since it contains src/gui_mac.c.  And you must not change
the directory structure, otherwise Vim.app can't be generated correctly.

-- 
From know your smileys:
 :-XMy lips are sealed

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: [PATCH] vim_is_xterm() and screen

2007-05-09 Thread Bram Moolenaar

Micah Cowan wrote:

 Sorry for the repost; but I realized I should've drawn more attention to
 the message with the patch in it, both so other lurkers know the thread
 now includes a proposed patch, and so that we know what message to go
 back to if we want to refer to the code we're discussing.
 
 I have made a slight adjustment to the patch, swapping the order of
 STRICMP and term_is_xterm within vim_uses_xterm_mouse(). I was using
 vim_is_xterm() instead of term_is_xterm at first, but afterwards
 replaced it for efficiency, but left the order as it was.

Looks OK to me.

If I understood your other message correctly then using xterm2 for
'ttymouse' would not work for screen.

-- 
From know your smileys:
 :-DBig smile

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: VimWiki - again - but with a brand new option

2007-05-09 Thread Bram Moolenaar

Ian Tegebo wrote:

   On 5/6/07, Sebastian Menge [EMAIL PROTECTED] wrote:
Hi all
   
Independent of the implementation used, I suggest to develop good
guidelines. The Wiki should be really valuable and not redundant to
vim-tips or mailing-lists.
  
   I would like to make another implementation independent suggestion;
   one could make a VimWiki more valuable by importing the _extremely_
   valuable vim helpfiles into it.
 
  Please don't do this.  It might sound like a nice idea, but it means
  making a branch that will be very hard to merge back into the help files
  of the distribution.
 I feel misunderstood but it serves me right for not saying what I mean...
 
 Synchronizing data is no fun, I agree.  While I was up in the clouds I
 was imaging that the wiki would be the authoritative source for the
 helpfiles after doing an initial _import_.   Then the text version
 would be exported as needed, e.g. end user runtime update or for a new
 release.

That's the problem: It's very easy to change the text in the wiki in
such a way it won't be possible to put back in the distribution.

Also, I need to check every change, at least briefly (depend on where
the change comes from).  That is the only way to maintain the quality.
Thus I would need a list of changes, preferably in the form of a patch.
When people change the wiki in various ways this will quickly become a
nightmare.

Taking the existing help files and _adding_ to them is good.  Especially
if corrections and additions are marked somehow, so that they eventually
end up in the distribution.  Otherwise links to tips can be added.

I'm currently working on the 7.1 release and then will go travelling,
thus I won't have much time to discuss the tips wiki.  I certainly
encourage everybody to make it work.  After all, a wiki is a
collaborative work!

-- 
From know your smileys:
 2B|^2B   Message from Shakespeare

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Vim version 7.1a BETA -- runtime files ?

2007-05-08 Thread Bram Moolenaar

Yakov Lerner wrote:

   On 5/5/07, Bram Moolenaar [EMAIL PROTECTED] wrote:
Announcing:  Vim (Vi IMproved) version 7.1a BETA
  
   I compared runtime files form ftp [1] and from svn [2].
   Both vims are labeled vim71a. But many runtimes are different.
   In svn, many files are labeled 2007. In ftp, they are 2006 versions.
   Why this difference in runtimes ?
  
   Yakov
   [1] ftp://ftp.vim.org/pub/vim/unstable/unix/vim-7.1a.tar.bz2
   [2] https://svn.sourceforge.net/svnroot/vim/vim7
 
  Do I need to hunt down the differences?  Please give a specific example.
  What label are you talking about?
 
 At closer examination, differences turned out to be in $Id..$, $Revision..$
 $Date...$ lines only, except for one file which has read differences:
 runtime/autoload/spellfile.vim -- see diffs below.
 By labels I meant the cvs  $Id...$ keywords and other $..$ keywords.
 Full diffs are attached. Diffs are produced by the script diff-vim-ftp-svn.sh,
 also attached.

Oh, the CVS version lines.  I ignore them.  In my opinion meta
information should not be inside the file.

The spellfile.vim script was changed by the one patch that went out for
Vim 7.1a.  Fixed a conflict with netrw changes that so far went
unnoticed.

So nothing to worry about.

-- 
Ed's Radiator Shop: The Best Place in Town to Take a Leak.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Compiling vim in mingw.

2007-05-08 Thread Bram Moolenaar

Markus Trenkwalder wrote:

 Suresh Govindachar wrote:
Bram Moolenaar wrote:
 Markus Trenkwalder wrote:

checked out vim-7.1a.001 today from svn (#263) and tried to
compile it with mingw-gcc and got the following error:
 
 8
 $ make -f Make_ming.mak
 gcc -c -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400
 -DHAVE_PATHDEF -DFEAT_BIG -DHAVE_GETTEXT -DHAVE_LOCALE_H
 -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG
 -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME
 -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=i386 -Wall -O3
 -fomit-frame-pointer -freg-struct-return -s gui_w32.c -o
 gobj/gui_w32.o gui_w32.c:236: error: redefinition of `struct
 tagNMTTDISPINFOA' gui_w32.c:246: error: redefinition of `struct
 tagNMTTDISPINFOW' make: *** [gobj/gui_w32.o] Error 1 8
  
I get the same error message.  I recursively grepped for
NMTTDISPINFO and examined the output, but did not find any
redefinition!  No clue where the compiler is finding the
redefinitions.
  
 My naive solution to this problem is:
 8
 --- src/gui_w32.c.000   Mon May  7 08:26:54 2007
 +++ src/gui_w32.c   Mon May  7 07:01:09 2007
 @@ -232,7 +232,7 @@
   LPARAM lParam;
   } NMTTDISPINFO_NEW;
 
 -#ifndef LPNMTTDISPINFO
 +#if !defined(LPNMTTDISPINFO)  !defined(TOOLTIPTEXTA)
   typedef struct tagNMTTDISPINFOA {
   NMHDR  hdr;
   LPSTR  lpszText;
 8
 
 What does TOOLTIPTEXTA have to do with this?  I don't understand
 why you try to solve it this way.
 
 Someone else also reported this problem while it worked OK
 earlier.  Perhaps there is something wrong with the way you
 obtained the sources?
  
(Tony reported working around the error message by not using svn.)
  
I got the sources from svn the same why I have always been getting
the sources (the whole process of get sources, build, deploy,
update runtime is automated in scripts).
 
 The symbol is defined in mingw in the file '/include/commctrl.h' through
 the file '/include/pshpack1.h'.  The relevant part in mingw's version of
 commctrl.h (starting at line 2368) is:
 8
 ...
 typedef struct tagNMTTDISPINFOA {
  NMHDR hdr;
  LPSTR lpszText;
  char szText[80];
  HINSTANCE hinst;
  UINT uFlags;
 #if (_WIN32_IE = 0x0300)
  LPARAM lParam;
 #endif
 } NMTTDISPINFOA, *LPNMTTDISPINFOA;
 #define TOOLTIPTEXTANMTTDISPINFOA
 #define LPTOOLTIPTEXTA  LPNMTTDISPINFOA
 ...
 8
 
 So the only chance I had to detect if tagNMTTDISPINFOA is defined alredy
 was to test one of the TOOLTIP macros.  I know this is not the most
 beautyful solution but I just wanted to show the problem and provide one
 possible solution.
 
 I'll try to compile the FTP-sources now and see if the problem still
 exists there -- report will follow.

Pity we can't check for typedefs with the preprocessor.  It indeed looks
like checking for LPTOOLTIPTEXT not being defined is the best solution,
although it looks weird.  Let's add a comment that explains it:


/* Older compilers don't have LPNMTTDISPINFO[AW].
 * MingW doesn't define LPNMTTDISPINFO but typedefs it.  Therefore check
 * LPTOOLTIPTEXT which is defined to be the same. */
#if !defined(LPNMTTDISPINFO)  !defined(LPTOOLTIPTEXT)
typedef struct tagNMTTDISPINFOA {
NMHDR   hdr;


Hopefully that works for everybody.  And without some magic dependency
on MingW or gcc.

-- 
hundred-and-one symptoms of being an internet addict:
91. It's Saturday afternoon in the middle of May and you
are on computer.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: vim_is_xterm() and screen

2007-05-08 Thread Bram Moolenaar

Micah Cowan wrote:

 Some folks who like to use vim under GNU screen, myself included, would
 like the ability for vim to automatically support xterm mouse escape
 sequences. Would it be a workable solution for vim to include screen
 as one of the initial strings for terms that trigger truth for
 vim_is_xterm()?

No, because screen is not an xterm.  The screen termcap/terminfo entry
differs from xterm.
 
 I'm guessing that a problem for this, might be the fact that if vim
 detects xterm-ish terminals, it automatically tries the t_RV sequence
 out, which isn't dependably valid for screen.
 
 If this is the case, perhaps there could be a vim_might_be_xterm(),
 which could set ttymouse to xterm, on the off-chance that the terminal
 may send it xterm-style mouse sequences, but leave t_RV empty so that it
 doesn't risk sending unrecognized stuff that the terminal may choose to
 display directly?
 
 The thing is, is that users of screen are able to use some other
 programs, such as elinks, and will wonder why vim can't work just as
 well. Are there any real impediments to it doing so?
 
 I suspect that my solution could actually be made much more simple by
 simply assuming that all terms might be xterm, thus eliminating the
 need to actually implement a function (just set ttymouse to xterm by
 default, again leaving t_RV).

There doesn't appear to be a standard for mouse escape sequences.  And
termcap/terminfo is too limited for the features of modern terminal
emulaters.  That means the only choice for Vim is to implement mouse
support for each terminal separately.  If screen uses the same codes as
xterm then this should be relatively simple.

It's about time termcap/terminfo gets updated to support the features we
need, instead of hacking solutions in all programs.  I'm afraid I don't
have time for this (the original development of termcap was closely
related to the early development of vi).

-- 
From know your smileys:
 :-)-O  Smiling doctor with stethoscope

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: surprised by beta

2007-05-08 Thread Bram Moolenaar

Mr Toothpik wrote:

 i was surpised by the fact that simply running 'svn update' bumped me
 up to 7.1a -- from previous posts i had thought there was something
 extra that had to be done to get the beta, like create a new 71a
 directory or something
 
 now i've got the beta i feel committed, and will commence chasing
 after the errors it spews from
 
   /usr/local/share/vim/vim71a/filetype.vim
 
 when i run it -- apparently the install created the 71a directory for me

What errors?

-- 
How many light bulbs does it take to change a person?

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: VimWiki - again - but with a brand new option

2007-05-08 Thread Bram Moolenaar

Ian Tegebo wrote:

 On 5/6/07, Sebastian Menge [EMAIL PROTECTED] wrote:
  Hi all
 
  Independent of the implementation used, I suggest to develop good
  guidelines. The Wiki should be really valuable and not redundant to
  vim-tips or mailing-lists.

 I would like to make another implementation independent suggestion;
 one could make a VimWiki more valuable by importing the _extremely_
 valuable vim helpfiles into it.

Please don't do this.  It might sound like a nice idea, but it means
making a branch that will be very hard to merge back into the help files
of the distribution.

Please use the wiki for tips.  That is an addition to the help files.

 For example, I would love to be able to quickly correct spelling
 mistakes or contribute to plugin helpfiles a la a Wiki interface.  I
 could then imagine updating my local helpfiles through the Wiki
 interface via a sync-plugin.

If you see spelling mistakes in the help files please send them to me.
I just fixed 250 of them, because someone send me a list.  That's useful
for everyone.

The main goal now is to get the Vim tips collection back to live.  It
has been dead for three months now!

Perhaps we can figure out some clever way to also make the help files
available with links between the tips and the help files.  Thus in
the help file you would see some link that takes you to a tip associated
with the text at that position.  But without that the tips are still
very useful.

-- 
From know your smileys:
 O:-)   Saint

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Compiling vim in mingw.

2007-05-07 Thread Bram Moolenaar

Markus Trenkwalder wrote:

checked out vim-7.1a.001 today from svn (#263) and tried to compile 
 it with mingw-gcc and got the following error:
 
 8
 $ make -f Make_ming.mak
 gcc -c -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 
 -DHAVE_PATHDEF -DFEAT_BIG -DHAVE_GETTEXT -DHAVE_LOCALE_H 
 -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_GUI_W32 
 -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME 
 -DDYNAMIC_ICONV -pipe -w -march=i386 -Wall -O3 -fomit-frame-pointer 
 -freg-struct-return -s gui_w32.c -o gobj/gui_w32.o
 gui_w32.c:236: error: redefinition of `struct tagNMTTDISPINFOA'
 gui_w32.c:246: error: redefinition of `struct tagNMTTDISPINFOW'
 make: *** [gobj/gui_w32.o] Error 1
 8
 
 My naive solution to this problem is:
 8
 --- src/gui_w32.c.000   Mon May  7 08:26:54 2007
 +++ src/gui_w32.c   Mon May  7 07:01:09 2007
 @@ -232,7 +232,7 @@
   LPARAM lParam;
   } NMTTDISPINFO_NEW;
 
 -#ifndef LPNMTTDISPINFO
 +#if !defined(LPNMTTDISPINFO)  !defined(TOOLTIPTEXTA)
   typedef struct tagNMTTDISPINFOA {
   NMHDR  hdr;
   LPSTR  lpszText;
 8

What does TOOLTIPTEXTA have to do with this?  I don't understand why you
try to solve it this way.

Someone else also reported this problem while it worked OK earlier.
Perhaps there is something wrong with the way you obtained the sources?

-- 
Proof techniques #2: Proof by Oddity.
SAMPLE: To prove that horses have an infinite number of legs.
(1) Horses have an even number of legs.
(2) They have two legs in back and fore legs in front.
(3) This makes a total of six legs, which certainly is an odd number of
legs for a horse.
(4) But the only number that is both odd and even is infinity.
(5) Therefore, horses must have an infinite number of legs.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: syntax highlighting addition

2007-05-07 Thread Bram Moolenaar

Jonathan Smith wrote:

 I know this is sortof late notice, but it would be great if this could
 go in 7.1 final :)
 
  The empty comment is still there.  Just leave that line blank.  No
  biggie, of course, just aesthetics.
 
 i could have sworn i fixed it. this time, though, it really is fixed. :)
 
  runtime! syntax/python.vim
 
  Just to make sure: Python is allowed anywhere in a conary recipe?
 
 correct. a recipe is a special type of python file
 
  syn match   conaryMacro %(\w*)[sd] contained
  syn match   conaryBadMacro  %(\w*)[^sd] contained  no final marker
 
  OK, so you can have the following:
 
  %()s
 
  or should it be %(\w\+)[sd]
 
 you're right. fixed
 
HiLink conaryUseFlag  Typedef
 
  Substitute that with
  hi def link conaryrecipeMacro Macro
  :
  :
 
 fixed
 
  (If conary recipe macros aren't much like macros in C, then perhaps
  Special is better.  Also note the linking of a generic group to
  function and then other groups linking to them so that a user can
  change them all en masse, to something they like.)
 
 fixed
 
  That HiLink cruft is also Vim5 compatibility stuff.  And remove the if
  statement.
 
 fixed
 
  let b:current_syntax = recipe
 
  This should be
 
  let b:current_syntax = conaryrecipe
 
 fixed

The only thing that I now spot is that the syntax items start with
conary instead of conaryrecipe.  That's a tiny issue though, since
if there is another conaryXXX syntax you can make sure there are no
conflicts.

I'll include the syntax file now.

-- 
hundred-and-one symptoms of being an internet addict:
80. At parties, you introduce your spouse as your service provider.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Where to find 7.1a patchlevels runtimes? (Was: patch 7.1a.001)

2007-05-07 Thread Bram Moolenaar

Tony Mechelynck wrote:

 Bram Moolenaar wrote:
  Patch 7.1a.001
  Problem:Crash when downloading a spell file.  (Szabolcs Horvat)
  Solution:   Avoid that did_set_spelllang() is used recursively when a new
  window is opened for the download.
  Also avoid wiping out the wrong buffer.
  Files:  runtime/autoload/spellfile.vim, src/buffer.c, src/ex_cmds.c,
  src/spell.c
 [...]
 
 After a little hunting, I found this patch on the ftp server too (with
 README, MD5 and MD5SUMS):
 
 ftp://ftp.vim.org/pub/vim/unstable/patches/7.1a/

That's right.

 Note: I prefer not to feed the email itself to the patch program, because:
 - my ISP's routers sometimes autoconvert the contents between 8-bit and 
 quoted-printable; and the latter make the patch program choke;
 - if I see several patches published while I was away or asleep, by FTP I can 
 get them all to where patch will find them.
 - the patch directory on FTP includes a table of contents, README
 
 I notice this patch modifies one runtime file. This reminds me that runtime 
 updates are not always reflected in patches. Do the files in 
 ftp://ftp.vim.org/pub/vim/runtime/ (and the equivalent rsync repository, 
 ftp.nluug.nl::Vim/runtime/ ) apply to 7.0 only, or to both 7.0 and 7.1? (The 
 latest changes there are for a large number of spelling dictionaries.)

They are for both.  There are no (recent) source code changes that are
required for the updated runtime files.

 On thinking back, I would suspect they /aren't/ the same, since the
 first line of each helpfile mentions either 7.0 or 7.1a -- so at least
 the contents of the doc/ subfolders are different. So -- will runtime
 upgrades for 7.1 beta be always reflected in patches, or else will
 there be a runtime server -- and where?
 (ftp://pub/vim/unstable/runtime/ contains only one item yet: a
 softlink to the main spell subfolder.)

There were runtime files here during the 7.0 beta testing, but I don't
think they are useful now.

 Hm... I see a snapshot zip,
 http://ftp.vim.org/pub/vim/unstable/snapshot/vim-7.1a.zip ,but it's
 more than 24h older than the patch, while it's only about 2h younger
 than the 7.0.000 tar.gz and tar.bz2 archives so I guess it's 7.1a.000
 in one big economy package...

It's almost the same.  I had trouble getting the CVS server updated, and
this snapshot went together with that update.  I don't think it adds
anything now, it was for when there was no 7.0x release yet.

-- 
hundred-and-one symptoms of being an internet addict:
77. The phone company asks you to test drive their new PBX system

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: patch 7.1a.001

2007-05-07 Thread Bram Moolenaar

Chris Sutcliffe wrote:

 Hey All,

  Patch 7.1a.001

 I managed to compile 7.1a from cvs yesterday.  I went and did a cvs up
 to grab this patch and I am now getting this error:

 gui_w32.c:236: error: redefinition of `struct tagNMTTDISPINFOA'
 gui_w32.c:246: error: redefinition of `struct tagNMTTDISPINFOW'
 mingw32-make: *** [gobj/gui_w32.o] Error 1

 I'm guessing it's not a result of this patch, since this patch did not
 affect gui_w32.c.  Perhaps there was something changed in CVS (I
 notice the update grabbed a whole bunch of files)?

I don't know what happened.  When I checkout the files from CVS now I
don't see a problem in gui_w32.c.  Was this a temporary problem?

-- 
hundred-and-one symptoms of being an internet addict:
83. Batteries in the TV remote now last for months.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Vim version 7.1a BETA -- runtime files ?

2007-05-07 Thread Bram Moolenaar

Yakov Lerner wrote:

 On 5/5/07, Bram Moolenaar [EMAIL PROTECTED] wrote:
  Announcing:  Vim (Vi IMproved) version 7.1a BETA
 
 I compared runtime files form ftp [1] and from svn [2].
 Both vims are labeled vim71a. But many runtimes are different.
 In svn, many files are labeled 2007. In ftp, they are 2006 versions.
 Why this difference in runtimes ?
 
 Yakov
 [1] ftp://ftp.vim.org/pub/vim/unstable/unix/vim-7.1a.tar.bz2
 [2] https://svn.sourceforge.net/svnroot/vim/vim7

Do I need to hunt down the differences?  Please give a specific example.
What label are you talking about?

-- 
hundred-and-one symptoms of being an internet addict:
84. Books in your bookcase bear the names Bongo, WinSock and Inside OLE

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Vim version 7.1a BETA has been released

2007-05-06 Thread Bram Moolenaar

Gary Johnson wrote:

 I noticed that filetype.vim does not include the patch that I 
 submitted to this list 2006-07-25 to fix the recognition of mutt 
 temporary files on SunOS.  Is there something else I can do to have 
 this patch accepted?

It was still in the todo list.  There are many items I still didn't have
time for, unfortunately.  I assume you have properly tested this change.
I'll include this one now.

-- 
Q: Should I clean my house or work on Vim?
A: Whatever contains more bugs.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Vim version 7.1a BETA -- svn ?

2007-05-06 Thread Bram Moolenaar

Yakov Lerner wrote:

 On 2007-05-05, Bram Moolenaar [EMAIL PROTECTED] wrote:
  Announcing:  Vim (Vi IMproved) version 7.1a BETA
 
 I tried to build vim7.1 from svn. But all I get from usual
 svn location (https://svn.sourceforge.net/svnroot/vim/vim7), is
 vim 7.0.236. Will vim7.1 be served at this localtion eventually ?

I had some trouble with the CVS server yesterday.  Still working on it.

The SVN server always lags behind a bit.  I don't update it myself (one
less thing to worry about).

-- 
Time is money.  Especially if you make clocks.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Patch: virtcol([123,'$'])

2007-05-06 Thread Bram Moolenaar

Michael Schaap wrote:

 On 26-Mar-2007 18:25, Bram Moolenaar wrote:
  Michael Schaap wrote:

  Here's a patch to make virtcol([123, '$']) do the right thing.
  If it looks good to you, can you include it?
  
 
  Looks good, I'll include it.  Thanks!
 

 It appears that this didn't make it into 7.1a.  Probably slipped through 
 the cracks?  :-)

It's in the todo list.  I simply don't enough have time to work away all
todo items.  Otherwise the release would have to wait another year...

-- 
hundred-and-one symptoms of being an internet addict:
63. You start using smileys in your snail mail.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.1a.001

2007-05-06 Thread Bram Moolenaar

Patch 7.1a.001
Problem:Crash when downloading a spell file.  (Szabolcs Horvat)
Solution:   Avoid that did_set_spelllang() is used recursively when a new
window is opened for the download.
Also avoid wiping out the wrong buffer.
Files:  runtime/autoload/spellfile.vim, src/buffer.c, src/ex_cmds.c,
src/spell.c


*** ../vim-7.1a.000/runtime/autoload/spellfile.vim  Tue Aug 29 22:31:34 2006
--- runtime/autoload/spellfile.vim  Sun May  6 23:52:05 2007
***
*** 1,6 
   Vim script to download a missing spell file
   Maintainer: Bram Moolenaar [EMAIL PROTECTED]
!  Last Change:2006 Aug 29
  
  if !exists('g:spellfile_URL')
let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell'
--- 1,6 
   Vim script to download a missing spell file
   Maintainer: Bram Moolenaar [EMAIL PROTECTED]
!  Last Change:2007 May 06
  
  if !exists('g:spellfile_URL')
let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell'
***
*** 58,76 
  let fname = a:lang . '.' . enc . '.spl'
  
   Split the window, read the file into a new buffer.
  new
  setlocal bin
  echo 'Downloading ' . fname . '...'
  call spellfile#Nread(fname)
  if getline(2) !~ 'VIMspell'
 Didn't work, perhaps there is an ASCII one.
!   g/^/d
let fname = a:lang . '.ascii.spl'
echo 'Could not find it, trying ' . fname . '...'
call spellfile#Nread(fname)
if getline(2) !~ 'VIMspell'
echo 'Sorry, downloading failed'
!   bwipe!
return
endif
  endif
--- 58,97 
  let fname = a:lang . '.' . enc . '.spl'
  
   Split the window, read the file into a new buffer.
+  Remember the buffer number, we check it below.
  new
+ let newbufnr = winbufnr(0)
  setlocal bin
  echo 'Downloading ' . fname . '...'
  call spellfile#Nread(fname)
  if getline(2) !~ 'VIMspell'
 Didn't work, perhaps there is an ASCII one.
!Careful: Nread() may have opened a new window for the error message,
!we need to go back to our own buffer and window.
!   if newbufnr != winbufnr(0)
!   let winnr = bufwinnr(newbufnr)
!   if winnr == -1
!  Our buffer has vanished!?  Open a new window.
! echomsg download buffer disappeared, opening a new one
! new
! setlocal bin
!   else
! exe winnr . wincmd w
!   endif
!   endif
!   if newbufnr == winbufnr(0)
!We are back the old buffer, remove any (half-finished) download.
! g/^/d
!   else
!   let newbufnr = winbufnr(0)
!   endif
! 
let fname = a:lang . '.ascii.spl'
echo 'Could not find it, trying ' . fname . '...'
call spellfile#Nread(fname)
if getline(2) !~ 'VIMspell'
echo 'Sorry, downloading failed'
!   exe newbufnr . bwipe!
return
endif
  endif
***
*** 96,112 
let fname = substitute(fname, '\.spl$', '.sug', '')
echo 'Downloading ' . fname . '...'
call spellfile#Nread(fname)
!   if getline(2) !~ 'VIMsug'
! echo 'Sorry, downloading failed'
!   else
  1d
  exe write  . escape(dirlist[dirchoice], ' ') . '/' . fname
endif
-   set nomod
endif
  endif
  
! bwipe
endif
  endfunc
  
--- 117,145 
let fname = substitute(fname, '\.spl$', '.sug', '')
echo 'Downloading ' . fname . '...'
call spellfile#Nread(fname)
!   if getline(2) =~ 'VIMsug'
  1d
  exe write  . escape(dirlist[dirchoice], ' ') . '/' . fname
+ set nomod
+   else
+ echo 'Sorry, downloading failed'
+  Go back to our own buffer/window, Nread() may have taken us to
+  another window.
+ if newbufnr != winbufnr(0)
+   let winnr = bufwinnr(newbufnr)
+   if winnr != -1
+ exe winnr . wincmd w
+   endif
+ endif
+ if newbufnr == winbufnr(0)
+   set nomod
+ endif
endif
endif
  endif
  
!  Wipe out the buffer we used.
! exe newbufnr . bwipe
endif
  endfunc
  
*** ../vim-7.1a.000/src/buffer.cThu Mar 15 22:53:25 2007
--- src/buffer.cSun May  6 15:44:08 2007
***
*** 1426,1431 
--- 1426,1438 
  if (curbuf-b_kmap_state  KEYMAP_INIT)
keymap_init();
  #endif
+ #ifdef FEAT_SPELL
+ /* May need to set the spell language.  Can only do this after the buffer
+  * has been properly setup. */
+ if (!curbuf-b_help  curwin-w_p_spell  *curbuf-b_p_spl != NUL)
+   did_set_spelllang(curbuf);
+ #endif
+ 
  redraw_later(NOT_VALID);
  }
  
***
*** 2414,2424 
  /* Set 'foldlevel' to 'foldlevelstart' if it's not negative. */
  if (p_fdls = 0)
curwin-w_p_fdl = p_fdls;
- #endif
- 
- #ifdef FEAT_SPELL
- if (curwin-w_p_spell  *buf-b_p_spl

patch 7.0.243 (extra)

2007-05-05 Thread Bram Moolenaar

Patch 7.0.243 (extra)
Problem:Win32: When GvimExt is built with MSVC 2005 or later, the Edit
with vim context menu doesn't appear in the Windows Explorer.
Solution:   Embed the linker manifest file into the resources of GvimExt.dll.
(Mathias Michaelis)
Files:  src/GvimExt/Makefile


*** ../vim-7.0.242/src/GvimExt/Makefile Tue Mar  7 00:12:38 2006
--- src/GvimExt/MakefileSat May  5 12:47:27 2007
***
*** 19,24 
--- 19,25 
  # $(implib) /NOLOGO -machine:$(CPU) -def:gvimext.def $** -out:gvimext.lib
  # $(link) $(dlllflags) -base:0x1C00 -out:$*.dll $** $(olelibsdll) 
shell32.lib gvimext.lib comctl32.lib gvimext.exp
$(link) $(lflags) -dll -def:gvimext.def -base:0x1C00 -out:$*.dll $** 
$(olelibsdll) shell32.lib comctl32.lib
+   if exist $*.dll.manifest mt -nologo -manifest $*.dll.manifest 
-outputresource:$*.dll;2
  
  gvimext.obj: gvimext.h
  
***
*** 34,36 
--- 35,38 
  - if exist gvimext.exp del gvimext.exp
  - if exist gvimext.obj del gvimext.obj
  - if exist gvimext.res del gvimext.res
+ - if exist gvimext.dll.manifest del gvimext.dll.manifest
*** ../vim-7.0.242/src/version.cFri May  4 22:31:31 2007
--- src/version.c   Sat May  5 12:54:21 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 243,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
50. The last girl you picked up was only a jpeg.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Vim version 7.1a BETA has been released

2007-05-05 Thread Bram Moolenaar


Announcing:  Vim (Vi IMproved) version 7.1a BETA


This is a BETA release of Vim 7.1.  It consists of Vim 7.0 plus all
patches and updated runtime files.

I expect this to be stable, since the patches have been used by many
people already.  This BETA is mainly to check that the files has been
setup properly.  It's been almost a year since the last one!

Please report every problem you find!  It will only be a few days until
the 7.1 release, so please take a little time right now to check it out.

Once you have installed Vim 7.1a BETA you can find details about the
changes since Vim 7.0 with :help version-7.1.


Testing
---

This is a BETA test version.  Please give it a good test and report
anything that isn't right.  That includes a crash but also a typo in the
documentation.

I will not make an Amiga or OS/2 binary for Vim 7.1a.  A Mac version is
hopefully available soon on http://macvim.org/


Where to get it
---

All files can be found below this directory:
ftp://ftp.vim.org/pub/vim/unstable/

Information about which files to download for what system (don't use the
links, they are still for Vim 7.0):
http://www.vim.org/download.php

A list of mirror sites can be found here:
http://www.vim.org/mirrors.php

Vim 7.1a is also available from CVS (when it works again) and with Aap:
http://www.vim.org/develop.php


An overview of the files:

UNIX:
unix/vim-7.1a.tar.bz2   sources + runtime files, bzip2 compressed

VARIOUS:
extra/vim-7.1a-extra.tar.gz extra files
extra/vim-7.1a-lang.tar.gz  multi-language files
doc/vim71ahtml.zip  help files converted to HTML

MS-WINDOWS:
pc/gvim71a.exe  self-installing, includes all runtime files
pc/vim71art.zip runtime files
pc/vim71alang.zip   files for translated messages and menus
pc/gvim71a.zip  GUI binary for Windows 95/98/NT/2000/XP
pc/gvim71aole.zip   GUI binary with OLE support
pc/gvim71a_s.zipGUI binary for Windows 3.1 (untested)
pc/vim71ad16.zip16 bit console version for MS-DOS
pc/vim71ad32.zipconsole version for MS-DOS/Windows 95/98
pc/vim71aw32.zipconsole version for Windows NT/2000/XP
pc/vim71asrc.zipsources for PC (with CR-LF)

DIFFS TO PREVIOUS RELEASE:
unix/vim-7.0-7.1a.diff.gz  sources + runtime files
extra/vim-7.0-7.1a-extra.diff.gz   extra files
extra/vim-7.0-7.1a-lang.diff.gzmulti-language files


Mailing lists
-

For user questions you can turn to the Vim mailing list.  There are a
lot of tips, scripts and solutions.  You can ask your Vim questions, but
only if you subscribe.  See http://www.vim.org/maillist.php#vim

If you want to help Vim development or get the latest patches, subscribe
to the vim-dev mailing list.  See http://www.vim.org/maillist.php#vim-dev

Subject specific lists:
Multi-byte issues: http://www.vim.org/maillist.php#vim-multibyte
Macintosh issues:  http://www.vim.org/maillist.php#vim-mac

Before you ask a question you should search the archives, someone may
already have given the answer.


Reporting bugs
--

Send them to [EMAIL PROTECTED].  Please describe the problem precisely.
All the time spent on answering mail is subtracted from the time that is
spent on improving Vim!  Always give a reproducible example and try to
find out which settings or other things influence the appearance of the
bug.  Try starting without your own vimrc file: vim -u NONE.  Try
different machines if possible.  See :help bugs in Vim.  Send me a
patch if you can!

If something needs discussing with other developers, send a message to the
vim-dev mailing list.  You need to subscribe first.


Happy Vimming!

-- 
hundred-and-one symptoms of being an internet addict:
53. To find out what time it is, you send yourself an e-mail and check the
Date: field.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.242 (extra)

2007-05-04 Thread Bram Moolenaar

Patch 7.0.242 (extra)
Problem:Win32: Using -register in a Vim that does not support OLE causes
a crash.
Solution:   Don't use EMSG() but mch_errmsg().  Check p_go for being NULL.
(partly by Michael Wookey)
Files:  src/gui_w32.c


*** ../vim-7.0.241/src/gui_w32.cTue Aug 29 21:30:15 2006
--- src/gui_w32.c   Fri May  4 22:26:13 2007
***
*** 1140,1147 
  static void
  ole_error(char *arg)
  {
! EMSG2(_(E243: Argument not supported: \-%s\; Use the OLE version.),
!arg);
  }
  #endif
  
--- 1140,1152 
  static void
  ole_error(char *arg)
  {
! char buf[IOSIZE];
! 
! /* Can't use EMSG() here, we have not finished initialisation yet. */
! vim_snprintf(buf, IOSIZE,
!   _(E243: Argument not supported: \-%s\; Use the OLE version.),
!   arg);
! mch_errmsg(buf);
  }
  #endif
  
***
*** 3164,3171 
  
  /*
   * Check button names.  A long one will make the dialog wider.
   */
! vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
  if (!vertical)
  {
// Place buttons horizontally if they fit.
--- 3169,3177 
  
  /*
   * Check button names.  A long one will make the dialog wider.
+  * When called early (-register error message) p_go isn't initialized.
   */
! vertical = (p_go != NULL  vim_strchr(p_go, GO_VERTICAL) != NULL);
  if (!vertical)
  {
// Place buttons horizontally if they fit.
*** ../vim-7.0.241/src/version.cThu May  3 22:13:03 2007
--- src/version.c   Thu May  3 22:32:06 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 242,
  /**/

-- 
Microsoft is to software what McDonalds is to gourmet cooking

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: [patch] search() flag to not use smartcase

2007-05-03 Thread Bram Moolenaar

Yakov Lerner wrote:

 The patch adds flag to search() flag to not use smartcase.
 '*' and '#' do not use smartcase, but search() always uses smartcase
 (cannot be turned off).
 When we use search() with @/ pattern that comes from * or #,
 search() fails because of discrepancy in smartcase handling.
 
 Yakov
 
 --- runtime/doc/eval.txt.0002007-05-03 09:35:19.0 -0400
 +++ runtime/doc/eval.txt2007-05-03 09:36:21.0 -0400
 @@ -4086,6 +4086,7 @@
 'n' do Not move the cursor
 'p' return number of matching sub-pattern (see below)
 's' set the ' mark at the previous location of the cursor
 +   'S' do not use smartcase
 'w' wrap around the end of the file
 'W' don't wrap around the end of the file
 If neither 'w' or 'W' is given, the 'wrapscan' option applies.

Looks a bit inconsistent.  Why not also add a flag to ignore
'ignorecase' and 'magic'?

-- 
Everybody lies, but it doesn't matter since nobody listens.
-- Lieberman's Law

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.241

2007-05-03 Thread Bram Moolenaar

Patch 7.0.241
Problem::windo throw 'foo' loops forever. (Andy Wokula)
Solution:   Detect that win_goto() doesn't work.
Files:  src/ex_cmds2.c


*** ../vim-7.0.240/src/ex_cmds2.c   Tue Feb 13 06:21:24 2007
--- src/ex_cmds2.c  Wed May  2 22:04:38 2007
***
*** 2287,2292 
--- 2287,2294 
if (!win_valid(wp))
break;
win_goto(wp);
+   if (curwin != wp)
+   break;  /* something must be wrong */
wp = curwin-w_next;
}
else if (eap-cmdidx == CMD_tabdo)
*** ../vim-7.0.240/src/version.cWed May  2 21:52:18 2007
--- src/version.c   Thu May  3 22:12:17 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 241,
  /**/

-- 
Well, you come from nothing, you go back to nothing...  What have you
lost?  Nothing!
-- Monty Python: The life of Brian

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.239

2007-05-02 Thread Bram Moolenaar

Patch 7.0.239
Problem:When using local directories and tab pages :mksession uses a
short file name when it shouldn't.  Window-local options from a
modeline may be applied to the wrong window. (Teemu Likonen)
Solution:   Add the did_lcd flag, use the full path when it's set.  Don't use
window-local options from the modeline when using the current
window for another buffer in :doautoall.
Files:  src/fileio.c,  src/ex_docmd.c


*** ../vim-7.0.238/src/fileio.c Tue Feb 27 16:51:07 2007
--- src/fileio.cTue May  1 22:35:34 2007
***
*** 8086,8092 
  
/* execute the autocommands for this buffer */
retval = do_doautocmd(eap-arg, FALSE);
!   do_modelines(0);
  
/* restore the current window */
aucmd_restbuf(aco);
--- 8087,8096 
  
/* execute the autocommands for this buffer */
retval = do_doautocmd(eap-arg, FALSE);
! 
!   /* Execute the modeline settings, but don't set window-local
!* options if we are using the current window for another buffer. */
!   do_modelines(aco.save_curwin == NULL ? OPT_NOWIN : 0);
  
/* restore the current window */
aucmd_restbuf(aco);
*** ../vim-7.0.238/src/ex_docmd.c   Tue Mar 27 16:57:54 2007
--- src/ex_docmd.c  Tue Mar 27 16:49:06 2007
***
*** 375,380 
--- 375,381 
  static intput_view __ARGS((FILE *fd, win_T *wp, int add_edit, unsigned 
*flagp));
  static void   ex_loadview __ARGS((exarg_T *eap));
  static char_u *get_view_file __ARGS((int c));
+ static intdid_lcd;/* whether :lcd was produced for a session */
  #else
  # define ex_loadview  ex_ni
  #endif
***
*** 8573,8578 
--- 8574,8581 
  }
  
  #ifdef FEAT_SESSION
+ did_lcd = FALSE;
+ 
  /* :mkview or :mkview 9: generate file name with 'viewdir' */
  if (eap-cmdidx == CMD_mkview
 (*eap-arg == NUL
***
*** 10327,10332 
--- 10330,10336 
|| ses_put_fname(fd, wp-w_localdir, flagp) == FAIL
|| put_eol(fd) == FAIL)
return FAIL;
+   did_lcd = TRUE;
  }
  
  return OK;
***
*** 10384,10394 
  char_u*name;
  
  /* Use the short file name if the current directory is known at the time
!  * the session file will be sourced.  Don't do this for :mkview, we
!  * don't know the current directory. */
  if (buf-b_sfname != NULL
 flagp == ssop_flags
!(ssop_flags  (SSOP_CURDIR | SSOP_SESDIR)))
name = buf-b_sfname;
  else
name = buf-b_ffname;
--- 10388,10401 
  char_u*name;
  
  /* Use the short file name if the current directory is known at the time
!  * the session file will be sourced.
!  * Don't do this for :mkview, we don't know the current directory.
!  * Don't do this after :lcd, we don't keep track of what the current
!  * directory is. */
  if (buf-b_sfname != NULL
 flagp == ssop_flags
!(ssop_flags  (SSOP_CURDIR | SSOP_SESDIR))
!!did_lcd)
name = buf-b_sfname;
  else
name = buf-b_ffname;
*** ../vim-7.0.238/src/version.cTue May  1 22:06:41 2007
--- src/version.c   Tue May  1 23:21:32 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 239,
  /**/

-- 
Those who live by the sword get shot by those who don't.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.240

2007-05-02 Thread Bram Moolenaar

Patch 7.0.240
Problem:Crash when splitting a window in the GUI. (opposite of 7.0.227)
Solution:   Don't call out_flush() from win_alloc().  Also avoid this for
win_delete().  Also block autocommands while the window structure
is invalid.
Files:  src/window.c


*** ../vim-7.0.239/src/window.c Thu Apr 26 16:11:47 2007
--- src/window.cTue May  1 19:23:22 2007
***
*** 722,727 
--- 722,733 
need_status = STATUS_HEIGHT;
  }
  
+ #ifdef FEAT_GUI
+ /* May be needed for the scrollbars that are going to change. */
+ if (gui.in_use)
+   out_flush();
+ #endif
+ 
  #ifdef FEAT_VERTSPLIT
  if (flags  WSP_VERT)
  {
***
*** 4071,4076 
--- 4077,4088 
  
  if (newwin != NULL)
  {
+ #ifdef FEAT_AUTOCMD
+   /* Don't execute autocommands while the window is not properly
+* initialized yet.  gui_create_scrollbar() may trigger a FocusGained
+* event. */
+   ++autocmd_block;
+ #endif
/*
 * link the window in the window list
 */
***
*** 4100,4106 
  #ifdef FEAT_GUI
if (gui.in_use)
{
-   out_flush();
gui_create_scrollbar(newwin-w_scrollbars[SBAR_LEFT],
SBAR_LEFT, newwin);
gui_create_scrollbar(newwin-w_scrollbars[SBAR_RIGHT],
--- 4112,4117 
***
*** 4114,4119 
--- 4125,4133 
  #ifdef FEAT_FOLDING
foldInitWin(newwin);
  #endif
+ #ifdef FEAT_AUTOCMD
+   --autocmd_block;
+ #endif
  }
  return newwin;
  }
***
*** 4130,4135 
--- 4144,4155 
  {
  int   i;
  
+ #ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while the window is halfway being deleted.
+  * gui_mch_destroy_scrollbar() may trigger a FocusGained event. */
+ ++autocmd_block;
+ #endif
+ 
  #ifdef FEAT_MZSCHEME
  mzscheme_window_free(wp);
  #endif
***
*** 4188,4193 
--- 4208,4217 
  
  win_remove(wp, tp);
  vim_free(wp);
+ 
+ #ifdef FEAT_AUTOCMD
+ --autocmd_block;
+ #endif
  }
  
  /*
*** ../vim-7.0.239/src/version.cTue May  1 23:22:32 2007
--- src/version.c   Wed May  2 21:51:10 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 240,
  /**/

-- 
Just remember...if the world didn't suck, we'd all fall off.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Regex performance - SoC

2007-05-02 Thread Bram Moolenaar

James -

 I'm wondering if any of the Summer of Code winners are tackling the  
 regex performance thing suggested here: http://www.vim.org/soc/ideas.php
 
 If anyone chose that project, I'll of course defer to them.  But if  
 no one's working on it, I might give it a shot, I think it'd be fun.

Yes, two students were selected to work on this.  Russ Cox volunteered
to mentor them.

- Bram

-- 
Bumper sticker: Honk if you love peace and quiet.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Bug: windo and exceptions

2007-05-02 Thread Bram Moolenaar

Andy Wokula wrote:

 GVim runs into an endless loop if I do the following:
 
  clean startup
 :new  at least two windows
 :windo throw foo
 
 Error detected while processing :
 E605: Exception not caught: foo
 E605: Exception not caught: foo
 E605: Exception not caught: foo
 E605: Exception not caught: foo
 ...

See patch below.

 Another example:
 
 clean startup
:set modified
:bot new
:try
:  windo enew
 
 - go and kill GVim in the task manager
 
 (does not happen if  :bot new  is replaced by  :abo new )

Solved with the same patch.  Please verify.


*** ../vim-7.0.240/src/ex_cmds2.c   Tue Feb 13 06:21:24 2007
--- src/ex_cmds2.c  Wed May  2 22:04:38 2007
***
*** 2287,2292 
--- 2287,2294 
if (!win_valid(wp))
break;
win_goto(wp);
+   if (curwin != wp)
+   break;  /* something must be wrong */
wp = curwin-w_next;
}
else if (eap-cmdidx == CMD_tabdo)


-- 
The 50-50-90 rule: Anytime you have a 50-50 chance of getting
something right, there's a 90% probability you'll get it wrong.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: wish: show search progress on slow searches

2007-05-01 Thread Bram Moolenaar

[This is development, removed the Vim maillist]

Yakov Lerner wrote:

 On 4/29/07, Yakov Lerner [EMAIL PROTECTED] wrote:
  On 4/29/07, Bram Moolenaar [EMAIL PROTECTED] wrote:
  
   Yakov Lerner wrote:
  
Wish: when search is slow, show the progress line number
every second on the bottom line (like, 12345 of 9).
  
   What is slow?
  To my taste, when something takes longer than 1-2 sec,
  I'd prefer some visual feedback on the progress.
 
   Checking if the second passed will make the search even slower.
   Checking time is quite slow on some systems (the check for CTRL-C
   suffers from this).
 
  Checking for time every several hundred (N) lines will probably not slow
  the search perceptibly. N can be configurable, a parameter.
  Some value between 10 and 1000 will probaby be reasonable.
 
 I think it's possibe to check for time, which searching, not too
 often and not too seldom, even without user-defined parameter.
 Adaptive algorithm with two counters will find the right rate or
 time-checking:
 
 - as we start search, we check time every 50 lines
 (N=50 is initial value of N). We maintain counter M. M is how
 many times we called time() between the seconds changed.
 M is checked and reset every second. M is checked as folllows:
 
 - If M is too high (M10), then we adjust N by increasing it.
 If M is too low(M10), then we adjust N by decreasing it. Ideally,
 we want to check time() ~10 times per second. (overhead of 10
 calls to time() per second cannot he high, right ?)
 
 - if search progresses for several seconds, then N quickly converges
 to the ideal value (~10 checks/sec).
 
 - we start every search with same value of N (say, 50). If search
 is slow, then N will quickly converge to the ideal value for this regex,
 the value in which where time() is checked ~10 times per second.

It will help for differences in speed for various patterns, but it won't
help for lines differing in length.  Quite a few patterns with wildcards
depend on the line length a lot.

It might work better to adjust to the delay caused by the time
function.  This varies greatly between systems.  When it's fast we can
check the time often, when it's slow it delays the search more and
should be called less often.

- Bram

-- 
hundred-and-one symptoms of being an internet addict:
33. You name your children Eudora, Mozilla and Dotcom.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: feedkeys() allowed in sandbox

2007-05-01 Thread Bram Moolenaar

John Beckett wrote:

 A.J.Mechelynck wrote:
  Is folding really needed in a default modeline?
  Folding may be useful in a modeline.
  (Don't know what you call a default modeline.)
 
 By default modeline I mean I would like Vim to be changed so
 that its default behaviour is aggressively safe. If wanted,
 there could be a new option to enable clever features, and a
 user could choose to allow modelines with folding or expression
 evaluation, etc.

This is not true.  It just reduces the chance of a mistake being made by
an unknown factor.  It's still possible to allow an option to be set,
thinking that it is OK, but we later find out that it was not OK.  Just
like carefully removing mistakes and screening the options for mistakes
does help to make it safer.  Thus it doesn't make an essential
difference.  N times as safe still isn't 100% safe.

In other words: If we have an option run insecure nobody would set it.
Vim must be secure as-is.

 But the only long-term safe procedure is to have Vim *default*
 to work with only very restricted modelines (set tab and other
 options - no way to even get near executing code).

As they sometimes joke: The best way to protect your computer from
malicious software is to switch it off.  Likewise, the only really safe
way is to disable modelines.  Obviously you pay a price: restricted
functionality.  Options to partly disable modelines make it more
complicated and don't help much for security.

 I am wondering what the lack of comment on this topic indicates.
 Do you understand that another modeline vulnerability could
 allow the next file you open to overwrite all files under your
 home folder? Or it might overwrite all sectors on your disk, if
 you have sufficient privilege.

Don't forget that this requires someone who intentionally wants this
evil thing to happen.  So far the only examples seen are jokes and proof
of concept.  I have never seen a file with a modeline that intentionally
causes harm.

 How about if you go to another computer that you rarely use.
 Would you be happy using Vim on that computer?
 Network admins in secure environments should be prohibited
 from using Vim.

Modelines are default off when you are root.  The mail filetype plugin
also switches it off.

 If I am overlooking something, or am overly alarmist, please
 tell me. For anyone new to this, enter following in Google:
 vim vulnerability modeline

Thanks for the advertisement!  :-).

-- 
Give a man a computer program and you give him a headache,
but teach him to program computers and you give him the power
to create headaches for others for the rest of his life...
R. B. Forest

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: feedkeys() allowed in sandbox

2007-05-01 Thread Bram Moolenaar

Tony Mechelynck wrote:

 Bram Moolenaar wrote:
 [...]
  Modelines are default off when you are root.  The mail filetype plugin
  also switches it off.
 [...]
 
 Are you sure? In a terminal logged-in as root, using vim 7.0.235:
 
   vim -u NONE -N
   :set ml? mls?
modeline
modelines=5
 
 Modelines default off when 'compatible' is set, they default on (and 5) when 
 'nocompatible' is set. Root login changes nothing to that AFAICT.

Sorry, my mistake.  There is a recommendation that when working as root
you switch 'modeline' off, but it's not done automatically.

I do think that it's a good idea to make it automatic.

-- 
He who laughs last, thinks slowest.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.236

2007-05-01 Thread Bram Moolenaar
 (shiftright  0  (sinfo.mem_unit  1) == 0)
+   {
+   sinfo.mem_unit = sinfo.mem_unit  1;
+   --shiftright;
+   }
+   mem = sinfo.totalram * sinfo.mem_unit;
+ #   else
mem = sinfo.totalram;
+ #   endif
+   }
  }
  #  endif
  
***
*** 473,479 
--- 486,500 
pagesize = sysconf(_SC_PAGESIZE);
pagecount = sysconf(_SC_PHYS_PAGES);
if (pagesize  0  pagecount  0)
+   {
+   /* avoid overflow as much as possible */
+   while (shiftright  0  (pagesize  1) == 0)
+   {
+   pagesize = pagesize  1;
+   --shiftright;
+   }
mem = (long_u)pagesize * pagecount;
+   }
  }
  #  endif
  
***
*** 488,502 
  #   ifdef RLIM_INFINITY
 rlp.rlim_cur != RLIM_INFINITY
  #   endif
!(long_u)rlp.rlim_cur  mem
   )
!   return (long_u)rlp.rlim_cur;
  }
  #  endif
  
  if (mem  0)
!   return mem;
! return (long_u)0x7fff;
  # endif
  }
  #endif
--- 509,526 
  #   ifdef RLIM_INFINITY
 rlp.rlim_cur != RLIM_INFINITY
  #   endif
!((long_u)rlp.rlim_cur  10)  (mem  shiftright)
   )
!   {
!   mem = (long_u)rlp.rlim_cur;
!   shiftright = 10;
!   }
  }
  #  endif
  
  if (mem  0)
!   return mem  shiftright;
! return (long_u)0x1f;
  # endif
  }
  #endif
*** ../vim-7.0.235/src/version.cSun Apr 29 13:55:43 2007
--- src/version.c   Tue May  1 13:32:44 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 236,
  /**/

-- 
A day without sunshine is like, well, night.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.237

2007-05-01 Thread Bram Moolenaar

Patch 7.0.237
Problem:For root it is recommended to not use 'modeline', but in
not-compatible mode the default is on.
Solution:   Let 'modeline' default to off for root.
Files:  runtime/doc/options.txt, src/option.c


*** ../vim-7.0.236/runtime/doc/options.txt  Tue Oct 10 18:43:50 2006
--- runtime/doc/options.txt Tue May  1 13:29:08 2007
***
*** 1,4 
! *options.txt* For Vim version 7.0.  Last change: 2006 May 04
  
  
  VIM REFERENCE MANUALby Bram Moolenaar
--- 1,4 
! *options.txt* For Vim version 7.0.  Last change: 2007 May 01
  
  
  VIM REFERENCE MANUALby Bram Moolenaar
***
*** 528,534 
  ':' is removed.  Thus to include \: you have to specify \\:.
  
  No other commands than set are supported, for security reasons (somebody
! might create a Trojan horse text file with modelines).
  
  Hint: If you would like to do something else than setting an option, you could
  define an autocommand that checks the file for a specific string.  For
--- 528,539 
  ':' is removed.  Thus to include \: you have to specify \\:.
  
  No other commands than set are supported, for security reasons (somebody
! might create a Trojan horse text file with modelines).  And not all options
! can be set.  For some options a flag is set, so that when it's used the
! |sandbox| is effective.  Still, there is always a small risc that a modeline
! causes trouble.  E.g., when some joker sets 'textwidth' to 5 all your lines
! are wrapped unexpectedly.  So disable modelines before editing untrusted text.
! The mail ftplugin does this, for example.
  
  Hint: If you would like to do something else than setting an option, you could
  define an autocommand that checks the file for a specific string.  For
***
*** 4520,4526 
languages, no matter what you set 'mkspellmem' to.
  
   *'modeline'* *'ml'* *'nomodeline'* *'noml'*
! 'modeline' 'ml'   boolean (Vim default: on, Vi default: off)
local to buffer
*'modelines'* *'mls'*
  'modelines' 'mls' number  (default 5)
--- 4557,4564 
languages, no matter what you set 'mkspellmem' to.
  
   *'modeline'* *'ml'* *'nomodeline'* *'noml'*
! 'modeline' 'ml'   boolean (Vim default: on (off for root),
!Vi default: off)
local to buffer
*'modelines'* *'mls'*
  'modelines' 'mls' number  (default 5)
*** ../vim-7.0.236/src/option.c Tue May  1 13:39:14 2007
--- src/option.cTue May  1 13:26:10 2007
***
*** 3429,3434 
--- 3429,3439 
/* the cast to long is required for Manx C, long_i is needed for
 * MSVC */
*(int *)varp = (int)(long)(long_i)options[opt_idx].def_val[dvi];
+ #ifdef UNIX
+   /* 'modeline' defaults to off for root */
+   if (options[opt_idx].indir == PV_ML  getuid() == ROOT_UID)
+   *(int *)varp = FALSE;
+ #endif
/* May also set global value for local option. */
if (both)
*(int *)get_varp_scope((options[opt_idx]), OPT_GLOBAL) =
*** ../vim-7.0.236/src/version.cTue May  1 13:39:14 2007
--- src/version.c   Tue May  1 19:03:09 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 237,
  /**/

-- 
The users that I support would double-click on a landmine to find out
what happens.   -- A system administrator

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.238

2007-05-01 Thread Bram Moolenaar

Patch 7.0.238
Problem:Crash when :match pattern runs into 'maxmempattern'. (Yakov
Lerner)
Solution:   Don't free the regexp program of match_hl.
Files:  src/screen.c


*** ../vim-7.0.237/src/screen.c Tue Nov 28 16:16:03 2006
--- src/screen.cTue May  1 21:36:50 2007
***
*** 6477,6485 
if (called_emsg)
{
/* Error while handling regexp: stop using this regexp. */
!   vim_free(shl-rm.regprog);
shl-rm.regprog = NULL;
!   no_hlsearch = TRUE;
break;
}
if (nmatched == 0)
--- 6477,6491 
if (called_emsg)
{
/* Error while handling regexp: stop using this regexp. */
!   if (shl == search_hl)
!   {
!   /* don't free the regprog in match_hl[], it's a copy */
!   vim_free(shl-rm.regprog);
!   no_hlsearch = TRUE;
!   }
shl-rm.regprog = NULL;
!   shl-lnum = 0;
!   got_int = FALSE;  /* avoid the Type :quit to exit Vim message */
break;
}
if (nmatched == 0)
*** ../vim-7.0.237/src/version.cTue May  1 19:06:39 2007
--- src/version.c   Tue May  1 21:39:48 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 238,
  /**/

-- 
Change is inevitable, except from a vending machine.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.235

2007-04-29 Thread Bram Moolenaar

Patch 7.0.235
Problem:It is possible to use writefile() in the sandbox.
Solution:   Add a few more checks for the sandbox.
Files:  src/eval.c


*** ../vim-7.0.234/src/eval.c   Fri Apr 27 22:17:43 2007
--- src/eval.c  Sat Apr 28 21:36:02 2007
***
*** 15598,15603 
--- 15598,15606 
  int   err = FALSE;
  FILE  *fd;
  
+ if (check_restricted() || check_secure())
+   return;
+ 
  if (argvars[1].v_type != VAR_UNKNOWN)
  {
/*
***
*** 16430,16435 
--- 16433,16441 
  char_u*s;
  int   ret = 0;
  int   c;
+ 
+ if (check_restricted() || check_secure())
+   return;
  
  if (argvars[0].v_type != VAR_LIST)
  {
*** ../vim-7.0.234/src/version.cFri Apr 27 22:17:43 2007
--- src/version.c   Sun Apr 29 13:54:29 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 235,
  /**/

-- 
Now it is such a bizarrely improbable coincidence that anything as
mind-bogglingly useful as the Babel fish could have evolved purely by chance
that some thinkers have chosen to see it as a final and clinching proof of the
NON-existence of God.
The argument goes something like this: 'I refuse to prove that I exist,' says
God, 'for proof denies faith, and without faith I am nothing.'
'But,' says Man, 'the Babel fish is a dead giveaway, isn't it?  It could not
have evolved by chance.  It proves you exist, and so therefore, by your own
arguments, you don't.  QED.'
'Oh dear,' says God, 'I hadn't thought of that,' and promptly vanishes in a
puff of logic.
'Oh, that was easy,' says Man, and for an encore goes on to prove that black
is white and gets himself killed on the next pedestrian crossing.
-- Douglas Adams, The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Syntax error: let a1 = 1 | let b = [1,2,3] | echo b[a1:-1] = Undefined variable a1:

2007-04-29 Thread Bram Moolenaar

Thomas wrote:

 The following code throws a Undefined variable a1: error:
 
   let a1 = 1 | let b = [1,2,3] | echo b[a1:-1]
 
 When one puts a blank after a1, it's ok though:
 
   let a1 = 1 | let b = [1,2,3] | echo b[a1 : -1]
 
 Since a1 is no valid scope and a1: is an illegal variable name, IMHO
 this code shouldn't be considered ambiguous.

We want to keep the possibility open to add more scopes later.  Thus
anything that looks like {scope}:{name} is handled as such.

Using : both for scopes and Sublist is not ideal.  But it's hard to
think of something that is better.  Just always put a space before the
: used for a Sublist.

-- 
I'm not familiar with this proof, but I'm aware of a significant
following of toddlers who believe that peanut butter is the solution
to all of life's problems...-- Tim Hammerquist

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Viminfo dictionaries

2007-04-29 Thread Bram Moolenaar

Thomas wrote:

 Part two in this week's installment of unsolicited comment on vimscript:
 
 I also realized that viminfo doesn't save upper case letter variables
 the values of which are dictionaries. This can be solved by using
 VimEnter  VimLeavePre autocommands and by converting the variable to 
 from strings. If this is intended to be so, I think this should be noted
 in the help -- AFAIK it currently isn't.

It's documented at :help 'viminfo':

CHARVALUE   ~
!   When included, save and restore global variables that start
with an uppercase letter, and don't contain a lowercase
letter.  Thus KEEPTHIS and K_L_M are stored, but KeepThis
and _K_L_M are not.  Only String and Number types are
stored.


-- 
So this is it, said Arthur, we are going to die.
Yes, said Ford, except...no!  Wait a minute!  He suddenly lunged across
the chamber at something behind Arthur's line of vision.  What's this
switch? he cried.
What?   Where? cried Arthur, twisting around.
No, I was only fooling, said Ford, we are going to die after all.
-- Douglas Adams, The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: feedkeys() allowed in sandbox

2007-04-29 Thread Bram Moolenaar

Ciaran McCreesh wrote:

 On Sat, 28 Apr 2007 21:52:07 +0200
 Bram Moolenaar [EMAIL PROTECTED] wrote:
  I don't like this solution.  Opening some files would be OK in the
  sandbox, e.g., for reading.  readfile() would be OK in the sandbox,
  right?
 
 Probably not. In a multi-user environment it can be used as a
 privilege escalation by inserting the contents of a non-world-readable
 file into a world-readable file when the latter is edited by a user
 with elevated privileges.

In the sandbox you can't insert text into a file or buffer.  Anything
that requires saving text for undo is blocked.

You can also get the text from an already opened file with getbufline().
It's difficult to draw a line, but I think blocking everything that
writes is good enough.

-- 
`The Guide says there is an art to flying,' said Ford, `or at least a
knack. The knack lies in learning how to throw yourself at the ground
and miss.' He smiled weakly.
-- Douglas Adams, The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: valgrind filetype detection

2007-04-29 Thread Bram Moolenaar

Rodolfo Borges wrote:

 When opening a valgrind output file, the syntax highlighting was not
 being automatically turned on.
 I found that on scripts.vim it's checking for 'valgrind' on the first
 line, but my version of valgrind (3.2.1 ) prints 'Memcheck' instead.
 So I fixed it adding the second elseif bellow:
 
Valgrind
   elseif s:line1 =~ '^==\d\+== valgrind'
 set ft=valgrind
   elseif s:line1 =~ '^==\d\+== Memcheck'
 set ft=valgrind
 
 Maybe this should be included on Vim distribution?

Memcheck is not valgrind, right?  Or is the format exactly the same?

One example I found starts with:

==16418== Memcheck, a memory error detector for x86-linux.
==16418== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==16418== Using valgrind-2.1.2, a program supervision framework for x86-linux.
==16418== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==16418== For more details, rerun with: -v
==16418==

So perhaps we should check for Using valgrind in the third line?  Or
is it possible that the header looks different?

-- 
'Well, here's something to occupy you and keep your mind off things.'
'It won't work, I have an exceptionally large mind.'
-- Douglas Adams, The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: wish: collaboration of N vim instances editing same file

2007-04-29 Thread Bram Moolenaar

Yakov Lerner wrote:

 Is it possible to add this item to the vim voting list ?:
 
   collaboration of N vim instances editing same file
   -- Ability of N instances of vim to absorb, merge and show changes
   to the same file made by other running vim instances [ either by reading
   other vim's swapfiles, or somehow else ] ?

It's an interesting idea.  Won't be easy to implement in such a way that
it works on most platforms.

It will probably require a server to make it possible for various Vim
instances to find each other.  And to take care of authentication.
Perhaps such a server already exists?

 Can this be added to SOC ?

Too late.

-- 
What a wonderfully exciting cough!  Do you mind if I join you?
-- Douglas Adams, The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: wish: show search progress on slow searches

2007-04-29 Thread Bram Moolenaar

Yakov Lerner wrote:

 Wish: when search is slow, show the progress line number
 every second on the bottom line (like, 12345 of 9).

What is slow?

Checking if the second passed will make the search even slower.
Checking time is quite slow on some systems (the check for CTRL-C
suffers from this).

 Maybe this can be done with plugin, I'm not sure.

Probably not without a big performance hit.

 Maybe simply status line can be refreshed once in a second,
 temporarily setting line number to the current search position.

That would be confusing.  Need to show it somewhere else (but where?).

 Some regexes take half minute to several minutes time on multimegabyte
 file. It would be nice to see the progress numbers onscreen.

True.  Some of my functions also echo the current line number now and
then.

-- 
You know, it's at times like this when I'm trapped in a Vogon airlock with
a man from Betelgeuse and about to die of asphyxiation in deep space that I
really wish I'd listened to what my mother told me when I was young!
Why, what did she tell you?
I don't know, I didn't listen!
-- Arthur Dent and Ford Prefect in Douglas Adams'
   The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: vim 7.1?

2007-04-28 Thread Bram Moolenaar

Ian Tegebo wrote:

 On 4/27/07, Bram Moolenaar [EMAIL PROTECTED] wrote:
 
  Jonathan Smith wrote:
 
   With the insane number of patches collecting against 7.0, and
   presumably the new features accumulating in the devel tree, is anyone
   thinking about when a 7.1 release might be made?
 
  Yeah, it's about time for Vim 7.1.  Unfortunately I haven't found a good
  moment to make a new release.  And I don't see it happening in the
  coming weeks either...

 Would it be possible for people to help make new releases?

You can certainly help fixing bugs.  There is about a hundred of them at
the top of the todo list.  I first thought to fix them all before making
a 7.1, but since the list only appears to get longer I might drop that
idea.

-- 
How To Keep A Healthy Level Of Insanity:
9. As often as possible, skip rather than walk.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.234

2007-04-27 Thread Bram Moolenaar

Patch 7.0.234
Problem:It's possible to use feedkeys() from a modeline.  That is a
security issue, can be used for a trojan horse.
Solution:   Disallow using feedkeys() in the sandbox.
Files:  src/eval.c


*** ../vim-7.0.233/src/eval.c   Thu Apr 26 17:08:16 2007
--- src/eval.c  Fri Apr 27 21:48:18 2007
***
*** 9078,9083 
--- 9078,9089 
  int   typed = FALSE;
  char_u*keys_esc;
  
+ /* This is not allowed in the sandbox.  If the commands would still be
+  * executed in the sandbox it would be OK, but it probably happens later,
+  * when sandbox is no longer set. */
+ if (check_secure())
+   return;
+ 
  rettv-vval.v_number = 0;
  keys = get_tv_string(argvars[0]);
  if (*keys != NUL)
*** ../vim-7.0.233/src/version.cThu Apr 26 18:42:17 2007
--- src/version.c   Fri Apr 27 22:13:23 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 234,
  /**/

-- 
Making it up?  Why should I want to make anything up?  Life's bad enough
as it is without wanting to invent any more of it.
-- Marvin, the Paranoid Android in Douglas Adams'
   The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: feedkeys() allowed in sandbox

2007-04-27 Thread Bram Moolenaar

Tomas Golembiovsky wrote:

 today somebody came to #vim, and pasted some modeline (containig joke or
 such). He muttered something about not knowing what that means and left
 before long. But (!) what I noticed is that feedkeys() was used as part of
 foldexpression and it turned out that feedkeys() is allowed in sandbox,
 which means malicious file can run arbitrary command via modeline like
 this:
 
 vim: fdm=expr fde=feedkeys(\\:!touch\ phantom_was_here\\cr)
 
 I guess you can see the consequences. Is this known/intentional?

That's pretty nasty.  I'll make a patch right away.

-- 
Far back in the mists of ancient time, in the great and glorious days of the
former Galactic Empire, life was wild, rich and largely tax free.
Mighty starships plied their way between exotic suns, seeking adventure and
reward among the furthest reaches of Galactic space.  In those days, spirits
were brave, the stakes were high, men were real men, women were real women
and small furry creatures from Alpha Centauri were real small furry creatures
from Alpha Centauri.  And all dared to brave unknown terrors, to do mighty
deeds, to boldly split infinitives that no man had split before -- and thus
was the Empire forged.
-- Douglas Adams, The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: vim 7.1?

2007-04-27 Thread Bram Moolenaar

Jonathan Smith wrote:

 With the insane number of patches collecting against 7.0, and
 presumably the new features accumulating in the devel tree, is anyone
 thinking about when a 7.1 release might be made?

Yeah, it's about time for Vim 7.1.  Unfortunately I haven't found a good
moment to make a new release.  And I don't see it happening in the
coming weeks either...

However, the number of patches is not insane, nor are the new features
waiting in some development tree.  It will be just Vim 7.0 with all
patches included and updated runtime files.

-- 
How To Keep A Healthy Level Of Insanity:
4. Put your garbage can on your desk and label it in.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: feedkeys() allowed in sandbox

2007-04-27 Thread Bram Moolenaar

Tony Mechelynck wrote:

 Tomas Golembiovsky wrote:
  Greetings mortals,
  
  today somebody came to #vim, and pasted some modeline (containig joke or
  such). He muttered something about not knowing what that means and left
  before long. But (!) what I noticed is that feedkeys() was used as part of
  foldexpression and it turned out that feedkeys() is allowed in sandbox,
  which means malicious file can run arbitrary command via modeline like
  this:
  
  vim: fdm=expr fde=feedkeys(\\:!touch\ phantom_was_here\\cr)
  
  I guess you can see the consequences. Is this known/intentional?
  
 
 IIUC, feedkeys() called from sandbox should execute as if in sandbox,
 i.e., only (at most) key sequences acceptable in sandbox should be
 able to be fed. 

 Now this is what I think it ought to do. How does it actually
 behave? Did you try your example? Did it touch the file?

That was the idea: The sandbox flag is checked when the keys are
executed.  However, the sandbox flag may have been reset by then, as the
example shows.  Thus feedkeys() needs to be disallowed in the sandbox.

-- 
I have a drinking problem -- I don't have a drink!

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: possible bug: lowercase dotless i and langmap

2007-04-27 Thread Bram Moolenaar

Ali Polatel wrote:

 Hi everyone,
   I was playing around with langmap and found out there is a problem with
 characters
 'ı'[1] - 0131;LATIN SMALL LETTER DOTLESS I - and
 'ğ'[2] - 011F;LATIN SMALL LETTER G WITH BREVE
   The Turkish keyboard looks like this[3] for those who don't know about
 it.
   The problem is when I set langmap=ıi small dotless I doesn't work as
 expected. I'm using tr_TR.UTF-8 locale and I tried it both on the
 console,with consoles on X and with gvim. The same is true
 for g with breve. The other turkish keys work fine with langmap. I wasn't sure
 if this was about my system or vim so I made some people with turkish 
 keyboards
 try this:
 [EMAIL PROTECTED] ~ $ vim -c set lmap=ıi
  execute \normal ıhi\Esc\
  let line = getline(1)
  if line =~ \hi\
 echo \The dotless small I works as expected\
  else
 echo \The dotless small I doesn't work with langmap\
  endif 
 - - there is probably a shorter way but anyway :) -
 and they could reproduce the problem. 
   Internationalizing dotted and dotless letter I has always been a
   problem[4] but I don't think this is the issue here because the same
   problem exists for g with breve.

From :help 'langmap':

This only works for 8-bit characters.  The value of 'langmap' may be
specified with multi-byte characters (e.g., UTF-8), but only the lower
8 bits of each character will be used.

I guess most Turkish characters are in latin1, only the ones that are
not won't work with 'langmap'.

-- 
How To Keep A Healthy Level Of Insanity:
3. Every time someone asks you to do something, ask if they want fries
   with that.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.225

2007-04-26 Thread Bram Moolenaar

Patch 7.0.225
Problem:When using setline() in an InsertEnter autocommand and doing A
the cursor ends up on the last byte in the line. (Yukihiro
Nakadaira)
Solution:   Only adjust the column when using setline() for the cursor line.
Move it back to the head byte if necessary.
Files:  src/eval.c, src/misc2.c


*** ../vim-7.0.224/src/eval.c   Tue Mar 27 16:57:54 2007
--- src/eval.c  Thu Apr 26 10:52:09 2007
***
*** 14397,14403 
if (u_savesub(lnum) == OK  ml_replace(lnum, line, TRUE) == OK)
{
changed_bytes(lnum, 0);
!   check_cursor_col();
rettv-vval.v_number = 0;   /* OK */
}
}
--- 14411,14418 
if (u_savesub(lnum) == OK  ml_replace(lnum, line, TRUE) == OK)
{
changed_bytes(lnum, 0);
!   if (lnum == curwin-w_cursor.lnum)
!   check_cursor_col();
rettv-vval.v_number = 0;   /* OK */
}
}
*** ../vim-7.0.224/src/misc2.c  Tue Feb 20 03:18:20 2007
--- src/misc2.c Tue Mar 27 21:59:56 2007
***
*** 516,522 
--- 516,529 
|| virtual_active())
curwin-w_cursor.col = len;
else
+   {
curwin-w_cursor.col = len - 1;
+ #ifdef FEAT_MBYTE
+   /* prevent cursor from moving on the trail byte */
+   if (has_mbyte)
+   mb_adjust_cursor();
+ #endif
+   }
  }
  
  #ifdef FEAT_VIRTUALEDIT
*** ../vim-7.0.224/src/version.cTue Mar 27 16:57:54 2007
--- src/version.c   Thu Apr 26 10:53:33 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 225,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
14. You start introducing yourself as Jim at I-I-Net dot net dot au

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.226

2007-04-26 Thread Bram Moolenaar

Patch 7.0.226
Problem:Display flickering when updating signs through the netbeans
interface. (Xavier de Gaye)
Solution:   Remove the redraw_later(CLEAR) call.
Files:  src/netbeans.c


*** ../vim-7.0.225/src/netbeans.c   Tue Nov 14 18:29:00 2006
--- src/netbeans.c  Sat Apr 21 18:14:00 2007
***
*** 2143,2150 
coloncmd(:sign jump %d buffer=%d, serNum,
   buf-bufp-b_fnum);
}
-   /* XXX only redraw what changed. */
-   redraw_later(CLEAR);
  #endif
  /* =*/
}
--- 2143,2148 
*** ../vim-7.0.225/src/version.cThu Apr 26 10:55:46 2007
--- src/version.c   Thu Apr 26 11:00:01 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 226,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
15. Your heart races faster and beats irregularly each time you see a new WWW
site address in print or on TV, even though you've never had heart
problems before.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.227

2007-04-26 Thread Bram Moolenaar

Patch 7.0.227
Problem:Crash when closing a window in the GUI. (Charles Campbell)
Solution:   Don't call out_flush() from win_free().
Files:  src/window.c


*** ../vim-7.0.226/src/window.c Sun Mar 11 15:53:27 2007
--- src/window.cWed Apr 18 22:31:52 2007
***
*** 2084,2089 
--- 2084,2096 
  }
  #endif
  
+ #ifdef FEAT_GUI
+ /* Avoid trouble with scrollbars that are going to be deleted in
+  * win_free(). */
+ if (gui.in_use)
+   out_flush();
+ #endif
+ 
  /*
   * Close the link to the buffer.
   */
***
*** 4174,4180 
  #ifdef FEAT_GUI
  if (gui.in_use)
  {
-   out_flush();
gui_mch_destroy_scrollbar(wp-w_scrollbars[SBAR_LEFT]);
gui_mch_destroy_scrollbar(wp-w_scrollbars[SBAR_RIGHT]);
  }
--- 4181,4186 
*** ../vim-7.0.226/src/version.cThu Apr 26 11:01:16 2007
--- src/version.c   Thu Apr 26 16:09:30 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 227,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
16. You step out of your room and realize that your parents have moved and
you don't have a clue when it happened.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.228

2007-04-26 Thread Bram Moolenaar

Patch 7.0.228
Problem:Cygwin: problem with symlink to DOS style path.
Solution:   Invoke cygwin_conv_to_posix_path(). (Luca Masini)
Files:  src/os_unix.c


*** ../vim-7.0.227/src/os_unix.cTue Mar  6 20:27:03 2007
--- src/os_unix.c   Mon Apr 23 22:27:16 2007
***
*** 55,60 
--- 55,66 
  # endif
  #endif
  
+ #ifdef __CYGWIN__
+ # ifndef WIN32
+ #  include sys/cygwin.h /* for cygwin_conv_to_posix_path() */
+ # endif
+ #endif
+ 
  #if defined(HAVE_SELECT)
  extern int   select __ARGS((int, fd_set *, fd_set *, fd_set *, struct timeval 
*));
  #endif
***
*** 2228,2233 
--- 2258,2270 
  
  #ifdef VMS
  fname = vms_fixfilename(fname);
+ #endif
+ 
+ #ifdef __CYGWIN__
+ /*
+  * This helps for when /etc/hosts is a symlink to c:/something/hosts.
+  */
+ cygwin_conv_to_posix_path(fname, fname);
  #endif
  
  /* expand it if forced or not an absolute path */
*** ../vim-7.0.227/src/version.cThu Apr 26 16:11:47 2007
--- src/version.c   Thu Apr 26 16:27:29 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 228,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
19. All of your friends have an @ in their names.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.229

2007-04-26 Thread Bram Moolenaar

Patch 7.0.229
Problem:When 'pastetoggle' starts with Esc then pressing Esc in Insert
mode will not time out. (Jeffery Small)
Solution:   Use KL_PART_KEY instead of KL_PART_MAP, so that 'ttimeout' applies
to the 'pastetoggle' key.
Files:  src/getchar.c


*** ../vim-7.0.228/src/getchar.cSun Mar  4 21:25:44 2007
--- src/getchar.c   Thu Apr 19 22:13:37 2007
***
*** 2183,2189 
}
/* Need more chars for partly match. */
if (mlen == typebuf.tb_len)
!   keylen = KL_PART_MAP;
else if (max_mlen  mlen)
/* no match, may have to check for termcode at
 * next character */
--- 2187,2193 
}
/* Need more chars for partly match. */
if (mlen == typebuf.tb_len)
!   keylen = KL_PART_KEY;
else if (max_mlen  mlen)
/* no match, may have to check for termcode at
 * next character */
*** ../vim-7.0.228/src/version.cThu Apr 26 16:28:43 2007
--- src/version.c   Thu Apr 26 16:48:59 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 229,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
20. When looking at a pageful of someone else's links, you notice all of them
are already highlighted in purple.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.230

2007-04-26 Thread Bram Moolenaar

Patch 7.0.230
Problem:After using :lcd a script doesn't know how to restore the
current directory.
Solution:   Add the haslocaldir() function. (Bob Hiestand)
Files:  runtime/doc/usr_41.txt, runtime/doc/eval.txt, src/eval.c


*** ../vim-7.0.229/runtime/doc/usr_41.txt   Sun May  7 17:02:39 2006
--- runtime/doc/usr_41.txt  Thu Apr 26 17:06:48 2007
***
*** 1,4 
! *usr_41.txt*  For Vim version 7.0.  Last change: 2006 Apr 30
  
 VIM USER MANUAL - by Bram Moolenaar
  
--- 1,4 
! *usr_41.txt*  For Vim version 7.0.  Last change: 2007 Apr 26
  
 VIM USER MANUAL - by Bram Moolenaar
  
***
*** 703,708 
--- 703,709 
isdirectory()   check if a directory exists
getfsize()  get the size of a file
getcwd()get the current working directory
+   haslocaldir()   check if current window used |:lcd|
tempname()  get the name of a temporary file
mkdir() create a new directory
delete()delete a file
*** ../vim-7.0.229/runtime/doc/eval.txt Tue Mar 27 10:20:58 2007
--- runtime/doc/eval.txtTue Apr 24 21:50:49 2007
***
*** 1,4 
! *eval.txt*  For Vim version 7.0.  Last change: 2006 Nov 01
  
  
  VIM REFERENCE MANUALby Bram Moolenaar
--- 1,4 
! *eval.txt*  For Vim version 7.0.  Last change: 2007 Apr 24
  
  
  VIM REFERENCE MANUALby Bram Moolenaar
***
*** 1623,1628 
--- 1633,1639 
  globpath( {path}, {expr}) String  do glob({expr}) for all dirs in {path}
  has( {feature})   Number  TRUE if feature {feature} 
supported
  has_key( {dict}, {key})   Number  TRUE if {dict} has entry {key}
+ haslocaldir() Number  TRUE if current window executed |:lcd|
  hasmapto( {what} [, {mode} [, {abbr}]])
Number  TRUE if mapping to {what} exists
  histadd( {history},{item})String  add an item to a history
***
*** 3016,3021 
--- 3041,3049 
The result is a Number, which is 1 if |Dictionary| {dict} has
an entry with key {key}.  Zero otherwise.
  
+ haslocaldir() *haslocaldir()*
+   The result is a Number, which is 1 when the current
+ window has set a local path via |:lcd|, and 0 otherwise.
  
  hasmapto({what} [, {mode} [, {abbr}]])*hasmapto()*
The result is a Number, which is 1 if there is a mapping that
*** ../vim-7.0.229/src/eval.c   Thu Apr 26 10:55:46 2007
--- src/eval.c  Thu Apr 26 10:52:09 2007
***
*** 541,546 
--- 541,547 
  static void f_globpath __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_has __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_has_key __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_haslocaldir __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_hasmapto __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_histadd __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_histdel __ARGS((typval_T *argvars, typval_T *rettv));
***
*** 7110,7115 
--- 7111,7117 
  {globpath,  2, 2, f_globpath},
  {has,   1, 1, f_has},
  {has_key,   2, 2, f_has_key},
+ {haslocaldir,   0, 0, f_haslocaldir},
  {hasmapto,  1, 3, f_hasmapto},
  {highlightID,   1, 1, f_hlID},  /* obsolete */
  {highlight_exists,1, 1, f_hlexists},/* obsolete */
***
*** 11131,11136 
--- 11133,11150 
  
  rettv-vval.v_number = dict_find(argvars[0].vval.v_dict,
  get_tv_string(argvars[1]), -1) != NULL;
+ }
+ 
+ /*
+  * haslocaldir() function
+  */
+ /*ARGSUSED*/
+ static void
+ f_haslocaldir(argvars, rettv)
+ typval_T  *argvars;
+ typval_T  *rettv;
+ {
+ rettv-vval.v_number = (curwin-w_localdir != NULL);
  }
  
  /*
*** ../vim-7.0.229/src/version.cThu Apr 26 16:50:05 2007
--- src/version.c   Thu Apr 26 17:04:15 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 230,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
22. You've already visited all the links at Yahoo and you're halfway through
Lycos.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.231

2007-04-26 Thread Bram Moolenaar

Patch 7.0.231
Problem:When recovering from a swap file the page size is likely to be
different from the minimum.  The block used for the first page
then has a buffer of the wrong size, causing a crash when it's
reused later.  (Zephaniah Hull)
Solution:   Reallocate the buffer when the page size changes.  Also check that
the page size is at least the minimum value.
Files:  src/memline.c


*** ../vim-7.0.230/src/memline.cTue Mar  6 20:27:03 2007
--- src/memline.c   Thu Apr 19 16:10:39 2007
***
*** 1015,1032 
--- 1015,1053 
msg_end();
goto theend;
  }
+ 
  /*
   * If we guessed the wrong page size, we have to recalculate the
   * highest block number in the file.
   */
  if (mfp-mf_page_size != (unsigned)char_to_long(b0p-b0_page_size))
  {
+   unsigned previous_page_size = mfp-mf_page_size;
+ 
mf_new_page_size(mfp, (unsigned)char_to_long(b0p-b0_page_size));
+   if (mfp-mf_page_size  previous_page_size)
+   {
+   msg_start();
+   msg_outtrans_attr(mfp-mf_fname, attr | MSG_HIST);
+   MSG_PUTS_ATTR(_( has been damaged (page size is smaller than 
minimum value).\n),
+   attr | MSG_HIST);
+   msg_end();
+   goto theend;
+   }
if ((size = lseek(mfp-mf_fd, (off_t)0L, SEEK_END)) = 0)
mfp-mf_blocknr_max = 0;/* no file or empty file */
else
mfp-mf_blocknr_max = (blocknr_T)(size / mfp-mf_page_size);
mfp-mf_infile_count = mfp-mf_blocknr_max;
+ 
+   /* need to reallocate the memory used to store the data */
+   p = alloc(mfp-mf_page_size);
+   if (p == NULL)
+   goto theend;
+   mch_memmove(p, hp-bh_data, previous_page_size);
+   vim_free(hp-bh_data);
+   hp-bh_data = p;
+   b0p = (ZERO_BL *)(hp-bh_data);
  }
  
  /*
*** ../vim-7.0.230/src/version.cThu Apr 26 17:08:16 2007
--- src/version.c   Thu Apr 26 17:11:38 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 231,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
23. You can't call your mother...she doesn't have a modem.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.232 (extra)

2007-04-26 Thread Bram Moolenaar
;
+ 
+ // add if items can be selected (?): kDataBrowserListViewSelectionColumn
+ colDesc.propertyDesc.propertyFlags = kDataBrowserDefaultPropertyFlags;
+ 
+ colDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc;
+ colDesc.headerBtnDesc.minimumWidth = 100;
+ colDesc.headerBtnDesc.maximumWidth = 150;
+ colDesc.headerBtnDesc.titleOffset = 0;
+ colDesc.headerBtnDesc.titleString = CFSTR(Tabs);
+ colDesc.headerBtnDesc.initialOrder = kDataBrowserOrderIncreasing;
+ colDesc.headerBtnDesc.btnFontStyle.flags = 0; // use default font
+ colDesc.headerBtnDesc.btnContentInfo.contentType = 
kControlContentTextOnly;
+ 
+ AddDataBrowserListViewColumn(dataBrowser, colDesc, 0);
+ 
+ // create tabline popup menu required by vim docs (see :he tabline-menu)
+ CreateNewMenu(kTabContextMenuId, 0, contextMenu);
+ AppendMenuItemTextWithCFString(contextMenu, CFSTR(Close), 0,
+   TABLINE_MENU_CLOSE, NULL);
+ AppendMenuItemTextWithCFString(contextMenu, CFSTR(New Tab), 0,
+ TABLINE_MENU_NEW, NULL);
+ AppendMenuItemTextWithCFString(contextMenu, CFSTR(Open Tab...), 0,
+TABLINE_MENU_OPEN, NULL);
+ }
+ 
+ 
+ /*
+  * Show or hide the tabline.
+  */
+ void
+ gui_mch_show_tabline(int showit)
+ {
+ if (showit == 0)
+ CloseDrawer(drawer, true);
+ else
+ OpenDrawer(drawer, kWindowEdgeRight, true);
+ }
+ 
+ /*
+  * Return TRUE when tabline is displayed.
+  */
+ int
+ gui_mch_showing_tabline(void)
+ {
+ WindowDrawerState state = GetDrawerState(drawer);
+ 
+ return state == kWindowDrawerOpen || state == kWindowDrawerOpening;
+ }
+ 
+ /*
+  * Update the labels of the tabline.
+  */
+ void
+ gui_mch_update_tabline(void)
+ {
+ tabpage_T *tp;
+ int   numTabs = getTabCount();
+ int   nr = 1;
+ int   curtabidx = 1;
+ 
+ // adjust data browser
+ if (tabLabels != NULL)
+ {
+ int i;
+ 
+ for (i = 0; i  tabLabelsSize; ++i)
+ CFRelease(tabLabels[i]);
+ free(tabLabels);
+ }
+ tabLabels = (CFStringRef *)malloc(numTabs * sizeof(CFStringRef));
+ tabLabelsSize = numTabs;
+ 
+ for (tp = first_tabpage; tp != NULL; tp = tp-tp_next, ++nr)
+ {
+   if (tp == curtab)
+   curtabidx = nr;
+ tabLabels[nr-1] = getTabLabel(tp);
+ }
+ 
+ RemoveDataBrowserItems(dataBrowser, kDataBrowserNoItem, 0, NULL,
+ kDataBrowserItemNoProperty);
+ // data browser uses ids 1, 2, 3, ... numTabs per default, so we
+ // can pass NULL for the id array
+ AddDataBrowserItems(dataBrowser, kDataBrowserNoItem, numTabs, NULL,
+ kDataBrowserItemNoProperty);
+ 
+ DataBrowserItemID item = curtabidx;
+ SetDataBrowserSelectedItems(dataBrowser, 1, item, 
kDataBrowserItemsAssign);
+ }
+ 
+ /*
+  * Set the current tab to nr.  First tab is 1.
+  */
+ void
+ gui_mch_set_curtab(nr)
+ int   nr;
+ {
+ DataBrowserItemID item = nr;
+ SetDataBrowserSelectedItems(dataBrowser, 1, item, 
kDataBrowserItemsAssign);
+ 
+ // TODO: call something like this?: (or restore scroll position, or...)
+ RevealDataBrowserItem(dataBrowser, item, kTabsColumn,
+ kDataBrowserRevealOnly);
+ }
+ 
+ #endif // FEAT_GUI_TABLINE
*** ../vim-7.0.231/src/proto/gui_mac.proTue Mar 28 23:01:02 2006
--- src/proto/gui_mac.pro   Thu Mar 15 20:23:42 2007
***
*** 84,89 
--- 84,93 
  int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u 
*buttons, int dfltbutton, char_u *textfield));
  char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, 
char_u *ext, char_u *initdir, char_u *filter));
  void gui_mch_set_foreground __ARGS((void));
+ void gui_mch_show_tabline __ARGS((int showit));
+ int gui_mch_showing_tabline __ARGS((void));
+ void gui_mch_update_tabline __ARGS((void));
+ void gui_mch_set_curtab __ARGS((int nr));
  
  char_u *C2Pascal_save __ARGS((char_u *Cstring));
  char_u *C2Pascal_save_and_remove_backslash __ARGS((char_u *Cstring));
*** ../vim-7.0.231/src/version.cThu Apr 26 17:23:28 2007
--- src/version.c   Thu Apr 26 18:17:42 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 232,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
24. You realize there is not a sound in the house and you have no idea where
your children are.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help

Re: syntax highlighting addition

2007-04-26 Thread Bram Moolenaar

Jonathan Smith wrote:

 sorry for the long time between replies. i've been busy on other things :)
 
 Nikolai Weibull wrote:
   Well, the rpm spec file-type has been with us a long time, well before
   we knew better.  Try to give your file-type an as specific name as
   possible.  You will not be getting the name recipe; it's way too
   generic in this day and age.  Go with conrecipe or something
   similar.  Remember: Bram has his own build system, called Aap, which
   also uses recipes.  Also, if Vim will never edit a (Conary) changeset,
   then why will we have to worry about a name-clash between different
   conary file-types?
 
 done - changed to conaryRecipe.

No other filetype has an uppercase letter.  I would call it
conaryrecipe.  It's a bit long, but clear.

Now all items in the syntax file need to start with conaryrecipe to
avoid any confusion with other syntax files and highlighting items.
b:current_syntax also needs to be set to the same name.

   Nitpick: remove the empty comment.
 
 done
 
   Just do
  
   if exists(b:current_syntax)
finish
   endif
  
   No one will be using your syntax definition with vim 5 anyway.  Let's
   keep new files clean from (now) unnecessary cruft.
 
 done
 
   syn match   conaryUse   Use\.[a-z0-9.]* contains=conaryUseFlag
  
   Sure that * shouldn't be a \+?  And can you have a sequence of dots,
   as in Use...?
 
 done
 
   A better way of doing this is to do (substitute \w with whatever
   pattern your parser actually allows)
  
   syn match conaryUse
   \ Use\.\w\+
   \ nextgroup=conaryUseFlag
  
   syn keyword conaryUseFlag
   \ contained
   \ nextgroup=conaryUseFlagSeparator
   \ pcre
   \ tcpwrappers
   \ ...
  
   syn match conaryUseFlagSeparator
   \ contained
   \ nextgroup=conaryUseFlag
   \ '\.'
 
 that didn't work for me for some reason. perhaps i'm misunderstanding?
 
   syn match   conaryRr\.\w* contains=conaryFunction
  
   Leftover?
 
 yes. axed.
 
   if version = 508 || !exists(did_python_syn_inits)
 if version = 508
  let did_python_syn_inits = 1
   command -nargs=+ HiLink hi link args
 else
   command -nargs=+ HiLink hi def link args
 endif
  
   Just skip this.  No one will be using your syntax definition with Vim 5.
 
 yep, removed. as i said, rPath has been maintaining this for a long time. :)

You might as well use hi def link instead of HiLink.

 HiLink pythonStatement   Statement
 HiLink pythonFunctionFunction
 HiLink pythonConditional Conditional
 HiLink pythonRepeat  Repeat
 HiLink pythonString  String
 HiLink pythonRawString   String
 HiLink pythonEscape  Special
 HiLink pythonOperatorOperator
 HiLink pythonPreCondit   PreCondit
 HiLink pythonComment Comment
 HiLink pythonTodoTodo
  
   ?
 
 all wacked. just crufty.

But the python syntax items are still there.  This doesn't look right.

vim: ts=8
  
   This is the default setting.
 
 removed
 
 new version attached, as before. thanks for the feedback. further feedback 
 requested :)

-- 
hundred-and-one symptoms of being an internet addict:
27. You refer to your age as 3.x.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: search() and smartcase

2007-04-24 Thread Bram Moolenaar

Yakov Lerner wrote:

 The search() doesn't seem to follow 'smartcase' (and this does not
 seem to be documented). Is it possible to have a flag to search() to
 obey the 'smartcase' ? Can it be included into todo ?

The search() function does use 'smartcase'.

-- 
hundred-and-one symptoms of being an internet addict:
2. You kiss your girlfriend's home page.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: [PATCH] Determining whether a window used :lcd

2007-04-24 Thread Bram Moolenaar

Bob Hiestand wrote:

 On 4/20/07, Bram Moolenaar [EMAIL PROTECTED] wrote:
 
  It was still in my pile of messages to read.
 
 I apologize for my impatience.
 
  I agree that a different function would be more useful.  I prefer
  haslocaldir().  This would return zero when the current window uses the
  global directory, one when it has a local directory.  Later we could add
  an argument for selecting the window.
 
  If you agree, and nobody has something to say on this, can you change
  your patch?
 
 Done.  Please see attached.

Great thanks.  Good to see a patch with documentation updates!

-- 
A)bort, R)etry, B)ang it with a large hammer

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Vim's ole functionality

2007-04-22 Thread Bram Moolenaar

Nageshwar wrote:

   I tried to embed the vim in eclipse using swt library. I used
 program id as Vim.Application. but i got an error. The error message
 that i got was
  org.eclipse.swt.SWTException: Failed to create Ole Client. result
 = -2147221164
 I tried to embed some other applications like actorbat pdf viewer, IE
 etc., they are working perfectly.
 I guess there is some problem with vim's ole interface implementation.
 can anybody help me..

Did you run gvim -register?

-- 
Engineers understand that their appearance only bothers other people and
therefore it is not worth optimizing.
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: [PATCH] Determining whether a window used :lcd

2007-04-20 Thread Bram Moolenaar

Bob Hiestand wrote:

 On 4/11/07, Bob Hiestand [EMAIL PROTECTED] wrote:
  The attached patch very simply implements the following from the todo:
 
  7   There is no way to change directory and go back without changing the 
  local
  and/or global directory.  Add a way to find out if the current window 
  uses
  a local directory.  Add cdcmd() that returns :cd or :lcd?
 
  I personally would prefer the function be called something like 
  'isdirlocal()'.
 
  I need this feature for my vcscommand.vim plugin, which changes
  directory a fair amount, and can screw up the user environment if the
  user makes use of :lcd.
 
 Does anyone have any feedback on this?

It was still in my pile of messages to read.

I agree that a different function would be more useful.  I prefer
haslocaldir().  This would return zero when the current window uses the
global directory, one when it has a local directory.  Later we could add
an argument for selecting the window.

If you agree, and nobody has something to say on this, can you change
your patch?

-- 
The only way the average employee can speak to an executive is by taking a
second job as a golf caddie.
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: syntax highlighting addition

2007-04-20 Thread Bram Moolenaar

Jonathan Smith wrote:

  Conary [1] has a file format called a recipe [2] which is in many
  ways similar in function to a spec file or an ebuild. rPath has been
  maintaining a syntax highlighting file for this format, but it would
  be nice if vim would accept a patch to include this in the standard
  distribution. Attached is just such a patch.
  
  Thanks for looking into this.
  
  recipe is not a good filetype name.  Is there anything against using
  conary?
  
  The syntax file must not start with syntax clear.  Look into a few
  examples in the Vim 7 distribution how this is done properly.
  
  I would very much prefer that the author of the file directly sends the
  syntax file to me.  At least for copyright issues.
  
 
 Well, the files are called recipes. In the same way that you wouldn't call a 
 spec file rpm, you wouldn't call a recipe conary. Conary has other file 
 types which it uses, which vim should not be able to edit (changesets, the 
 equivalent of an RPM).

Well, then we would need to call it conaryrecipe, but that's quite
long.

At least you need to be consistent: the name of the filetype is used for
the file name, and all syntax items must start with that name.

I now notice that you also have items starting with python.  That's
weird.  Is this the result of copypaste or was this intentional?

 You'll notice that rPath Inc is listed as the author. I am a member
 of the rPath distro team, and an employee of the same, so copyright
 shouldn't be an issue.

Ah, it's good to know this.

 Thanks for the tips about syntax clear. Taking an example from the
 spec.vim file, I have modified the recipe.vim file to hopefully be
 acceptable. It is once again attached to this email.

Getting better.  Nikola's comments also apply (thanks Nikola!).

-- 
Sometimes you can protect millions of dollars in your budget simply by buying
a bag of cookies, dropping it on the budget anylyst's desk, and saying
something deeply personal such as How was your weekend, big guy?
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Multi-byte in the special key

2007-04-19 Thread Bram Moolenaar

Volodia Vichniakov wrote:

 It's my first mail to this list.
 
 I'm using vim on Win32 this Russian keyboard. There are some bugs with
 mapping of russians special keys. I've made some patches to fix these
 bugs.
 
 Let start step by step.
 1. Special key may contain multi-byte character (ex. unicode) after
 modifier. For example, if I press a key Alt-k with russian input
 (Alt-Ì) then vim's got key K_SPECIAL K_SPECIAL 0x08 0xd0 0xbb, where
 0xd0 0xbb is the unicode character CYRILLIC_SMALL_LETTER_EL.
 2. In functions find_special_key (misc2.c) and str2special (message.c)
 vim supposes that there is only _1_ byte after modifiers.
 
 I can offer the corrected code for these functions.
 
 (There are 2 other patches to fix this problem in the console Win32
 application)

It will help us a lot if you provide a reproducable example.  I don't
have a Russian keyboard, thus hopefully this won't be required.

You can send patches directly to me.  If they are small you can also
send them to the vim-dev list, so that others can make comments.

-- 
The acknowledged parents of reengineering are Michael Hammer and James Champy.
When I say they're the parents I don't mean they had sex - and I apologize
for making you think about it.  I mean they wrote the best-selling business
book _Reengineering the Corporation_, which was published in 1993.
   Businesses flocked to reengineering like frat boys to a drunken
cheerleader.  (This analogy wasn't necessary, but I'm trying to get my mind
off that Hammer and Champy thing.)
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: vim patch for cygwin

2007-04-18 Thread Bram Moolenaar

Luca Masini wrote:

 Bram Moolenaar wrote:
 
   Why at the end of mch_FullName()?  I would guess it needs to be done
   before this line:
  
   /* expand it if forced or not an absolute path */
   if (force || !mch_isFullName(fname))
 
 Ok.
 
 Luca.
 
 diff --recursive --unified vim70/src/os_unix.c vim70-patch/src/os_unix.c
 --- vim70/src/os_unix.c   2006-05-01 10:13:15.0 +0200
 +++ vim70-patch/src/os_unix.c 2007-04-18 00:40:52.747808000 +0200
 @@ -2228,6 +2228,10 @@
  fname = vms_fixfilename(fname);
  #endif
  
 +#ifdef __CYGWIN__
 +cygwin_conv_to_posix_path( fname, fname );
 +#endif
 +
  /* expand it if forced or not an absolute path */
  if (force || !mch_isFullName(fname))
  {


Hmm, I'm not getting the feeling this has been properly tested.  I'll
await comments for a while.

In src/main.c I found this, perhaps it's also needed in os_unix.c:

#ifdef __CYGWIN__
# ifndef WIN32
#  include sys/cygwin.h   /* for cygwin_conv_to_posix_path() */
# endif
# include limits.h
#endif


-- 
FIRST VILLAGER: We have found a witch.  May we burn her?
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.221

2007-03-27 Thread Bram Moolenaar

Patch 7.0.221
Problem:finddir() uses 'path' by default, where . means relative to the
current file.  But it works relative to the current directory.
(Tye Zdrojewski)
Solution:   Add the current buffer name to find_file_in_path_option() for the
relative file name.
Files:  runtime/doc/eval.txt, src/eval.c


*** ../vim-7.0.220/runtime/doc/eval.txt Sun Feb  4 02:59:04 2007
--- runtime/doc/eval.txtMon Mar 26 20:49:06 2007
***
*** 2541,2550 
  
  
  finddir({name}[, {path}[, {count}]])  *finddir()*
!   Find directory {name} in {path}.  Returns the path of the
!   first found match.  When the found directory is below the
!   current directory a relative path is returned.  Otherwise a
!   full path is returned.
If {path} is omitted or empty then 'path' is used.
If the optional {count} is given, find {count}'s occurrence of
{name} in {path} instead of the first one.
--- 2565,2576 
  
  
  finddir({name}[, {path}[, {count}]])  *finddir()*
!   Find directory {name} in {path}.  Supports both downwards and
!   upwards recursive directory searches.  See |file-searching|
!   for the syntax of {path}.
!   Returns the path of the first found match.  When the found
!   directory is below the current directory a relative path is
!   returned.  Otherwise a full path is returned.
If {path} is omitted or empty then 'path' is used.
If the optional {count} is given, find {count}'s occurrence of
{name} in {path} instead of the first one.
*** ../vim-7.0.220/src/eval.c   Sun Mar 25 17:50:22 2007
--- src/eval.c  Sun Mar 25 17:43:53 2007
***
*** 9195,9201 
vim_free(fresult);
fresult = find_file_in_path_option(first ? fname : NULL,
   first ? (int)STRLEN(fname) : 0,
!   0, first, path, dir, NULL,
dir ? (char_u *) : curbuf-b_p_sua);
first = FALSE;
  
--- 9195,9201 
vim_free(fresult);
fresult = find_file_in_path_option(first ? fname : NULL,
   first ? (int)STRLEN(fname) : 0,
!   0, first, path, dir, curbuf-b_ffname,
dir ? (char_u *) : curbuf-b_p_sua);
first = FALSE;
  
*** ../vim-7.0.220/src/version.cSun Mar 25 17:50:22 2007
--- src/version.c   Tue Mar 27 10:16:35 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 221,
  /**/

-- 
Beer  pretzels can't be served at the same time in any bar or restaurant.
[real standing law in North Dakota, United States of America]

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.223

2007-03-27 Thread Bram Moolenaar

Patch 7.0.223
Problem:Unprintable characters in completion text mess up the popup menu.
(Gombault Damien)
Solution:   Use strtrans() to make the text printable.
Files:  src/charset.c, src/popupmnu.c


*** ../vim-7.0.222/src/charset.cTue Apr 18 00:04:40 2006
--- src/charset.c   Sat Mar 24 21:10:37 2007
***
*** 317,323 
  }
  }
  
! #if defined(FEAT_EVAL) || defined(FEAT_TITLE) || defined(PROTO)
  /*
   * Translate a string into allocated memory, replacing special chars with
   * printable chars.  Returns NULL when out of memory.
--- 317,324 
  }
  }
  
! #if defined(FEAT_EVAL) || defined(FEAT_TITLE) || defined(FEAT_INS_EXPAND) \
!   || defined(PROTO)
  /*
   * Translate a string into allocated memory, replacing special chars with
   * printable chars.  Returns NULL when out of memory.
*** ../vim-7.0.222/src/popupmnu.c   Tue Aug 22 21:51:18 2006
--- src/popupmnu.c  Sat Mar 24 21:07:39 2007
***
*** 280,287 
w = ptr2cells(p);
if (*p == NUL || *p == TAB || totwidth + w  pum_width)
{
!   /* Display the text that fits or comes before a Tab. */
!   screen_puts_len(s, (int)(p - s), row, col, attr);
col += width;
  
if (*p != TAB)
--- 280,299 
w = ptr2cells(p);
if (*p == NUL || *p == TAB || totwidth + w  pum_width)
{
!   /* Display the text that fits or comes before a Tab.
!* First convert it to printable characters. */
!   char_u *st;
!   int  saved = *p;
! 
!   *p = NUL;
!   st = transstr(s);
!   *p = saved;
!   if (st != NULL)
!   {
!   screen_puts_len(st, (int)STRLEN(st), row, col,
!   attr);
!   vim_free(st);
!   }
col += width;
  
if (*p != TAB)
*** ../vim-7.0.222/src/version.cTue Mar 27 11:00:43 2007
--- src/version.c   Tue Mar 27 12:42:15 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 223,
  /**/

-- 
Violators can be fined, arrested or jailed for making ugly faces at a dog.
[real standing law in Oklahoma, United States of America]

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: InsertEnter breaks cursor position.

2007-03-27 Thread Bram Moolenaar

Yukihiro Nakadaira wrote:

 I defined InsertEnter autocommand
 
   :autocmd InsertEnter * call setline(1, strftime(%c))
 
 and started Insert mode at end of line with a or A.  I expected
 
   1 Tue Mar 27 20:00:00 2007
   2 abc|
 (| is cursor)
 
 But cursor was moved before last character.
 
   1 Tue Mar 27 20:00:00 2007
   2 ab|c
 
 If c is multi-byte character, cursor is displayed at end of line.
 
   1 Tue Mar 27 20:00:00 2007
   2 abc|
 
 But it is actually placed in middle of multi-byte character.  Then
 typing key breaks that character.
 
   1 Tue Mar 27 20:00:00 2007
   2 abfirst-bytesecond-byteX|last-byte

This should help:

*** eval.c~ Tue Mar 27 16:47:56 2007
--- eval.c  Tue Mar 27 21:55:26 2007
***
*** 14397,14403 
if (u_savesub(lnum) == OK  ml_replace(lnum, line, TRUE) == OK)
{
changed_bytes(lnum, 0);
!   check_cursor_col();
rettv-vval.v_number = 0;   /* OK */
}
}
--- 14397,14404 
if (u_savesub(lnum) == OK  ml_replace(lnum, line, TRUE) == OK)
{
changed_bytes(lnum, 0);
!   if (lnum == curwin-w_cursor.lnum)
!   check_cursor_col();
rettv-vval.v_number = 0;   /* OK */
}
}


There can still be a problem when appending to line 1 and it ends in a
multi-byte character.  Then this patch should help:


*** misc2.c~Wed Feb  7 05:00:13 2007
--- misc2.c Tue Mar 27 21:59:56 2007
***
*** 516,522 
--- 516,529 
|| virtual_active())
curwin-w_cursor.col = len;
else
+   {
curwin-w_cursor.col = len - 1;
+ #ifdef FEAT_MBYTE
+   /* prevent cursor from moving on the trail byte */
+   if (has_mbyte)
+   mb_adjust_cursor();
+ #endif
+   }
  }
  
  #ifdef FEAT_VIRTUALEDIT

-- 
SIGIRO -- irony detected (iron core dumped)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: patch 7.0.224

2007-03-27 Thread Bram Moolenaar

Tony Mechelynck wrote:

 Bram Moolenaar wrote:
  Patch 7.0.224
  Problem:When expanding ## spaces are escaped twice.
  Solution:   Don't escape the spaces that separate arguments.
  Files:  src/eval.c, src/ex_docmd.c, src/proto/ex_docmd.pro
  
 [...]
 
 This patch failed to appear at ftp.vim.org.

I'm having hardware problems.  I managed to send it up just now.

 Patching from the .eml
 saved email succeeded after hand-converting from quoted-printable to
 8bit -- not actually 8bit since the only things to convert were
 
   :%s/=3D/=/g
   :%s/=\n//g

I'm still using text-only e-mail and don't have these strange problems.

-- 
FROG: How you English say:  I one more time, mac, I unclog my nose towards
  you, sons of a window-dresser,  so, you think you could out-clever us
  French fellows with your silly knees-bent creeping about advancing
  behaviour.  (blows a raspberry) I wave my private parts at your aunties,
  you brightly-coloured, mealy-templed, cranberry-smelling, electric
  donkey-bottom biters.
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Patch: virtcol([123,'$'])

2007-03-26 Thread Bram Moolenaar

Michael Schaap wrote:

 Here's a patch to make virtcol([123, '$']) do the right thing.
 If it looks good to you, can you include it?

Looks good, I'll include it.  Thanks!

-- 
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 -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: BUG vim 7.0-204?: autocmd CusorMoved vs select/visual mode vs :behave mswin vs norm!

2007-03-25 Thread Bram Moolenaar

Thomas wrote:

 When I use the following command (for demonstration purposes):
 
 au CursorMoved * norm! zz
 
 When I now press s-c-left or s-c-right, zz get inserted in the buffer.
 
 These cursor key seem to be set by :behave mswin.
 
 In summary:
 :au CursorMoved * norm! zz
 :behave mswin
 Press s-c-left or s-c-right
 zz gets inserted.
 
 Is there a work-around?

When you do :behave mswin the shifted cursor keys start Select mode.
What you type then replaces the selected text.

Have a look at what :behave does, you can also set individual options.

-- 
Q: Why does /dev/null accept only integers?
A: You can't sink a float.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: segfault in vim7

2007-03-25 Thread Bram Moolenaar

Pancake wrote:

 I've found a bug in vim, i have no time for debugging, but here's
 an example and a minor backtrace:
 
 looks like %edx is used as a pointer and this pointer is NULL. No
 idea if this should be fixed in this way, but here's some info:
 
 [EMAIL PROTECTED] vim -r /tmp/  
 Vim: Caught deadly signal SEGV
 
 Press ENTER or type command to continueVim: Finished.
 
 Segmentation fault
 
 0x080e86d4 in ml_recover ()
 (gdb) bt
 #0  0x080e86d4 in ml_recover ()
 #1  0x080ddc38 in main ()
 
 0x080e86cc ml_recover+284:mov$0x1,%bl
 0x080e86ce ml_recover+286:mov0xfeec(%ebp),%edx
 0x080e86d4 ml_recover+292:mov0xc(%edx),%eax  -here
 0x080e86d7 ml_recover+295:mov%eax,(%esp)
 0x080e86da ml_recover+298:call   0x80fe440 vim_free
 0x080e86df ml_recover+303:mov0xfeec(%ebp),%ecx
 0x080e86e5 ml_recover+309:mov%ecx,(%esp)
 0x080e86e8 ml_recover+312:call   0x80fe440 vim_free
 
 (gdb) info  registers 

What is the source code?  Compile for debugging.

What version of Vim?  Perhaps it's already fixed.

What is your name?  I don't like talking to a black box.

-- 
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 ... Arrggghhh!
   BRIDGEKEEPER is cast into the gorge.
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


patch 7.0.220

2007-03-25 Thread Bram Moolenaar

Patch 7.0.220
Problem:Crash when using winnr('#') in a new tab page. (Andy Wokula)
Solution:   Check for not finding the window.
Files:  src/eval.c


*** ../vim-7.0.219/src/eval.c   Tue Feb 20 03:18:20 2007
--- src/eval.c  Sun Mar 25 17:43:53 2007
***
*** 15769,15775 
--- 15769,15783 
  if (nr  0)
for (wp = (tp == curtab) ? firstwin : tp-tp_firstwin;
  wp != twin; wp = wp-w_next)
+   {
+   if (wp == NULL)
+   {
+   /* didn't find it in this tabpage */
+   nr = 0;
+   break;
+   }
++nr;
+   }
  return nr;
  }
  #endif
*** ../vim-7.0.219/src/version.cSun Mar 18 21:52:09 2007
--- src/version.c   Sun Mar 25 17:48:20 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 220,
  /**/

-- 
Men may not be seen publicly in any kind of strapless gown.
[real standing law in Florida, United States of America]

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Bug report: display bug with accented characters and completion menu

2007-03-24 Thread Bram Moolenaar

Gombault Damien wrote:

 I noticed a display bug with the completion menu.
 
 If accented characters appears in the completion menu, some others characters 
 from the edited file appears too in the menu ! It's quite difficult to 
 explain so I've made some screenshots. You can also notice these bad 
 characters appears only if a filename is displayed next to the word.
 
 Screenshots taken from  Ubuntu Feisty (VIM 7.0-164) :
  - GVIM (GTK+) with custom config : 
 http://img139.imageshack.us/img139/21/vim1et2.png
 
  - GVIM (GTK+) with custom config (another colorscheme) :
 http://img115.imageshack.us/img115/6541/vim2jb9.png
 
  - GVIM (GTK+) with default config :
 http://img163.imageshack.us/img163/2661/vim3fp1.png
 
  - VIM (gnome-terminal) with default config :
 http://img53.imageshack.us/img53/6716/vim4xk5.png
 
 I noticed this bug with :
 - GVIM (GTK+) 7.0-164 (Ubuntu Feisty)
 - VIM (gnome-terminal) 7.0-164 (Ubuntu Feisty)
 - GVIM (GTK+) 7.0-201 (Gentoo)
 - GVIM (x11) 7.0-201 (Gentoo) (I have not tested x11 on other builds)
 - VIM (konsole) 7.0-201 (Gentoo)
 - GVIM (GTK+) 7.0-219 (custom build on Gentoo)
 - VIM (konsole) 7.0-219 (custom build on Gentoo)
 
 I have NOT noticed this bug with :
  - GVIM (win32) 7.0-219 (Cream build without Cream config)

A few questions:

- What is 'encoding' set to?
- What is the actual text in the entries with problems?  Give this
  byte-for-byte.  You may need to insert an entry to find out.
- Can you reproduce it by setting 'omnifunc' to a simple function that
  returns a fixed list of text entries?  If so, please give us the
  script with this.  Otherwise, give us a text file to reproduce the
  problem.
- The entries in the menu appear not to be sorted.  How did this happen?
- What did you type to get to these screenshots?

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

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Bug report: display bug with accented characters and completion menu

2007-03-24 Thread Bram Moolenaar

Gombault Damien wrote:

  A few questions:
 
  - What is 'encoding' set to?
  - What is the actual text in the entries with problems?  Give this
byte-for-byte.  You may need to insert an entry to find out.
  - Can you reproduce it by setting 'omnifunc' to a simple function that
returns a fixed list of text entries?  If so, please give us the
script with this.  Otherwise, give us a text file to reproduce the
problem.
  - The entries in the menu appear not to be sorted.  How did this happen?
  - What did you type to get to these screenshots?
 
 My system is UTF-8, so 'encoding' is also set to 'utf-8'. On the screenshot, 
 the file was wrotten in 'latin1' charset.
 
 After some tests, I noticed this bugs seems only appears when 'encoding' 
 and 'fileencoding' are not the same. Finally, I could get this bug on win32 : 
 I set 'encoding' to 'utf-8' then open some 'latin-1' files.
 
 I wrote two very simple C++ file to help you to reproduce the bug. These two 
 files are written in 'latin1' charset. Their content is simple C++ comments 
 containing French text with accented characters like é, è, à, etc.
 
 Put the two files in the same directory.
 Then open gvim and set your 'encoding' to 'utf-8'.
 Edit the '2.cpp' file.
 Verify that 'fileencoding' is set to 'latin1'.
 Insert a new line between #include and the begin of the /* comment. (o key)
 Then type CTRL+x CTRL+i and the include completion menu appears like this :
 http://img131.imageshack.us/img131/4117/vim5ls3.png
 
 Another test : 
 'encoding' = latin1 and utf-8 texts, you get this :
 http://img78.imageshack.us/img78/483/vim6nt2.png
 Accents are not correctly displayed.
 
 The completion menu uses 'encoding' to display its text.
 When you edit a file, the buffer is converted to the current encoding (the 
 [converted] message). When you use the completion menu with current buffer 
 words, accented characters will be correctly displayed.
 
 But if you use completion menu with words in other files (like with include 
 completion) with a different fileencoding than your current buffer encoding, 
 accented characters will not be displayed correctly because they are not 
 converted to the current encoding.
 
 So words from other files should be converted to the current buffer
 'encoding'  before display them in the completion menu. That will
 certainly fix this problem.

Thanks for the clear example.  I'm now able to reproduce the problem.

There are actually two problems.  One is that text with non-printable
characters causes trouble in the popup menu.  I'll fix that now (see
patch below).

The other is that completions obtained from a file in another encoding
result in text with the wrong encoding.  That's difficult to fix.  It
would require loading the file as if editing it, so that the encoding is
detected.  I'll put this in the todo list, but don't expect it to be
fixed soon.


*** ../vim-7.0.219/src/charset.cTue Apr 18 00:04:40 2006
--- src/charset.c   Sat Mar 24 21:10:37 2007
***
*** 317,323 
  }
  }
  
! #if defined(FEAT_EVAL) || defined(FEAT_TITLE) || defined(PROTO)
  /*
   * Translate a string into allocated memory, replacing special chars with
   * printable chars.  Returns NULL when out of memory.
--- 317,324 
  }
  }
  
! #if defined(FEAT_EVAL) || defined(FEAT_TITLE) || defined(FEAT_INS_EXPAND) \
!   || defined(PROTO)
  /*
   * Translate a string into allocated memory, replacing special chars with
   * printable chars.  Returns NULL when out of memory.
*** ../vim-7.0.219/src/popupmnu.c   Tue Aug 22 21:51:18 2006
--- src/popupmnu.c  Sat Mar 24 21:07:39 2007
***
*** 280,287 
w = ptr2cells(p);
if (*p == NUL || *p == TAB || totwidth + w  pum_width)
{
!   /* Display the text that fits or comes before a Tab. */
!   screen_puts_len(s, (int)(p - s), row, col, attr);
col += width;
  
if (*p != TAB)
--- 280,299 
w = ptr2cells(p);
if (*p == NUL || *p == TAB || totwidth + w  pum_width)
{
!   /* Display the text that fits or comes before a Tab.
!* First convert it to printable characters. */
!   char_u *st;
!   int  saved = *p;
! 
!   *p = NUL;
!   st = transstr(s);
!   *p = saved;
!   if (st != NULL)
!   {
!   screen_puts_len(st, (int)STRLEN(st), row, col,
!   attr);
!   vim_free(st);
!   }
col += width;
  
if (*p != TAB)


-- 
Dreams are free, but there's a small charge for alterations.

 /// Bram

Re: Bug report : Spell checking doesn't know about HTML entities

2007-03-22 Thread Bram Moolenaar

Tony Mechelynck wrote:

 In languages using accented letters, the Vim spell checker doesn't recognise 
 HTML entities (in HTML text): for example, the letters outside of the ...; 
 entities are highlighted as spellBad (after :set spell spelllang=fr) in 
 the following French words:
 
 ougrave;   meaning: où (where)
 apregrave;s après  (after)
 ceacute;reacute;monie  cérémonie  (ceremony)
 courrouccedil;a courrouça  ([he] angered)
 deacute;sespeacute;reacute;   désespéré  (desperate)
 neacute;cessairenécessaire (necessary)
 anneacute;e année  (year)
 
 etc.
 
 They are perfectly valid French words, if one takes into account the 
 following 
 equivalences:
 
 ugrave; = ù
 egrave; = è
 eacute; = é
 ccedil; = ç
 etc.
 
 I don't know how to solve the problem; maybe an interpretation layer to 
 resolve the entities between the HTML text and the French (or other 
 non-English language) dictionary?

Well, words with HTML things in them are NOT French words.  Why don't
you use utf-8 encoded HTML?

If you really want to recognize these words, you could take the French
dictionary, do a global replace and build a spell file from that.

You'll have to check if using  and ; in the middle of a word is causing
trouble.  Adding them to word characters will probably create different
problems.

-- 
The Law of VIM:
For each member b of the possible behaviour space B of program P, there exists
a finite time t before which at least one user u in the total user space U of
program P will request b becomes a member of the allowed behaviour space B'
(B' = B).
In other words: Sooner or later everyone wants everything as an option.
-- Vince Negri

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Understanding regxp implementation

2007-03-22 Thread Bram Moolenaar

Nikolai Weibull wrote:

 On 3/22/07, Asiri Rathnayake [EMAIL PROTECTED] wrote:
 
  As you might know, the reg_comp() method is called twice when compiling
  a r.e; first to determine the size of the compiled expression and then
  to actually compile it. I was thinking if this can be used to our
  advantage, while on the first pass, we look for occurrences of special
  characters and set a flag in regprog_T appropriately. If such thing was
  not found, we branch off the second pass into one of our own routines to
  compile the expression into our own structures (say, a state diagram).
  And we have to change other functions a bit to look for the above flag
  and call new routines appropriately. What do you think ?
 
 That sounds like a good way of determining whether the old engine will
 be required or if a new one (with more limited functionality) should
 be used.  One way of keeping this information as local as possible
 would be to keep a set of function pointers with the compiled regex
 that point to the appropriate functions to execute them on some input.
 
 For example, you could have something like this:
 
 typedef struct
 {
 int (*exec)();
 int   regstart;
 char_ureganch;
 char_u*regmust;
 int   regmlen;
 unsigned  regflags;
 char_ureghasz;
 char_uprogram[1]; /* actually longer.. */
 } regprog_T;
 
 and change vim_regexec() to call the exec() function of the regprog_T
 in the regmatch_T that it gets passed.  You'd then set exec() to point
 to either vim_old_regexec() or vim_new_regexec() (or similarly named
 functions) in vim_regcomp() depending on the type of regex we have.  I
 guess it could be some flag field as well, but this makes it possible
 to add a third matcher, should we so desire...like a
 Boyer-Moore-Horspool matcher for fixed strings.

Adding a third matcher won't happen soon, and is a big change.  It's not
really needed to prepare for that.

The disadvantage of using a function pointer is that in the place where
it's used you only see:

 myprog-exec(args);

You can't see which function is being called, and finding out is not
that simple.  So when you browse the code this is like a dead end.

Using this keeps navigating much simpler:

if (myprog-difficultregexp)
regmatch_old(args);
else
regmatch_new(args);

One reason why inheritance in object oriented programming makes our life
more difficult is that you quite often don't know for sure which method
is invoked.

-- 
ROBIN:  The what?
ARTHUR: The Holy Hand Grenade of Antioch.  'Tis one of the sacred relics
Brother Maynard always carries with him.
ALL:Yes. Of course.
ARTHUR: (shouting) Bring up the Holy Hand Grenade!
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


  1   2   3   4   5   6   >