[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: C++-mode: Syntax highlighting: wrong color for funct

From: Richard Stallman
Subject: Re: address@hidden: C++-mode: Syntax highlighting: wrong color for function identifier depending on the kind of whitespace that follows]
Date: Thu, 10 Mar 2005 20:46:45 -0500

    Hmmm.  The advice facility exists within Emacs, and it is difficult to
    see what it could be used on, aside from another part of Emacs.  After
    all, one does not need to advise one's own code, having full control over
    the source.

It is meant for users to use in their Lisp code.  We can't anticipate
all of what they need.  But when something is part of Emacs, it should
not use advice.  When we install code in Emacs, if it advises some
other part of Emacs, then we should add a hook for it to use instead
of the advice.

The reason the hook is better is that it is visible in the source.  If
you are debugging a call to the function foo, there is nothing to show
you it has advice.  That can be a real pain in debugging.  How much
time would you waste before it occurred to you to wonder if the
code that's running really matches the source?

If foo has a hook, at least you'll see `run-hooks' in the code for
foo, so you will ask yourself "What's in that hook?"

I just had an idea that could perhaps eliminate this problem.  Emacs
Lisp mode could have a feature to put an overlay on the defun for a
function that has advice.  The overlay could have `after-text' like "
[Function has advice]".  If you see

(defun foo [Function has advice] (x y) 

you would not be confused by the advice.  The overlay could also perhaps
be a button that you could use to view the advice.

I will add this to TODO.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]