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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:20:38+00:00 2026-05-11T13:20:38+00:00

Say you write some code like this (using ruby-mode, but I’ve seen this happen

  • 0

Say you write some code like this (using ruby-mode, but I’ve seen this happen in other modes too):

# This is a comment. def foo     puts 'foo!' end 

If you put the point on the first line and hit M-q, you get this:

# This is a comment. def foo puts 'foo!' end 

How do I avoid that? I’m using version 21.3.

Clarification: This does not happen when I add a blank line between the comment and the code. As a work-around when I want to refill my comments, I go through an annoying three step process:

  1. I add a blank line before and after the comment paragraph
  2. M-q
  3. delete the blank lines

It’d be much nicer if M-q handled refilling comment paragraphs without having to add and delete blank lines. Emacs already know what text is comment text, so there must be a way to do this.

  • 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. 2026-05-11T13:20:38+00:00Added an answer on May 11, 2026 at 1:20 pm

    filladapt.el does the trick. That with the latest version of RubyMode.

    Using those two packages solves the M-q problem you’re seeing. (Using GNU Emacs 22.1)

    Looking at the code for ruby-mode, it looks like it has customized the variables to control paragraph filling like so:

    (make-local-variable 'paragraph-start) (setq paragraph-start (concat '$\\|' page-delimiter)) (make-local-variable 'paragraph-separate) (setq paragraph-separate paragraph-start) (make-local-variable 'paragraph-ignore-fill-prefix) (setq paragraph-ignore-fill-prefix t) 

    Which can be added to a custom hook for your current ruby, or whatever major mode where you want fill behavior to act as you described – provided you use filladapt.el.

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

Sidebar

Ask A Question

Stats

  • Questions 87k
  • Answers 87k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Same as for Tables really. A renderer component is not… May 11, 2026 at 5:35 pm
  • Editorial Team
    Editorial Team added an answer You are doing it right, but the order of the… May 11, 2026 at 5:35 pm
  • Editorial Team
    Editorial Team added an answer This should do it... basicData = System.Text.ASCIIEncoding.ASCII.GetString( System.Convert.FromBase64String( EncodedAuth )… May 11, 2026 at 5:35 pm

Related Questions

Say you write some code like this (using ruby-mode, but I've seen this happen
When I am making methods with return values, I usually try and set things
I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP
I often find I want to write code something like this in C#, but
I have some neural net code written in c# that would benefit from using

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.