Skip to content

Commit

Permalink
Enable tab-bar-mode if the loaded session includes a tab-bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescherti committed Jan 20, 2025
1 parent b9c6d9b commit 5aab7d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion easysession.el
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,16 @@ When LOAD-GEOMETRY is non-nil, load the frame geometry."
:cleanup-frames easysession-frameset-restore-cleanup-frames
:force-display easysession-frameset-restore-force-display
:force-onscreen easysession-frameset-restore-force-onscreen)

(when (fboundp 'tab-bar-mode)
(when (seq-some
(lambda (frame)
(menu-bar-positive-p
(frame-parameter frame 'tab-bar-lines)))
(frame-list))
(tab-bar-mode 1)))

;; Return t
t)
(easysession--warning "%s: Failed to restore the frameset"))))))

Expand Down Expand Up @@ -739,7 +749,7 @@ Returns t if the session file exists, nil otherwise."
(easysession--prompt-session-name
"Delete session: " session-name)))
(session-file (easysession--get-session-file-name session-name)))
(if-let ((session-buffer (find-buffer-visiting session-file)))
(if-let* ((session-buffer (find-buffer-visiting session-file)))
(kill-buffer session-buffer))
(if (file-exists-p session-file)
(progn (delete-file session-file nil)
Expand Down
3 changes: 2 additions & 1 deletion tests/test-easysession.el
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ storing them in respective variables for later use."
(defun test-easysession--get-all-names ()
"Test: `easysession--get-all-names'."
(interactive)
(unless (equal (easysession--get-all-names) '("main" "test"))
(unless (equal (sort (easysession--get-all-names) #'string<)
(sort (list "main" "test") #'string<))
(error "The easysession--get-all-names failed")))

(defun test-save-mode-predicate ()
Expand Down

0 comments on commit 5aab7d0

Please sign in to comment.