php-eldoc icon indicating copy to clipboard operation
php-eldoc copied to clipboard

Symbol's value as variable is void: auto-complete-mode

Open alflanagan opened this issue 8 years ago • 1 comments

I get the above error when running php-eldoc-enable. It appears to arise from this code:

  (when (and (fboundp 'auto-complete-mode)
             auto-complete-mode)...

This seems to fix it:

  (when (and (fboundp 'auto-complete-mode)
             (auto-complete-mode))...

alflanagan avatar Dec 21 '16 18:12 alflanagan

I believe the correct fix for this (which is also #4) is simply to check if ac-sources is bound:

(when (boundp 'ac-sources)
  (pushnew 'ac-source-php-eldoc ac-sources))

Executing (auto-complete-mode) is not always desired. Checking (bound-and-true-p 'auto-complete-mode) has roughly the same effect, but if the point is to modify ac-sources, might as well check for ac-sources...

joewreschnig avatar Feb 13 '19 22:02 joewreschnig