Re: Bug? E216: No such group or event: filetypedetect BufReadPost msg in 14_XxdBack:

2023-05-02 Thread Zach Pfeffer
On Tue, May 2, 2023 at 5:46 PM Bram Moolenaar  wrote:
>
>
> [resend, picky postmaster refused the message]
>
> Zach Pfeffer wrote:
>
> > Posting this here based on the request at
> > https://github.com/vim/vim/blob/master/CONTRIBUTING.md :
> >
> > "If you are not 100% sure that your problem is a Vim issue, please first
> > discuss this on the Vim user maillist."
> >
> > Running:
> >
> > VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 28 2022 13:09:53)
> > MS-Windows 32-bit GUI version with OLE support
> > (the one downloadable from https://www.vim.org/download.php)
> >
> > ... I noticed a message when clicking Convert Back after Convert to HEX:
> >
> > Error detected while processing functions 14_XxdBack:
> > line9:
> > E216: No such group or event: filetypedetect BufReadPost
> >
> > ...this message cleared when I pressed Enter.
> >
> > I found this message went away with this patch:
> >
> > --- menu.vim2023-04-29 16:47:05.708417500 -0600
> > +++ menu.vim.bak2022-06-28 07:08:36.0 -0600
> > @@ -599,10 +599,8 @@
> >  s:XxdFind()
> >  exe ':%!' .. g:xxdprogram .. ' -r'
> >endif
> > -  if exists('did_load_filetypes')
> > -set ft=
> > -doautocmd filetypedetect BufReadPost
> > -  endif
> > +  set ft=
> > +  doautocmd filetypedetect BufReadPost
> > = mod
> >  enddef
> >
> > Is there a better solution? Should I file this as a bug?
>
> Looks like your diff is the wrong way around.


Yup! I'm sorry about that. Here's the patch with your suggestion with
the diff the correct way around.

--- menu.vim.orig   2022-06-28 07:08:36.0 -0600
+++ menu.vim2023-05-02 20:20:00.052527000 -0600
@@ -599,8 +599,10 @@
 s:XxdFind()
 exe ':%!' .. g:xxdprogram .. ' -r'
   endif
-  set ft=
-  doautocmd filetypedetect BufReadPost
+  if exists('#filetypedetect') && exists('#BufReadPost')
+set ft=
+doautocmd filetypedetect BufReadPost
+  endif
= mod
 enddef

>
>
> Instead of checking for "did_load_filetypes" a more direct condition
> would be to use:
>
>  if exists('#filetypedetect') && exists('#BufReadPost')
> set ft=
> doautocmd filetypedetect BufReadPost
>   endif
>
> Does that work for you?

Yup. Works great.

Would you like me to file a bug and create a patch on vim-dev against the bug?

>
>
> --
> Lower life forms have more fun!
>
>  /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
> ///  \\\
> \\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
>  \\\help me help AIDS victims -- http://ICCF-Holland.org///



-- 
 Blog | LinkedIn | Twitter | Facebook

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CAPXzgB3%3D7pBT2OwSyvvM2WKsdj2zy1s88ttbtSYWVieYcFtECg%40mail.gmail.com.


Re: Bug? E216: No such group or event: filetypedetect BufReadPost msg in 14_XxdBack:

2023-05-02 Thread Bram Moolenaar


[resend, picky postmaster refused the message]

Zach Pfeffer wrote:

> Posting this here based on the request at
> https://github.com/vim/vim/blob/master/CONTRIBUTING.md :
> 
> "If you are not 100% sure that your problem is a Vim issue, please first
> discuss this on the Vim user maillist."
> 
> Running:
> 
> VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 28 2022 13:09:53)
> MS-Windows 32-bit GUI version with OLE support
> (the one downloadable from https://www.vim.org/download.php)
> 
> ... I noticed a message when clicking Convert Back after Convert to HEX:
> 
> Error detected while processing functions 14_XxdBack:
> line9:
> E216: No such group or event: filetypedetect BufReadPost
> 
> ...this message cleared when I pressed Enter.
> 
> I found this message went away with this patch:
> 
> --- menu.vim2023-04-29 16:47:05.708417500 -0600
> +++ menu.vim.bak2022-06-28 07:08:36.0 -0600
> @@ -599,10 +599,8 @@
>  s:XxdFind()
>  exe ':%!' .. g:xxdprogram .. ' -r'
>endif
> -  if exists('did_load_filetypes')
> -set ft=
> -doautocmd filetypedetect BufReadPost
> -  endif
> +  set ft=
> +  doautocmd filetypedetect BufReadPost
> = mod
>  enddef
> 
> Is there a better solution? Should I file this as a bug?

Looks like your diff is the wrong way around.

Instead of checking for "did_load_filetypes" a more direct condition
would be to use:

 if exists('#filetypedetect') && exists('#BufReadPost')
set ft=
doautocmd filetypedetect BufReadPost
  endif

Does that work for you?


-- 
Lower life forms have more fun!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502234621.33D7C1C0664%40moolenaar.net.


Re: How to remove uploaded scripts on vim.org and how to find scriptid and src_id?

2023-05-02 Thread Bram Moolenaar


[resend, picky postmaster refused the message]

Ubaldo Tiberi wrote:

> This is my first post in this mailing list, I hope I am not messing up
> anything!
> I wrote my first two plugins and I uploaded them on vim.org
>  but in one of them an extra .0 slipped away while I
> was writing its version and I realized it  after the script was
> uploaded. Now I wish to remove and upload it again with the correct
> version number but I couldn’t figure out how to do it. 

There is no web interface for this.  It needs to be done with an SQL
query, only a few people have access.

Is this about "vim-outline-1.0.0.zip", listed with version "v1.0.0.0"?
And you want to change the version to "v1.0.0"?
 
> Another thing: I discovered :h glvs-plugin but I have no idea what how
> to find both my scriptid and and src_id. Any help?

The script_id is in the URL of your script:
https://www.vim.org/scripts/script.php?script_id=6068
The src_id is in the URL of the download:
https://www.vim.org/scripts/download_script.php?src_id=28444

-- 
I once paid $12 to peer at the box that held King Tutankhamen's little
bandage-covered midget corpse at the De Young Museum in San Francisco.  I
remember thinking how pleased he'd be about the way things turned out in his
afterlife.
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502234621.4415B1C1250%40moolenaar.net.


Re: How to remove uploaded scripts on vim.org and how to find scriptid and src_id?

2023-05-02 Thread Bram Moolenaar


[resend, picky postmaster refused the message]

Ubaldo Tiberi wrote:

> This is my first post in this mailing list, I hope I am not messing up
> anything!
> I wrote my first two plugins and I uploaded them on vim.org
>  but in one of them an extra .0 slipped away while I
> was writing its version and I realized it  after the script was
> uploaded. Now I wish to remove and upload it again with the correct
> version number but I couldn’t figure out how to do it. 

There is no web interface for this.  It needs to be done with an SQL
query, only a few people have access.

Is this about "vim-outline-1.0.0.zip", listed with version "v1.0.0.0"?
And you want to change the version to "v1.0.0"?
 
> Another thing: I discovered :h glvs-plugin but I have no idea what how
> to find both my scriptid and and src_id. Any help?

The script_id is in the URL of your script:
https://www.vim.org/scripts/script.php?script_id=6068
The src_id is in the URL of the download:
https://www.vim.org/scripts/download_script.php?src_id=28444

-- 
I once paid $12 to peer at the box that held King Tutankhamen's little
bandage-covered midget corpse at the De Young Museum in San Francisco.  I
remember thinking how pleased he'd be about the way things turned out in his
afterlife.
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502234621.3F2991C123B%40moolenaar.net.


Re: Bug? E216: No such group or event: filetypedetect BufReadPost msg in 14_XxdBack:

2023-05-02 Thread Bram Moolenaar


[resend, picky postmaster refused the message]

Zach Pfeffer wrote:

> Posting this here based on the request at
> https://github.com/vim/vim/blob/master/CONTRIBUTING.md :
> 
> "If you are not 100% sure that your problem is a Vim issue, please first
> discuss this on the Vim user maillist."
> 
> Running:
> 
> VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 28 2022 13:09:53)
> MS-Windows 32-bit GUI version with OLE support
> (the one downloadable from https://www.vim.org/download.php)
> 
> ... I noticed a message when clicking Convert Back after Convert to HEX:
> 
> Error detected while processing functions 14_XxdBack:
> line9:
> E216: No such group or event: filetypedetect BufReadPost
> 
> ...this message cleared when I pressed Enter.
> 
> I found this message went away with this patch:
> 
> --- menu.vim2023-04-29 16:47:05.708417500 -0600
> +++ menu.vim.bak2022-06-28 07:08:36.0 -0600
> @@ -599,10 +599,8 @@
>  s:XxdFind()
>  exe ':%!' .. g:xxdprogram .. ' -r'
>endif
> -  if exists('did_load_filetypes')
> -set ft=
> -doautocmd filetypedetect BufReadPost
> -  endif
> +  set ft=
> +  doautocmd filetypedetect BufReadPost
> = mod
>  enddef
> 
> Is there a better solution? Should I file this as a bug?

Looks like your diff is the wrong way around.

Instead of checking for "did_load_filetypes" a more direct condition
would be to use:

 if exists('#filetypedetect') && exists('#BufReadPost')
set ft=
doautocmd filetypedetect BufReadPost
  endif

Does that work for you?


-- 
Lower life forms have more fun!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502234621.39F791C0D4E%40moolenaar.net.


Re: surprising glob() result on Windows

2023-05-02 Thread Mike

On 05/02/2023 3:53 PM, Bram Moolenaar wrote:



Just out of curiosity, I tried the same with python and tcl.  Neither
returns multiple files for the *.abc case so their behavior is
different.  I don't know why it differs but I would argue that their
outputs do a better job of "meeting expectations".


That depends on what your expectations are.  If you list a directory and
see a file "some~1.abc" then a glob() with *.abc should find it, right?
Or not?  The question is whether you expect to match the long name only.


On my Windows 10 system with NTFS, Windows Explorer and dir will, by 
default, show "some.abcd" and not "some~1.abc".  Therefore I don't 
expect  glob("*.abc") to return "some.abcd".


However, the command "dir /X" will display the short-filename 
equivalents but I never use that option and suspect that few do.




Usually when we encounter something where it's not 100% clear what the
right behavior is, the best choice is to leave it alone.  The people who
are happy with the current behavior won't make any remark right now,
thus we have no idea how many we would "hurt" by making a change.


Perhaps this is an issue I should raise with the vim developers for the
following reasons.  First, the Windows outputs are inconsistent with the
linux outputs for the same directory contents.


Still, there have been no complaints until now.  It appears to be more a
theoretical problem than a practical one.

Adding an optional argument to glob() to avoid the short filenames is
not a good idea, there already are three optional arguments.  We could
change this to use a second argument that is a dictionary with the
current options plus the new one.  It would be clearer when reading back
the function call.  Is it really worth making this change?


Second, it appears that vim is using this glob capability when
sourcing plugins (I first noticed this using packadd) and so unwanted
files could be sourced on Windows systems.


Can you be more specific about "when sourcing plugins" ?
Are there really files using an extension starting with ".vim"?



By "sourcing plugins" I mean what Vim automatically does when it starts 
up and what it does when it executes the "packadd" command.  If a 
"plugin" directory includes a file with the extension .vim9 for example, 
it will be sourced, apparently because the filesystem, if it supports 
short filenames, has a duplicate name for "some.vim9" which could be 
"some~1.vim".


I do admit that I don't know what actually happens under-the-covers 
because Vim-glob does return "some.vim9" and not "some~1.vim".  As I 
mentioned above, the python & Tcl glob commands do not return some.vim9 
when the pattern is *.vim so their behavior is different.



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_use" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/u2rski%24s25%241%40ciao.gmane.io.


Re: surprising glob() result on Windows

2023-05-02 Thread Bram Moolenaar


> Just out of curiosity, I tried the same with python and tcl.  Neither 
> returns multiple files for the *.abc case so their behavior is 
> different.  I don't know why it differs but I would argue that their 
> outputs do a better job of "meeting expectations".

That depends on what your expectations are.  If you list a directory and
see a file "some~1.abc" then a glob() with *.abc should find it, right?
Or not?  The question is whether you expect to match the long name only.

Usually when we encounter something where it's not 100% clear what the
right behavior is, the best choice is to leave it alone.  The people who
are happy with the current behavior won't make any remark right now,
thus we have no idea how many we would "hurt" by making a change.

> Perhaps this is an issue I should raise with the vim developers for the 
> following reasons.  First, the Windows outputs are inconsistent with the 
> linux outputs for the same directory contents.

Still, there have been no complaints until now.  It appears to be more a
theoretical problem than a practical one.

Adding an optional argument to glob() to avoid the short filenames is
not a good idea, there already are three optional arguments.  We could
change this to use a second argument that is a dictionary with the
current options plus the new one.  It would be clearer when reading back
the function call.  Is it really worth making this change?

> Second, it appears that vim is using this glob capability when
> sourcing plugins (I first noticed this using packadd) and so unwanted
> files could be sourced on Windows systems.

Can you be more specific about "when sourcing plugins" ?
Are there really files using an extension starting with ".vim"?

-- 
Team-building exercises come in many forms but they all trace their roots back
to the prison system.  In your typical team-building exercise the employees
are subjected to a variety of unpleasant situations until they become either a
cohesive team or a ring of car jackers.
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502195340.586011C0C46%40moolenaar.net.


Re: surprising glob() result on Windows

2023-05-02 Thread Mike

On 04/29/2023 3:37 PM, Stan Brown wrote:



Stan Brown
Tehachapi, CA, USA
https://BrownMath.com

On 2023-04-29 08:28, Mike wrote:

On 04/29/2023 10:51 AM, Mike wrote:

On 04/28/2023 9:32 PM, Mike wrote:

Briefly, I have a case where glob("*.ext") returns more files than I
expect.

To give an example, in a directory of your choice create two files
named "test.any" and "zest.anyother".  The important detail is that
the second filename's extension be prefixed by the first filename's
extension.

Then launch Vim in that directory and run the command
     :echo glob("*.any")
Both files are returned, not just "test.any".

I see this on Windows running vim 9.0.1240 with normal features built
with Visual C.  On the other hand, Vim on my linux box returns only
"test.any", as I would expect, so I don't think this a feature. :)


I've since rebuilt Vim to include patches up to 1494 and still see the
same results on my Windows 10 system.  I thought that patches 1400 and
1458 might help but they did not.


More potatoes for the stew.

Create 5 files: test.a, test.ab, test.abc, test.abcd and test.abcde.
Then, using gvim -u NONE -U NONE --noplugin or gvim --clean:
     glob("*.a") returns test.a
     glob("*.ab") returns test.ab
     glob("*.abc") returns test.abc, test.abcd and test.abcde
     glob("*.abcd") returns test.abcd

So the problem occurs when the glob pattern has a 3-character extension.


Mike, I saw someone answered this, but maybe their answer didn't reach you?

Short version: Windows is doing what it's supposed to, and so is Vim.


Just out of curiosity, I tried the same with python and tcl.  Neither 
returns multiple files for the *.abc case so their behavior is 
different.  I don't know why it differs but I would argue that their 
outputs do a better job of "meeting expectations".


Perhaps this is an issue I should raise with the vim developers for the 
following reasons.  First, the Windows outputs are inconsistent with the 
linux outputs for the same directory contents.  Second, it appears that 
vim is using this glob capability when sourcing plugins (I first noticed 
this using packadd) and so unwanted files could be sourced on Windows 
systems.




 stuff snipped




--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_use" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/u2r9ob%2416j2%241%40ciao.gmane.io.


How to remove uploaded scripts on vim.org and how to find scriptid and src_id?

2023-05-02 Thread Ubaldo Tiberi
Hi all,

This is my first post in this mailing list, I hope I am not messing up anything!
I wrote my first two plugins and I uploaded them on vim.org  
but in one of them an extra .0 slipped away while I was writing its version and 
I realized it  after the script was uploaded. Now I wish to remove and upload 
it again with the correct version number but I couldn’t figure out how to do 
it. 

Another thing: I discovered :h glvs-plugin but I have no idea what how to find 
both my scriptid and and src_id. Any help?

Thanks,
/U.  

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/8767730A-010A-4458-8EB8-35D33D7154E2%40gmail.com.


Bug? E216: No such group or event: filetypedetect BufReadPost msg in 14_XxdBack:

2023-05-02 Thread Zach Pfeffer
Vim Users,

Posting this here based on the request at
https://github.com/vim/vim/blob/master/CONTRIBUTING.md :

"If you are not 100% sure that your problem is a Vim issue, please first
discuss this on the Vim user maillist."

Running:

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 28 2022 13:09:53)
MS-Windows 32-bit GUI version with OLE support
(the one downloadable from https://www.vim.org/download.php)

... I noticed a message when clicking Convert Back after Convert to HEX:

Error detected while processing functions 14_XxdBack:
line9:
E216: No such group or event: filetypedetect BufReadPost

...this message cleared when I pressed Enter.

I found this message went away with this patch:

--- menu.vim2023-04-29 16:47:05.708417500 -0600
+++ menu.vim.bak2022-06-28 07:08:36.0 -0600
@@ -599,10 +599,8 @@
 s:XxdFind()
 exe ':%!' .. g:xxdprogram .. ' -r'
   endif
-  if exists('did_load_filetypes')
-set ft=
-doautocmd filetypedetect BufReadPost
-  endif
+  set ft=
+  doautocmd filetypedetect BufReadPost
= mod
 enddef

Is there a better solution? Should I file this as a bug?

-- 
 Blog | LinkedIn | Twitter | Facebook

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CAPXzgB2qrdX%3Dwy3_yfpDUj3-oRBy5ThTKNF0EQEoGpsgse7XXw%40mail.gmail.com.