David PONCE | 8 Jan 2004 16:56
Picon

Re: Lexical safety

Hi Eric,

[...]
> I also used this feature in senator's extension to hippie expand.
> This way if you type:
> 
>   funcall(boo
> 
> and hit hippie-expand, the old behavior was to mark everything as
> unmatched syntax starting with the function you were in.  Bad bad
> bad.  Now a quick use of the lexical safety macro puts the buffer
> into the 'unparseable' state, so all searches use the cache.  Once an
> element is found as replacement, the buffer reverts to being merely
> out of date.  Nifty.
[...]

I encountered a little problem with the senator's extension to hippie
expand when semantic-lex throws a lexical error.  In some cases the
point is not preserved by `semantic-lex-catch-errors' and hippie
expand fails to try other completion methods.

The following patch seemed to have fixed the issue.  However I am not
sure it is the right thing to do.  What do you think?  Can I commit
it?

David

Index: semantic-lex.el
===================================================================
RCS file: /cvsroot/cedet/cedet/semantic/semantic-lex.el,v
(Continue reading)

Eric M. Ludlam | 8 Jan 2004 19:10
Gravatar

Re[2]: Lexical safety

Your patch makes good sense.  The only other place to do that is
within the lexer, restoring state on a throw.  The problem then would
be that determining the location of lexical issues would be difficult.

Please do check in your fix.

Eric

>>> David PONCE <david.ponce <at> wanadoo.fr> seems to think that:
>Hi Eric,
>
>[...]
>> I also used this feature in senator's extension to hippie expand.
>> This way if you type:
>> 
>>   funcall(boo
>> 
>> and hit hippie-expand, the old behavior was to mark everything as
>> unmatched syntax starting with the function you were in.  Bad bad
>> bad.  Now a quick use of the lexical safety macro puts the buffer
>> into the 'unparseable' state, so all searches use the cache.  Once an
>> element is found as replacement, the buffer reverts to being merely
>> out of date.  Nifty.
>[...]
>
>I encountered a little problem with the senator's extension to hippie
>expand when semantic-lex throws a lexical error.  In some cases the
>point is not preserved by `semantic-lex-catch-errors' and hippie
>expand fails to try other completion methods.
>
(Continue reading)

Eric M. Ludlam | 8 Jan 2004 22:29
Gravatar

Doc

I mentioned on this mailing list a long time ago that the semantic doc
should be split into separate info files.  I have done this and check
in the resulting files and project/makefiles too.

Please poke through them to make sure I didn't mess anything up too
much.

Thanks
Eric

--

-- 
          Eric Ludlam:                 zappo <at> gnu.org, eric <at> siege-engine.com
   Home: http://www.ludlam.net            Siege: www.siege-engine.com
Emacs: http://cedet.sourceforge.net               GNU: www.gnu.org

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
David PONCE | 9 Jan 2004 11:32
Picon

semantic-load fix

Hi Eric,

Since your latest change in semantic-load.el, when I start Emacs I
get this message: "Symbol's value as variable is void:
Info-directory-list".

IMO it would be better to setup `Info-default-directory-list' instead
of 'Info-directory-list' in semantic-load.  As the documentation says
"If nil, meaning not yet initialized, Info uses the environment
variable INFOPATH to initialize it, or `Info-default-directory-list'
if there is no INFOPATH variable in the environment, or the
concatenation of the two if INFOPATH ends with a colon."

Also I think it would be more portable to use `expand-file-name'
instead of `concat' to produce directory names.

What do you think of the following patch?

David

Index: semantic-load.el
===================================================================
RCS file: /cvsroot/cedet/cedet/semantic/semantic-load.el,v
retrieving revision 1.39
diff -c -r1.39 semantic-load.el
*** semantic-load.el	8 Jan 2004 21:47:03 -0000	1.39
--- semantic-load.el	9 Jan 2004 10:29:49 -0000
***************
*** 32,40 ****
  ;;; Add parser and doc directories
(Continue reading)

Eric M. Ludlam | 9 Jan 2004 14:37
Gravatar

Re[1]: semantic-load fix

Hi David,

  I discovered the same problem after I restarted my Emacs, and when I
looked into info.el to see what I should do, I came up with this
patch:

*** semantic-load.el.~1.39.~	Thu Jan  8 16:47:03 2004
--- semantic-load.el	Thu Jan  8 21:01:23 2004
***************
*** 34,40 ****
  (let ((dir (file-name-directory (locate-library "semantic"))))
    (add-to-list 'load-path (concat dir "bovine"))
    (add-to-list 'load-path (concat dir "wisent"))
!   (add-to-list 'Info-directory-list (concat dir "doc"))
    )

  ;;; Some speedbar major modes
--- 34,41 ----
  (let ((dir (file-name-directory (locate-library "semantic"))))
    (add-to-list 'load-path (concat dir "bovine"))
    (add-to-list 'load-path (concat dir "wisent"))
!   (eval-after-load "info"
!     `(add-to-list 'Info-additional-directory-list ,(concat dir "doc")))
    )

  ;;; Some speedbar major modes

The purpose of 'Info-additional-directory-list' seemed like the right
thing to do.  As I examine the doc more closely, your idea seems
better.
(Continue reading)

Eric M. Ludlam | 10 Jan 2004 00:36
Gravatar

semantic-idle-summary-mode

I made some improvements to semantic-idle-summary-mode.
The changes reached out into different parts of semantic, fixing bugs
to get things to work more reliably.

Semanticdb searching was fixed up to better use project roots.
Dependency locating was fixed to handle cases where include tags were
not in a buffer.

Finally, the semantic idle summary mode was updated to first check
for keywords.  It used to do a semantic search, then look for
keywords.  This should speed things up.

Second, it uses semantic-analyze to determine the local context, then
uses what it finds for the message.

Lastly, it does a deep search as it did before to identify the symbol
under the cursor.

I tried it out in some C code I have here and it works very well.
It needs a system database for C code headers still.  I tried turning
those on in the search and it made things unbearably slow still.

Try it out in your favorite language (except Emacs Lisp, of course.)

Thanks
Eric

--

-- 
          Eric Ludlam:                 zappo <at> gnu.org, eric <at> siege-engine.com
   Home: http://www.ludlam.net            Siege: www.siege-engine.com
(Continue reading)

Eric M. Ludlam | 10 Jan 2004 02:35
Gravatar

idle completions mode

Hi,

  I wrote a new idle service called `semantic-idle-completions-mode'.
This mode works in conjunction with the summary mode I wrote about
earlier.

  This mode calculates the completion list (as specified by
`semantic-analyze-possible-completions') and displays it in a tooltip.

  In theory, a keybinding for `semantic-ia-complete-symbol' would then
cycle through what is displayed in the tooltip.

  This created a need for a new function `semantic-unique-tag-table-by-name'
to help cut down on cruft in the limited (max 5) real estate.  I also
found a pretty serious bug in the idle scheduler.  (It cycled forever
over the first entry in the queue!)

  Because the mode-line is already in use, this will only work if
actual tool-tips are available and tooltip mode is on.  Does anyone
think that is too limiting?

  Special thanks to Masatake YAMATO <jet <at> gyve.org> who wrote the first
tag display in a tooltip device for completion mode which I recycled
here.

  Please try out this nifty new feature in your favorite language.

Thanks
Eric

(Continue reading)

David PONCE | 12 Jan 2004 14:24
Picon

A semantic-idle fix

Hi Eric,

Here is a small patch to semantic-idle that fixes customization
problems with the new idle scheduler mode.

If you don't have objection, I will check it in.

David

2004-01-12  David Ponce  <david <at> dponce.com>

	* cedet/semantic/semantic-idle.el

	(global-semantic-idle-scheduler-mode): defcustom requires
	semantic-idle instead of semantic-util-modes.
	(define-semantic-idle-service): Likewise.
	(semantic-idle-scheduler-mode): Add autoload cookie.
	
Index: semantic-idle.el
===================================================================
RCS file: /cvsroot/cedet/cedet/semantic/semantic-idle.el,v
retrieving revision 1.7
diff -c -r1.7 semantic-idle.el
*** semantic-idle.el	10 Jan 2004 01:26:31 -0000	1.7
--- semantic-idle.el	12 Jan 2004 13:18:53 -0000
***************
*** 88,94 ****
    "*If non-nil, enable global use of idle-scheduler mode."
    :group 'semantic
    :type 'boolean
(Continue reading)

Eric M. Ludlam | 12 Jan 2004 16:23
Gravatar

Re[1]: A semantic-idle fix

Thanks for identifying that.  It looks good.

Eric

>>> David PONCE <david.ponce <at> wanadoo.fr> seems to think that:
>Hi Eric,
>
>Here is a small patch to semantic-idle that fixes customization
>problems with the new idle scheduler mode.
>
>If you don't have objection, I will check it in.
>
>David
>
>2004-01-12  David Ponce  <david <at> dponce.com>
>
>	* cedet/semantic/semantic-idle.el
>
>	(global-semantic-idle-scheduler-mode): defcustom requires
>	semantic-idle instead of semantic-util-modes.
>	(define-semantic-idle-service): Likewise.
>	(semantic-idle-scheduler-mode): Add autoload cookie.
>	
>Index: semantic-idle.el
>===================================================================
>RCS file: /cvsroot/cedet/cedet/semantic/semantic-idle.el,v
>retrieving revision 1.7
>diff -c -r1.7 semantic-idle.el
>*** semantic-idle.el	10 Jan 2004 01:26:31 -0000	1.7
>--- semantic-idle.el	12 Jan 2004 13:18:53 -0000
(Continue reading)

David Ponce | 13 Jan 2004 20:33
Picon

Auto-generation of lexical analyzer

Hi Eric,

Attached you will find my first patch for semantic that implements
generation of lexical analyzers from specifications found in the
grammar :-)

For now, analyzers are generated only for token types which have the
`syntax' property set. So existing grammar shouldn't be impacted.
However, I would appreciate your feedback before to check that changes
in.

[As discussed in the "generic lexical analyzers" thread, the `syntax'
property should hold a regexp that matches a buffer substring based on
Emacs syntax classes.  That substring (one can see it as an sort of
"anchor" in the buffer) is then refined with lexical elements provided
by the grammar.]

I attached a sample grammar gr-test.wy that you can use to experiment
lexical analyzer generation ;-)

Following is a change log.

Enjoy!

David

2004-01-13  David Ponce  <david <at> dponce.com>

	* semantic/semantic-grammar-wy.el

(Continue reading)


Gmane