Arne Schmitz | 3 Nov 2010 10:51
Picon
Gravatar

Find references to tag feature suggestion

Hi everybody!

When I hit C-c , G to find references to a tag, Senator asks me a y/n question if I want to look for the tag under
the cursor. Saying no will cancel the whole operation. I think a much better interface would the way xgtags
handels this: let the user edit the tag in question in the minibuffer, defaulting to the tag under the
cursor. If the user just hits RET, it will use the default tag, if the user edits the tag first, it will use the
edited tag, if the user hits C-g, it will abort. It would be very nice to see this functionality in Semantic / Senator.

Best regards,

Arne Schmitz

--

-- 
Dipl.-Inform. Arne Schmitz              Phone   +49 (0)241 80-21817
Computer Graphics Group                 Mobile  +49 (0)151 29145947
RWTH Aachen University                  Fax     +49 (0)241 80-22899
Ahornstrasse 55, 52074 Aachen, Germany  http://www.rwth-graphics.de

------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware, 
phishing sites, and compromised hosts - saving your company time, 
money, and embarrassment.   Learn More! 
http://p.sf.net/sfu/hpdev2dev-nov
Arne Schmitz | 4 Nov 2010 19:24
Picon
Gravatar

Question about semantic-complete-jump(-local)

And I have another question: How does semantic-complete-jump choose the symbol to jump to? E.g. in Python I
have expressions like:

	self.someFunction()

When the cursor is somewhere on someFunction, semantic-complete-jump will still suggest to jump to self,
which is rather useless. Can I change this behaviour, to get it to suggest someFunction instead?

Best regards,

Arne Schmitz

--

-- 
Dipl.-Inform. Arne Schmitz              Phone   +49 (0)241 80-21817
Computer Graphics Group                 Mobile  +49 (0)151 29145947
RWTH Aachen University                  Fax     +49 (0)241 80-22899
Ahornstrasse 55, 52074 Aachen, Germany  http://www.rwth-graphics.de

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
fajfusio | 8 Nov 2010 11:27
Picon
Favicon

Re: not to parse system libraries

