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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:48:42+00:00 2026-05-17T22:48:42+00:00

Since it may be a good idea to have lines that are not wider

  • 0

Since it may be a good idea to have lines that are not wider than 80 characters in code files, what’s the most effective way of recursively identify these lines in an existing project using Emacs?

UPDATE:

Using Trey’s suggestion, I’m currently using the following code:

(defun find-long-lines (base-dir)
  "Recursively look for lines longer than 80 characters files"
  (interactive "DPath:")
  (grep-compute-defaults)
  (rgrep "^................................................................................." "*" base-dir))

Which works fine in combination with whitespace-mode.

  • 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-17T22:48:42+00:00Added an answer on May 17, 2026 at 10:48 pm

    You could use igrep-find and use a regular expression that matches 81(+) characters like so:

    M-x igrep-find ^.................................................................................. RET /path/to/area/to/search/* RET
    

    And then you get a buffer in compilation mode that lets you easily jump to each of the offending lines (either via a mouse click, or C-x ` or M-x next-error).

    Alternatively, you could use the built-in M-x grep-find and use the same regular expression.

    To enter 81 ., type C-u 81 ..

    And, if you want to have this all contained in a single command (that prompts you for the path to the files), you can use this:

    (defun find-lines-longer-than-80 (files)
      "Recursively look for lines longer than 80 characters files"
      (interactive (list (igrep-read-files)))
      (igrep igrep-program "^................................................................................." files igrep-options))
    

    There are some other tips available on the Emacs Wiki for Find Long Lines, including several options for highlighting lines that are longer than 80 characters when you’re visiting a file.

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

Sidebar

Related Questions

Since vector elements are stored contiguously, I guess it may not have the same
I have a php application that has about 50-55 code files. The file that
This may be a little hard to describe since I don't have a sample.
Since LESS is a pre-compile stylesheet language, this may not achieve what I'm after,
I have the following scenario that may warrant storing data in a conroller member
I have a process that's going to initially generate 3-4 million PDF files, and
I have a problem that I am not sure of the best way to
Be patient since I haven't worked with compression algorithms much so this may be
Since regular jQuery animations are not fluent on iOS ( .hide() , slideDown() ),
Since REST is stateless, each request that comes in has no knowledge of the

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.