1

(Emacs 23.4.1)

I'm looking for a solution to where the color of the function name turn to regular text whenever the function parameterlist is equal to, or above 2 arguments.

So functions that takes 0 or 1 argument, have the nice color which I've set in my .emacs file.

Why doesn't functions with >= 2 arguments get that?

Here is my .emacs custom-set-face:

    (custom-set-faces
     '(default ((t (:background "#F9F9F7" :family "liberation mono"))))
     '(font-lock-builtin-face ((t (:foreground "#5B5B5B"))))
     '(font-lock-comment-face ((t (:foreground "#afaf9d"))))
     '(font-lock-constant-face ((t (:foreground "#2caeae"))))
     '(font-lock-function-name-face ((t (:bold t :foreground "#931616"))))
     '(font-lock-keyword-face ((t (:bold t :foreground "#35363a"))))
     '(font-lock-negation-char-face ((t (:bold t))))
     '(font-lock-reference-face ((t (:foreground "#cbcbcb"))))
     '(font-lock-string-face ((t (:foreground "#e80000"))))
     '(font-lock-type-face ((t (:bold t :foreground "#3f4d7f"))))
     '(font-lock-variable-name-face ((t (:foreground "#35363a"))))
     '(font-locl-preprocessor-face ((t (:foreground "#cbcbcb"))))
    )
TacticalCoder
  • 6,275
  • 3
  • 31
  • 39

1 Answers1

1

Not sure I understand your question. But I think it is something like this:

Font-lock does not highlight function names in function definitions, if the function takes more than one parameter.

Is that it?

If so, then you need to specify what language the code is in, and give and example of a function definition with > 1 parameter that does not highlight correctly. And morst importantly, give the value of font-lock-keywords (at least the part of it that pertains to font-lock-function-name-face).

If I understand your question, customizing faces should have no effect, so you can remove that code from your question.

Finally, do you see the problem when you start Emacs using emacs -Q, that is, without using your init file? If not, then assume that you are doing something in your init file (~/.emacs) that is causing the problem. In that case, bisect it recursively to narrow it down to find the culprit part.

Drew
  • 29,895
  • 7
  • 74
  • 104
  • You've understood my question right. Function names doesn't get highlighted in function definitions when the function takes more than one parameter. The language is C++. I do see the problem when I run emacs -Q. http://image.bayimg.com/65746891ea7341e1da904c5873b2b72cb6c72354.jpg –  Jul 19 '14 at 17:55
  • Then see the rest of my answer. Start from `emacs -Q`. Tell us the language; give an example that doesn't highlight; let us know what `font-lock-keywords` is. – Drew Jul 19 '14 at 17:57
  • Updated my previous comment. –  Jul 19 '14 at 18:02
  • That URL gives a 404 error. (You can insert an image into your post here.) But we don't really need an image showing non-highlighting. Just show us the code, as text. And show `font-lock-keywords` -- the part of it that involves `font-lock-function-name-face`. I won't ask again - if you want help then step up and provide a useful problem report. – Drew Jul 19 '14 at 18:08