[BRLTTY] Collision of speech output between Brltty and a Vim script

Eric Scheibler email at eric-scheibler.de
Mon Jun 18 14:11:19 EDT 2012


Hello,

Vim should speak the name of the current buffer when I switch between open
files. For that I've wrote a little script for Vim. The following is
located in my ~/.vimrc:
" function to speak the title of the current buffer
:py import vim
:py import os
:py import string
function! GetBufferName()
python << EOF
full_name = vim.current.buffer.name
if full_name is None:
	os.system('espeak -v de -s 500 "Kein Titel" > /dev/null 2>&1')
else:
	full_name_list = string.split(full_name, "/")
	os.system('espeak -v de -s 500 "' +	full_name_list[len(full_name_list)-1] + '" > /dev/null 2>&1')
EOF
endfunction
nnoremap gt gt:call GetBufferName()<cr>
nnoremap gT gT:call GetBufferName()<cr>

I use the standard Vim commands "gt" and "gT" for switching between open
buffers and only append the defined function.

This works really well but I have one problem: When I press "gt" the command
":call GetBufferName()<cr>" is entered in the command prompt automatically and
cause of that Brltty speaks it. So I hear both: the title of the open file and
the spoken command. If I'am fast enough to mute Brltty directly after pressing
"gt" it's ok but this is not very comfortable.

Does anyone have an idea how to mute Brltty in this special case?
Thank you in advance

Regards
Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://mielke.cc/pipermail/brltty/attachments/20120618/49b8a17f/attachment.sig>


More information about the BRLTTY mailing list