How to check if a function (e.g. server-running-p) is available under Emacs?

后端 未结 3 585
予麋鹿
予麋鹿 2021-01-01 17:28

I\'m trying to check if server-running-p is available in my .emacs file before calling it. I already have the following:

(if (not (server-runnin         


        
3条回答
  •  感情败类
    2021-01-01 18:21

    ryuslash’s suggestion was really helpful, but I modified it for my .emacs:

    (unless (and (fboundp 'server-running-p)
                 (server-running-p))
      (server-start))
    

    This gets the server running even if server.el hasn't been loaded—server-running-p is only defined when server.el is loaded, and server-start is autoloaded.

提交回复
热议问题