From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?iso-8859-1?q?R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: auto correction propagation mode Date: Sat, 7 Jun 2008 20:05:59 +0200 Message-ID: <200806072006.00518.andreas.roehler@online.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1212861641 28343 80.91.229.12 (7 Jun 2008 18:00:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Jun 2008 18:00:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 07 20:01:24 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K52j9-00067B-3k for geh-help-gnu-emacs@m.gmane.org; Sat, 07 Jun 2008 20:01:19 +0200 Original-Received: from localhost ([127.0.0.1]:52171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K52iM-0005Ri-4D for geh-help-gnu-emacs@m.gmane.org; Sat, 07 Jun 2008 14:00:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K52i0-0005Ov-32 for help-gnu-emacs@gnu.org; Sat, 07 Jun 2008 14:00:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K52hx-0005N8-GZ for help-gnu-emacs@gnu.org; Sat, 07 Jun 2008 14:00:06 -0400 Original-Received: from [199.232.76.173] (port=41086 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K52hx-0005N2-5D for help-gnu-emacs@gnu.org; Sat, 07 Jun 2008 14:00:05 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.187]:49178) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K52hw-0006VS-RN for help-gnu-emacs@gnu.org; Sat, 07 Jun 2008 14:00:05 -0400 Original-Received: from noname (p54BEBA94.dip0.t-ipconnect.de [84.190.186.148]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1K52hv1QUq-0000vs; Sat, 07 Jun 2008 20:00:03 +0200 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) In-Reply-To: Content-Disposition: inline X-Provags-ID: V01U2FsdGVkX193ePGpSWQxq3AajLtO/vbE94leHc4ElBVBney b9WL4I9Wy2bIaFtrG6uc+VWSX3Ub6i6yhEUapBBcKfURCV4zka +oHU58iF8Ww3kWWbQrBlA== X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54584 Archived-At: Am Samstag, 7. Juni 2008 schrieb Plamen Tanovski: > Hi, >=20 > I need a mode, where emacs "whatches" my typing, and if I correct a word, > emacs does the same correction on all remaining text in the buffer, after= I > leave the word. For example, if I correct the _first_ "foo" to "fip" in >=20 > The foo is not always foo, not even really foo. >=20 > emacs changes automatically the sentence (in the background) to >=20 > The fip is not always fip, not even really fip.=20 >=20 > I searched the net but didn't find smth. apropriate. >=20 >=20 > Best regards >=20 Just to indicate a direction how this could be done IMHO: (defun allkorr ()=20 (interactive "*") (let* ((wap (word-at-point)) (replmt (read-from-minibuffer "Correction: " wap))) (define-abbrev text-mode-abbrev-table wap replmt) (expand-region-abbrevs (point-min) (point-max)))) It uses the abbrev facility, prompts for the correct word, which will be registered as an expansion for the then wrong word, conceived as an abbrev in the text. `expand-region-abbrevs' will query you then for every replacement. This might be abolished still, bound to an argument etc. HTH Andreas R=F6hler