[comp.emacs] Micro-emacs replacement strings

tmoody@sjuvax.UUCP (T. Moody) (04/22/88)

The international language Esperanto has several letters with
diacritical marks.  These letters (consonants) are not ascii symbols, so
one convention is to place an 'x' after the letter that would otherwise
have a '^' over it.

Frequently, I need to convert a document of this sort to a LaTeX input
file, with the control string for printing that circumflex.  I am using
the micro-emacs 3.9i editor.  Thus, what I want is to be able to take a
string such as

	Cxu sxi gxemas?

... and convert it to this:

	\^{C}u \^{s}i \^{g}emas?

First, I turn on the exact and magic modes.  Next I globally replace all
occurrences of 'x' with '}'.  This gives me

	C}u s}i g}emas?

Now, it seems to me that what I *ought* to be able to do is search for
all strings that match 

	.}

and use as a replacement string

	\\^{&

right?  But it doesn't work out that way.  What am I doing wrong?
-- 
Todd Moody * {allegra|astrovax|bpa|burdvax}!sjuvax!tmoody * SJU Phil. Dept.
    "The wind is not moving.  The flag is not moving.  Mind is moving."

zessel@incas.UUCP (Holger Zessel AG Nehmer) (06/07/88)

I think, you do nothing wrong. It's an editor bug with an easy workaround.
You mustn't take query-replace-string instead of replace-string. Also you
have to answer every question for replacement, because the bug appears with
answer '(!) Do rest' in query-replace-mode too.

Micro-emacs 3.9i seems to replace all occurrences of the search string
with the replacement string of the last match or something like this.
My result of your example was the following line:

    \^{g}u \^{g}i \^{g}emas

It's an interesting bug. I'll take a look at the sources and try to find it
out.

When I am successful, I'll post it here.

    Happy hacking,      Holger

tmoody@sjuvax.UUCP (T. Moody) (06/13/88)

In article <530@ndbs.UUCP> zessel@ndbs.UUCP (Holger Zessel AG Nehmer) writes:
>I think, you do nothing wrong. It's an editor bug with an easy workaround.
>You mustn't take query-replace-string instead of replace-string. Also you
>have to answer every question for replacement, because the bug appears with
>answer '(!) Do rest' in query-replace-mode too.

Thank you.  There is some satisfaction in knowing that I wasn't simply
misunderstanding the metalanguage.  Since my objective is to write a
macro to do this task automatically, the query-replace solution isn't
optimal.  In fact, I have already written a macro that does the job
without using regular expressions; instead, it makes ten or so passes
through the file, changing one letter sequence at a time.

But this is inelegant and slow.  I hope the bug is fixed soon.  As of
version 3.9n, it isn't.

>Micro-emacs 3.9i seems to replace all occurrences of the search string
>with the replacement string of the last match or something like this.
>My result of your example was the following line:
>
>    \^{g}u \^{g}i \^{g}emas
>
>It's an interesting bug. I'll take a look at the sources and try to find it
>out.

Yes, that's what happens.  Unfortunately, I am no C programmer (nor any
kind of a programmer, really), so I doubt that the "happy hacking" will
be mine.  Perhaps it's not a fiendishly difficult bug to repair.  But
then, I presume it has been a know bug for some time.


-- 
Todd Moody * {allegra|astrovax|bpa|burdvax}!sjuvax!tmoody * SJU Phil. Dept.
            "The mind-forg'd manacles I hear."  -- William Blake