1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-02-26 09:27:36 +01:00

- [gemini] allowed save in tour the selected link.

This commit is contained in:
cage 2021-06-13 16:02:12 +02:00
parent b4a3dfabde
commit de53c838c1
3 changed files with 17 additions and 4 deletions

View File

@ -459,7 +459,7 @@
(define-key "t" #'tour-mode-link *open-message-link-keymap*) (define-key "t" #'tour-mode-link *open-message-link-keymap*)
(define-key "T" #'save-selected-message-in-tour *open-message-link-keymap*)
;; chats list window ;; chats list window

View File

@ -2530,6 +2530,7 @@
:tour-mode-link :tour-mode-link
:next-tour-link :next-tour-link
:show-tour-links :show-tour-links
:save-selected-message-in-tour
:open-gemini-toc :open-gemini-toc
:gemini-toc-scroll-up :gemini-toc-scroll-up
:gemini-toc-scroll-down :gemini-toc-scroll-down

View File

@ -1940,7 +1940,19 @@ gemini://gemini.circumlunar.space/docs/companion/subscription.gmi
(defun show-tour-links () (defun show-tour-links ()
"Show a link window with all the links in the tour queue." "Show a link window with all the links in the tour queue."
(open-message-link-window:init-gemini-links (reverse tour)) (open-message-link-window:init-gemini-links (reverse tour))
(focus-to-open-message-link-window))) (focus-to-open-message-link-window))
(defun save-selected-message-in-tour ()
"Save the selected link in the tour queue"
(ignore-errors
(let ((win *open-message-link-window*))
(with-accessors ((links open-message-link-window::links)) win
(when-let* ((selected-index (line-oriented-window:row-selected-index win))
(selected-link (elt links selected-index))
(label (or (gemini-parser:name selected-link)
(gemini-parser:target selected-link))))
(push selected-link tour)
(info-message (format nil (_ "~s saved in tour") label))))))))
(defun open-gemini-toc () (defun open-gemini-toc ()
"Opend a windows that contains a generated table of contents of the "Opend a windows that contains a generated table of contents of the