Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8658009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:39:44+00:00 2026-06-12T15:39:44+00:00

Where I work we use a lot of our own custom data types. The

  • 0

Where I work we use a lot of our own custom data types. The c++ that emacs recognizes, notices many of the custom datatypes from the STL such as string, vector, etc. This means that in my editor if i declare a function like so:

string getString() const {
    return str;
}

The return value will be highlighted green and due to this the function name will in blue. Now if I decide to use a custom string this messes everything up. So now my cpp files are mostly in white because we don’t use the normal stl classes here. How can I program my emacs editor to recognize that when I mean ‘String’, color it the same way you would as ‘string’?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:39:46+00:00Added an answer on June 12, 2026 at 3:39 pm

    You need font-lock-add-keywords. Here’s an example:

    (font-lock-add-keywords 'cc-mode
      '(("String" . font-lock-type-face)
        ("str" . font-lock-type-face)))
    

    It adds a list of regular expression/font lock pairs.

    There’s much more to be read on the topic of adding-keywords.
    In particular, ctypes.el might be of interest to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use $_SERVER[DOCUMENT_ROOT] a lot to make sure that all my links will work
Our software produces a lot of data that is georeferenced and recorded over time.
We have a tech support website/database at work that we use to record our
At work we use a common makefile that other makefiles include (via the include
Where I work we use a set schedule to build our applications. What is
I have a reference application that I use to work through DDD issues, and
We create a lot of internal tools in order to work with the data
We currently use a Sax Basic OCX that allows us to edit some custom
In our application we work with DataTable s a lot. This is dictated by
At work, we use Team Foundation Server for source control. I work from home

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.