[Top][All Lists]

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

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

From: Tassilo Horn
Subject: Re: ;;; anything.el --- open anything
Date: Tue, 17 Jul 2007 08:36:13 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

"address@hidden" <address@hidden> writes:

Hi Tamas,

>> But the locate source lists always the same files, although none of
>> them matches the given pattern. Those are the listed files, I typed
>> the pattern "foobarbaz".
> Works for me. I started emacs with -q, loaded anything, did a (push
> anything-source-locate anything-sources) and anything listed the
> matching files with locate.

Ok, I tried emacs -Q as well, but still I get the same list of files.

> I use the locate source every day, so it should work. :) Maybe you
> should try starting the locate process manually with start-process to
> see if it returns the correct results.


> Someone else also had a problem with the locate source and it turned
> out his locate didn't understand the options I used in the example
> anything-locate-source.

Ah, yes, that's it. I use GNU slocate version 3.1. The option -r has to
be followed by the regexp to search, so

   locate -r -i foobarbaz

will look for the regexp -i instead of foobarbaz. So the solution is to
reverse -r and -i:

--8<---------------cut here---------------start------------->8---
(defvar anything-source-locate
  '((name . "Locate")
    (candidates . (lambda ()
                    (start-process "locate-process" nil
                                   "locate" "-i" "-r"
    (type . file)
    (requires-pattern . 3))
  "Source for retrieving files matching the current input pattern
  with locate.")
--8<---------------cut here---------------end--------------->8---

      "DRM manages rights in the same way a jail manages freedom"

reply via email to

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