From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Bonow Newsgroups: gmane.emacs.help Subject: regexp question Date: Thu, 06 Jan 2011 17:14:59 +0100 Message-ID: <87d3oaf1q4.fsf@withouthat.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1294335329 27199 80.91.229.12 (6 Jan 2011 17:35:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Jan 2011 17:35:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 06 18:35:24 2011 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 1PatkB-0000Z7-Qm for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Jan 2011 18:35:23 +0100 Original-Received: from localhost ([127.0.0.1]:52047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PatkB-0007A4-8c for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Jan 2011 12:35:23 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-X-Trace: news.dfncis.de aDmqkwM3u0WBA0dWCAW6dQwt3TSQMuvB9nr0D31cdTV+COLvEH4YB38qgj Cancel-Lock: sha1:SEF+kAkKkOs31F6ENhGk8L6E1Iw= sha1:fu2/LKL0P9RlV5/chVu6kJ2MP/I= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:184067 X-Mailman-Approved-At: Thu, 06 Jan 2011 12:31:38 -0500 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:78265 Archived-At: Hi, I wrote the following defun: (defun yyy-rmligs() "Function to call `query-replace-regexp' and search for words, ignoring LaTeX commands starting with a backslash, which contain ligatures 'ff', 'fi', 'fl', 'ffi' and 'ffl' and queries about replacing them with their LaTeX non-ligature variant. E.g. 'shelfful' could be replaced by 'shelf\"|ful', while '\\flushright' is ignored." (interactive) (query-replace-regexp "\\([^\\\\]\\b\\w*\\)f\\(f\\|i\\|l\\|fi\\|fl\\)\\(\\w*\\b\\)" "\\1f\"|\\2\\3)")) It works, unless there is more then one ligature in the word. I can replace 'aaaflaaa' with 'aaaf"|laaa', but the defun fails to replace the first occurrences of 'fl' in 'aaaflaaaflaaa'. Help on the rexeps involved would be appreciated. Thx! Toto PS: Yes I know of the rmligs program; my need is for other languages than German. I know that for LaTeX documents I should (and will) use `reftex-query-replace-document' instead of `query-replace-regexp'. Do words in the English language exist which have more than one ligature? -- "A Korean newspaper wrote that Aachen University is the MIT of Europe." Burkhard Rauhut / "Anything that's the something of something isn't really the anything of anything." Lisa Simpson