Re: (semanticdb-directory-loaded-p default-directory) returns nil
Oleh Krehel <[email protected]> Tue, 27 Jan 2015 16:53:27 +0100
| Newsgroups | gmane.emacs.cedet |
|---|---|
| Message-ID | <CAA01p3oq=jSwZDOf45B9WzW_jWu+SDxsytB6XRRJXzkJLEr3gw@mail.gmail.com> |
Hi Eric,
I'd like to bump this, as well as add a new question.
Say that I store:
(setq db (semanticdb-directory-loaded-p path))
Now `db` stores the database for all files in path. It happens
sometimes that I know for sure that one of these files was already
deleted. How can I update `db`, deleting the corresponding entry for
both for the current and future sessions?
regards,
Oleh
On Wed, Feb 26, 2014 at 9:09 AM, Oleh <[email protected]> wrote:
> On Wed, Feb 26, 2014 at 2:32 AM, Eric M. Ludlam <[email protected]> wrote:
>> On 02/20/2014 12:43 PM, Oleh wrote:
>>>
>>> Hi all,
>>>
>>> I've noticed a strange bug: when I do from bash
>>>
>>> emacs .emacs
>>>
>>> and eval (semanticdb-directory-loaded-p default-directory), it returns
>>> nil.
>>> But if I do from bash
>>>
>>> emacs
>>>
>>> and then find .emacs manually, the return result is the correct one.
>>> Tested on 24.3.50.1 and 24.3, with CEDET from bzr.
>>>
>>> Furthermore, when I kill the buffer and re-open it, the return result
>>> is correct again.
>>>
>>> I'm guessing that CEDET does initialization in some hook that gets
>>> bypassed
>>> when the file is opened from the console.
>>
>>
>> Hi Oleh,
>>
>> I can confirm that the buffer's aren't picked up by Semantic when used as
>> command line arguments.
>>
>> I suppose we could try to identify existing buffer's and apply on them when
>> Semantic starts up. I'm not sure what the impact might be.
>
> Thanks. I've been browsing the code to see where the init is done, but
> I couldn't find it.
> I'm currently using this silly hack to load a directory of semanticdb:
>
> (setq db (or (semanticdb-directory-loaded-p path)
> ;; a trick to make sure semantic loads
> (let ((file (expand-file-name (car (lispy--file-list)))))
> (when file
> (with-current-buffer
> (find-file-noselect file)
> (unless (equal this-file (buffer-file-name))
> (kill-buffer))))
> (semanticdb-directory-loaded-p path))))
>
> Can you point me to a better way?
>
> regards,
> Oleh
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/