 (defvar live-py-dir nil)
 (defvar live-py-path nil)
 (defvar live-py-version nil)
+(defvar live-py-lighter-delaying nil
+  "Lighter during the plugin state \"delaying\".
+For understanding purposes this can be set to for example \" Live-D\"
+when the other `live-py-lighter-*' are adapted too.")
+(defvar live-py-lighter-tracing nil
+  "Lighter during the plugin state \"tracing\".
+For understanding purposes this can be set to for example \" Live-T\".
+when the other `live-py-lighter-*' are adapted too.")
+(defvar live-py-lighter-ready " Live"
+  "Lighter during the plugin state \"trace ready\".
+For understanding purposes this can be set to for example \" Live-t\".
+when the other `live-py-lighter-*' are adapted too.")
+(defvar live-py-lighter-fail " Live-FAIL"
+  "Lighter during the plugin state \"failed\".")
 
 ;; Internal variables.
 (defvar live-py-output-window nil)

  (ignore start stop len)
  (if live-py-timer
      (cancel-timer live-py-timer)
    (setq-local live-py-lighter " Live-D") ; D for delaying
    ;; Here it seems not necessary to `force-mode-line-update'.
    (redisplay))
  (setq-local live-py-timer (run-at-time 0.5 nil 'live-py-trace-update)))

(defun live-py-trace-update ()
  "Trace the Python code using code_tracer.py."
  ;; For when called from elsewhere than `live-py-after-change-function'.
  (when live-py-timer (cancel-timer live-py-timer))
  (setq-local live-py-lighter " Live-T") ; T for tracing
  (force-mode-line-update)
  (redisplay)
  (let* ((tracer-path (locate-file "code_tracer.py" load-path))
         (command-line-start (concat
			      (shell-quote-argument live-py-version)

                       t))))

  (unless (string-prefix-p live-py-dir buffer-file-name)
    (user-error "Working directory %s must be a parent of %s"
		live-py-dir
		buffer-file-name))
  (setq-local live-py-module (file-name-base buffer-file-name))
