how to configure multiple locate dbs

37 views
Skip to first unread message

senior7515

unread,
Dec 22, 2012, 3:56:42 PM12/22/12
to emacs...@googlegroups.com
Hello, 

I can't figure out how to configure helm to look up multiple locate dbs. 

What I would like to have is:

1. project locate.db file 
    a. Ideally it can pick up a 'locate.db' from the root of this vcs directory. Meaning if I open a file on '~/src/project.git' it can pick it up even if i'm in '~/src/project.git/some/other/path' 
2. other locate db (emacs config & other paths) that I have configured on my ~/locate.db
3. system locate.db

I tried given multiple paths to:

(helm-ff-find-locatedb "~/locate.db")

But haven't been able to figure out. 

Any pointers would be greatly appreciated. 


senior7515

unread,
Dec 22, 2012, 7:38:08 PM12/22/12
to emacs...@googlegroups.com
I would still like to know the solution to locatedbs path. However, the locate-per-project question can be disregarded. 

I just learned of helm-git and it works really well. 

Thanks again!

Thierry Volpiatto

unread,
Dec 23, 2012, 1:46:10 AM12/23/12
to emacs...@googlegroups.com
senior7515 <galleg...@gmail.com> writes:

> I would still like to know the solution to locatedbs path. However, the
> locate-per-project question can be disregarded.
C-u C-x c l
if your locate.db exists, start to search, otherwise press RET to create
it.
Same from M-x helm-find-files:
press C-u C-x C-f


> I just learned of helm-git and it works really well.
Please use helm-ls-git, it is the improved and maintained version of
helm-git.
https://github.com/emacs-helm/helm-ls-git.git

> Thanks again!
>
> On Saturday, December 22, 2012 3:56:42 PM UTC-5, senior7515 wrote:
>>
>> Hello,
>>
>> I can't figure out how to configure helm to look up multiple locate dbs.
>>
>> What I would like to have is:
>>
>> 1. project locate.db file
>> a. Ideally it can pick up a 'locate.db' from the root of this vcs
>> directory. Meaning if I open a file on '~/src/project.git' it can pick it
>> up even if i'm in '~/src/project.git/some/other/path'
>> 2. other locate db (emacs config & other paths) that I have configured on
>> my ~/locate.db
>> 3. system locate.db
>>
>> I tried given multiple paths to:
>>
>> (helm-ff-find-locatedb "~/locate.db")
>>
>> But haven't been able to figure out.
>>
>> Any pointers would be greatly appreciated.
>>
>>
>>

--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997

Alexander Gallego

unread,
Dec 23, 2012, 12:46:21 PM12/23/12
to emacs...@googlegroups.com
Hi Thierry,

Thanks for the reply, very insightful.

2 things:

1. I saw that you are one of the members of emacs-helm group. Is there
a chance that you guys can push helm-ls-git to melpa or
mamalade-repo.org. Is really nice on emacs24 to just do
package-install helm-ls-git. (helm-mercurial-* would be nice too)

2. I can fire up helm-find-find and I in fact see that it is using
locate command results. This is great. What I was looking for is a way
to configure helm to look for locate.db files in some other
directories, perhaps part of my init.el script.

The system locate.db updates every 24 hours. However, I have my own
cron job that updates my ~/workspace every 10 minutes eventually I'll
get around to writing something with inotify so that it updates on
file delete/add. I like this because when I switch branches my old
locatedb is essentially useless. This happens quite often.

I tried your suggestion of ' C-u C-x c l ' and it just brings up the
'pattern: ' on the mini-buffer. This indicates that the locate.db
exists as per you comment but I want helm to look for multiple
locate.db files. This is the part i'm a bit confused, how to make this
part of my init script.

one in ~/locate.db && one in the system wherever it exists.

Thanks again.


Sincerely,
Alexander Gallego

---*---
------*
* * *

Thierry Volpiatto

unread,
Dec 23, 2012, 2:08:59 PM12/23/12
to emacs...@googlegroups.com
Alexander Gallego <galleg...@gmail.com> writes:

> 1. I saw that you are one of the members of emacs-helm group. Is there
> a chance that you guys can push helm-ls-git to melpa or
> mamalade-repo.org. Is really nice on emacs24 to just do
> package-install helm-ls-git. (helm-mercurial-* would be nice too)
You should ask at melpa for this, I am just developing helm, no more.

> 2. I can fire up helm-find-find
Probably you are speaking of `helm-for-file', not `helm-find-find'
(which doesn't exists).

> and I in fact see that it is using locate command results. This is
> great. What I was looking for is a way to configure helm to look for
> locate.db files in some other directories, perhaps part of my init.el
> script.
You have nothing to configure:
M-x helm-find-files
=> navigate to the directory of your choice (Without quitting helm)
Hit `C-u M-.' RET and start writing in pattern prompt.

> The system locate.db updates every 24 hours. However, I have my own
> cron job that updates my ~/workspace every 10 minutes eventually I'll
> get around to writing something with inotify so that it updates on
> file delete/add. I like this because when I switch branches my old
> locatedb is essentially useless. This happens quite often.
Same as above but instead of:
`C-u M-.' do `C-u C-u M-.' and RET
This will rewrite your locate.db file.

Alexander Gallego

unread,
Dec 23, 2012, 4:24:10 PM12/23/12
to emacs...@googlegroups.com
Thanks for the help. I submitted a pull request to Melpa for
helm-ls-git and it was merged in. So hopefully I can pull from Melpa
later this afternoon.

Thanks again.

Sent from my phone. Please excuse any typos.


On Dec 23, 2012, at 2:09 PM, Thierry Volpiatto
Reply all
Reply to author
Forward
0 new messages