Move :tools impatient-mode to new :collab category

This commit is contained in:
Henrik Lissner 2018-05-14 21:23:48 +02:00
parent bdf6fceb52
commit abb4d5a009
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 7 additions and 5 deletions

View file

@ -0,0 +1,25 @@
;;; collab/impatient-mode/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +impatient-mode/toggle ()
"TODO"
(interactive)
(require 'simple-httpd)
(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)))