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

  • Home
  • SEARCH
  • 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 270499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:00:36+00:00 2026-05-12T00:00:36+00:00

My .emacs is like a roadmap for me where I source many files. Their

  • 0

My .emacs is like a roadmap for me where I source many files.
Their extension is .emacs: for instance,

 fileName.emacs

The problem is that only ~/.emacs has syntax highlighting.

I would like to have the syntax highlighting for all sourced files which end with .emacs.

How can you put syntax highlighting on to all sourced .emacs -files?

  • 1 1 Answer
  • 1 View
  • 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-05-12T00:00:36+00:00Added an answer on May 12, 2026 at 12:00 am

    Yes. I assume these are lisp files, so you need Emacs to automatically be in lisp-mode when viewing these files. There’s two solutions:

    1. The simplest thing is to change the extension to .el. By default, those are opened in lisp-mode.

    2. If, for some reason you really want to use the .emacs extension, you’ll want to add this somewhere in your ~/.emacs file:

      (setq auto-mode-alist 
            (append '((".*\\.emacs\\'" . lisp-mode))
                    auto-mode-alist))
      

    auto-mode-alist is the list Emacs uses to determine the major mode to use. Each item is a list, the first is the Emacs regular expression Emacs uses to test the filename against, and if true, it uses the mode given in the third item.

    (I don’t know what the second item is, I’ve never used it.)

    I strongly suggest option 1 though.

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

Sidebar

Related Questions

I would like emacs to mark files that are generated as read-only when they're
I like to use Emacs' shell mode, but it has a few deficiencies. One
I would like to use Emacs to edit some VB6 files but Emacs does
Emacs puts backup files named foo~ everywhere and I don't like having to remember
I would like to have an .emacs setting so that tabs are always formed
I would like to insert dates in an emacs buffer like I do in
What's the correct method for defining multi-line comments in an emacs mode (like C's
Any other tweaks for making emacs as vim-like as possible would be appreciated as
Is there any themes for emacs which looks like this one? http://www.lnbogen.com/VisualStudioNet2005Colors.aspx
I would like to to try Emacs, and want to give it the best

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.