[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mac specific trick for working with chromevox and emacs



Hi,

Here is a little trick I'm finding useful when working with edit fields
in chrome.

The EditWithEmacs chrome extension allows you to edit textareas in
emacs.  Just install it from the chrome store.

Once you follow the instructions you will get something called "gumdrop"
after text areas.  Click on this and the text area content pops up in
emacs for editing and c-c c-c closes the buffer.

The trick is that when this happens I was having to manually switch
focus between chrome and emacs.  Not all that cumbersome but annoying

With the addition of two tiny defuns and the hooks provided by
edit-server I have been able to automate that process.

So now when I click the gumdrop I'm in the focused emacs buffer and when
I hit c-c c-c when finished I'm back in chrome.

I thought this may be helpful to anyone else out there using mac with
emacspeak.

Here is the trivial code.

(defun bb-focus-chrome ()
(interactive)
(ns-do-applescript "tell application \"Google Chrome\" 
activate
end tell"))

(add-hook 'edit-server-done-hook 'bb-focus-chrome)

(defun bb-focus-emacs ()
(interactive)
(ns-do-applescript "tell application \"Emacs\" 
activate
end tell"))

(add-hook 'edit-server-start-hook 'bb-focus-emacs)
   
Kind regards

Bart

-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@cs.vassar.edu" with a
subject of "unsubscribe" or "help".



If you have questions about this archive or had problems using it, please send mail to:

priestdo@cs.vassar.edu No Soliciting!

Emacspeak List Archive | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 | 2001 | 2000 | 1999 | 1998 | Pre 1998

Emacspeak Files | Emacspeak Blog | Search the archive