Loading ...
Sorry, an error occurred while loading the content.

Re: How to avoid highlighting identifiers as misspelt words?

Expand Messages
  • A.J.Mechelynck
    ... Does it change anything if you quote the identifiers? /* * Function foo_safe() * * Safe variant as foo() where pointers are checked for being null */
    Message 1 of 2 , Nov 29, 2006
      Vadim Zeitlin wrote:
      > On Wed, 29 Nov 2006 09:07:40 +0800 panshizhu@... wrote:
      >>> E.g. if I have
      >>> // function foo() does whatever it does
      >>> ~~~
      >>> void foo() { ... }
      >> Generally, it is not a good practice to use // or /* */ to comment out
      >> codes. (a better approach might be "#if 0" and "#endif"), so if you use #if
      >> 0 there would not be problem.
      > Thanks, but I probably didn't explain clearly enough: I don't ask about
      > commented out code. My question is about identifiers appearing in the real
      > comments (as is quite often the case). E.g. for a maybe more clear example,
      > consider a comment like this one:
      > // this function does the same as foo() but checks if the pointer
      > // is NULL first
      > void foo_safe(void *p) { ... }
      > In the above _comment_ "foo" is highlighted as a misspelling which is very
      > annoying.
      >> If you just want all identifiers to be valid word, there has been somewhere
      >> a method to permenantly add all identifiers in a tags file to your
      >> dictionary. But it is inconvinient, since tags file will change frequently,
      >> and you may want to use different tags file with different project.
      > Indeed, it's very inconvenient. And I don't know of any easy way to add
      > the identifiers from tags file to the internal word list. And, worse, not
      > all identifiers are included in the tags file. E.g. static function or
      > parameter names are not.
      > It really looks like a mechanism is needed to check if a misspelt word
      > doesn't appear elsewhere in the file outside of the comment... But I just
      > don't see how could this be done. OTOH I have trouble believing it's
      > impossible to do it, how do people use 'spell' option with program sources
      > without being able to do it?
      > Thanks,
      > VZ

      Does it change anything if you quote the identifiers?

      * Function "foo_safe()"
      * Safe variant as "foo()" where pointers are checked for being null
      void *foo_safe(p)
      void *p;
      if (p == NULL)
      return NULL;
      return foo(p)

      Best regards,
    Your message has been successfully submitted and would be delivered to recipients shortly.