gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
235 stars 23 forks source link

Skip completion at point if there is no REPL buffer #142

Closed danielmatz closed 8 months ago

danielmatz commented 8 months ago

If the completion-at-point system is triggered, but there is no REPL buffer, the julia-snail-repl-completion-at-point function still attempts to communicate with the REPL buffer, yielding the following message:

completion--some: No Julia REPL buffer *julia* found; run
julia-snail

Unfortunately, no other completion-at-point-functions are allowed to attempt completion, so no completion is performed, even if later entries in completion-at-point-functions could have handled it (e.g., the ones provided by julia-mode).

The documentation for completion-at-point-functions says to return nil if the completion function is not applicable. This commit changes julia-snail-repl-completion-at-point to check that the REPL buffer exists, and if it doesn't, it returns nil, allowing other completion-at-point-functions to take a turn.

gcv commented 8 months ago

Looks good, thank you!