(let* ((url (elpher-info-current))
(desc (car elpher-current-page))
(protocol (cond
- ((string-prefix-p "gemini:" url) "gemini")
((string-prefix-p "gopher:" url) "gopher")
((string-prefix-p "finger:" url) "finger")
+ ((string-prefix-p "gemini:" url) "gemini")
+ ((string-prefix-p "spartan:" url) "spartan")
(t "elpher"))))
(when (equal "elpher" protocol)
;; Weird link. Or special inner link?
:export (lambda (link description format _plist)
(elpher-org-export-link link description format "gopher"))
:follow (lambda (link _arg) (elpher-org-follow-link link "gopher")))
+ (org-link-set-parameters
+ "spartan"
+ :export (lambda (link description format _plist)
+ (elpher-org-export-link link description format "spartan"))
+ :follow (lambda (link _arg) (elpher-org-follow-link link "spartan")))
(org-link-set-parameters
"finger"
:export (lambda (link description format _plist)
(if (boundp 'browse-url-default-handlers)
(add-to-list
'browse-url-default-handlers
- '("^\\(gopher\\|finger\\|gemini\\)://" . elpher-browse-url-elpher))
+ '("^\\(gopher\\|finger\\|gemini\\|spartan\\)://" . elpher-browse-url-elpher))
;; Patch `browse-url-browser-function' for older ones. The value of
;; that variable is `browse-url-default-browser' by default, so
;; that's the function that gets advised. If the value is an alist,
(lambda (url &rest _args)
"Handle gemini, gopher, and finger schemes using Elpher."
(let ((scheme (downcase (car (split-string url ":" t)))))
- (if (member scheme '("gemini" "gopher" "finger"))
+ (if (member scheme '("gopher" "gemini" "spartan" "finger"))
;; `elpher-go' always returns nil, which will stop the
;; advice chain here in a before-while
(elpher-go url)
;; Make mu4e aware of the gemini world
(setq mu4e~view-beginning-of-url-regexp
- "\\(?:https?\\|gopher\\|finger\\|gemini\\)://\\|mailto:")
+ "\\(?:https?\\|gopher\\|finger\\|gemini\\|spartan\\)://\\|mailto:")
;;; eww:
;; Let elpher handle gemini, gopher links in eww buffer.
(setq eww-use-browse-url
- "\\`mailto:\\|\\(\\`gemini\\|\\`gopher\\|\\`finger\\)://")
+ "\\`mailto:\\|\\(\\`gemini\\|\\`gopher\\|\\`finger\\|\\`spartan\\)://")
;;; Interactive procedures