mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-03 04:37:29 +01:00
- [experimental][gemini] used URI's fragment as a search criteria for the gemini page (disabled by default).
This commit is contained in:
parent
f46d86baea
commit
bce702465c
@ -201,3 +201,16 @@ open "^((gemini://)|(\\.)|(/)).+gmi$" with "tinmop"
|
|||||||
open "^((gemini://)|(\\.)|(/)).+txt$" with "tinmop"
|
open "^((gemini://)|(\\.)|(/)).+txt$" with "tinmop"
|
||||||
open "^((gemini://)|(\\.)|(/)).+sh$" with "tinmop"
|
open "^((gemini://)|(\\.)|(/)).+sh$" with "tinmop"
|
||||||
open ".gpub$" with "tinmop"
|
open ".gpub$" with "tinmop"
|
||||||
|
|
||||||
|
######################
|
||||||
|
# EXPERIMENTAL ZONE #
|
||||||
|
######################
|
||||||
|
|
||||||
|
# use fragment of a gemini IRI/URI as a searching criteria for the downloaded page
|
||||||
|
# E.g. gemini://foo/bar.gmi#baz will jump to the first occurence of "baz"
|
||||||
|
# the fragment is used as a regular expressions
|
||||||
|
|
||||||
|
# Note: incomplete implementation, works fine for headers, preformatted text,
|
||||||
|
# and likely links, broken for the rest.
|
||||||
|
|
||||||
|
experimental.gemini.iri.fragment.regex = no
|
@ -441,7 +441,15 @@
|
|||||||
(progn
|
(progn
|
||||||
(maybe-render-toc)
|
(maybe-render-toc)
|
||||||
(ui:notify (_ "Gemini document downloading completed"))
|
(ui:notify (_ "Gemini document downloading completed"))
|
||||||
(setf (stream-status wrapper-object) :completed)))
|
(setf (stream-status wrapper-object) :completed)
|
||||||
|
(when (and fragment
|
||||||
|
(swconf:config-gemini-fragment-as-regex-p))
|
||||||
|
(let ((regex (if (text-utils:percent-encoded-p fragment)
|
||||||
|
(text-utils:percent-encode fragment)
|
||||||
|
fragment))
|
||||||
|
(priority program-events:+standard-event-priority+))
|
||||||
|
(ui::message-search-regex-callback regex
|
||||||
|
:priority priority)))))
|
||||||
;; (allow-downloading wrapper-object)
|
;; (allow-downloading wrapper-object)
|
||||||
(gemini-client:close-ssl-socket download-socket))))))))
|
(gemini-client:close-ssl-socket download-socket))))))))
|
||||||
;; (fs:delete-file-if-exists support-file)))))
|
;; (fs:delete-file-if-exists support-file)))))
|
||||||
|
@ -1218,6 +1218,7 @@
|
|||||||
:config-purge-history-days-offset
|
:config-purge-history-days-offset
|
||||||
:config-purge-cage-days-offset
|
:config-purge-cage-days-offset
|
||||||
:config-notification-life
|
:config-notification-life
|
||||||
|
:config-gemini-fragment-as-regex-p
|
||||||
:config-notify-window-geometry
|
:config-notify-window-geometry
|
||||||
:config-notification-icon
|
:config-notification-icon
|
||||||
:config-server-name
|
:config-server-name
|
||||||
|
@ -421,7 +421,9 @@
|
|||||||
,@(loop for name in names collect
|
,@(loop for name in names collect
|
||||||
`(gen-key-constant ,name))))
|
`(gen-key-constant ,name))))
|
||||||
|
|
||||||
(gen-key-constants background
|
(gen-key-constants experimental
|
||||||
|
regex
|
||||||
|
background
|
||||||
foreground
|
foreground
|
||||||
title
|
title
|
||||||
start
|
start
|
||||||
@ -541,6 +543,8 @@
|
|||||||
directory
|
directory
|
||||||
fetch
|
fetch
|
||||||
update
|
update
|
||||||
|
iri
|
||||||
|
fragment
|
||||||
close-after-select
|
close-after-select
|
||||||
password-echo-character
|
password-echo-character
|
||||||
color-re
|
color-re
|
||||||
@ -922,6 +926,14 @@
|
|||||||
+key-notify-window+
|
+key-notify-window+
|
||||||
+key-life+)
|
+key-life+)
|
||||||
|
|
||||||
|
(gen-simple-access (gemini-fragment-as-regex-p
|
||||||
|
:transform-value-fn (lambda (a) (not (false-value-p a))))
|
||||||
|
+key-experimental+
|
||||||
|
+key-gemini+
|
||||||
|
+key-iri+
|
||||||
|
+key-fragment+
|
||||||
|
+key-regex+)
|
||||||
|
|
||||||
(defun config-notify-window-geometry ()
|
(defun config-notify-window-geometry ()
|
||||||
(values (access:accesses *software-configuration*
|
(values (access:accesses *software-configuration*
|
||||||
+key-notify-window+
|
+key-notify-window+
|
||||||
|
@ -394,14 +394,16 @@ Metadata includes:
|
|||||||
(defun message-scroll-previous-page ()
|
(defun message-scroll-previous-page ()
|
||||||
(message-window:scroll-previous-page *message-window*))
|
(message-window:scroll-previous-page *message-window*))
|
||||||
|
|
||||||
|
(defun message-search-regex-callback (regex &key (priority +maximum-event-priority+))
|
||||||
|
(let ((event (make-instance 'search-regex-message-content-event
|
||||||
|
:priority priority
|
||||||
|
:payload regex)))
|
||||||
|
(push-event event)))
|
||||||
|
|
||||||
(defun message-search-regex ()
|
(defun message-search-regex ()
|
||||||
"Search regular expression in message"
|
"Search regular expression in message"
|
||||||
(flet ((on-input-complete (regex)
|
(ask-string-input #'message-search-regex-callback
|
||||||
(let ((event (make-instance 'search-regex-message-content-event
|
:prompt (_ "Search key: ")))
|
||||||
:priority +maximum-event-priority+
|
|
||||||
:payload regex)))
|
|
||||||
(push-event event))))
|
|
||||||
(ask-string-input #'on-input-complete :prompt (_ "Search key: "))))
|
|
||||||
|
|
||||||
(defun message-toggle-preformatted-block ()
|
(defun message-toggle-preformatted-block ()
|
||||||
"Toggles on/of preformatted block from text and shows alt text, if exists"
|
"Toggles on/of preformatted block from text and shows alt text, if exists"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user