[Conkeror] [PATCH 3/3] session: Offer suspend of the autosaved session on startup

Jörg Sommer joerg at alea.gnuu.de
Sun Oct 30 11:02:30 PDT 2011


If you start up conkeror with your default session that contains many
buffers and you only want to quickly lookup a single page and don't need
to load the whole session, you might prefer to suspend the autosaved
session and start with a new one (instead of drop it or load it). You can
later load the saved session with the session‐load-* commands.
---
 modules/session.js |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/modules/session.js b/modules/session.js
index f07e2c2..02378a7 100644
--- a/modules/session.js
+++ b/modules/session.js
@@ -342,10 +342,24 @@ in_module(null);
         if (session_auto_save_auto_load == true)
             do_load = true;
         else if (session_auto_save_auto_load == "prompt" && !user_gave_urls) {
-            do_load = (yield window.minibuffer.read_single_character_option(
-                $prompt = "Load auto-saved session? (y/n)",
-                $options = ["y", "n"]
-            )) == "y";
+            while (true)
+            {
+                var answer = (yield window.minibuffer.read_single_character_option(
+                    $prompt = "Load auto-saved session? y(es)/n(o)/s(uspend)",
+                    $options = ["y", "n", "s"]));
+                if (answer == "s")
+                {
+                    let new_filename = make_file(yield _session_prompt_file(window));
+                    if (! new_filename)
+                        continue;
+                    session_write(new_filename, _session_auto_save_cached);
+                    do_load = false;
+                }
+                else
+                    do_load = answer == "y";
+
+                break;
+            }
         } else
             throw new Error("Invalid value for session_auto_save_auto_load: " +
                             session_auto_save_auto_load);
-- 
1.7.7



More information about the Conkeror mailing list