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 8187689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:38:48+00:00 2026-06-07T02:38:48+00:00

I recently upgraded from emacs 23 to emacs 24. Working with JavaScript using the

  • 0

I recently upgraded from emacs 23 to emacs 24. Working with JavaScript using the default js-mode, I’ve noticed a minor but annoying difference between js-mode in emacs23 vs. emacs24. To make sure it wasn’t one of my settings I started emacs23 and emacs24 with the --no-init-file option and I see the same problem, namely:

In emacs23 in js-mode, when you type a closing curly brace, }, it temporarily jumps the cursor back to the match opening curly brace and then indents the closing brace to the appropriate level of indentation.

When I do it in emacs24, the temp cursor jump to the matching opening curly brace occurs as expected, but it does not indent the closing brace, making me hit the tab key to finish the job.

Is anyone else seeing this discrepancy? If so, any ideas on how to fix it? Is there is nice “indent-on-closing-curly” type of variable to set somewhere in my init.el?

I am using emacs on Xubuntu Linux (and I installed from source). I haven’t compared 23 vs. 24 on other platforms yet.

Note: someone might want to suggest using Yegge’s js2-mode instead, but I generally don’t like using it and would like to get js-mode working right.

  • 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-07T02:38:49+00:00Added an answer on June 7, 2026 at 2:38 am

    Since I’ve found a satisfactory answer and haven’t heard from anyone else, I’ll post my answer and accept it in case it helps anybody else.

    I didn’t find the exact reason why js-mode behaves differently in emacs 23 vs. emacs 24, but setting electric-indent-mode in your .emacs or init.el gives the behavior I want. With this, it actually indents before you type the closing brace, but that works for me. This is a new setting in emacs 24. Your .emacs entry would be:

    (electric-indent-mode t)
    

    One problem I encountered is that org-mode doesn’t like electric-indent-mode, so you can either specifically set electric-indent-mode for javascript/java/c/etc. modes or specifically unset it for org-mode. I chose the latter with this:

    (defun my-org-mode-hooks ()
      (electric-indent-mode -1))
    
    (add-hook 'org-mode-hook 'my-org-mode-hooks)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently upgraded from jQuery 1.2.6 to 1.3.2 Now on the page I'm using
I recently upgraded from Vista/32 to Win7/64. On my old machine, everything was working
I recently upgraded from Grails 1.3.7 to Grails 2.0.1. The application runs normal, but
We just recently upgraded from VS2008 to VS2010. Our project compiles fine; but when
I am using PHP 5.3 on Ubuntu 10.0.4. I recently upgraded from PHP 5.2
I recently upgraded from Emacs 23 to Emacs 24. Since the upgrade, it seems
I recently upgraded from classical registration using element.property = function to advanced registration using
I recently upgraded from 4.0.1 to 4.2.1 and noticed that when I publish to
We just recently upgraded from VS2005 to VS2010. I've noticed that unlike VS2005, when
I am using visual studio 2008 on vista business. We just recently upgraded from

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.