Dnia 26-10-2010 o godz. 9:46 David Engster napisał(a):
> 'fajfusio' writes:
> > Looks like I found the necessary command:
> > (semantic-remove-system-include "/usr/include/" 'c++-mode)
> >
> > Unfortunately it works only when I execute it directly in emacs. It does
> > not
> > have an effect in ~/.emacs file.
> 
> Did you try the solution I posted last week?
>     
> -David

The final solution that workes to me is as follows:
(add-hook 'semantic-init-hooks 'semantic-reset-system-include)

Great thanks for all your suggestions and patience.

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
fajfusio | 8 Nov 2010 11:29
Picon
Favicon

binding a semantic-mrub-switch-tag to a key

Hi

I would like to bind semantic-mrub-switch-tag to F5 key.
I put the following to an ~/.emacs:

(define-key global-map [f5]  'semantic-mrub-switch-tag)

Unfortunately when I press F5 it does not switch back to a previous tag 
and I
get the following message:
Symbol's function definition is void: semantic-mrub-switch-tag

M-x semantic-mrub-switch-tag
works fine.

Do you know how can I map it to a F5 key ?
The best solution to me would be just to switch back to a previous tag 
without
asking any question.
Great thanks for help

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
fajfusio | 8 Nov 2010 11:30
Picon
Favicon

semantic, parsing source code on demand

Hi

How may I force semantic to parse source code on demand.
I would like semantic to do a big work on demand. A big work that is 
done after
idle time configurable in: semantic-idle-scheduler-work-idle-time.

Great thanks for help.

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
Nate Schley | 8 Nov 2010 18:06
Picon

Re: semantic looking up tags with cursor placed in code comments or strings

Eric,

I have the idle scheduler config'd for reasons you explained.  I have
 '(semantic-idle-scheduler-idle-time 5)
in my .emacs, but there's a correlation between my placement of the cursor in a comment/string, and Semantic's *immediate* commencement of parsing.  It's not like I place the cursor, pause to think what I'm going to do for so many seconds, and then see the parser working...  It's as if the parser activates in response to my placing the point.

It occurred to me that the issue may be with ECB.  I use its fairly new "symboldef" buffer.  I suspect now that ECB is reacting to my point placement, and (ecb-symboldef-find-definition) is triggering the reparse without paying attention to the context of the point's location.  This seems to be the case; there seems to be no check for context in the function.  The issue, does, however, come back to a question about semantic...

ecb-symboldef.el does have a commented code block that employs (semantic-analyze-current-context).  I evaluated that with the point in a comment, on the name of the .h file I was browsing.  I don't understand the meaning of the come-back, but it appears that semantic is digesting the location as if it were code:

I put the cursor "FooClass" on the line
  |// FILE:        FooClass.h
and on the line
  |class FooClass {
The comeback from (semantic-analyze-current-context) was
  |[object semantic-analyze-context "context"
  |        (98 . 111)
  |        (
  |         ("FooClass" type
  |          (:members ... :type "class")
  |          (:filename "w:/project/foo/include/FooClass.h")
  |          [2715 3238]))
  |        (type)
  |        nil ........

The only difference was what I've broken out as the 2nd line, which seems to be the range of the word in which the point lies.  So, it appears Semantic *will* look up words in comments as if they were "live" code.

Questions to you: 
1.  is the behavior of (semantic-analyze-current-context) correct & desirable?  I would think not.
2.  Is there a better way to determine if the context of (point) is code (and not "string" or "comment")?

BTW, I wrote the draft of this email on around 10/1, so if (semantic-analyze-current-context) has changed, please disregard

2010/9/30 Eric M. Ludlam <eric <at> siege-engine.com>
Hi,

Semantic will go off and do work, even when in knows there is nothing to do.  It is basically pre-parsing files for you, and that work is not related to comments or strings.

If you have a particularly large code base, and you would rather wait when you ask for something instead of the idle interruptions, you should turn off the following:

semantic-idle-work-parse-neighboring-files-flag
semantic-idle-work-update-headers-flag

You could also just move out when it happens here:

semantic-idle-scheduler-work-idle-time

I posted on stackoverflow about this recently on a question with an Emacs tag.  I need to get that info merged into the CEDET info file still.

Eric


On 09/30/2010 09:54 AM, Nate Schley wrote:
Eric,

I find that often, when place the cursor in // a code comment
 or "a literal string", I find myself waiting for semantic to digest
gobs of files in an apparent attempt to look up what should be ignored.
Happily, ^G works eventually, but it is an interruption to the workflow.

As an enhancement to your excellent SW, may I suggest first checking to
see if the point lies in a comment or literal string before charging off
into the look-up task.

FWIW, I'm working in C++ with more kSLOCs than you can shake a stick at.
--
Thanks,

Nate




--
Thanks,

Nate
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
cedet-semantic mailing list
cedet-semantic <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cedet-semantic
Eric M. Ludlam | 11 Nov 2010 00:09
Gravatar

Re: Question about semantic-complete-jump(-local)

On 11/04/2010 02:24 PM, Arne Schmitz wrote:
> And I have another question: How does semantic-complete-jump choose the symbol to jump to? E.g. in Python
I have expressions like:
>
> 	self.someFunction()
>
> When the cursor is somewhere on someFunction, semantic-complete-jump will still suggest to jump to
self, which is rather useless. Can I change this behaviour, to get it to suggest someFunction instead?

If you use:

M-x semantic-analyze-current-context RET

you will get a buffer that shows the interpreted prefix.  If it says 
something like this in the buffer:

Prefix: moose self
         "someFunction"

that means if found a variable called 'self' of type moose, but has no 
idea what someFunction is.  In this case, it will fall back to just 
going to wherever self is.

Use:

M-x semantic-analyze-debug-assist RET

to identify more details about the code that is having issues.

In the case of python, I suspect that analyzer support there is 
incomplete.  Someone posted a question about imports today not working. 
  Fixing that might help get this working for python, but it could be 
anything.  I don't know python, so it will take a python & Emacs hacker 
to finish the python support.

Eric

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
Eric M. Ludlam | 11 Nov 2010 00:24
Gravatar

Re: not to parse system libraries

On 11/08/2010 05:27 AM, fajfusio <at> wp.pl wrote:
> Dnia 26-10-2010 o godz. 9:46 David Engster napisał(a):
>> 'fajfusio' writes:
>>> Looks like I found the necessary command:
>>> (semantic-remove-system-include "/usr/include/" 'c++-mode)
>>>
>>> Unfortunately it works only when I execute it directly in emacs. It does
>>> not
>>> have an effect in ~/.emacs file.
>>
>> Did you try the solution I posted last week?
>>
>> -David
>
> The final solution that workes to me is as follows:
> (add-hook 'semantic-init-hooks 'semantic-reset-system-include)
>
> Great thanks for all your suggestions and patience.

If someone wants to create a patch for an option that makes this easier; 
ie - via EDE or other, that would make this easier for the next guy.

Thanks
Eric

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
Eric M. Ludlam | 11 Nov 2010 00:32
Gravatar

Re: binding a semantic-mrub-switch-tag to a key

On 11/08/2010 05:29 AM, fajfusio <at> wp.pl wrote:
> Hi
>
> I would like to bind semantic-mrub-switch-tag to F5 key.
> I put the following to an ~/.emacs:
>
> (define-key global-map [f5]  'semantic-mrub-switch-tag)
>
> Unfortunately when I press F5 it does not switch back to a previous tag
> and I
> get the following message:
> Symbol's function definition is void: semantic-mrub-switch-tag
>
> M-x semantic-mrub-switch-tag
> works fine.

That is because the function ends in an 's' and M-x auto-completes for 
you when you press RET.

> Do you know how can I map it to a F5 key ?
> The best solution to me would be just to switch back to a previous tag
> without
> asking any question.

That seems like a fine thing to be able to do.  A command that cycles 
backward through the mrub list would be pretty cool.  The issue is that 
it will be incomplete!  The mrub list is constantly resorted, and 
duplicates expunged, making the end result a bit less deterministic.

If someone wants to submit a patch, that would be great.  Here is a 
quick hack that vaguely works.  Fix it up as needed:

(defun semantic-mrub-switch-to-mr-tag ()
   "Switch to the most recently visited tag that is not the current tag.
Selects the new tag from the most recently used tags list."
   (interactive)
   (if (ring-empty-p (oref semantic-mru-bookmark-ring ring))
       (error "Semantic Bookmark ring is currently empty"))
   (let* ((ring (oref semantic-mru-bookmark-ring ring))
	 (alist (semantic-mrub-ring-to-assoc-list ring))
	 (first (cdr (car alist))))
     (semantic-mrub-push semantic-mru-bookmark-ring
			(point)
			'jump)
     (semantic-mrub-visit first)
     ))

Eric

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
Eric M. Ludlam | 11 Nov 2010 00:33
Gravatar

Re: semantic, parsing source code on demand

On 11/08/2010 05:30 AM, fajfusio <at> wp.pl wrote:
> Hi
>
> How may I force semantic to parse source code on demand.
> I would like semantic to do a big work on demand. A big work that is
> done after
> idle time configurable in: semantic-idle-scheduler-work-idle-time.

Semantic already does this in the work timer.  It will parse all files 
near the current buffer in idle time.

If you would like to somehow add a file to a queue of things to parse, 
then just load that file into a buffer, and it will get parsed in idle 
time after the given delay.

Eric

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev

Gmane