First , you need a list of arguments after tmr-active-timer-p ; defun syntax
(defun function-name (arg1 arg2 ...) code...)
Second , you do not need to wrap the body in progn .
Third , the return value is the last processed form. If your case you can just write
(defun tmr-active-timer-p () "Returns t or nil depending of if there an active timer." (when (file-exists-p tmr-file) ; (... more code) ))
then it will return nil if the file does not exist (since (when foo bar) matches (if foo (progn bar) nil) ).
Finally , parentheses are considered a bad style for formatting code in lisp.
PS. Emacs Lisp does not have return , but it does have Non-local outputs . I urge you to avoid them if you really do not know what you are doing.
source share