emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sesman b27755c150 003/100: Major update before cider integ


From: ELPA Syncer
Subject: [nongnu] elpa/sesman b27755c150 003/100: Major update before cider integration
Date: Tue, 28 Dec 2021 14:05:57 -0500 (EST)

branch: elpa/sesman
commit b27755c150638c2a1f1ccc48ff24cd35e6b5c92b
Author: Vitalie Spinu <spinuvit@gmail.com>
Commit: Vitalie Spinu <spinuvit@gmail.com>

    Major update before cider integration
---
 README.md |  16 ++--
 sesman.el | 301 +++++++++++++++++++++++++++++++++++++++++---------------------
 2 files changed, 210 insertions(+), 107 deletions(-)

diff --git a/README.md b/README.md
index d03390c234..9448baafbd 100644
--- a/README.md
+++ b/README.md
@@ -5,15 +5,15 @@ This is a brief overview. Please see the code for more 
details.
 
 Sesman provides facilities for session management and interactive session 
association with current contexts. While "sessions" is a broad and 
implementation specific concept, the primary target of `sesman` are Emacs based 
IDEs ([CIDER][], [ESS][], [Geiser][], [Robe][], [SLIME][] etc.)
 
-For Emacs based IDEs, session is commonly composed of one or more physical 
processes (sub-processes, sockets, websockets etc). For example in the current 
implementation of [CIDER][] a session would be composed of one or more cider 
connections (Clojre or ClojureScript). Each [CIDER][] connection consists of 
user REPL buffer and two processes, one for user eval communication and another 
for tooling (completion, inspector etc).
+For Emacs based IDEs, session is commonly composed of one or more physical 
processes (sub-processes, sockets, websockets etc). For example in the current 
implementation of [CIDER][] a session would be composed of one or more cider 
connections (Clojre or ClojureScript). Each [CIDER][] connection consists of 
user REPL buffer and two sub-processes, one for user eval communication and 
another for tooling (completion, inspector etc).
 
 ### Concepts:
 
   - "session" is a list of the form `(session-name ..other-stuff..)` where 
`..other-stuff..` is system dependent.
-  - "system" is generic name used for the tools which uses sesman (e.g. 
`CIDER`, `ESS` etc)
-  - "contexts" are Emacs objects which describe current context. For example 
`current-buffer`, `default-directory` and `project-current` are such contexts. 
Context objects are used to create associations (links) between the current 
context and sessions. At any given time the user can link/unlink sessions 
to/from contexts. By default there are three types of contexts - buffer, 
directory and project, but systems can define their own contexts as they see 
fit.
+  - "system" is generic name used for a tool which uses sesman (e.g. `CIDER`, 
`ESS` etc)
+  - "contexts" are Emacs objects which describe current context. For example 
`current-buffer`, `default-directory` and `project-current` are such contexts. 
Context objects are used to create associations (links) between the current 
context and sessions. At any given time the user can link (unlink) sessions to 
(from) contexts. By default there are three types of contexts - buffer, 
directory and project, but systems can define their own contexts.
   
-Sesman is composed of two parts, [user interface][], available as [sesman 
map][], and [system interface][] consisting of a few generic functions which 
systems should define. 
+Sesman is composed of two parts, [user interface][], available as [sesman 
map][], and [system interface][] consisting of a few generic functions for 
which each systems should define its own methods. 
 
 ### [User Interface][]
 
@@ -22,7 +22,7 @@ Consists of
  - lifecycle management commands (`sesman-start`, `sesman-kill` and 
`sesman-restart`), and
  - association management commands (`sesman-link-with-buffer`, 
`sesman-link-with-directory`, `sesman-link-with-project` and `sesman-unlink`). 
 
-From the user's prospective the work-flow is simple. Start a session, either 
with `sesman-start` (`C-c C-s C-s`) or some of the system specific commands 
(`run-xyz`, `xyz-jack-in` etc). On startup each session is automatically 
associated with the least specific context (commonly a project). In the most 
common case the user has one session open per project; thus, no ambiguity 
arises when the system retrieves current session. If none or multiple sessions 
are associated with current context, [...]
+From the user's prospective the work-flow is simple. Start a session, either 
with `sesman-start` (`C-c C-s C-s`) or some of the system specific commands 
(`run-xyz`, `xyz-jack-in` etc). On startup each session is automatically 
associated with the least specific context (commonly a project). In the most 
common case the user has only one session open per project. In such case, no 
ambiguity arises when a system retrieves the current session. If none or 
multiple sessions are associated with c [...]
 
 Currently there is only one custom variable, `sesman-1-to-1-links`, which 
