Function: sesman-register

sesman-register is a byte-compiled function defined in sesman.el.

Signature

(sesman-register SYSTEM SESSION)

Documentation

Register SESSION into sesman-sessions-hashmap and sesman-links-alist.

SYSTEM defaults to current system. If a session with same name is already registered in sesman-sessions-hashmap, change the name by appending "#1",
"#2" ... to the name. This function should be called by system-specific
connection initializers ("run-xyz", "xyz-jack-in" etc.).

Source Code

;; Defined in ~/.emacs.d/elpa/sesman-20240417.1723/sesman.el
(defun sesman-register (system session)
  "Register SESSION into `sesman-sessions-hashmap' and `sesman-links-alist'.
SYSTEM defaults to current system.  If a session with same name is already
registered in `sesman-sessions-hashmap', change the name by appending \"#1\",
\"#2\" ... to the name.  This function should be called by system-specific
connection initializers (\"run-xyz\", \"xyz-jack-in\" etc.)."
  (let* ((system (or system (sesman--system)))
         (ses-name (car session))
         (ses-name0 (car session))
         (i 1))
    (while (sesman-session system ses-name)
      (setq ses-name (format "%s#%d" ses-name0 i)
            i (1+ i)))
    (setq session (cons ses-name (cdr session)))
    (puthash (cons system ses-name) session sesman-sessions-hashmap)
    (sesman-link-session system session)
    session))