Re: [cedet-semantic] Completion-UI support for Semantic
Brought to you by:
zappo
From: Toby C. <ts...@ca...> - 2008-10-14 15:31:03
|
Hmmmm... M-TAB is bound in `completion-map', which is added to the `minor-mode-map-alist' when the completion-ui library is loaded. So either something is overriding that (a minor-mode map that appears earlier in the alist?), or the completion-UI library isn't actually being loaded at all. Easy test: try "M-x complete-word-at-point". If that fails, completion-UI isn't loaded. If it works, try "M-/" (or better still, "C-h k M-/" and check whether it's bound to `complete-word-at-point'). If that works, the M-TAB binding is being overridden by something else. Use "C-h k M-TAB" to see what might be doing this. In other words, I still believe this to be a simple configuration issue, and would like to rule this out before expending further effort on it :) I don't usually like adding `require' statements within function bodies, but perhaps in the case of the EmacsWiki code snippets, it might be a good idea. It would at least give an obvious error message and rule out some trivial issues. Toby Eric M. Ludlam wrote: > I just noticed that the default binding of M-TAB is `complete-symbol' > which has doc that says: > > --- > Perform tags completion on the text around point. > Completes to the set of names listed in the current tags table. > --- > > so it sounds like the keybinding M-TAB was never rebound to > completion-UI. > > Eric > >>>> Toby Cubitt <ts...@ca...> seems to think that: >> Hi Eric, >> >> Thanks for finally injecting some intelligent input into my wild >> speculations :) >> >> Completion-UI doesn't default to any kind of completion. Until you set >> the `completion-function' variable, it does absolutely nothing at all. >> So somewhere, someone would have to explicitly set `completion-function' >> to the etags wrapper function (in a .emacs?). But running >> `completion-setup-semantic' sets `completion-function' (buffer-locally), >> overriding whatever was there before. So I don't see how it >> completion-UI could be calling the etags wrapper instead of the Semantic >> one, unless someone told it to. >> >> I have this vague recollection that Semantic might use etags in some >> major-modes (elisp?). Does that recollection have any reflection in >> reality? Could that explain why it's complaining? >> >> Otherwise, the answer lies in a backtrace... >> >> Toby >> >> >> Eric M. Ludlam wrote: >>> Hi, >>> >>> The message: >>> >>> No tags table loaded; Try M-x visit-tag-table" >>> >>> is in complete-tag in etags.el. >>> >>> I assumed it was that the semantic setup for completion ui was not >>> reconfigured as expected, and completion-ui was defaulting to etags >>> completion instead. >>> >>> Eric >>> >>>>>> Toby Cubitt <ts...@ca...> seems to think that: >>>> Hi, >>>> >>>> There's little more I can add. "No tags table loaded" is not a >>>> completion-UI error message (grep the code if you don't believe me), so >>>> something else is responsible. And I can't reproduce this problem. I >>>> still suspect there's something not quite configured right in your buffer. >>>> >>>> If the code is throwing a lisp error (rather than just printing a >>>> message), you could `toggle-debug-on-error', repeat the steps that >>>> produce the error, and look at the backtrace to show you the function >>>> calls that caused the error. I still expect that it's one of the >>>> Semantic functions, but this would confirm it. >>>> >>>> Otherwise, you could edebug the completion-UI Semantic support code, and >>>> step through it to figure out where the problem occurs. >>>> >>>> If you still can't figure out what's going on, you could send me (off >>>> list) the contents of the backtrace, or details of the results of >>>> stepping through the code. >>>> >>>> >>>>> I'm sure semantic worked for me, as i can use company-mode properly and >>>>> semantic-ia-complete-symbol-menu to pop up a menu of completions. >>>> Company mode's Semantic support code is very, very similar to the >>>> completion-UI support code...except that it's surrounded by >>>> "(ignore-errors...)". So the fact that company-mode works doesn't tell >>>> me much :) >>>> >>>> The fact that `semantic-ia-complete-symbol-menu' works does seem to >>>> indicate that Semantic is correctly enabled, but I'm not familiar enough >>>> with Semantic to know what's going on without being able to reproduce >>>> the error myself... >>>> >>>> >>>>> what's more, i think allowing users to re-bind the function of M-TAB with >>>>> other keys will be more flexible since some users may use M-TAB to switch >>>>> between windows. >>>> Errmmmm...did you look at completion-UI? I know it's not documented very >>>> well, but it does most things in the conventional Emacs way...including >>>> binding keys in keymaps (imaginatively called `completion-map' etc.) >>>> which can be rebound to your heart's content. >>>> >>>> Moreover, M-/ is bound to the same command as M-TAB, for precisely the >>>> reason you cite. >>>> >>>> Toby >>>> >>>> >>>> >>>> >>>>>> Hi, >>>>>> >>>>>> bread wrote: >>>>>>> I tried M-TAB after M-x completion-setup-semantic , but i was told that >>>>>> "No >>>>>>> tags table loaded; Try M-x visit-tag-table"$B!#(B >>> >>> This is a CEDET error message, so has nothing to do with completion-UI. >>>>>> It sounds like you haven't enabled Semantic in the buffer. I'm not a >>>>>> Semantic expert, but you'll probably want to enable >>>>>> `semantic-idle-scheduler-mode' at least. >>>>>> >>>>>> If it still doesn't work, try getting Semantic to work in the buffer >>>>>> first, before trying to enable completion-UI. I recommend reading the >>>>>> INSTALL file that accompanies CEDET carefully... >>>>>> >>>>>> HTH, >>>>>> >>>>>> Toby |