Now that we are loading package autoloads files (as part of the generated doom-package-autoload-file when running make autoloads), many :commands properties are redundant. In fact, many def-package! blocks are redundant. In some cases, we can do without a config.el file entirely, and can move into the autoloads file or rely entirely on package autoloads. Also, many settings have been moved in their module's autoloads files, which makes them available ASAP; their use no longer depends on module load order. This gained me a modest ~10% boost in startup speed.
24 lines
879 B
EmacsLisp
24 lines
879 B
EmacsLisp
;;; collab/impatient-mode/autoload.el -*- lexical-binding: t; -*-
|
|
|
|
;;;###autoload
|
|
(defun +impatient-mode/toggle ()
|
|
"Toggle `impatient-mode' in the current buffer."
|
|
(interactive)
|
|
(unless (process-status "httpd")
|
|
(httpd-start))
|
|
(impatient-mode)
|
|
(if impatient-mode
|
|
(add-hook 'kill-buffer-hook '+impatient-mode--cleanup-impatient-mode)
|
|
(+impatient-mode--cleanup-impatient-mode)))
|
|
|
|
(defun +impatient-mode--cleanup-impatient-mode ()
|
|
(unless (cl-loop for buf in (doom-buffer-list)
|
|
if (buffer-local-value 'impatient-mode buf)
|
|
return t)
|
|
(httpd-stop)
|
|
(cl-loop for buf in (doom-buffer-list)
|
|
if (buffer-local-value 'impatient-mode buf)
|
|
do
|
|
(with-current-buffer buf
|
|
(impatient-mode -1)))
|
|
(remove-hook 'kill-buffer-hook '+impatient-mode--cleanup-impatient-mode)))
|