From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Arnaldo Mandel Newsgroups: gmane.emacs.help Subject: Why do I need to eval this? Date: Mon, 15 Jan 2007 17:15:22 -0200 Message-ID: <17835.53962.828333.510421@galena.ime.usp.br> NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1168894014 7675 80.91.229.12 (15 Jan 2007 20:46:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 15 Jan 2007 20:46:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 15 21:46:50 2007 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 1H6YF7-0004Dn-V6 for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Jan 2007 21:15:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6YF7-00031m-O7 for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Jan 2007 15:15:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H6YEu-00031K-2B for help-gnu-emacs@gnu.org; Mon, 15 Jan 2007 15:15:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H6YEo-0002z7-VF for help-gnu-emacs@gnu.org; Mon, 15 Jan 2007 15:15:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6YEo-0002z4-S1 for help-gnu-emacs@gnu.org; Mon, 15 Jan 2007 15:15:26 -0500 Original-Received: from [143.107.45.59] (helo=birosca.ime.usp.br) by monty-python.gnu.org with smtp (Exim 4.52) id 1H6YEo-0002pq-8j for help-gnu-emacs@gnu.org; Mon, 15 Jan 2007 15:15:26 -0500 Original-Received: (qmail 20883 invoked from network); 15 Jan 2007 19:14:57 -0000 X-Mail-Scanner: Scanned by qSheff-II-2.1-r2 (http://www.enderunix.org/qsheff/) Original-Received: from galena.ime.usp.br (143.107.45.17) by birosca.ime.usp.br with QMQP; 15 Jan 2007 19:14:56 -0000 Original-To: help-gnu-emacs@gnu.org X-Mailer: VM 7.03 under Emacs 21.2.2 Full-Name: Arnaldo Mandel 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:40334 Archived-At: Here is a short utility command that is useful to those writing Portuguese on US keyboards: (defun crases (daqui) "Offers all grave-accented chars to be corrected to the corresponding tilda. Argument DAQUI starts search from point." (interactive "P") (let ((start (if daqui (point) (point-min)))) (save-excursion (query-replace-regexp-eval "[àòÀÒ]" '(cdr (assoc (match-string-no-properties 0) '(("à" . "ã") ("ò" . "õ") ("À" . "Ã") ("Ò" . "Õ")))) nil start (point-max))))) If I either byte-compile it or load it uncompiled from a file, it doesn't work: it finds the characters that have to be replaced, but replaces with nil. On the other hand, if I eval this expression (C-x C-e), it works perfectly. The behavior is the same in emacs 21 and 22. Any idea on what is going on? am -- Arnaldo Mandel am@ime.usp.br