lists context types for which `1-to-1` associations are desired (defaults to 
`'(directory buffer)`. This means, that each time the user links a session with 
a directory, any previous associations with that directory are lost. For 
context types not in this list (e.g. `project`), 1-to-many associations are 
allowed. 
 
@@ -33,10 +33,10 @@ Consists of several generics, of which only first two are 
strictly required:
   - `sesman-start-session`
   - `sesman-kill-session`
   - `sesman-restart-session` - defaults to `sesman-start-session` + 
`sesman-kill-session`
-  - `sesman-greater-p` - used for sorting sessions in "recency" order
-  - `sesman-friendly-session-p` - used to define friendly sessions (such as 
projects which are dependencies of other projects)
+  - `sesman-greater-p` - used for sorting sessions in "recency" order. 
Defaults to sorting by session name.
+  <!-- - `sesman-friendly-session-p` - used to define friendly sessions (e.g. 
dependency projects). -->
   
-Depending on the purpose, sesman system can use several functions to retrieve 
sessions (`sesman-ensure-session`, `sesman-linked-sessions`, 
`sesman-friendly-sessions`, `sesman-system-sessions` and `sesman-sessions`). 
Most important of these being `sesman-ensure-session` which should be used to 
ensure that at least one session is linked to the current context. It returns 
the most specific session given sesman associations already in place. In case 
of ambiguity (or no sessions) the user is  [...]
+Depending on the purpose at hand, sesman system can use several functions to 
retrieve sessions (`sesman-ensure-session`, `sesman-linked-sessions`, 
`sesman-friendly-sessions`  and `sesman-sessions`). Most important of these 
being `sesman-ensure-session` which should be used to ensure that at least one 
session is linked to the current context. It returns the most specific session 
given sesman associations already in place. In case of ambiguity (or no 
sessions) the user is asked for a session.
 
 Systems could directly use user level commands to manage sessions 
(`sesman-start`, `sesman-kill`) or use legacy system specific initializer 
(`run-xyz`, `xyz-jack-in` etc). In the latter case, systems should call 
`sesman-register` to register their sessions with `sesman`.
 
diff --git a/sesman.el b/sesman.el
index d004f75272..f577c38a83 100644
--- a/sesman.el
+++ b/sesman.el
@@ -44,6 +44,7 @@
 (defvar sesman-sessions (make-hash-table :test #'equal)
   "Hashtable of all sesman sessions.
 Key is a cons (system-name . session-name).")
+
 (defvar sesman-links nil
   "An alist of all sesman associations.
 Each element is of the form (key cxt-type cxt-value) where
@@ -60,31 +61,56 @@ Each element is of the form (key cxt-type cxt-value) where
 (defun sesman-start ()
   "Start sesman session."
   (interactive)
-  (let ((session (sesman-start-session (sesman--system))))
-    (sesman-register session)
+  (let* ((system (sesman--system))
+         (session (sesman-start-session system)))
+    (sesman-register system session)
     (message "Started %s" (car session))))
 
 (defun sesman-restart ()
   "Restart sesman session."
   (interactive)
   (let* ((system (sesman--system))
-         (old-session (sesman-ensure-session "Restart session: "))
-         (old-session (sesman-unregister old-session system))
+         (old-session (sesman-ensure-session system "Restart session: "))
+         (old-session (sesman-unregister system old-session))
          (new-session (sesman-restart-session system old-session)))
-    (sesman-register new-session system)
+    (sesman-register system new-session)
     (message "Restarted %s" (car old-session))
     new-session))
 
-(defun sesman-kill ()
-  "Kill sesman session."
-  (interactive)
-  (let ((sessions (sesman-ensure-session "Kill session: " nil 'ask-all))
-        (system (sesman--system)))
-    (mapc (lambda (s)
-            (sesman-unregister s system)
-            (sesman-kill-session system s))
-          sessions)
-    (message "Killed %s" (mapcar #'car sessions))))
+(defun sesman-quit (all)
+  "Terminate sesman session.
+When WHICH is nil, kill only the current session; when a single
+universal argument or 'linked, kill all linked session; when a
+double universal argument, t or 'all, kill all sessions."
+  (interactive "P")
+  (let* ((system (sesman--system))
+         (sessions (sesman--on-C-u-u-sessions
+                    system "Kill session: " all)))
+    (if (null sessions)
+        (message "No more %s sessions" system)
+      (mapc (lambda (s)
+              (sesman-unregister system s)
+              (sesman-quit-session system s))
+            sessions)
+      (message "Killed %s" (mapcar #'car sessions)))))
+
+(defun sesman-info (which)
+  "Display current session info.
+When WHICH is nil, show info for current session; when a single
+universal argument or 'linked, show info for all linked session;
+when a double universal argument or 'all, show info for all
+sessions."
+  (interactive "P")
+  (let* ((system (sesman--system))
+         (sessions (sesman--on-C-u-u-sessions
+                    system "Info for session: : " all)))
+    (message
+     (mapconcat (lambda (ses)
+                  (format "%s:\n%s"
+                          (propertize (car ses) 'face 'bold)
+                          (sesman-session-info system ses)))
+                sessions
+                "\n"))))
 
 (defun sesman-link-with-buffer ()
   "Associate a session with current buffer."
@@ -112,12 +138,16 @@ Each element is of the form (key cxt-type cxt-value) where
 (defvar sesman-map
   (let (sesman-map)
     (define-prefix-command 'sesman-map)
+    (define-key sesman-map (kbd "C-i") 'sesman-info)
+    (define-key sesman-map (kbd   "i") 'sesman-info)
     (define-key sesman-map (kbd "C-s") 'sesman-start)
     (define-key sesman-map (kbd   "s") 'sesman-start)
     (define-key sesman-map (kbd "C-r") 'sesman-restart)
     (define-key sesman-map (kbd   "r") 'sesman-restart)
-    (define-key sesman-map (kbd "C-k") 'sesman-kill)
-    (define-key sesman-map (kbd   "k") 'sesman-kill)
+    (define-key sesman-map (kbd "C-R") 'sesman-replicate)
+    (define-key sesman-map (kbd   "R") 'sesman-replicate)
+    (define-key sesman-map (kbd "C-q") 'sesman-quit)
+    (define-key sesman-map (kbd   "q") 'sesman-quit)
     (define-key sesman-map (kbd "C-b") 'sesman-link-with-buffer)
     (define-key sesman-map (kbd   "b") 'sesman-link-with-buffer)
     (define-key sesman-map (kbd "C-d") 'sesman-link-with-directory)
@@ -130,35 +160,42 @@ Each element is of the form (key cxt-type cxt-value) where
   "Session management prefix keymap.")
 
 
-;;; System Interface
+;;; System Generic
 
 (defvar-local sesman-system nil
   "Name of the system managed by `sesman'.
 Can be either a symbol, or a function returning a symbol.")
 
-(cl-defgeneric sesman-context-types (system)
-  "Return a list of context types understood by SYSTEM."
-  '(buffer directory project))
-
-(cl-defgeneric sesman-start-session (system &optional session)
-  "Start and return SYSTEM SESSION.
-A session is a list with first element being a name.  When
-present SESSION is an old session (typically during the session
-restart) and could be safely (re-)used.")
+(cl-defgeneric sesman-start-session (system)
+  "Start and return SYSTEM SESSION.")
 
-(cl-defgeneric sesman-kill-session (system session)
-  "Kill SYSTEM SESSION.")
+(cl-defgeneric sesman-quit-session (system session)
+  "Terminate SYSTEM SESSION.")
 
 (cl-defgeneric sesman-restart-session (system session)
   "Restart SYSTEM SESSION.
-By default, calls `sesman-kill-session' and then
+By default, calls `sesman-quit-session' and then
 `sesman-start-session'."
   (let ((old-name (car session)))
-    (sesman-kill-session system session)
-    (let ((new-session (sesman-start-session system session)))
+    (sesman-quit-session system session)
+    (let ((new-session (sesman-start-session system)))
       (setcar new-session old-name)
       new-session)))
 
+(cl-defgeneric sesman-session-info (system session)
+  (cdr session))
+
+(cl-defgeneric sesman-context-types (system)
+  "Return a list of context types understood by SYSTEM."
+  '(buffer directory project))
+
+(cl-defgeneric sesman-session-object-type (system)
+  "Return type (a symbol) of the constituents of the session object.
+Depending on this type, sesman might provide additional
+functionality (e.g. a better default for
+`sesman-greater-p'). Currently only 'buffer is understood."
+  nil)
+
 (cl-defgeneric sesman-greater-p (system session1 session2)
   "Return non-nil if SESSION1 should be sorted before SESSION2.
 By default, sort by session name.  Systems should overwrite this
@@ -166,48 +203,65 @@ method to provide a more meaningful ordering; ideally more
 recently used session should score higher."
   (string-greaterp (car session1) (car session2)))
 
-(cl-defgeneric sesman-friendly-session-p (system session)
-  "Non-nil if SYSTEM's SESSION is friendly to current context.
-A friendly session is the one for which it makes sense to create
-an association with current contexts.  For example, if the user
-is within the project A which is required (dependent upon) from
-project B, then a session opened within project B is a friendly
-session for current context.  By default, there are no friendly
-sessions."
-  ;; by default no friendly sessions
-  nil)
+;; (cl-defgeneric sesman-friendly-session-p (system session)
+;;   "Non-nil if SYSTEM's SESSION is friendly to current context.
+;; A friendly session is the one for which it makes sense to create
+;; an association with current contexts.  For example, if the user
+;; is within the project A which is required (dependent upon) from
+;; project B, then a session opened within project B is a friendly
+;; session for current context.  By default, there all sessions are
+;; friendly sessions."
+;;   ;; by default all are friendly sessions
+;;   t)
+
+
+
+;;; System API
 
-(defun sesman-ensure-session (&optional prompt ask-new ask-all)
+(defun sesman-get-session (system session-name)
+  "Retrieve SYSTEM's session with SESSION-NAME from global hash."
+  (let ((system (or system (sesman--system))))
+    (gethash (cons system session-name) sesman-sessions)))
+
+(defun sesman-ensure-session (system &optional prompt ask-new ask-all all)
   "Ensure that at least one session is linked and return most relevant one.
-If there is an unambiguous link, return the linked session.  In
-case of multiple associations, ask the user for a session with
-PROMPT.  When ASK-NEW is non-nil, offer *new* option to start a
-new session.  If ASK-ALL is non-nil offer *all* option to return
-the sessions.  If ASK-ALL is non-nil, return a list of sessions."
-  (let ((prompt (or prompt "Session: "))
-        (sessions (sesman-linked-sessions)))
+If there is an unambiguous link in place, return that
+session. Otherwise, ask the user for a session with PROMPT.  When
+ASK-NEW is non-nil, offer *new* option to start a new session. If
+ASK-ALL is non-nil offer *all* option. If ASK-ALL is non-nil,
+return a list of sessions, otherwise a single session. If ALL is
+non-nil, search among all system sessions, otherwise only for
+linked sessions."
+  (let ((prompt (or prompt (format "%s session: " (sesman--system-name 
system))))
+        (sessions (if all
+                      (sesman--all-system-sessions system)
+                    (sesman-linked-sessions system))))
     (cond
+     ;; 0. No sessions; return nil
+     ((null sessions) nil)
      ;; 1. Single association; return
-     ((and (eq (length sessions) 1)
-           (not ask-new)
-           (not ask-all))
-      (car sessions))
+     ((and (not ask-new)
+           (eq (length sessions) 1))
+      (if ask-all
+          sessions
+        (car sessions)))
      ;; 2. Multiple associations; ask
      (sessions
-      (sesman--ask-for-session prompt sessions ask-new ask-all))
-     ;; 3. No associations, get all friendly sessions and ask
-     (t (let ((sessions (sesman-friendly-sessions)))
-          (sesman--ask-for-session prompt sessions ask-new ask-all))))))
+      (sesman--ask-for-session system prompt sessions ask-new ask-all))
+     ;; 3. No associations, get all system sessions and ask
+     ;; (t (let ((sessions (sesman--all-system-sessions)))
+     ;;      (sesman--ask-for-session system prompt sessions ask-new ask-all)))
+     )))
 
-(defun sesman-linked-session (&optional system cxt-types)
+(defun sesman-current-session (system &optional cxt-types)
   "Get the most relevant linked session for SYSTEM.
 CXT-TYPES is as in `sesman-linked-sessions'."
   (car (sesman-linked-sessions system cxt-types)))
 
-(defun sesman-linked-sessions (&optional system cxt-types)
+(defun sesman-linked-sessions (system &optional cxt-types)
   "Return a list of SYSTEM sessions linked in current context.
-CXT-TYPES is a list of context types to considere. Defaults to
-the list returned from `sesman-context-types'."
+CXT-TYPES is a list of context types to consider. Defaults to the
+list returned from `sesman-context-types'."
   (let* ((system (or system (sesman--system)))
          (cxt-types (or cxt-types (sesman-context-types system))))
     ;; just in case some links are lingering due to user errors
@@ -216,42 +270,30 @@ the list returned from `sesman-context-types'."
               (gethash (car assoc) sesman-sessions))
             (sesman--current-links system cxt-types))))
 
-(defun sesman-friendly-sessions (&optional system)
-  "Return a list of friendly (for current context) SYSTEM sessions.
-Session is friendly if `sesman-friendly-session-p' returns non-nil."
-  (let ((system (or system (sesman--system)))
-        sessions)
-    (maphash
-     (lambda (k s)
-       (when (and (eql (car k) system)
-                  (sesman-friendly-session-p system s))
-         (push s sessions)))
-     sesman-sessions)
-    (sesman--sort-sessions system sessions)))
-
-(defun sesman-system-sessions (&optional system)
-  "Return a list of sessions registered with SYSTEM."
-  (let ((system (or system (sesman--system)))
-        sessions)
-    (maphash
-     (lambda (k s)
-       (when (eql (car k) system)
-         (push s sessions)))
-     sesman-sessions)
-    (sesman--sort-sessions system sessions)))
+;; (defun sesman-friendly-sessions (&optional system)
+;;   "Return a list of friendly (for current context) SYSTEM sessions.
+;; Session is friendly if `sesman-friendly-session-p' returns non-nil."
+;;   (let ((system (or system (sesman--system)))
+;;         sessions)
+;;     (maphash
+;;      (lambda (k s)
+;;        (when (and (eql (car k) system)
+;;                   (sesman-friendly-session-p system s))
+;;          (push s sessions)))
+;;      sesman-sessions)
+;;     (sesman--sort-sessions system sessions)))
 
 (defun sesman-sessions (&optional system)
-  "Return all sessions for SYSTEM.
-Return a list of `sesman-linked-sessions',
-`sesman-friendly-sessions' and all other `sesman-system-sessions'
-in that order."
+  "Return all sessions registered with SYSTEM.
+Return a list of all session registered with the
+system. `sesman-linked-sessions' are sorted first."
   (let* ((system (or system (sesman--system))))
     (delete-dups
      (append (sesman-linked-sessions system)
-             (sesman-friendly-sessions system)
-             (sesman-system-sessions system)))))
+             ;; (sesman-friendly-sessions system)
+             (sesman--all-system-sessions system)))))
 
-(defun sesman-register (session &optional system)
+(defun sesman-register (system session)
   "Register SESSION into `sesman-sessions' and `sesman-links'.
 SYSTEM defaults to current system.  If a session with same name
 is already registered in `sesman-sessions', change the name by
@@ -261,14 +303,14 @@ be called by legacy connection initializers (\"run-xyz\",
   (let* ((system (or system (sesman--system)))
          (ses-name (car session))
          (i 1))
-    (while (gethash (cons system ses-name) sesman-sessions)
-      (setq ses-name (format "%s<%d>" i)))
+    (while (sesman-get-session system ses-name)
+      (setq ses-name (format "%s#%d" i)))
     (setq session (cons ses-name (cdr session)))
     (puthash (cons system ses-name) session sesman-sessions)
     (sesman--link-session session system)
     session))
 
-(defun sesman-unregister (session &optional system)
+(defun sesman-unregister (system session)
   "Unregister SESSION.
 SYSTEM defaults to current system.  Remove session from
 `sesman-sessions' and `sesman-links'."
@@ -278,6 +320,40 @@ SYSTEM defaults to current system.  Remove session from
     (sesman--clear-links)
     session))
 
+(defun sesman-add-object (system session-name object)
+  "Add (destructively) OBJECT to session SESSION-NAME.
+SYSTEM defaults to the system in the current buffer. If
+SESSION-NAME, does not exist create one first."
+  (let* ((system (or system (sesman--system)))
+         (session (sesman-get-session system session-name)))
+    (if session
+        (setcdr session (cons object (cdr session)))
+      (sesman-register system (list session-name object)))))
+
+(defun sesman-remove-object (system session-name object)
+  "Remove (destructively) OBJECT from session SESSION-NAME of SYSTEM.
+If SESSION-NAME is nil, retrieve the session with
+`sesman-session-for-object'. If OBJECT is the last object in
+sesman session, `sesman-unregister' the session."
+  (let* ((system (or system (sesman--system)))
+         (session (if session-name
+                      (sesman-get-session system session-name)
+                    (sesman-get-session-for-object system object)))
+         (new-session (delete object session)))
+    (if (= (length new-session) 1)
+        (sesman-unregister system session)
+      (puthash (cons system (car session)) new-session sesman-sessions))))
+
+(defun sesman-get-session-for-object (system object &optional no-error)
+  (let* ((system (or system (sesman--system)))
+         (sessions (sesman--all-system-sessions system)))
+    (or (seq-find (lambda (ses)
+                    (seq-find (lambda (x) (equal object x)) (cdr ses)))
+                  sessions)
+        (unless no-error
+          (error "%s is not part of any %s sessions"
+                 object system)))))
+
 
 ;;; Contexts
 
@@ -311,6 +387,22 @@ SYSTEM defaults to current system.  Remove session from
 
 ;; Internals
 
+(defun sesman--on-C-u-u-sessions (system prompt which)
+  (cond
+   ((or (eq which '(4)) (eq which 'linked))
+    (sesman-linked-sessions system))
+   ((or (eq which '(16)) (eq which 'all) (eq which t))
+    (sesman--all-system-sessions system))
+   (t (sesman-ensure-session system prompt nil 'ask-all 'all))))
+
+(defun sesman--system-name (system)
+  (let ((name (cond ((symbolp system) (symbol-name system))
+                    ((stringp system) system)
+                    (t (format "s" system)))))
+    (if (string-match-p "^[[:upper:]]" name)
+        name
+      (capitalize name))))
+
 (defun sesman--current-links (&optional system cxt-types)
   (let* ((system (or system (sesman--system)))
          (cxt-types (or cxt-types (sesman-context-types system))))
@@ -363,7 +455,7 @@ SYSTEM defaults to current system.  Remove session from
              (sesman--link-session session system ',cxt-type))
          (error (format "%s association not allowed for this system (%s)"
                         ,(capitalize (symbol-name cxt-type))
-                        (sesman--system)))))))
+                        system))))))
 
 (defun sesman--system ()
   (if sesman-system
@@ -372,6 +464,17 @@ SYSTEM defaults to current system.  Remove session from
         sesman-system)
     (error "No `sesman-system' in buffer `%s'" (current-buffer))))
 
+(defun sesman--all-system-sessions (&optional system)
+  "Return a list of sessions registered with SYSTEM."
+  (let ((system (or system (sesman--system)))
+        sessions)
+    (maphash
+     (lambda (k s)
+       (when (eql (car k) system)
+         (push s sessions)))
+     sesman-sessions)
+    (sesman--sort-sessions system sessions)))
+
 (defun sesman--lookup-fn (&optional system ses-name cxt-type cxt-val x)
   (let ((system (or system (caar x)))
         (ses-name (or ses-name (cdar x)))
@@ -395,7 +498,7 @@ SYSTEM defaults to current system.  Remove session from
                     sesman-links)))
 
 (defvar sesman--select-session-history nil)
-(defun sesman--ask-for-session (prompt sessions &optional ask-new ask-all)
+(defun sesman--ask-for-session (system prompt sessions &optional ask-new 
ask-all)
   (let* ((name.syms (mapcar (lambda (s)
                               (let ((name (car s)))
                                 (cons (if (symbolp name) (symbol-name name) 
name)
@@ -403,7 +506,7 @@ SYSTEM defaults to current system.  Remove session from
                             sessions))
          (nr (length name.syms))
          (syms (if (and (not ask-new) (= nr 0))
-                   (error "No %s sessions found" (sesman--system))
+                   (error "No %s sessions found" system)
                  (append name.syms
                          (when ask-new '(("*new*")))
                          (when (and ask-all (> nr 1))
@@ -416,7 +519,7 @@ SYSTEM defaults to current system.  Remove session from
                prompt (mapcar #'car syms) nil t nil 
'sesman--select-session-history def)))
     (cond
      ((string= sel "*new*")
-      (let ((ses (sesman-register)))
+      (let ((ses (sesman-start-session system)))
         (message "Started %s" (car ses))
         (if ask-all (list ses) ses)))
      ((string= sel "*all*")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]