Re: bell(), looking for builtin function to ring the bell

2023-09-13 Fir de Conversatie Ernie Rael

On 23/09/13 10:48 AM, Gary Johnson wrote:

I use

 normal \

but I don't know how cross-platform it is.  It's documented at

 :help :echoerr

You don't have to use :exe.  I surround it with a test for
'errorbells', e.g.,

 if 
 normal \ " Generate a bell
 endif
 echohl ErrorMsg
 echomsg "Oops!"
 echohl None


Thanks.

-ernie



Regards,
Gary



--
--
You received this message from the "vim_dev" 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_dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/8b62bb86-31db-038f-5598-7d17775b6469%40raelity.com.


Re: bell(), looking for builtin function to ring the bell

2023-09-13 Fir de Conversatie Gary Johnson
On 2023-09-13, Ernie Rael wrote:
> Greetings,
> 
> In a plugin I'm working on, when certain simple errors occur, I want to ring
> the bell, some kind of alert. A popup, use in some place in the plugin, is 
> more
> than is needed.
> 
> The closest thing I can find is
> 
> call sound_playevent('bell')
> 
> which isn't cross platform.
> 
> What have I missed?

I use

normal \

but I don't know how cross-platform it is.  It's documented at

:help :echoerr

You don't have to use :exe.  I surround it with a test for
'errorbells', e.g.,

if 
normal \ " Generate a bell
endif
echohl ErrorMsg
echomsg "Oops!"
echohl None

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230913174857.GD2657%40phoenix.


Re: bell(), looking for builtin function to ring the bell

2023-09-13 Fir de Conversatie Yegappan Lakshmanan
Hi,

On Wed, Sep 13, 2023 at 9:32 AM Ernie Rael  wrote:
>
> Greetings,
>
> In a plugin I'm working on, when certain simple errors occur, I want to ring 
> the bell, some kind of alert. A popup, use in some place in the plugin, is 
> more than is needed.
>
> The closest thing I can find is
>
> call sound_playevent('bell')
>
> which isn't cross platform.
>
> What have I missed?
>

There is no builtin function to just ring the bell.  You can try using
the following:

   set errorbells
   echoerr ''
   set noerrorbells

Regards,
Yegappan

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAAW7x7mK%3DaxzkxCN3dMhHsOzqDu5uqwEkYZ-kTjP4pQW_4cMgA%40mail.gmail.com.


bell(), looking for builtin function to ring the bell

2023-09-13 Fir de Conversatie Ernie Rael

Greetings,

In a plugin I'm working on, when certain simple errors occur, I want to 
ring the bell, some kind of alert. A popup, use in some place in the 
plugin, is more than is needed.


The closest thing I can find is

   call sound_playevent('bell')

which isn't cross platform.

What have I missed?

-ernie

--
--
You received this message from the "vim_dev" 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_dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/06f8b4df-662b-1479-dca5-65869898a160%40raelity.com.