[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ;;; anything.el --- open anything

From: address@hidden
Subject: Re: ;;; anything.el --- open anything
Date: Fri, 24 Aug 2007 23:52:02 -0700
User-agent: G2/1.0

I use Wikipedia a lot, so I made a source similar to Google Suggest
for Wikipedia titles. Here it is if someone's interested:

(defvar anything-wikipedia-title-lookup-program nil
  "The program is called with one argument and it should return
  matching titles from Wikipedia.")

(setq anything-sources
 '(((name . "Wikipedia Titles")
     . (lambda ()
         (start-process "wp-process" nil
                        (replace-regexp-in-string " " "_" anything-
     . (lambda (candidates)
         (mapcar (lambda (candidate)
                   (replace-regexp-in-string "_" " " candidate))
    (action . (("Look up Title" .
                (lambda (candidate)
                  (browse-url (concat "";
    (requires-pattern . 3)

In order to get useful results exact title matches should be listed
first and substring matches afterwards. Currently, anything.el cannot
invoke two processes for the same source, one after the other, that's
why you need to supply an external program for the lookup.

It can be a simple shell script:

grep -i "^$1$" <title file>
grep -i "$1" <title file>

or a Windows batch file:

@echo off
grep.exe -i "^%1$" <title file>
grep.exe -i "%1" <title file>

The current title file can be downloaded from here:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]