On Thursday 19 June 2008 01:31, Eric M. Ludlam wrote:
> >>> Michael Reiher <redm@...> seems to think that:
> >On Wednesday 11 June 2008 03:58, Eric M. Ludlam wrote:
> >> >> After semantic has parsed a file, you can right-click on any include,
> >> >> and get a context menu which is good for debugging include paths. If
> >> >> not, you need to get semantic-decorate-include working. (It should
> >> >> if you enable decorations.)
> >> >
> >> >Hmm, it doesn't. Maybe this is some autoload problem?
> >> >
> >> >semantic-decoration-styles is only:
> >> >(("semantic-decoration-on-protected-members")
> >> >("semantic-decoration-on-private-members") ("semantic-tag-boundary" .
> >> > t))
> >> >
> >> >Though it probably should contain semantic-decoration-on-includes as
> >> > well, right? Then the question is why it doesn't...? I'm using XEmacs,
> >> > but it seems to be the same with GNU Emacs 21.4.
> >> Odd. If you have been making incremental CVS updates for a while, the
> >> autoloads for the decoration-include registration may have gotten
> >> missed. A full rebuild should get that working... unless you had
> >> turned it off at some point.
> >A full rebuild shows no changes, still doesn't load. Also I don't see
> > where I might have turned that off.
> Ok, I'm beginning to remember. This routine is loaded in via
> semantic-load-enable-gaudy-code-helpers, so if you have hand-enabled
> various modes, you would need to have some lines like:
> (global-semantic-decoration-mode 1)
> (require 'semantic-decorate-include)
> to get it to turn on.
> I was in error when I thought it was related to autoloads.
Ah I see, I had excessive code helpers turned on, but that doesn't cover
decoration mode ... with gaudy code helpers it all loads fine. Actually the
odd thing was just, that some other decorations were loaded, but not the
include deco, which confused me.
> >When I manually load semantic-decorate-include in XEmacs and turn on
> > decorate mode, I get (See backtrace below):
> >"No such face: region"
> >Hmm.. so when I take out:
> >(semantic-overlay-put ol 'mouse-face 'region)
> >in semantic-decorate-include.el, it seems to load fine.
> Does anyone know of a face name in both Emacs and XEmacs that is good
> for a generic mouse-face?
How about "highlight"? If I see it right also ECB uses this for mouse over
highlights. That's what you do here, right?
> >Now just how do I get this context menu?? What should be bound to my 3rd
> > mouse button? Atm. it's popup-mode-menu, which pops up ... well, some
> > mode menu, with e.g. the Senator menu in it.
> Ah. XEmacs. There are a bunch of functions in
> semantic-decorate-include that use `popup-menu' which, I would guess,
> is Emacs only. Someone who knows XEmacs would need to add a
> compatibility layer to make the menus popup.
Ah, I see... Hmm, there is a popup-menu function in XEmacs as well (see help
text at the end of this mail), it seems different though from the GNU Emacs
one. It looks however very similay to what you do with the
easy-menu-defines ... In general it doesn't look too complicated getting this
to work, I might even give it a try.. unfortunately I have absolutly no time
for this atm., so (from my side) it has to wait. Anyway, having the
highlights is already very helpful!
`popup-menu' is a built-in function
(popup-menu MENU-DESCRIPTION &optional EVENT)
Pop up the menu described by MENU-DESCRIPTION.
A menu description is a list of menu items, strings, and submenus.
The first element of a menu must be a string, which is the name of the menu.
This is the string that will be displayed in the parent menu, if any. For
toplevel menus, it is ignored. This string is not displayed in the menu
If an element of a menu is a string, then that string will be presented in
the menu as unselectable text.
If an element of a menu is a string consisting solely of hyphens, then that
item will be presented as a solid horizontal line.
If an element of a menu is a list, it is treated as a submenu. The name of
that submenu (the first element in the list) will be used as the name of the
item representing this menu on the parent.
Otherwise, the element must be a vector, which describes a menu item.
A menu item can have any of the following forms:
[ "name" callback <active-p> ]
[ "name" callback <active-p> <suffix> ]
[ "name" callback :<keyword> <value> :<keyword> <value> ... ]
The name is the string to display on the menu; it is filtered through the
resource database, so it is possible for resources to override what string
is actually displayed.
If the `callback' of a menu item is a symbol, then it must name a command.
It will be invoked with `call-interactively'. If it is a list, then it is
evaluated with `eval'.
The possible keywords are this:
:active <form> Same as <active-p> in the first two forms: the
expression is evaluated just before the menu is
displayed, and the menu will be selectable only if
the result is non-nil.
:suffix <form> Same as <suffix> in the second form: the expression
is evaluated just before the menu is displayed and
resulting string is appended to the displayed name,
providing a convenient way of adding the name of a
command's ``argument'' to the menu, like
``Kill Buffer NAME''.
:keys "string" Normally, the keyboard equivalents of commands in
menus are displayed when the `callback' is a symbol.
This can be used to specify keys for more complex menu
items. It is passed through `substitute-command-keys'
:style <style> Specifies what kind of object this menu item is:
nil A normal menu item.
toggle A toggle button.
radio A radio button.
The only difference between toggle and radio buttons is
how they are displayed. But for consistency, a toggle
button should be used when there is one option whose
value can be turned on or off, and radio buttons should
be used when there is a set of mutually exclusive
options. When using a group of radio buttons, you
should arrange for no more than one to be marked as
selected at a time.
:selected <form> Meaningful only when STYLE is `toggle' or `radio'.
This specifies whether the button will be in the
selected or unselected state.
[ "Save As..." write-file t ]
[ "Revert Buffer" revert-buffer (buffer-modified-p) ]
[ "Read Only" toggle-read-only :style toggle :selected buffer-read-only ]
See menubar.el for many more examples.