Re: Bug in syntax/mail.vim

2008-01-10 Fir de Conversatie Richard Hartmann

On Jan 10, 2008 4:20 PM, Ben Schmidt [EMAIL PROTECTED] wrote:


 I suspect it is deliberate. URLs rarely contain parentheses, but are often 
 written
 inside them in sentences, e.g.

 There is interesting information on the web (for example, at http://vim.org/).

That is true. In case there is an opening bracket in the URL, I do think
highlighting the closing bracket as well would make sense, though.


Richard

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Bug in syntax/mail.vim

2008-01-10 Fir de Conversatie Ben Schmidt

Richard Hartmann wrote:
 On Jan 10, 2008 4:20 PM, Ben Schmidt [EMAIL PROTECTED] wrote:
 
 
 I suspect it is deliberate. URLs rarely contain parentheses, but are often 
 written
 inside them in sentences, e.g.

 There is interesting information on the web (for example, at 
 http://vim.org/).
 
 That is true. In case there is an opening bracket in the URL, I do think
 highlighting the closing bracket as well would make sense, though.

Yeah. I think it would make sense, too, but it's horrible to code nicely and 
reliably.

Ben.





Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Bug in syntax/mail.vim

2008-01-10 Fir de Conversatie Gautam Iyer

On Fri, Jan 11, 2008 at 02:20:05AM +1100, Ben Schmidt wrote:

  to reproduce:
  
  vim -u NONE -U NONE
  :set syntax
 
 Presuming you mean :syntax enable.
 
  :set ft=mail
  ithis newline is for readability
  http://vim.org/(test)
  
  The closing bracket will not be highlighted.
 
 I suspect it is deliberate. URLs rarely contain parentheses, but are
 often written inside them in sentences, e.g.
 
 There is interesting information on the web (for example, at
 http://vim.org/).

Yes, it is deliberate (I wrote it a long time ago, for exactly the
purpose you point out above). If you notice, even a period at the end of
a URL will not be highlighted as in www.vim.org.

If you like you can modify the current URL regexp so that it that
matches URLs which includes the ) at the end provided the URL contains
a (. Send it to me, and I'll include it :).

GI

-- 
'Code Orange' -- Eat dessert first.

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Bug in syntax/mail.vim

2008-01-10 Fir de Conversatie Tony Mechelynck

Richard Hartmann wrote:
 On Jan 10, 2008 4:20 PM, Ben Schmidt [EMAIL PROTECTED] wrote:
 
 
 I suspect it is deliberate. URLs rarely contain parentheses, but are often 
 written
 inside them in sentences, e.g.

 There is interesting information on the web (for example, at 
 http://vim.org/).
 
 That is true. In case there is an opening bracket in the URL, I do think
 highlighting the closing bracket as well would make sense, though.
 
 
 Richard

The parentheses should have been percent-escaped, i.e., replaced by a percent 
sign and their hex value (00-FF) as in

http://www.vim.org/%28test%29


Best regards,
Tony.
-- 
hundred-and-one symptoms of being an internet addict:
225. You sign up for free subscriptions for all the computer magazines

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Bug in syntax/mail.vim

2008-01-10 Fir de Conversatie James Vega
On Thu, Jan 10, 2008 at 08:28:14PM +0100, Tony Mechelynck wrote:
 The parentheses should have been percent-escaped, i.e., replaced by a percent 
 sign and their hex value (00-FF) as in
 
   http://www.vim.org/%28test%29

While it's true that the URL RFC dictates that such characters should be
hex-escaped, most user interfaces accept the non-escaped version so
people don't have to remember character codes for everything.  This does
make it more difficult to perform proper highlighting/selection of a URL
but it's a give and take for user simplicity vs. developer hardship.
This is also why angle brackets are specified for use as URL delimiters
in text, since it vastly simplifies parsing.

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega [EMAIL PROTECTED]


signature.asc
Description: Digital signature


Re: Bug in syntax/mail.vim

2008-01-10 Fir de Conversatie Matt Wozniski

On Jan 10, 2008 2:39 PM, James Vega [EMAIL PROTECTED] wrote:
 On Thu, Jan 10, 2008 at 08:28:14PM +0100, Tony Mechelynck wrote:
  The parentheses should have been percent-escaped, i.e., replaced by a 
  percent
  sign and their hex value (00-FF) as in
 
http://www.vim.org/%28test%29

 While it's true that the URL RFC dictates that such characters should be
 hex-escaped, most user interfaces accept the non-escaped version so
 people don't have to remember character codes for everything.  This does
 make it more difficult to perform proper highlighting/selection of a URL
 but it's a give and take for user simplicity vs. developer hardship.
 This is also why angle brackets are specified for use as URL delimiters
 in text, since it vastly simplifies parsing.

Actually, RFC 2616 (Hypertext Transfer Protocol -- HTTP/1.1) says at
3.2.3 (URI Comparison) that parentheses, being in the reserved set,
are not required to evaluate as equal to the %XX forms.  So, a
standards conforming web server could send you to a different page
depending on whether you use http://vim.org/%28test%29 or
http://vim.org/(test) ... Though that may or may not be relevant to
the conversation at hand.

~Matt

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Bug in syntax/mail.vim

2008-01-10 Fir de Conversatie Ben Schmidt

 I was thinking of RFC 1738 (Uniform Resource Locators) but it also
 mentions that parentheses are reserved characters and can be escaped
 unless they're being used for a reserved purpose.

And whether they have a reserved purpose is dictated by the URL scheme, isn't 
it, 
not the browser/software. So a web browser shouldn't serve different pages, as 
brackets don't have a reserved purpose in http URIs.

Ben.




Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---