How do you wrote an abortable function, so that when user presses C-g during execution, this function is "stopped"
;; my function so far
(defun my/elfeed-extra-info-2 ()
(interactive)
(next-line)
(message "here1")
(sleep-for 0.5)
(next-line)
(message "here2")
(sleep-for 0.5)
(next-line)
(message "here3")
(sleep-for 0.5)
(next-line)
(message "here4")
(sleep-for 0.5)
(next-line)
(message "here5")
(sleep-for 0.5)
(next-line)
(message "here6")
(sleep-for 0.5)
(next-line)
(message "here7")
(sleep-for 0.5)
(next-line)
(message "here8")
(sleep-for 0.5)
)
sleep-for
. – wasamasa Jul 6 '18 at 17:15C-g
aborts the function. – Tyler Jul 6 '18 at 17:41quit
works reliable. Under Linux it works perfect (also formy/elfeed-extra-info-2
) while under cygwin I often have emacs hanging without being able to quit viaC-g
. I have to usepkill -SIGUSR2 emacs
from the command line in those cases. If you experience problems with your function please extend your question with system information and with a detailed description what happens on your system if you pressC-g
. – Tobias Jul 6 '18 at 21:18