emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [OT] wildcards in autocorrect?
@ 2015-03-28 14:19 Matt Price
  2015-03-28 16:57 ` Samuel W. Flint
  0 siblings, 1 reply; 8+ messages in thread
From: Matt Price @ 2015-03-28 14:19 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 727 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OT] wildcards in autocorrect?
  2015-03-28 14:19 [OT] wildcards in autocorrect? Matt Price
@ 2015-03-28 16:57 ` Samuel W. Flint
  2015-03-28 17:17   ` Ken Mankoff
  2015-03-28 18:20   ` John Kitchin
  0 siblings, 2 replies; 8+ messages in thread
From: Samuel W. Flint @ 2015-03-28 16:57 UTC (permalink / raw)
  To: Matt Price; +Cc: Org Mode

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 <moptop99@gmail.com> 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
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OT] wildcards in autocorrect?
  2015-03-28 16:57 ` Samuel W. Flint
@ 2015-03-28 17:17   ` Ken Mankoff
  2015-03-28 17:47     ` briangpowell .
  2015-03-28 18:20   ` John Kitchin
  1 sibling, 1 reply; 8+ messages in thread
From: Ken Mankoff @ 2015-03-28 17:17 UTC (permalink / raw)
  To: Samuel W. Flint; +Cc: Org Mode

Maybe key-chord mode could help with this?

  -k. 

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard. 

> On Mar 28, 2015, at 12:57, "Samuel W. Flint" <swflint@flintfam.org> 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 <moptop99@gmail.com> 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
>> 
>> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OT] wildcards in autocorrect?
  2015-03-28 17:17   ` Ken Mankoff
@ 2015-03-28 17:47     ` briangpowell .
  2015-03-28 17:58       ` briangpowell .
  0 siblings, 1 reply; 8+ messages in thread
From: briangpowell . @ 2015-03-28 17:47 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: Org Mode, Samuel W. Flint

[-- Attachment #1: Type: text/plain, Size: 2645 bytes --]

* Something like this may do what you seek (which isn't clear to me):

Mx replace-regexp \boc.*\b \bco.*\b

** But why you'd do such a thing is a mystery to me--this may be more
useful to you:

Query Replace

M-% string <RET> newstring <RET>
Replace some occurrences of string with newstring.
C-M-% regexp <RET> newstring <RET>
Replace some matches for regexp with newstring.

** Forgive me if you know this already.

*** But your question is slightly funny to long time Emacs users like
myself because Emacs has been built, piece-by-piece, by thousands of
programmers, to do the most complex editing jobs you can imagine and the
regular expression library is the fastest in the world for "buffers",
"windows" and visual incremental search and replace (as I describe above).
By the way if you have to do search and replace, and you want to do it
visually, I suggest "QEmacs"--made by the same genius who created Qemu
(which is what VirtualBox is based on) and he also broke the record for
calculating the digits of π.  I'm talking about Fabrice Bellard--thank God
for him!

(I recommend QEmacs--just for the fun of it--it has a few amazing
abilities.)

* Finally, from reading your general [OT]/help me plea: I strongly suggest
you use FlySpell-Mode (in addition to "abbrev" functions that the other
Emacs hackers suggested).













On Sat, Mar 28, 2015 at 1:17 PM, Ken Mankoff <mankoff@gmail.com> wrote:

> Maybe key-chord mode could help with this?
>
>   -k.
>
> Please excuse brevity. Sent from pocket computer with tiny non-haptic
> feedback keyboard.
>
> > On Mar 28, 2015, at 12:57, "Samuel W. Flint" <swflint@flintfam.org>
> 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 <moptop99@gmail.com> 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
> >>
> >>
> >
>
>

[-- Attachment #2: Type: text/html, Size: 4337 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OT] wildcards in autocorrect?
  2015-03-28 17:47     ` briangpowell .
