From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Is it possible to leverage ispell's interface for other purposes? Date: Fri, 10 Dec 2010 23:40:10 -0800 Message-ID: <56C0D58EA4DB442E8F82EEFD135F90CE@us.oracle.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292053502 14397 80.91.229.12 (11 Dec 2010 07:45:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Dec 2010 07:45:02 +0000 (UTC) To: "'Sean McAfee'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 11 08:44:57 2010 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.69) (envelope-from ) id 1PRK8X-0002Bd-HF for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Dec 2010 08:44:57 +0100 Original-Received: from localhost ([127.0.0.1]:49815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PRK8W-00036w-QK for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Dec 2010 02:44:56 -0500 Original-Received: from [140.186.70.92] (port=48404 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PRK4c-0001nY-QM for help-gnu-emacs@gnu.org; Sat, 11 Dec 2010 02:41:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PRK48-0007Av-7d for help-gnu-emacs@gnu.org; Sat, 11 Dec 2010 02:40:54 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:50717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PRK47-0007Aj-Um for help-gnu-emacs@gnu.org; Sat, 11 Dec 2010 02:40:24 -0500 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oBB7eKFc023346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 11 Dec 2010 07:40:21 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oBB7eImb018220; Sat, 11 Dec 2010 07:40:20 GMT Original-Received: from abhmt012.oracle.com by acsmt354.oracle.com with ESMTP id 845559391292053210; Fri, 10 Dec 2010 23:40:10 -0800 Original-Received: from dradamslap1 (/10.159.220.201) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 10 Dec 2010 23:40:09 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcuXRSBDr+YBWQg6Rbq/gA/DlatHLwBwRlxw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:77422 Archived-At: > From: Sean McAfee Sent: Thursday, August 26, 2010 8:47 PM > > I'd like to be able to scan through a buffer's content, > looking for any of several regular expressions, and as each > one is found, be presented with a list of replacements, in the > same manner that ispell provides possible spelling corrections. > The list of replacements will be dynamically generated by a > Lisp callback I specify. I want to be able to choose one of > the replacements by number, or provide new replacement > text, which in either case will cause a second callback to be > invoked so that I can keep a record of what changes were made. > > The real reason I'd like to be able to do this is rather > complicated to explain, so I'll offer a contrived example that > keeps all of the important features. Suppose I have a file of > text that frequently mentions various traditional metasyntactical > variables (foo, bar, baz, etc). For each such variable, I want > to be presented with a menu of replacements, one of which is the > same variable name but in upper case, and the rest of which are > the other known metasyntactical variables. > So, if foo, bar, and baz were the only three variables I cared about, > I'd have a callback that returns the list '("FOO" "bar" "baz") when > given the argument "foo", the list '("BAR" "foo" "baz") when given the > argument "bar", etc. I could pick from the list or type something > totally new, and in either case another callback like (lambda > (old-text new-text) ...) would be invoked. > > Is it remotely possible to leverage the existing ispell interface as > I've described, or would I have to roll something up from scratch? Sounds interesting to me, Sean. Did you ever get a reply or investigate this further yourself?