Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Name kill-emacs-hook function #497

Open
Ambrevar opened this issue Feb 4, 2018 · 0 comments
Open

Name kill-emacs-hook function #497

Ambrevar opened this issue Feb 4, 2018 · 0 comments

Comments

@Ambrevar
Copy link

Ambrevar commented Feb 4, 2018

(eval-after-load "go-mode"
  '(progn
     (let* ((user (or (getenv "USER") "all"))
            (sock (format (concat temporary-file-directory "gocode-daemon.%s") user)))
       (unless (file-exists-p sock)
         (add-hook 'kill-emacs-hook #'(lambda ()
                                        (ignore-errors
                                          (call-process company-go-gocode-command nil nil nil "close"))))))))

It's usually best practice to always name hook functions so that the user can call `remove-hook' on them.
It also helps readbility when inspecting the hook variable.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant