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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:32:13+00:00 2026-05-13T08:32:13+00:00

I usually use Geany or Hi-Tide under Debian (GNU/Linux) for firmware development, mainly C

  • 0

I usually use Geany or Hi-Tide under Debian (GNU/Linux) for firmware development, mainly C (but also reading old assembler). I document code using single-line comments, and it really annoys me when I retype something and have to manually re-break every following line to keep it in the 80-character margin.

Is there a text editor that can re-wrap consecutive single-line comments (and do this automatically while I type)? That is, given:

/// This is a really long line that should have been wrapped at "that" but was not.
/// This sentence is in the same
/// paragraph as the last.

…I want an editor that will re-wrap this to

/// This is a really long line that
/// should have been wrapped at "that"
/// but was not. This sentence is in
/// the same paragraph as the last.

…preferably doing this sensibly while I type.

I’ve tried:

  • Hi-Tide (based on Eclipse 3.3)
  • Geany
  • jEdit
  • UniversalIndentGUI + a bunch of prettifiers (I couldn’t find any formatters that worked, and it’s not a great workflow either)
  • GVim – next line begins //should have been… instead of /// should have been…

Update: just to elaborate on my accepted answer – I’ve gone with the snapshot emacs and an extra filladapt mode was also required

  • 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-13T08:32:13+00:00Added an answer on May 13, 2026 at 8:32 am

    In Emacs, to start automatic wrapping, enter auto-fill-mode. To set the line width, run C-u ⟨columns⟩ C-x f.
    Emacs, or really CC Mode, will anticipate your commenting structure, so that typing
    /// This is a really long line that shoul will result in

    /// This is a really long line that
    /// shoul‸

    And you can refill a paragraph at any time with M-q.

    If you want to do refills automatically with each keypress, well there may well be some interal command or third-party library out there, but off-hand you can use this elisp code:

    ;;; Can't advise SELF-INSERT-COMMAND, so create a wrapper procedure.
    (defun self-insert-refill (n)
      (interactive "p")
      (self-insert-command n))
    
    ;;; Advise SELF-INSERT-REFILL to execute FILL-PARAGRAPH after every
    ;;; keypress, but *only* if we're inside a comment
    (defadvice self-insert-refill (after refill-paragraph)
      (let ((face (or (get-char-property (point) 'read-face-name)
                      (get-char-property (point) 'face))) )
    
        (if (and (eq face 'font-lock-comment-face)
                 (not (string= " " (this-command-keys))))  ; Spaces would get deleted on refill.
            (fill-paragraph))))
    
    (ad-activate 'self-insert-refill)
    
    (add-hook 'c-mode-hook
      ;; Remap SELF-INSERT-COMMAND to be SELF-INSERT-REFILL.
      (local-set-key [remap self-insert-command] 'self-insert-refill) ))
    

    This is probably not very robust or in keeping with best-practice, and likely not wholly satisfactory, as it won’t work for general editing, e.g. C-d and backspace, and it slows down the editor somewhat, but it’s a start.

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

Sidebar

Ask A Question

Stats

  • Questions 275k
  • Answers 275k
  • 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 The first const says that the data pointed to is… May 13, 2026 at 2:41 pm
  • Editorial Team
    Editorial Team added an answer Use Reflection. I've modified an example from the PHP manual… May 13, 2026 at 2:41 pm
  • Editorial Team
    Editorial Team added an answer From reading your question it is not clear what you… May 13, 2026 at 2:41 pm

Related Questions

I was wondering how people usually navigate through large projects with several source files
I usually use C++ stdlib map whenever I need to store some data associated
I usually use IIS in conjunction with the OutSystems development platform, which does code-generation
I usually use SQLDeveloper to browse the database, but I couldn't make it work
I usually use Codesmith & NetTiers for my datalayers, and as they can be

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.