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

w3m-session display format [PATCH]



Currently, the listing of sessions (M-s, or M-x w3m-session-select) ends
each line with a list of all the urls for a session, which can make for
extremely long lines, and strikes me as pretty useless, since for
manually saved sessions, the user is already prompted for a name to
label the session.

The attached patch reduces the clutter, computation, memory usage, and
screen space by ignoring that information.

Note that the information is still available (and in a much more useful
and presentable manner) by pressing M-s a second time on any entry.

For your consideration.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0
Index: w3m-session.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m-session.el,v
retrieving revision 1.45
diff -u -r1.45 w3m-session.el
--- w3m-session.el	18 Feb 2018 23:38:58 -0000	1.45
+++ w3m-session.el	8 May 2018 19:17:20 -0000
@@ -518,7 +518,7 @@
 	(num 0)
 	(max 0)
 	(inhibit-read-only t)
-	title titles time times url urls wid pos)
+	title titles time times wid pos)
     (if (not sessions)
 	(progn
 	  (message "No saved session")
@@ -531,26 +531,17 @@
 	      (setq titles (cons title titles))
 	      (setq times (cons (format-time-string w3m-session-time-format
 						    (nth 1 x))
-				times))
-	      (setq urls (cons (mapconcat (lambda (url)
-					    (if (stringp url)
-						url
-					      (car url)))
-					  (nth 2 x) ", ")
-			       urls)))
+				times)))
 	    sessions)
       (setq titles (nreverse titles))
       (setq times (nreverse times))
-      (setq urls (nreverse urls))
       (setq max (+ max 2))
       (erase-buffer)
       (insert "Select session:\n\n")
       (while (and (setq title (car titles))
-		  (setq time (car times))
-		  (setq url (car urls)))
+		  (setq time (car times)))
 	(setq titles (cdr titles))
 	(setq times (cdr times))
-	(setq urls (cdr urls))
 	(setq pos (point))
 	(insert title)
 	(add-text-properties pos (point)
@@ -558,7 +549,7 @@
 				    w3m-session-number ,num))
 	(setq num (1+ num))
 	(insert (make-string (- max (string-width title)) ?\ ))
-	(insert time "  " url "\n"))
+	(insert time "\n"))
       (goto-char (point-min))
       (goto-char (next-single-property-change
 		  (point) 'w3m-session-number))