branch: externals/detached commit 515a4da434ff69f6166a7c224c79f65fe9a71d80 Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Add detached-debug-enabled option This variable is used to instruct detached to output messages used for debugging. That is useful for studying problems related to raise conditions. --- detached.el | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/detached.el b/detached.el index 614967f9dc..b2ffccb735 100644 --- a/detached.el +++ b/detached.el @@ -225,6 +225,12 @@ If set to a non nil value the latest entry to :group 'detached :type 'sexp) +(defcustom detached-debug-enabled + nil + "If t enable debug messages in `detached'." + :group 'detached + :type 'boolean) + ;;;;; Public (defvar detached-session-map @@ -1830,9 +1836,12 @@ session and trigger a state transition." (session-directory (detached-session-directory session)) (is-primary (detached--primary-detached-emacs-p session))) + (when detached-debug-enabled + (message "Session %s is set to inactive by notify-watch event" (detached-session-id session))) - ;; Remove from unvalidated sessions - (setq detached--unvalidated-session-ids (delete id detached--unvalidated-session-ids)) + ;; Remove from un-validated sessions + (setq detached--unvalidated-session-ids + (delete id detached--unvalidated-session-ids)) ;; Update session (detached--session-state-transition-update session) @@ -1857,7 +1866,10 @@ session and trigger a state transition." (session (detached--db-get-session id)) (session-directory (detached-session-directory session)) (is-primary (detached--primary-detached-emacs-p session))) - (setq detached--unvalidated-session-ids (delete (detached-session-id session) detached--unvalidated-session-ids)) + (when detached-debug-enabled + (message "Session %s is set to active by notify-watch event" (detached-session-id session))) + (setq detached--unvalidated-session-ids + (delete (detached-session-id session) detached--unvalidated-session-ids)) (setf (detached--session-state session) 'active) (setf (detached--session-time session) `(:start ,(time-to-seconds (current-time)) :end 0.0 :duration 0.0 :offset 0.0)) (detached--db-update-entry session)))))