@ 2015-03-28 17:58       ` briangpowell .
  0 siblings, 0 replies; 8+ messages in thread
From: briangpowell . @ 2015-03-28 17:58 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: Org Mode, Samuel W. Flint

[-- Attachment #1: Type: text/plain, Size: 3487 bytes --]

* Cosmic: Also in my email today is a link to discussion which brought up
QEmacs + Fabrice Bellard--and what some of you "[OT] Emacs Org-Mode
hackers" may be interested in: a tiny Emacs version called "Mg":

...
beagle3 5 days ago:

Related: Fabrice Bellard[0]'s QEmacs. http://bellard.org/qemacs/ - a 160KB
executable provides a mostly complete Emacs experience (sans scripting ..
sort of like Mg), but does include syntax coloring, unicode, and watching
video inside the editor. A 60KB stripped down version has a feature set
comparable to Mg as far as I can tell.
[0] of FFMPEG, QEMU, BPG, TCC, JSLINUX and more fame.
...

On Sat, Mar 28, 2015 at 1:47 PM, briangpowell . <briangpowellms@gmail.com>
wrote:

> * Something like this may do what you seek (which isn't clear to me):
>
> Mx replace-regexp \boc.*\b \bco.*\b
>
> ** But why you'd do such a thing is a mystery to me--this may be more
> useful to you:
>
> Query Replace
>
> M-% string <RET> newstring <RET>
> Replace some occurrences of string with newstring.
> C-M-% regexp <RET> newstring <RET>
> Replace some matches for regexp with newstring.
>
> ** Forgive me if you know this already.
>
> *** But your question is slightly funny to long time Emacs users like
> myself because Emacs has been built, piece-by-piece, by thousands of
> programmers, to do the most complex editing jobs you can imagine and the
> regular expression library is the fastest in the world for "buffers",
> "windows" and visual incremental search and replace (as I describe above).
> By the way if you have to do search and replace, and you want to do it
> visually, I suggest "QEmacs"--made by the same genius who created Qemu
> (which is what VirtualBox is based on) and he also broke the record for
> calculating the digits of π.  I'm talking about Fabrice Bellard--thank God
> for him!
>
> (I recommend QEmacs--just for the fun of it--it has a few amazing
> abilities.)
>
> * Finally, from reading your general [OT]/help me plea: I strongly suggest
> you use FlySpell-Mode (in addition to "abbrev" functions that the other
> Emacs hackers suggested).
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Sat, Mar 28, 2015 at 1:17 PM, Ken Mankoff <mankoff@gmail.com> wrote:
>
>> Maybe key-chord mode could help with this?
>>
>>   -k.
>>
>> Please excuse brevity. Sent from pocket computer with tiny non-haptic
>> feedback keyboard.
>>
>> > On Mar 28, 2015, at 12:57, "Samuel W. Flint" <swflint@flintfam.org>
>> 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 <moptop99@gmail.com> 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
>> >>
>> >>
>> >
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 5683 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OT] wildcards in autocorrect?
  2015-03-28 16:57 ` Samuel W. Flint
  2015-03-28 17:17   ` Ken Mankoff
@ 2015-03-28 18:20   ` John Kitchin
  2015-03-28 18:34     ` briangpowell .
  2015-03-28 19:56     ` Matt Price
  1 sibling, 2 replies; 8+ messages in thread
From: John Kitchin @ 2015-03-28 18:20 UTC (permalink / raw)
  To: Samuel W. Flint; +Cc: Org Mode

[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]

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
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Sat, Mar 28, 2015 at 12:57 PM, Samuel W. Flint <swflint@flintfam.org>
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 <moptop99@gmail.com> 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
> >
> >
>
>

[-- Attachment #2: Type: text/html, Size: 3209 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OT] wildcards in autocorrect?
  2015-03-28 18:20   ` John Kitchin
@ 2015-03-28 18:34     ` briangpowell .
  2015-03-28 19:56     ` Matt Price
  1 sibling, 0 replies; 8+ messages in thread
From: briangpowell . @ 2015-03-28 18:34 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org Mode, Samuel W. Flint

[-- Attachment #1: Type: text/plain, Size: 2542 bytes --]

Very interesting John, I get it now--that may be very useful--thanks for
that.

Also, I left out a main reason to use QEmacs: I use it for visually editing
very large multi-gigabyte files--I use it for some of the things we
discussed--search and replace and/or incremental-search-and-replace.

On Sat, Mar 28, 2015 at 2:20 PM, John Kitchin <jkitchin@andrew.cmu.edu>
wrote:

> 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
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Sat, Mar 28, 2015 at 12:57 PM, Samuel W. Flint <swflint@flintfam.org>
> 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 <moptop99@gmail.com> 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
>> >
>> >
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 4014 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OT] wildcards in autocorrect?
  2015-03-28 18:20   ` John Kitchin
  2015-03-28 18:34     ` briangpowell .
@ 2015-03-28 19:56     ` Matt Price
  1 sibling, 0 replies; 8+ messages in thread
From: Matt Price @ 2015-03-28 19:56 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org Mode, Samuel W. Flint

[-- Attachment #1: Type: text/plain, Size: 1149 bytes --]

On Sat, Mar 28, 2015 at 2:20 PM, John Kitchin <jkitchin@andrew.cmu.edu>
wrote:

> 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))))
>
>
> -----
Cool, I'm going to give that a try -- not quite what I was asking for, but
way better than what I've been doing so far!!
 Thanks John & Samuel

[-- Attachment #2: Type: text/html, Size: 1947 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-28 19:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-28 14:19 [OT] wildcards in autocorrect? Matt Price
2015-03-28 16:57 ` Samuel W. Flint
2015-03-28 17:17   ` Ken Mankoff
2015-03-28 17:47     ` briangpowell .
2015-03-28 17:58       ` briangpowell .
2015-03-28 18:20   ` John Kitchin
2015-03-28 18:34     ` briangpowell .
2015-03-28 19:56     ` Matt Price

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).