Jan Moringen | 1 Apr 2010 03:37
Picon
Picon

Re: Replacement for which-func advise

Hi.

> Scope calculations are pretty quick, but even so, if you call any of
> the 
> routines that needs to build up the semanticdb typecache, it is worth 
> doing it as a semantic-idle service.  The semantic idle service will 
> build up all the time consuming data structures such as the latest
> edit 
> reparses, typecache, scope, and parsing all the stray headers that are
> needed.  Once it's done with that, it dispatches to all the idle time 
> services.
> 
> If you need to calculate a scope, or do any sort of analysis, but do
> it during the reparse hooks, you will force data structure rebuilds
> before the idle timer gets to it.
> 
> Making a new idle service is pretty easy, as you can use 
> define-semantic-idle-service to define your feature.  There are plenty
> of examples in semantic-idle.el with semantic-idle-tag-highlight being
> pretty simple.

I made semantic-breadcrumbs-minor-mode into an idle service and it
worked like a charm. The sluggishness produced by the post-command-hook
-version is (as expected) gone.

> You may want to consider a "fast" answer, and a "detailed" answer 
> solution.  The immediate feedback variant would use the 'fast' answer,
> and an idle mode could then enable a better answer later.

For me, the feedback from the idle service seems fast enough, but I only
(Continue reading)

Eric M. Ludlam | 6 Apr 2010 22:00
Gravatar

Re: Replacement for which-func advise

Hi,

On 03/31/2010 09:37 PM, Jan Moringen wrote:
[ ... ]
>>
>> Making a new idle service is pretty easy, as you can use
>> define-semantic-idle-service to define your feature.  There are plenty
>> of examples in semantic-idle.el with semantic-idle-tag-highlight being
>> pretty simple.
>
> I made semantic-breadcrumbs-minor-mode into an idle service and it
> worked like a charm. The sluggishness produced by the post-command-hook
> -version is (as expected) gone.

Good news.

>> You may want to consider a "fast" answer, and a "detailed" answer
>> solution.  The immediate feedback variant would use the 'fast' answer,
>> and an idle mode could then enable a better answer later.
>
> For me, the feedback from the idle service seems fast enough, but I only
> did very limited testing.
>
> Please let me know whether the attached patch can be applied (provided I
> add docstrings and clean up, of course).

Having more modes is always good.  I'm not fond of the 'breadcrumb' name 
though.  It doesn't tell me what it does.  Not that stickyfunc is much 
better, of course.  In the case of this mode, it seems like it would be 
the end-all variant of "show me the tag under the cursor" feature. 
(Continue reading)

Jan Moringen | 7 Apr 2010 02:36
Picon
Picon

Re: Replacement for which-func advise

Hi.

> > Btw, I noticed a possible inconsistency in the scope analysis code. Some
> > languages, like Java or Common Lisp for example, have a non-lexical
> > package/namespace declaration construct (Python is even more difficult,
> > because containing directories and their contents matter):
> >
> > package foo.bar;
> >
> > in Java and
> >
> > (in-package :foo)
> >
> > in Common Lisp. These do not show up in the parents slots of the scope
> > object. In my opinion, it would be useful to have them there. Or should
> > the scope be understood to strictly describe the lexical structure of
> > the code?
> 
> These languages probably need to create an override function for 
> semantic-ctxt-imported-packages.  The one in semantic-c.el shows it 
> getting a bunch of using statements.

I looked at semantic-ctxt-imported-packages and the C++ overload and I
think it does something different since it analyzes "using" tags. In the
Java and Common Lisp cases above, the package and in-package
declarations imply that textually following tags are logically nested in
the specified package (although not textually). This is similar to the
srecode template grammar in which templates are placed in contexts
without being lexically contained.

(Continue reading)

Jan Moringen | 7 Apr 2010 03:17
Picon
Picon

Re: Replacement for which-func advise

Hi.

> >> You may want to consider a "fast" answer, and a "detailed" answer
> >> solution.  The immediate feedback variant would use the 'fast'
> >> answer, and an idle mode could then enable a better answer later.
> >
> > For me, the feedback from the idle service seems fast enough, but I
> > only did very limited testing.
> >
> > Please let me know whether the attached patch can be applied
> > (provided I add docstrings and clean up, of course).
>
> Having more modes is always good.  I'm not fond of the 'breadcrumb'
> name though. It doesn't tell me what it does. Not that stickyfunc is much
> better, of course. In the case of this mode, it seems like it would
> be the end-all variant of "show me the tag under the cursor" feature.=20
> Giving it a clean name like 'show-current-tag-name' or something
> similar seems important for discover-ability.

