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

后端 未结 3 569
予麋鹿
予麋鹿 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:24

    boundp checks to see if a variable is bound. Since server-running-p is a function you'll want to use fboundp. Like so:

    (if (and (fboundp 'server-running-p) 
             (not (server-running-p)))
       (server-start))
    

提交回复
热议问题