emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [OT] wildcards in autocorrect?


From: John Kitchin
Subject: Re: [O] [OT] wildcards in autocorrect?
Date: Sat, 28 Mar 2015 14:20:13 -0400

This is the code Samuel refers to. It is awesome. I use it less and less ;) by which I mean everytime I use it is one less time I ever have to use it.

;; http://endlessparentheses.com/ispell-and-abbrev-the-perfect-auto-correct.html
(define-key ctl-x-map "\C-i" 'endless/ispell-word-then-abbrev)

(defun endless/ispell-word-then-abbrev (p)
  "Call `ispell-word'. Then create an abbrev for the correction made.
With prefix P, create local abbrev. Otherwise it will be global."
  (interactive "P")
  (let ((bef (downcase (or (thing-at-point 'word) ""))) aft)
    (call-interactively 'ispell-word)
    (setq aft (downcase (or (thing-at-point 'word) "")))
    (unless (string= aft bef)
      (message "\"%s\" now expands to \"%s\" %sally"
               bef aft (if p "loc" "glob"))
      (define-abbrev
        (if p global-abbrev-table local-abbrev-table)
        bef aft)))) 



John

-----------------------------------
Professor John Kitchin 
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803

On Sat, Mar 28, 2015 at 12:57 PM, Samuel W. Flint <address@hidden> wrote:
There's something on endless parentheses that will let you generate a correction abbrev with a keystroke.

Samuel W. Flint
Please forgive any typos as this was composed on a screen keyboard.

> On Mar 28, 2015, at 9:19 AM, Matt Price <address@hidden> wrote:
>
> I make a lot of typing errors (I have an injury to one hand, which impedes bilateral cooperation). In Libreoffice I am able to define wildcard autocorrect objects, e.g.:
>
> oc.* ---> co.*
>
> This will correct ocrrect, ocmputer, ocndition, etc.  Does anyone know a way to do something similar in Emacs? Right now I am using abbrev mode and defining my errors one by one -- it is a very slow process since I make so many mistakes and have a moderately large vocabulary.
>
> I am sure this is possible somehow, I just don't know how.
>
> thanks as always,
> m
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]