Skip to content

Multiple instantiations of Wikipedia source #16

Closed Answered by armindarvish
neurolit asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, here is a quick and somewhat dirty solution. You can, of course, come up with cleaner solutions, for example using macros that take the language code as input and make the fetcher function for you, but I'll leave that to you to figure out!

;;; French Wikipedia
(cl-defun consult-omni--wikipedia-fetch-results-in-french (input &rest args &key callback lang &allow-other-keys)
  "Fetches search results from French Wikipedia for INPUT."
  (pcase-let* ((`(,query . ,opts) (consult-omni--split-command input (seq-difference args (list :callback callback))))
               (consult-omni-wikipedia-api-url "https://fr.wikipedia.org/w/api.php")
               (opts (car-safe opts))
               (c…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@neurolit
Comment options

@armindarvish
Comment options

Answer selected by neurolit
@neurolit
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested Sources Question, Discussion about Sources. Either a new one or an existing one.
2 participants