Patch 7.2.310

7 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 2, 2009, 7:28:40 AM12/2/09
to vim...@vim.org

Patch 7.2.310
Problem: When a filetype plugin in ~/.vim/ftdetect uses ":setfiletype" and
the file starts with a "# comment" it gets "conf" filetype.
Solution: Check for "conf" filetype after using ftdetect plugins.
Files: runtime/filetype.vim


*** ../vim-7.2.309/runtime/filetype.vim 2008-08-06 18:56:36.000000000 +0200
--- runtime/filetype.vim 2009-12-02 12:08:42.000000000 +0100
***************
*** 2400,2405 ****
--- 2435,2446 ----
au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')


+
+ " Use the filetype detect plugins. They may overrule any of the previously
+ " detected filetypes.
+ runtime! ftdetect/*.vim
+
+
" Generic configuration file (check this last, it's just guessing!)
au BufNewFile,BufRead,StdinReadPost *
\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
***************
*** 2408,2417 ****
\ setf conf |
\ endif

- " Use the plugin-filetype checks last, they may overrule any of the previously
- " detected filetypes.
- runtime! ftdetect/*.vim
-
augroup END


--- 2449,2454 ----
*** ../vim-7.2.309/src/version.c 2009-11-26 20:41:19.000000000 +0100
--- src/version.c 2009-12-02 12:05:27.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
{ /* Add new patch number below this line */
+ /**/
+ 310,
/**/

--
A)bort, R)etry, P)lease don't bother me again

/// 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 ///

Sir Raorn

unread,
Dec 14, 2009, 2:32:16 PM12/14/09
to vim...@googlegroups.com
On Wed, Dec 2, 2009 at 15:28, Bram Moolenaar <Br...@moolenaar.net> wrote:
> Problem:    When a filetype plugin in ~/.vim/ftdetect uses ":setfiletype" and
>            the file starts with a "# comment" it gets "conf" filetype.
This patch was submitted more than three years ago. And then rejected by you.

http://marc.info/?t=115695849000004&r=1&w=2

Could you please take a look at my other patches, that you have rejected?

--
Regards,
Sir Raorn.

Bram Moolenaar

unread,
Dec 16, 2009, 10:42:35 AM12/16/09
to Sir Raorn, vim...@googlegroups.com

Sir Raorn (?) wrote:

> On Wed, Dec 2, 2009 at 15:28, Bram Moolenaar <Br...@moolenaar.net> wrote:
> > Problem: When a filetype plugin in ~/.vim/ftdetect uses ":setfiletype" and
> > the file starts with a "# comment" it gets "conf" filetype.
> This patch was submitted more than three years ago. And then rejected
> by you.
>
> http://marc.info/?t=115695849000004&r=1&w=2

I now ran into a situation where, although the old behavior was correct,
it caused problems. Main problem is that the "conf" type detection is
guessing, it's not a proper detection.

> Could you please take a look at my other patches, that you have rejected?

Which ones?

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

Sir Raorn

unread,
Dec 17, 2009, 1:05:59 PM12/17/09
to vim...@googlegroups.com
On Wed, Dec 16, 2009 at 18:42, Bram Moolenaar <Br...@moolenaar.net> wrote:
> I now ran into a situation where, although the old behavior was correct,
> it caused problems.  Main problem is that the "conf" type detection is
> guessing, it's not a proper detection.
Are you really think I had other reasons when I offered this change?

>> Could you please take a look at my other patches, that you have rejected?
> Which ones?

The one about 'eightbitmeta' option. This commit is a bit outdated,
but you can get the idea -
http://git.altlinux.org/people/raorn/packages/?p=vim.git;a=commitdiff;h=882f7c13

In short: M- insert-mode mappings does not work in non-ascii 8-bit
locales. Haven't tested it in UTF-8.

--
Regards,
Sir Raorn.

Bram Moolenaar

unread,
Dec 17, 2009, 5:14:16 PM12/17/09
to Sir Raorn, vim...@googlegroups.com

Sir Raorn wrote:

> On Wed, Dec 16, 2009 at 18:42, Bram Moolenaar <Br...@moolenaar.net> wrote:
> > I now ran into a situation where, although the old behavior was correct,

> > it caused problems. =A0Main problem is that the "conf" type detection is


> > guessing, it's not a proper detection.
> Are you really think I had other reasons when I offered this change?
>

> >> Could you please take a look at my other patches, that you have rejected=


> ?
> > Which ones?
> The one about 'eightbitmeta' option. This commit is a bit outdated,
> but you can get the idea -
> http://git.altlinux.org/people/raorn/packages/?p=vim.git;a=commitdiff;h=882f7c13
>
> In short: M- insert-mode mappings does not work in non-ascii 8-bit
> locales. Haven't tested it in UTF-8.

I don't understand the help text for the option. I think you mean that
the terminal sets the 8th bit or uses an escape character.

Note that using an Esc-char sequence for "meta" characters causes much
trouble, terminals should not do that. It's too easy to type Esc and
then a letter when in Insert mode and confuse that with the letter with
the 8th bit set. Supporting it in Vim won't solve the problem, only
create the illusion that it works.

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

Sir Raorn

unread,
Dec 28, 2009, 12:34:08 PM12/28/09
to vim...@googlegroups.com
On Fri, Dec 18, 2009 at 01:14, Bram Moolenaar <Br...@moolenaar.net> wrote:
> Note that using an Esc-char sequence for "meta" characters causes much
> trouble, terminals should not do that.
I guess you should stop speaking for everyone. This is how most
terminals works outside of your 7-bit world.

> Supporting it in Vim won't solve the problem, only create the illusion that it works.

This "illusion" works for me (and other ALT Linux users) for more than
three years.

Forget it. I wont bother you any more.

--
Regards,
Sir Raorn.

Raúl Núñez de Arenas Coronado

unread,
Dec 28, 2009, 3:05:55 PM12/28/09
to vim...@googlegroups.com
Saluton Sir :)

Sir Raorn <s...@gmail.com> skribis:


> On Fri, Dec 18, 2009 at 01:14, Bram Moolenaar <Br...@moolenaar.net> wrote:
>> Note that using an Esc-char sequence for "meta" characters causes much
>> trouble, terminals should not do that.
> I guess you should stop speaking for everyone.  This is how most
> terminals works outside of your 7-bit world.

I guess you should stop speaking for everyone, too. I don't know why you
cited "7-bit world" here, really, but even "8-bit terminals" may use
other mechanisms to implement the "meta" keys. Esc-char is, IMHO, the
worst possible way of doing it, and even if it isn't, Vim has to work
with *any* kind of terminal, so...

>> Supporting it in Vim won't solve the problem, only create the
>> illusion that it works.
> This "illusion" works for me (and other ALT Linux users) for more than
> three years.

Nice sarcasm :) Supporting that feature in Vim won't solve the problem,
just as Bram said, but I'm not sure if you understood why. Again: Vim
has to work with many terminals, and it's not a good idea to hardcode
workarounds in Vim for certain kinds of terminals. That's all, it's
nothing personal against you or against any terminal, really.

BTW, politeness is free (as in beer), and Bram doesn't owe you ANYTHING
and he doesn't even have to give Vim for free: he is kind enough to do
it, so even if you don't like how Vim works please save your sarcasms
for other people that maybe deserve it. Bram is not one of them, and you
have Vim's source code available for free: add the feature you want and
even distribute your own version of Vim with that feature, but please
don't be so harsh with Bram...

> Forget it.  I wont bother you any more.

I don't think Bram has said anything which could make you think you were
bothering him... Take it easy, man ;)

--
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

Reply all
Reply to author
Forward
0 new messages