help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why do I need to eval this?


From: Arnaldo Mandel
Subject: Why do I need to eval this?
Date: Mon, 15 Jan 2007 17:15:22 -0200

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]