Re: Emacs package: Local function named "get" highlighted like built-in functions
Pierre Fenoll <[email protected]> Sun, 5 Apr 2015 15:12:55 -0700
| Newsgroups | gmane.comp.lang.erlang.bugs |
|---|---|
| Message-ID | <CAMmfOZs6BjRLwF2j5PRvqN9qjo9ZcUZToam9LzCLo8dCtnAGKg@mail.gmail.com> |
If we can have colouring based on parsing information, I'd love to have exported functions names highlighted in a different way than non-exported ones! Cheers, -- Pierre Fenoll On 5 April 2015 at 09:32, Luis Gerhorst < [email protected]> wrote: > Is there a way to prevent these keyword from being highlighted as bifs if > they refer to a function defined by another module or do I simply have to > avoid using such function names? > > ~ Luis > > On 15-W13-7, at 21:06, Steve Vinoski <[email protected]> wrote: > > > > On Sun, Mar 29, 2015 at 2:02 PM, Jesper Louis Andersen < > [email protected]> wrote: > >> >> On Sun, Mar 29, 2015 at 5:47 PM, Luis Gerhorst < >> [email protected]> wrote: >> >>> I'm using solarized-theme (https://github.com/bbatsov/solarized-emacs >>> <http://github.com/bbatsov/solarized-emacs>) and as you can see in the >>> screenshot the local function "get" is highlighted the same way built in >>> functions from the "erlang" module are highlighted. >>> >> >> I have a guess as to why this happens. The get/1 function is defined in >> erlang:get/1. It is used to look up values in the process dictionary. The >> syntax highlighter doesn't understand that get/2 is defined locally in the >> current module, so it thinks your call to get is to the underlying >> 'erlang:get/1', not to ?MODULE:get/2. And all problems stems from there. >> > > Correct -- see lib/tools/emacs/erlang.el on the maint branch, line 759 (I > would link to github but it's being ddos'ed right now so I can't get to > it), where "get" is specified as part of an elisp variable holding erlang > bif names. Erlang-mode highlights those names as symbols. > > --steve > > > > _______________________________________________ > erlang-bugs mailing list > [email protected] > http://erlang.org/mailman/listinfo/erlang-bugs > > _______________________________________________ erlang-bugs mailing list [email protected] http://erlang.org/mailman/listinfo/erlang-bugs