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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:52:47+00:00 2026-05-26T20:52:47+00:00

I think the behavior of flyspell-correct-word should be extended to a command that corrects

  • 0

I think the behavior of flyspell-correct-word should be extended to a command that corrects all occurrences of the misspelled word of interest. This of course is not relevant for syntactic errors in the underlying spelling correction. I don’t know if aspell/ispell supports such kinds of corrections. It would also like to combine the two into a command that queries the user whether he wants to correct next occurrence in a query-replace manner (y,n,q,Y,N,!). Has anybody implemented any of these ideas?

  • 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-26T20:52:47+00:00Added an answer on May 26, 2026 at 8:52 pm

    Try adding the following code to your .emacs, this seems to do what you’re requesting (though it does not prompt you for replacements (that seemed a bit cumbersome)):

    (setq flyspell-insert-function 'flyspell-insert-and-replace-all)
    (defvar flyspell-last-replacements nil)
    (defun flyspell-insert-and-replace-all (word)
      (unless (eq flyspell-auto-correct-pos pos) ; same check as done in flyspell-auto-correct-word
        (setq flyspell-last-replacements nil))
      (save-excursion
        (dolist (word-markers flyspell-last-replacements)
          (delete-region (car word-markers) (cdr word-markers))
          (goto-char (car word-markers))
          (insert word)))
      (insert word)
      (save-excursion
        (let ((do-replacement (not flyspell-last-replacements)))
          (while (re-search-forward (concat "\\<" flyspell-auto-correct-word "\\>") nil t)
            (replace-match word)
            ;; and, when doing first search/replace, record all the positions
            (when do-replacement
              (let ((end-marker (point-marker))
                    (begin-marker (make-marker)))
                (set-marker begin-marker (- (point) (length word)))
                (set-marker-insertion-type end-marker t)
                (set-marker-insertion-type begin-marker nil)
                (add-to-list 'flyspell-last-replacements (cons begin-marker end-marker))))))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I noticed that all jQuery transitions (e.g. slide effect) work in a
I think that the normal behavior of a button like the one below is
First of all, I don't think it is. But, I've observed such a behavior
I think that this problem occurs often on a web application development. But I'll
I've encountered (what I think is) a strange behavior when using the sax parser,
I think I am missing something about correct behaviour of Monitor.Enter and Monitor.TryEnter .
Think about doing this: import matplotlib.pyplot as plt plt.plot(x_A,y_A,'g--') plt.plot(x_B,y_B,'r-o') plt.show() How would you
Think I have an integer array like this: a[0]=60; a[1]=321; a[2]=5; now I want
Think: tiling my emacs window with eshells, a la xmonad. Is this possible? I
I think that handlers in android are tools to get different objects that are

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.