public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
* Re: If bash can, why not Speakup?
@  pj
   ` William Hubbs
  0 siblings, 1 reply; 20+ messages in thread
From: pj @  UTC (permalink / raw)
  To: speakup

Janina Sajka wrote:
> I've been happily using vim for years.

How do you cope with the endlessly-updating bottom line?, like:
 "497L, 15593C                             450,2         93%"

I find speakup is in general difficult with curses applications
because of their screen-update optimisation.  The characters
don't necessarily come out in a text-related order.

> My biggest complaint is that I need to be ultra-careful to
> track whether I'm in insert or command mode, i.e. it would
> sure help if Speakup could give me a differently pitched voice

Good point :-)  It might need some help from the vim folk...

Peter Billam

http://www.pjb.com.au       pj@pjb.com.au      (03) 6278 9410
"Was der Meister nicht kann,   vermöcht es der Knabe, hätt er
 ihm immer gehorcht?"   Siegfried to Mime, from Act 1 Scene 2


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: If bash can, why not Speakup?
@  pj
   ` William Hubbs
   ` Janina Sajka
  0 siblings, 2 replies; 20+ messages in thread
From: pj @  UTC (permalink / raw)
  To: speakup

Janina Sajka wrote:
> to track whether I'm in insert or command mode, i.e. it would
> sure help if Speakup could give me a differently pitched voice

Misunderstanding this to be about vim itself :-( , I wrote:
> Presumably by writing something to somewhere in
> /sys/accessibility/speakup/ (or /proc/speakup ?)
> ... It might be possible to do it with a vim script

And it is possible :-) if you copy spokenmode.vim (after the .sig)
into your ~/.vim/plugin/ dir (you might have to mkdir it first)
then you should see the contents of /tmp/t change according to
the editing mode.

It just remains to find something in /sys/accessibility/speakup/
which switches between two suitable voices...

Regards,  Peter Billam

http://www.pjb.com.au       pj@pjb.com.au      (03) 6278 9410
"Was der Meister nicht kann,   vermöcht es der Knabe, hätt er
 ihm immer gehorcht?"   Siegfried to Mime, from Act 1 Scene 2

--------------------------------------

" spokenmode.vim: cause Speakup to use a different tone of voice
" according to whether Vim is in insert mode or command mode
" 1.0, 2010.10.18
" inherits much from obviousmode.vim, by Brian Lewis and Sergey Vlasov
" 1. Put spokenmode.vim in ~/.vim/plugins/

if &cp || exists('g:loaded_spokenmode')
    finish
endif

let s:isInsertMode = 0

function! s:InsertEnter()
    let s:isInsertMode = 1
    call writefile(['low'], "/tmp/t")
endfunction

function! s:InsertLeave()
    let s:isInsertMode = 0
    call writefile(['high'], "/tmp/t")
endfunction

au InsertEnter * call s:InsertEnter()
au InsertLeave * call s:InsertLeave()

let g:loaded_spokenmode = 1


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: If bash can, why not Speakup?
@  Brian Buhrow
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Buhrow @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.; +Cc: buhrow

[Hello, let's try this again.]

	Hello.  I think there's a point of confusion here.  When you're in
vim, whether you're in emacs mode or vim mode, the communication between
your terminal and vim is direct.  That is, bash has no notion of what
you're doing when you're inside vim.
	Having said that, the typical historical vi user, and  vim is really
emulating vi mode whenit's in vim mode, never knows wheteher they're in
insert mode or command mode.  To get around that, you hit escape a few
times, since hitting escape puts you in command mode and, if you're already
in command mode, it causes the terminal to beep.  So, when in doubt, hit
escape twice, and you should either get 1 or 2 beeps from the terminal,
depending on whether you were already in command mode, or if you  went from
insert mode to command mode. And, if vim has a silent mode, turn that off,
so you'll get the appropriate beeps.
	So, Janina is right, you don't need anything special from Vim,, except
for it to beep the terminal, and you don't need anything special from
Speakup.
Hope that helps.

-thanks
-Brian
On Nov 18,  2:04pm, Brian Buhrow wrote:
} Subject: Re: If bash can, why not Speakup?
} On Nov 18,  3:27pm, Janina Sajka wrote:
} } Subject: Re: If bash can, why not Speakup?
} } I think my main point got lost in the litany of vim complaints that have
} } actually been with us for a long time. I was trying to say something new
} } that no one has commented on. So, let me try to redirect, if I may ...
} } 
} } William Hubbs writes:
} } > On Thu, Nov 18, 2010 at 09:23:29AM +1000, pj@pjb.com.au wrote:
} } > > Janina Sajka wrote:
} } > > > My biggest complaint is that I need to be ultra-careful to
} } > > > track whether I'm in insert or command mode, i.e. it would
} } > > > sure help if Speakup could give me a differently pitched voice
} } > > 
} } > > Good point :-)  It might need some help from the vim folk...
} } > 
} } > Yes, something like this would take modifications to vim to make it
} } > communicate to speakup some how, and I'm not sure what that would
} } > involve since I haven't looked at the vim code at all.
} } > 
} } Actually, I don't think we need anything from vim.
} } 
} } 
} } Note that you can have either vim or emacs editing of bash commands.
} } Emacs is the default, but you can reset this by issuing:
} } 
} } set -o vim
} } 
} } By, default, this provides bash shell command editing in insert mode. As
} } in vim, pressing Esc takes you into command mode where all the vim
} } command mode functionality is provided.
} } 
} } So, the shell knows. That's got to be a value that's written somewhere,
} } and thus something Speakup could read and respond to. I don't know
} } where, but am I wrong?
} } 
} } Janina
} } 
} } > William
} } > 
} } > _______________________________________________
} } > Speakup mailing list
} } > Speakup@braille.uwo.ca
} } > http://speech.braille.uwo.ca/mailman/listinfo/speakup
} } 
} } -- 
} } 
} } Janina Sajka,	Phone:	+1.443.300.2200
} } 		sip:janina@asterisk.rednote.net
} } 
} } Chair, Open Accessibility	janina@a11y.org	
} } Linux Foundation		http://a11y.org
} } 
} } Chair, Protocols & Formats
} } Web Accessibility Initiative	http://www.w3.org/wai/pf
} } World Wide Web Consortium (W3C)
} } 
} } _______________________________________________
} } Speakup mailing list
} } Speakup@braille.uwo.ca
} } http://speech.braille.uwo.ca/mailman/listinfo/speakup
} >-- End of excerpt from Janina Sajka
} 
} 
>-- End of excerpt from Brian Buhrow



^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: If bash can, why not Speakup?
@  pj
  0 siblings, 0 replies; 20+ messages in thread
From: pj @  UTC (permalink / raw)
  To: speakup

Janina Sajka wrote:
> to track whether I'm in insert or command mode, i.e. it would
> sure help if Speakup could give me a differently pitched voice

I wrote:
> Presumably by writing something to somewhere in
> /sys/accessibility/speakup/ (or /proc/speakup ?)
> ... It might be possible to do it with a vim script
>   http://www.vim.org/scripts/

It should be possible; e.g. the obviousmode.vim script:
  http://vim.sourceforge.net/scripts/script.php?script_id=2212
    Clearly indicate visually whether Vim is in insert mode via
    the StatusLine highlight group.  When you go into insert mode,
    the status line color changes.

and indeed in:
  http://vimdoc.sourceforge.net/htmldoc/usr_41.html#vim-script-intro:
there are "mode" and "writefile" functions available ...

Peter Billam

http://www.pjb.com.au       pj@pjb.com.au      (03) 6278 9410
"Was der Meister nicht kann,   vermöcht es der Knabe, hätt er
 ihm immer gehorcht?"   Siegfried to Mime, from Act 1 Scene 2


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: If bash can, why not Speakup?
@  pj
  0 siblings, 0 replies; 20+ messages in thread
From: pj @  UTC (permalink / raw)
  To: speakup

William Hubbs wrote:
> You can disable that line by putting the following line in your
> ~/.vimrc:   set noruler

Thank you :-)

> > > to track whether I'm in insert or command mode, i.e. it would
> > > sure help if Speakup could give me a differently pitched voice
> > Good point :-)  It might need some help from the vim folk...
> Yes, something like this would take modifications to vim to make
> it communicate to speakup some how, and I'm not sure what that
> would involve since I haven't looked at the vim code at all.

Presumably by writing something to somewhere in
/sys/accessibility/speakup/ (or /proc/speakup ?)
I don't see a /sys/accessibility/speakup/pitch
but something else might do.

It might be possible to do it with a vim script
  http://www.vim.org/scripts/
  http://vim.sf.net
and then eventually to get that into the vim-scripts package...

Peter

http://www.pjb.com.au       pj@pjb.com.au      (03) 6278 9410
"Was der Meister nicht kann,   vermöcht es der Knabe, hätt er
 ihm immer gehorcht?"   Siegfried to Mime, from Act 1 Scene 2


^ permalink raw reply	[flat|nested] 20+ messages in thread
* If bash can, why not Speakup?
@  Janina Sajka
  0 siblings, 0 replies; 20+ messages in thread
From: Janina Sajka @  UTC (permalink / raw)
  To: speakup

Hi, All:

I've been happily using vim for years. My biggest complaint is that I
need to be ultra-careful to track whether I'm in insert or command mode,
i.e. it would sure help if Speakup could give me a differently pitched
voice depending on that simple binary condition.

I'm aware of the status line in vim, but recently I've discovered that
one can have vim as the command editor in bash:

set -o vi


So, how is bash tracking this binary condition? I can surelyh confirm
that it does. Might it be something that could be used via Speakup to
change voice pitch on the fly depending on insert vs. command mode? Any
thoughts?


PS: In addition to the above set command, the following two are also
rather interesting:

set -o
bind -P

Janina


-- 

Janina Sajka,	Phone:	+1.443.300.2200
		sip:janina@asterisk.rednote.net

Chair, Open Accessibility	janina@a11y.org	
Linux Foundation		http://a11y.org

Chair, Protocols & Formats
Web Accessibility Initiative	http://www.w3.org/wai/pf
World Wide Web Consortium (W3C)


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~ UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
 If bash can, why not Speakup? pj
 ` William Hubbs
   ` Albert Sten-Clanton
     ` Steve Holmes
       ` Gregory Nowak
         ` Steve Holmes
           ` Gregory Nowak
       ` Janina Sajka
     ` Speech on vim backspace [Was: If bash can, why not Speakup?] Janina Sajka
       ` Albert Sten-Clanton
   ` If bash can, why not Speakup? Janina Sajka
     ` Rynhardt Kruger
     ` William Hubbs
  -- strict thread matches above, loose matches on Subject: below --
 pj
 ` William Hubbs
 ` Janina Sajka
 Brian Buhrow
 pj
 pj
 Janina Sajka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).