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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:24:37+00:00 2026-05-18T22:24:37+00:00

I have tried (set (make-local-variable ‘comment-auto-fill-only-comments) t) and also (auto-fill-mode 0) Though amazingly, neither

  • 0

I have tried

(set (make-local-variable 'comment-auto-fill-only-comments) t)

and also

(auto-fill-mode 0)

Though amazingly, neither of those work after emacs is restarted.

I am using eschulte’s emacs starter kit

Toggling it works fine with M-x auto-fill-mode.


UPDATE

Using a combination of (thanks Rémi):

(auto-fill-mode 1)
(setq comment-auto-fill-only-comments t) 

It works perfectly within programming files, where there are comments. However, in text mode, it auto-fills everywhere.

How can I turn off auto-fill-mode completely when inside text documents?

  • 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-05-18T22:24:37+00:00Added an answer on May 18, 2026 at 10:24 pm

    If you want Emacs to auto-fill comments you must not make comment-auto-fill-only-comments a local variable:

    (setq comment-auto-fill-only-comments t)
    

    If you want it only in some mode but not all you have to add it to the correct hook:

    (add-hook 'ruby-mode-hook 
              (lambda () ((set (make-local-variable 'comment-auto-fill-only-comments) t)))
    

    UPDATE answer

    To remove auto-fill from text mode, you have to use hook:

    (add-hook 'text-mode-hook 
              (lambda () (auto-fill-mode -1)))
    

    Note that this will change also the auto-fill state in mode deriving off text-mode (latex-mode is one examples, there are a lot of other such mode)

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

Sidebar

Related Questions

I want to achieve this using html and css: I have tried to set
I have tried the obvious SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED, but my
I have tried all of these various ways to set the value of the
I have tried setting the debug flags using the set command in cmake but
I have tried this but it doesn't work: tell application Preview set myfile to
I have created a button in my Android application & I tried to set
All right so I tried using the button set. So fair, I have been
I've tried almost everything. In my nginx.conf I have rails_env set to production in
I have to make local changes to my project files in order to get
I'm trying to make local development copies for my wordpress blog. I tried first

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.