Open zhro opened 9 years ago
Can't reproduce. The expected way for this to work is to have electric-pair-mode
on and call fa-show
when the point is inside the parens. Once you insert any character outside the parens, e.g. ";", the overlay will delete itself automatically.
I can confirm that if I turn on electric-pair-mode
and use fa-show
from within the parenthesis and complete the parameter list then syntax coloring works. However, the overlay does not remove itself when typing outside of the parenthesis afterwards; I have not yet seen this work.
If I invoke fa-show
for rect.set_values();
and then leave the parenthesis without adding any parameters, syntax coloring is again broken.
It seems as though function-args fa-show
does not work unless called from within an enclosed parenthesis (electric-pair-mode
as you said). The overlay will appear when called after an open-but-unclosed parenthesis but will not proceed through the list as commas are entered; it will not recognize the closing parenthesis being added later, and again appears to break syntax coloring.
I know that you said you can't reproduce. I can be available on Skype to do a screen share to demonstrate.
I still would like to see this fixed. :\
As I said, I can't do anything without a reproducible recipe. The error is likely in your config, unrelated to function-args
. Try to reproduce with emacs -Q
and only load function-args
.
In my first post I provided my slimmed .emacs config. There isn't anything there except for the bare essentials for testing.
I'm running Emacs under Windows/Cygwin. If I send you a complete working environment in a zip file (just run the a .bat) will you look at it?
I'm running Emacs under Windows/Cygwin. If I send you a complete working environment in a zip file (just run the a .bat) will you look at it?
Sorry, but I don't have Windows. I'll leave the issue open, maybe some other user can come up with a fix. Nothing else I can do, unless I get a reproducible recipe for GNU/Linux.
What flavor and version?
You mean GNU/Linux? It doesn't matter at all, they should work the same. I have Emacs 24.5.2 and Emacs 25 on Ubuntu 14.04, but I also fix bugs for Emacs 24.3, since it's provided by many package managers.
Clean install of ubuntu 15.04 in VMware Player 7.1.2 and same procedure as my first post results in the same problem: syntax coloring breaks. Please be sure to copy/paste and follow the instructions exactly. This version of Ubuntu comes with Emacs 24.4.1.
While in Ubuntu, although cedet loaded without error, I received the following error when attempting fa-show
:
Wrong type argument: listp, "rect"
There seems to be a problem with the built-in cedet in Ubuntu or perhaps it requires a slightly different configuration?
I corrected it by using the git head of the latest cedet and adding this to my .emacs:
(load-file "~/.emacs.d/cedet-git-head/cedet-devel-load.el")
(require 'cedet)
(require 'semantic)
(require 'semantic/ia)
(require 'semantic/bovine/gcc)
I can confirm that the problem persists with both the built-in cedet (tested on Windows) and the latest cedet head (tested on Windows and Ubuntu).
OK, so you wrote your setup in detail. I suppose that you use emacs -nw
. What exactly do you do when inside your C example, assuming you don't call fa-abort
manually?
The source is saved to main.cpp which is loaded by emacs -nw main.cpp
. The cursor is placed here:
rect.set_values(|
Everything is then as follows:
M-x fa-show
type: 1, 2);
then M-x fa-abort
to close the hint. Return
and int z;
. Notice that syntax coloring no longer occurs.
I can give you shell access if need be but this is all in a fresh VM.
While in Ubuntu, although cedet loaded without error, I received the following error when attempting fa-show:
This only happens for rect.set_values(
and not for rect.set_values()
, which how the function is meant to be used.
I don't use electric-pair-mode
and even with it on, the problem is that if I happened to delete a parenthesis and accidentally invoke fa-show
then my whole mode is gimped and I have to restart emacs.
I don't know why it's breaking syntax coloring but can you at least fix it so that fa-abort
restores the buffer to a working state? As I can understand if a visible popup interferes but not once it's been removed.
I can't reproduce the syntax coloring problem on Emacs 24.3.1 with emacs -nw
. The only thing I get is this error:
Wrong type argument: listp, "rect"
but nothing else bad happens.
Yes, for some reason I get this on Ubuntu as well. The built-in cedet isn't parsing the file for some reason.
See my comment here: https://github.com/abo-abo/function-args/issues/29#issuecomment-139189648
It can be that it's not parsing it: it's an outdated version after all. That error isn't really a bug that I can fix. However, the syntax discoloration might be related to function-args
, but I haven't encountered it so far under any circumstance.
Clone out the cedet repo and use the sample .emacs lines I provided and you will have the error to see. I would be extremely grateful if you could fix this.
Did you manage to get the error to reproduce?
Any luck? D:
GNU Emacs 24.5.1 in
-nw
terminal mode.Slimmed .emacs:
Using the collowing code:
With the cursor set to the right of
rect.set_values(
, I activatefa-show
, complete the function call withrect.set_values(1, 2);
and callfa-abort
to close the hint. I then hitReturn
and typeint z;
but it is no longer colored. Color-hinting for C++ no longer functions for anything new typed into the buffer.I have tried this several times and can't seem to figure out what's wrong. I have to restart Emacs to get color back.
If I create a new object
Rectangle m;
and then callm.area(
and invokefa-show
, the old hint of(int, int) : void
appears aboverect.set_values(1, 2);