I'm creating an Elisp function that basically copies the selected text to the clipboard and then it sends a signal to a TCP port that will trigger a TTS voice that reads aloud what's on the clipboard for me. The function I'm using is the following:
(defun read-aloud ()
"Read aloud selected text."
(interactive)
(call-interactively 'evil-yank)
(setq code "echo -n 'read-aloud' | netcat -q 2 localhost 7777")
(shell-command-to-string code))
Even though it works fine... The function (call-interactively 'evil-yank)
freezes for more than 10 seconds when I execute this read-aloud
function. I don't get why it's happening because if I call it directly with :(call-interactively 'evil-yank)
it works immediately. Is there anything wrong with my Elisp function? If not how can I debug what's happening and why is it so slow?