I think it is the canonical name of the user-interface design pattern
(see http://en.wikipedia.org/wiki/Breadcrumb_(navigation)). It doesn't
have to be breadcrumbs for me thought. After all, names in Emacs are
expected to be non-standard, aren't they? ;)

How about show-path-to-current-tag, show-nesting-of-current-tag or
show-current-tag-with-parents?

> Also, this bit:
>
> +(defcustom semantic-idle-breadcrumbs-format-tag-function
> +  #'semantic-format-tag-abbreviate
> +  "*"
> +  :group 'semantic
> +  :type  'function)
>
> There is a special custom type for formatting tag functions.  Here is
> an example:
>
> (defcustom semantic-idle-summary-function
>    'semantic-format-tag-summarize-with-file
>    "Function to call when displaying tag information during idle time.
> This function should take a single argument, a Semantic tag, and
> return a string to display.
> Some useful functions are found in `semantic-format-tag-functions'."
>    :group 'semantic
>    :type semantic-format-tag-custom-list)

Done.

> There is also a header line prefix.  The stickyfunc code has a way to=20
> calculate the prefix that might work for you if the X: is just a
> spacer, as opposed to meaning something.

I used the value of the stickyfunc custom option as default. This is not
optimal since it depends on the evaluation order, but I didn't want to
just copy the code.

> Other than that, things look pretty good to me after a quick read.

So is it OK to commit this version?

Jan

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cedet-devel mailing list
Cedet-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-devel
Eric M. Ludlam | 8 Apr 2010 13:33
Gravatar

Re: Replacement for which-func advise

On 04/06/2010 08:36 PM, Jan Moringen wrote:
>> This solution is  similar to what we'd get if we added a new
>> >  semantic-ctxt function that would, in Java's case, just be the
>> >  find-tags-by-class code.  We would then need to find all the necessary
>> >  locations to apply it.
> Wouldn't the function in question be (the already existing function)
> semantic-analyze-scope-nested-tags? This is what I currently do for
> Java:
>
> +(define-mode-local-override semantic-analyze-scope-nested-tags
> +  java-mode (position scopetypes)
> +  "Maybe add package declaration to list of parents."

I think you have just shown that I can't remember my own API anymore. ;)

Perhaps I didn't understand your question, which was:

 > > in Common Lisp. These do not show up in the parents slots of the scope
 > > object. In my opinion, it would be useful to have them there. Or should
 > > the scope be understood to strictly describe the lexical structure of
 > > the code?

So where you instead asking, should code that uses a 'package' statement 
followed by a function/method definition that is now in 'package' be 
modified to show that it is indeed a part of package?

In that case, the rule so far as been that the tag structure map as 
directly as possible to what is syntactically in the buffer as opposed 
to what is logically in the buffer.  The premise being that if you come 
to a tag list for some language there is a deterministic mapping.  That, 
in turn, means you can use srecode to regenerate the essence of a tag 
list as code from a tag list.

That said, I don't feel so strongly as to not allow variation.  It's 
just easier not to when it comes to developing a parser.

Your solution in the scope is a fine thing to do where the :parent is 
added to the tag, especially since you are cloning the tag first, 
leaving the buffer tag list alone.

You also asked:
 > What do :parent attributes do? I thought, the nesting of tags is
 > described by having children in the :members attribute of their parents.

In C++, this is like:

void namespace1::class2::method1() {};

so it is the name of some namespace/class where that method belongs.  In 
EIEIO, it is any method definition.

That parent tag is looked up to see if that thing belongs to some other 
type, and they will be gathered together in the typecache as if they had 
been parsed that way, making a more easily searched structure.

Thanks
Eric

Eric

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Eric M. Ludlam | 8 Apr 2010 20:27
Gravatar

Re: Replacement for which-func advise

On 04/06/2010 09:17 PM, Jan Moringen wrote:
> Hi.
>
>  > >> You may want to consider a "fast" answer, and a "detailed" answer
>  > >> solution. The immediate feedback variant would use the 'fast'
>  > >> answer, and an idle mode could then enable a better answer later.
>  > >
>  > > For me, the feedback from the idle service seems fast enough, but I
>  > > only did very limited testing.
>  > >
>  > > Please let me know whether the attached patch can be applied
>  > > (provided I add docstrings and clean up, of course).
>  >
>  > Having more modes is always good. I'm not fond of the 'breadcrumb'
>  > name though. It doesn't tell me what it does. Not that stickyfunc is much
>  > better, of course. In the case of this mode, it seems like it would
>  > be the end-all variant of "show me the tag under the cursor" feature.=20
>  > Giving it a clean name like 'show-current-tag-name' or something
>  > similar seems important for discover-ability.
>
> I think it is the canonical name of the user-interface design pattern
> (see http://en.wikipedia.org/wiki/Breadcrumb_(navigation)). It doesn't
> have to be breadcrumbs for me thought. After all, names in Emacs are
> expected to be non-standard, aren't they? ;)
>
> How about show-path-to-current-tag, show-nesting-of-current-tag or
> show-current-tag-with-parents?

Ok, I guess I'm ok with breadcrumbs.  I didn't realize it was all 
official and stuff.  I've been tending for the long descriptive names 
lately is all.

>  > Other than that, things look pretty good to me after a quick read.
>
> So is it OK to commit this version?

I tried your patch, and it does not load.  You have a function being 
used in a menu definition before the function is defined.

That got me looking at the menu.  There is a function in senator that I 
use everywhere for creating menu items that are compatible between Emacs 
and XEmacs.

If the default is the mode line, then we should use this mode instead of 
which-func in semantic-load.el.  If the default is the header-line, I 
wonder how to make it easy to choose between this and stickyfunc mode.

Thanks
Eric

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Jan Moringen | 9 Apr 2010 00:28
Picon
Picon

Re: Replacement for which-func advise

Hi,

I updated the patch as described below.

> > So is it OK to commit this version?
> 
> I tried your patch, and it does not load.  You have a function being 
> used in a menu definition before the function is defined.

I placed the function in front of the menu definition (and turned it
into a macro).

> That got me looking at the menu.  There is a function in senator that I 
> use everywhere for creating menu items that are compatible between Emacs 
> and XEmacs.

Menu items are now defined using `senator-menu-item'. As a result,
senator has to be required.

Also new: definition of a senator menu entry in senator.el.

> If the default is the mode line, then we should use this mode instead of 
> which-func in semantic-load.el.  If the default is the header-line, I 
> wonder how to make it easy to choose between this and stickyfunc mode.

[repeated here for the mailing list] Currently, the default is the
header line. The mode line variant does not work properly yet. Modifying
the mode line in a portable way that does not interfere with other modes
seems rather hard. Maybe I can take that part from which-func.

Kind regards,
Jan
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cedet-devel mailing list
Cedet-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-devel
Eric M. Ludlam | 9 Apr 2010 02:32
Gravatar

Re: Replacement for which-func advise

Hi Jan,

On 04/08/2010 06:28 PM, Jan Moringen wrote:
> Hi,
>
> I updated the patch as described below.
>
>>> So is it OK to commit this version?
>>
>> I tried your patch, and it does not load.  You have a function being
>> used in a menu definition before the function is defined.
>
> I placed the function in front of the menu definition (and turned it
> into a macro).
>
>> That got me looking at the menu.  There is a function in senator that I
>> use everywhere for creating menu items that are compatible between Emacs
>> and XEmacs.
>
> Menu items are now defined using `senator-menu-item'. As a result,
> senator has to be required.
>
> Also new: definition of a senator menu entry in senator.el.

Good idea, thanks.

>> If the default is the mode line, then we should use this mode instead of
>> which-func in semantic-load.el.  If the default is the header-line, I
>> wonder how to make it easy to choose between this and stickyfunc mode.
>
> [repeated here for the mailing list] Currently, the default is the
> header line. The mode line variant does not work properly yet. Modifying
> the mode line in a portable way that does not interfere with other modes
> seems rather hard. Maybe I can take that part from which-func.

It would probably be good to finish it.  I'm not sure how which-func 
mode works either.

If you suspect this breadcrumb mode will continue to grow with different 
places to display the crumb, different formats to display the crumb, and 
different features for the menu items on the crumbs, then it would be 
good to put it into it's own file.  The other idle modes in 
semantic-idle.el are all much shorter already.

Eric

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Eric M. Ludlam | 9 Apr 2010 04:40
Gravatar

Long checkin for CEDET today.

I finally figured out the macro needed to get interactive-p replaced in 
CEDET with the new called-interactively-p with an argument as needed in 
Emacs pretest.  I then used semantic-symref to do a mass replacement, 
and checked in all the changes.

Please try this out in different Emacsen with different variants of 
these interactive predicates.  That would be very handy and help 
validate all the changes.  I was using 23.1.  Thanks!

I also added a new refactoring tool into semantic-symref to get this 
done.  This time it is a define/execute macro command.  One key will 
position the cursor so you can create a keyboard macro.  When you are 
done, you can execute the macro and it will run that macro on all open 
hits.  Watching it mass-edit so much code in under a second is very 
cool!  Give it a try next time you need to rename something, or change 
the arguments to something, or just about anything a something.

Enjoy
Eric

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Granville Barnett | 13 Apr 2010 13:08
Gravatar

Configuring Cedet for large projects? (Apologies if this is the wrong mailing list)

Hi,

I'm trying to get Cedet 1 pre7 to work well while I'm hacking on the Linux kernel - my results are somewhat erratic at the moment, however.

I have done the following:

- Setup Cedet to use GNU Global
- Created Global databases for the kernel source code (I've also generated databases for /usr/include and /usr/local/include)
- Created an Ede project listing a few include directories

(I've used some of the configuration settings from http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html as the basis for my Cedet configuration.)

Now when I go to jump to definitions (using fast jump) I sometimes jump to the correct location but other times I just get a  message stating that no buffer information exists for a particular symbol. I'm not a pro Cedet user, in fact I've only recently started to use it, but I thought that when one delegated symbol information to Global then it should use Global for jumping so I'm not entirely sure what this message means.

Also, if anyone has any guidance on how to best use Cedet with large codebases I would very much like to hear from them.

Any help would be most appreciated.

Kind regards,

Granville


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cedet-devel mailing list
Cedet-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-devel

Gmane