Bug#241914: marked as done (vim: gf/^Wf won't work with e.g. ``SOMEVAR=/foo/bar'')

Debian Bug Tracking System owner@bugs.debian.org
Sat, 16 Apr 2005 16:18:06 -0700


Your message dated Sun, 17 Apr 2005 01:01:01 +0200
with message-id <20050416230101.GA19429@fistandantilus.takhisis.org>
and subject line vim: gf/^Wf won't work with e.g. ``SOMEVAR=/foo/bar''
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 3 Apr 2004 19:29:21 +0000
>From jjminar@fastmail.fm Sat Apr 03 11:29:21 2004
Return-path: <jjminar@fastmail.fm>
Received: from ns1.deusystems.com (deusystems.cz) [212.80.75.66] 
	by spohr.debian.org with smtp (Exim 3.35 1 (Debian))
	id 1B9qpU-0006uE-00; Sat, 03 Apr 2004 11:29:20 -0800
Received: (qmail 28791 invoked from network); 3 Apr 2004 18:31:31 -0000
Received: from unknown (HELO mail.haltyr.bohnice.centrum.czf) (10.10.8.133)
  by kerberos.deusystems.com with SMTP; 3 Apr 2004 18:31:31 -0000
Received: from jan by mail.haltyr.bohnice.centrum.czf with local (Exim 3.35 #1 (Debian))
	id 1B9qnP-0006gT-00
	for <submit@bugs.debian.org>; Sat, 03 Apr 2004 21:27:11 +0200
Date: Sat, 3 Apr 2004 21:27:11 +0200
To: submit@bugs.debian.org
Subject: vim: gf/^Wf won't work with e.g. ``SOMEVAR=/foo/bar''
Message-ID: <20040403192711.GA25691@kontryhel>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="45Z9DzgjV8m4Oswq"
Content-Disposition: inline
User-Agent: Mutt/1.3.28i
From: Jan Minar <jjminar@fastmail.fm>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.5 required=4.0 tests=BAYES_10,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 


--45Z9DzgjV8m4Oswq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: vim
Version: 6.1.018-1
Severity: normal

Hi!

The marvellous gf/^Wf won't parse the line found in almost every sh script:

  SOMEVAR=/foo/bar

The error is:

  E447: Can't find file "SOMEVAR=/foo/bar" in path

Doing ``:help E447'', I figured setting the 'includeexpr' solves the problem:

  :set includeexpr=substitute(v:fname,'^[a-zA-Z_][a-zA-Z0-9_]*=','','')

However, I'm not sure about the sideeffects this might have.

Conclusion:  gf/^Wf should be able to parse the variable assignment
statement, awa other statements, where the filename can occur.  E.g., in
the example statement above, it should never look for a
`SOMEVAR=/foo/bar' file, but always for the `/foo/bar' file: although
the former filename generally will be valid, it is not what the sh
script deals with.  But before vim(1) is a real IDE, there is that
'includeexpr' variable, which adds the ability to recognise the correct
filename in a second pass.  If this doesn't bring any drawbacks, it
should be set to some clever value in the default Debian `.vimrc'.

Cheers,
Jan.


-- System Information
Debian Release: 3.0
Kernel Version: Linux kontryhel 2.4.20-int-rt-uml-jan #3 SMP Thu Jul 3 03:30:43 CEST 2003 i686 unknown

Versions of the packages vim depends on:
ii  dpkg           1.9.21         Package maintenance system for Debian
ii  libc6          2.2.5-11.2     GNU C Library: Shared libraries and Timezone
ii  libgpmg1       1.19.6-12      General Purpose Mouse Library [libc6]
ii  libncurses5    5.2.20020112a- Shared libraries for terminal handling

--- Begin /etc/vim/vimrc (modified conffile)
*** Contents not text ***

--- End /etc/vim/vimrc

--45Z9DzgjV8m4Oswq
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFAbxAP+uczK20Fa5cRAhlGAJ0T9OdKs+Boc6Y9xhokCRDh+BEOfgCfd7BO
/nAYI/BdQXtS5Rfp91hrayQ=
=rK00
-----END PGP SIGNATURE-----

--45Z9DzgjV8m4Oswq--

---------------------------------------
Received: (at 241914-done) by bugs.debian.org; 16 Apr 2005 23:01:46 +0000
>From zack@bononia.it Sat Apr 16 16:01:46 2005
Return-path: <zack@bononia.it>
Received: from ms002msg.fastwebnet.it [213.140.2.52] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1DMwIM-0004Pa-00; Sat, 16 Apr 2005 16:01:46 -0700
Received: from fistandantilus.takhisis.org (37.10.140.106) by ms002msg.fastwebnet.it (7.2.052.3)
        id 41FFB3EA0067B344; Sun, 17 Apr 2005 01:01:15 +0200
Received: by fistandantilus.takhisis.org (Postfix, from userid 3148)
	id C41F027456F; Sun, 17 Apr 2005 01:01:01 +0200 (CEST)
Date: Sun, 17 Apr 2005 01:01:01 +0200
From: Stefano Zacchiroli <zack@debian.org>
To: 241914-submitter@bugs.debian.org
Cc: 241914-done@bugs.debian.org
Subject: Re: vim: gf/^Wf won't work with e.g. ``SOMEVAR=/foo/bar''
Message-ID: <20050416230101.GA19429@fistandantilus.takhisis.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="/9DWx/yDrRhgMJTb"
Content-Disposition: inline
In-Reply-To: <20040403192711.GA25691@kontryhel>
User-Agent: Mutt/1.5.9i
Delivered-To: 241914-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 


--/9DWx/yDrRhgMJTb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

jjminar@fastmail.fm wrote:
> The marvellous gf/^Wf won't parse the line found in almost every sh scrip=
t:
>   SOMEVAR=3D/foo/bar
> The error is:
>   E447: Can't find file "SOMEVAR=3D/foo/bar" in path

This is not a bug. According to ":help gf" the list of characters
supposed be in a file name is contained in the 'isfname' option. Per
default the value of that option is "@,48-57,/,.,-,_,+,,,#,$,%,~,=3D"
which, as you can see, includes the equal character '=3D'.

SOMEVAR=3D/foo/bar is considered to be a file name, but vim fails because
it does not exists. Thus, this is not a bug, vim acts as documented.
I'm closing the bug report with this mail.

If you want to access /foo/bar you can either:
1) remove '=3D' from the 'isfname' option with 'set isfname-=3D=3D'
2) enclose it in double quotes changing your line to SOMEVAR=3D"/foo/bar"
   (this will work since isfname does not include '"')

Cheers.

--=20
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-

--/9DWx/yDrRhgMJTb
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCYZkt1cqbBPLEI7wRAmU/AJ9ctd4aLFIm62TFVV4oJWZhPAnEZwCfd9Pi
QAN0IiGC7z/JskN0azHk/MM=
=c3gD
-----END PGP SIGNATURE-----

--/9DWx/yDrRhgMJTb--