From: João Távora Date: Thu, 10 May 2018 11:07:11 +0000 (+0100) Subject: More correctly setup rust-mode-related autoloads X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~600 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=eac9d2917847f77431bdffefae751c99a15e1df8;p=emacs.git More correctly setup rust-mode-related autoloads By autoloading the add-hook form and the eglot--setup-rls-idiosyncrasies definition, a user can start rust-mode without loading eglot.el along with it. * eglot.el (rust-mode-hook) (eglot--setup-rls-idiosyncrasies): Wrap in autoloaded progn. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index eba0e84f267..fbddf16c3f2 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1471,12 +1471,11 @@ Proceed? " (and (equal "Indexing" what) done)))) ;;;###autoload -(add-hook 'rust-mode-hook 'eglot--setup-rls-idiosyncrasies) - -;;;###autoload -(defun eglot--setup-rls-idiosyncrasies () - "RLS needs special treatment..." - (add-hook 'eglot--ready-predicates 'eglot--rls-probably-ready-for-p t t)) +(progn + (add-hook 'rust-mode-hook 'eglot--setup-rls-idiosyncrasies) + (defun eglot--setup-rls-idiosyncrasies () + "Prepare `eglot' to deal with RLS's special treatment." + (add-hook 'eglot--ready-predicates 'eglot--rls-probably-ready-for-p t t))) (cl-defun eglot--server-window/progress (process &key id done title message &allow-other-keys)