Skip to content

Instantly share code, notes, and snippets.

@gausby
Created March 22, 2012 08:45
Show Gist options
  • Save gausby/2157187 to your computer and use it in GitHub Desktop.
Save gausby/2157187 to your computer and use it in GitHub Desktop.
Speak region or a given input
(defun say nil
"Speak region."
(interactive)
(let (arg)
(if mark-active
(setq arg (buffer-substring (region-beginning) (region-end)))
(setq arg (read-from-minibuffer "Say: ")))
(save-window-excursion
(async-shell-command (format "say \"%s\" &" arg)))))
@gausby
Copy link
Author

gausby commented Mar 22, 2012

An async emacs function that speaks the region, or a text input. This uses the system say command. Has been testet on OS X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment