Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions srfi-tools/interactive.sld
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
srfi-browse-mail-archive-url
srfi-send-mail)
(import (scheme base)
(scheme char)

(srfi-tools private external)
(srfi-tools private list)
(srfi-tools private string)
(srfi-tools private os)
(srfi-tools private command)

(srfi-tools data)
(srfi-tools path)
(srfi-tools html)
Expand Down Expand Up @@ -91,6 +96,21 @@
"Browse Github page for SRFI <num>."
(srfi-browse-github-url (parse-srfi-number num)))

(define (srfi-lucky query)
(let* ((query (string-downcase query))
(match (find (lambda (srfi)
(string-contains
(string-downcase (srfi-title srfi))
query))
(srfi-list))))
(if match
(srfi-browse (srfi-number match))
(error "No luck. Try another query?"))))

(define-command (lucky query)
"Browse the first SRFI whose title matches <query>."
(srfi-lucky query))

;;

(define (srfi-pager num)
Expand Down