Patch 7.1.193

2 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 3, 2008, 11:54:03 AM1/3/08
to vim...@vim.org

Patch 7.1.193
Problem: Some Vim 5.x digraphs are missing in Vim 7, even though the
character pairs are not used. (Philippe de Muyter)
Solution: Add those Vim 5.x digraphs that don't conflict with others.
Files: src/digraph.c


*** ../vim-7.1.192/src/digraph.c Thu Sep 13 18:25:08 2007
--- src/digraph.c Thu Jan 3 17:48:47 2008
***************
*** 1978,1983 ****
--- 1978,2038 ----
{'f', 't', 0xfb05},
{'s', 't', 0xfb06},
# endif /* FEAT_MBYTE */
+
+ /* Vim 5.x compatible digraphs that don't conflict with the above */
+ {'~', '!', 161}, /* ¡ */
+ {'c', '|', 162}, /* ¢ */
+ {'$', '$', 163}, /* £ */
+ {'o', 'x', 164}, /* ¤ - currency symbol in ISO 8859-1 */
+ {'Y', '-', 165}, /* ¥ */
+ {'|', '|', 166}, /* ¦ */
+ {'c', 'O', 169}, /* © */
+ {'-', ',', 172}, /* ¬ */
+ {'-', '=', 175}, /* ¯ */
+ {'~', 'o', 176}, /* ° */
+ {'2', '2', 178}, /* ² */
+ {'3', '3', 179}, /* ³ */
+ {'p', 'p', 182}, /* ¶ */
+ {'~', '.', 183}, /* · */
+ {'1', '1', 185}, /* ¹ */
+ {'~', '?', 191}, /* ¿ */
+ {'A', '`', 192}, /* À */
+ {'A', '^', 194}, /* Â */
+ {'A', '~', 195}, /* Ã */
+ {'A', '"', 196}, /* Ä */
+ {'A', '@', 197}, /* Å */
+ {'E', '`', 200}, /* È */
+ {'E', '^', 202}, /* Ê */
+ {'E', '"', 203}, /* Ë */
+ {'I', '`', 204}, /* Ì */
+ {'I', '^', 206}, /* Î */
+ {'I', '"', 207}, /* Ï */
+ {'N', '~', 209}, /* Ñ */
+ {'O', '`', 210}, /* Ò */
+ {'O', '^', 212}, /* Ô */
+ {'O', '~', 213}, /* Õ */
+ {'/', '\\', 215}, /* × - multiplication symbol in ISO 8859-1 */
+ {'U', '`', 217}, /* Ù */
+ {'U', '^', 219}, /* Û */
+ {'I', 'p', 222}, /* Þ */
+ {'a', '`', 224}, /* à */
+ {'a', '^', 226}, /* â */
+ {'a', '~', 227}, /* ã */
+ {'a', '"', 228}, /* ä */
+ {'a', '@', 229}, /* å */
+ {'e', '`', 232}, /* è */
+ {'e', '^', 234}, /* ê */
+ {'e', '"', 235}, /* ë */
+ {'i', '`', 236}, /* ì */
+ {'i', '^', 238}, /* î */
+ {'n', '~', 241}, /* ñ */
+ {'o', '`', 242}, /* ò */
+ {'o', '^', 244}, /* ô */
+ {'o', '~', 245}, /* õ */
+ {'u', '`', 249}, /* ù */
+ {'u', '^', 251}, /* û */
+ {'y', '"', 255}, /* x XX */
+
{NUL, NUL, NUL}
};

*** ../vim-7.1.192/src/version.c Thu Jan 3 16:31:17 2008
--- src/version.c Thu Jan 3 17:52:51 2008
***************
*** 668,669 ****
--- 668,671 ----
{ /* Add new patch number below this line */
+ /**/
+ 193,
/**/

--
Futility Factor: No experiment is ever a complete failure - it can always
serve as a negative example.

/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 ///

Zvi Har'El

unread,
Jan 3, 2008, 12:40:30 PM1/3/08
to Bram Moolenaar, vim...@googlegroups.com

Dear Bram,


I believe this patch contradicts the spirit of Vim digraphs since Vim 6, which is expressed in digraph.txt as follows:


These are the RFC1345 digraphs for the one-byte characters.  See the output of
":digraphs" for the others.  The characters above 255 are only available when
Vim was compiled with the |+multi_byte| feature.

EURO

Exception: RFC1345 doesn't specify the euro sign.  In Vim the digraph =e was
added for this.  Note the difference between latin1, where the digraph Cu is
used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
used for the euro sign, while both of them are the character 164, 0xa4.  For
compatibility with zsh Eu can also be used for the euro sign.

RFC 1345 has a very special logic behind its digraphs (e.g., the grave accent is marked by an exclamation mark, so that è is entered as <C-K>e!, rather than <C-K>e`, ê is entered as <C-K>e> rather then <C-K>e^, etc), which is very consistent, logical, and mostly - a standard.


I also believe that digraphs that are not defined should prompt an error, unlike the situation today, when you hit bad combination, the first character is ignored: For example, if you hit <C-K>ff you get, as you should, the digraph for the ff ligature, but if you misstype <C-K>gg, instead of getting an error indication (like zsh does) you simply get a g.


Finally, I believe that if one is interested in resurrecting Vim 5 digraphs, the solution should be to knowingly source some runtime file which defines these extra digraphs.


Best,

Zvi.

-- 
Dr. Zvi Har'El      mailto:r...@math.technion.ac.il    Department of Mathematics
tel:+972-54-4227607                  Technion - Israel Institute of Technology
fax:+972-4-8293388  http://www.math.technion.ac.il/~rl/    Haifa 32000, ISRAEL
"If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)

Bill McCarthy

unread,
Jan 3, 2008, 9:49:11 PM1/3/08
to Bram Moolenaar
On Thu 3-Jan-08 10:54am -0600, Bram Moolenaar wrote:

> Patch 7.1.193
> Problem: Some Vim 5.x digraphs are missing in Vim 7, even though the
> character pairs are not used. (Philippe de Muyter)
> Solution: Add those Vim 5.x digraphs that don't conflict with others.
> Files: src/digraph.c

I hadn't seen this warning before:

pad> pv 193
patching file src/digraph.c
Hunk #1 succeeded at 1978 with fuzz 1.
patching file src/version.c

SVN is only at 191 at the moment so I can't check to see if
the patch really worked.

--
Best regards,
Bill

Bill McCarthy

unread,
Jan 3, 2008, 10:23:13 PM1/3/08
to Vim Developers

I don't have to wait for SVN - I just tried to rebuild after
adding patches 189-196. It failed :-(

gcc -c -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400
-DHAVE_PATHDEF -DFEAT_BIG -DHAVE_GETTEXT -DHAVE_LOCALE_H
-DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_MBYTE -DFEAT_MBYTE_IME
-DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=pentium3 -Wall
-Ic:/util/MzScheme/include -DFEAT_MZSCHEME
-DMZSCHEME_COLLECTS=\"c:/util/MzScheme/collects\" -DDYNAMIC_MZSCHEME
-DDYNAMIC_MZSCH_DLL=\"libmzsch209_000.dll\"
-DDYNAMIC_MZGC_DLL=\"libmzgc209_000.dll\" -DFEAT_PYTHON -I
c:/util/python24/include -DDYNAMIC_PYTHON
-DDYNAMIC_PYTHON_DLL=\"python24.dll\" -O3 -fomit-frame-pointer
-freg-struct-return -s digraph.c -o objZ/digraph.o
digraph.c:1981: error: syntax error before '=' token
digraph.c:1984: error: syntax error before '{' token
make: *** [objZ/digraph.o] Error 1

--
Best regards,
Bill

Tony Mechelynck

unread,
Jan 3, 2008, 11:09:36 PM1/3/08
to vim...@googlegroups.com

Maybe you got a corrupt file (or files)? In the course of Vim 7.1 life, I have
applied all patches in sequence, and most of them (including 7.1.193) didn't
give any patch message -- and the 7.1.196 compile didn't fail either. If you
want, I can "make distclean" on a copy of my build directory tree and send you
a .zip or .tgz of that.

Best regards,
Tony.
--
Real software engineers work from 9 to 5, because that is the way the
job is described in the formal spec. Working late would feel like
using an undocumented external procedure.

Bram Moolenaar

unread,
Jan 4, 2008, 5:55:38 AM1/4/08
to Bill McCarthy, Vim Developers

Bill McCarthy wrote:

The comments in the patch contain non-ASCII characters. I've seen
before that these may cause trouble.

If you used the path from the e-mail you can first check if it's equal
to what is on the ftp site: ftp://ftp.vim.org/pub/vim/patches/7.1/7.1.193

Then check the lines in digraph.c if they match with what's in the
patch. Perhaps patch itself can't handle characters with the 8th bit
set.

--
You know you use Vim too much when you have this alias in your
~/.bashrc file: alias :e=/bin/vim (Eljay Love-Jensen)

Charles E Campbell Jr

unread,
Jan 4, 2008, 12:44:07 PM1/4/08
to vim...@googlegroups.com
Bram Moolenaar wrote:

>The comments in the patch contain non-ASCII characters. I've seen
>before that these may cause trouble.
>
>If you used the path from the e-mail you can first check if it's equal
>to what is on the ftp site: ftp://ftp.vim.org/pub/vim/patches/7.1/7.1.193
>
>Then check the lines in digraph.c if they match with what's in the
>patch. Perhaps patch itself can't handle characters with the 8th bit
>set.
>
>
>

Probably depends on the version of patch. My Linux (Centos 5) version
of patch worked to do these patches without fuss.

Regards,
Chip Campbell

Tony Mechelynck

unread,
Jan 4, 2008, 1:41:02 PM1/4/08
to vim...@googlegroups.com

If you use the raw email as your patchfile, it may also depend on the
Content-Transfer-Encoding of the mail. Bram now sends it out as 8bit, which is
what I need, but I've been burnt before with quoted-printable (which is not
necessarily Bram's fault: my ISP's mail routers appear to convert from 8bit to
quoted-printable and vice-versa without a discernible rule; but I'm popping
the list mail from pop.gmail.com nowadays *and* checking the mail headers
before applying any patch I got by mail). As long as it doesn't arrive as
base64...


Best regards,
Tony.
--
At Group L, Stoffel oversees six first-rate programmers, a managerial
challenge roughly comparable to herding cats.
-- The Washington Post Magazine, June 9, 1985

Bill McCarthy

unread,
Jan 4, 2008, 11:18:09 PM1/4/08
to Bram Moolenaar
On Fri 4-Jan-08 4:55am -0600, Bram Moolenaar wrote:

> The comments in the patch contain non-ASCII characters. I've seen
> before that these may cause trouble.
>
> If you used the path from the e-mail you can first check if it's equal
> to what is on the ftp site:
> ftp://ftp.vim.org/pub/vim/patches/7.1/7.1.193
>
> Then check the lines in digraph.c if they match with what's in the
> patch. Perhaps patch itself can't handle characters with the 8th bit
> set.

I capture the mail in what is called RFC-822 format by my
mail client (The Bat!). It does NOT match the file in the
patches folder of the vim FTP site - those graphic
characters are replaced by '=xx' where the xx is hex
representation of the graphics character - probably an
encoding issue as Tony mentioned.

Anyway, I've grabbed the patched digraph.c from svn and have
successfully build vim and gvim 203.

Thanks to all of you - Tony, Bram and Chip - for responding.

--
Best regards,
Bill

Tony Mechelynck

unread,
Jan 5, 2008, 12:39:33 AM1/5/08
to vim...@googlegroups.com
Bill McCarthy wrote:
> On Fri 4-Jan-08 4:55am -0600, Bram Moolenaar wrote:
>
>> The comments in the patch contain non-ASCII characters. I've seen
>> before that these may cause trouble.
>>
>> If you used the path from the e-mail you can first check if it's equal
>> to what is on the ftp site:
>> ftp://ftp.vim.org/pub/vim/patches/7.1/7.1.193
>>
>> Then check the lines in digraph.c if they match with what's in the
>> patch. Perhaps patch itself can't handle characters with the 8th bit
>> set.
>
> I capture the mail in what is called RFC-822 format by my
> mail client (The Bat!). It does NOT match the file in the
> patches folder of the vim FTP site - those graphic
> characters are replaced by '=xx' where the xx is hex
> representation of the graphics character - probably an
> encoding issue as Tony mentioned.

yes, =xx is typical of quoted-printable. The emails which have it should have

Content-Transfer-Encoding: quoted-printable

as one of their headers, so that the mail client will translate =xx to the
appropriate byte value when displaying the mail on a computer screen.
Similarly, a quoted-printable email may contain an equal sign as the last
character on a line to indicate that it should be joined to the next line,
with no line break, on display.

>
> Anyway, I've grabbed the patched digraph.c from svn and have
> successfully build vim and gvim 203.
>
> Thanks to all of you - Tony, Bram and Chip - for responding.
>

Best regards,
Tony.
--
Power corrupts. And atomic power corrupts atomically.

Reply all
Reply to author
Forward
0 new messages