Hi, Vincent.

Thanks for your response. I appreciate the additional information, and I'm copying this message to the developers' list.

In case you're wondering why I'm so interested in LFUN_WORD_REPLACE, I'm trying to set up LyX for use in book editing, with such features as transpose words, transpose characters, and so on. There are also lots of find/replace routines that editors would find useful--if I can find a way to implement them.

LyX solves many of the problems that editors face--most notably ad-hoc formatting. It's a great, truly innovative program.

Thanks again.

Best wishes,
Jack Lyon
The Editorium
http://www.editorium.com
Waking Lion Press
http://www.wakinglionpress.com


Vincent van Ravesteijn - TNW wrote:
Hi Jack,
I believe I didn't answer yet. But that's probably caused by the fact
that I'm running out of ideas. I don't think you can put newlines in the
ui-configuration files. The only thing you can do is to ask for a
user-friendly possibility for searching.
There will be a complete new find and replace framework in 2.0.0, so if
you mail the Developers list (lyx-devel@lists.lyx.org), the developer
who works on this subject might take your request into account. It won't
be available before the next major release, but it might save a few
frustrations for other users in the future.
I'm not sure whether the new framework allows this already because of
some other technical difficulties, but the developer (Tommaso) might
give you an answer.

Vincent
-----Original Message-----
From: Jack Lyon [mailto:jack.l...@comcast.net] Sent: donderdag 10 september 2009 22:03
To: Vincent van Ravesteijn - TNW
Subject: Re: Help with LFUN_WORD_REPLACE

Hi, Vincent.

My ultimate aim is to use word-replace in a command-sequence for a
toolbar--not the command buffer. Can you advise how I might be able to
do that? Something like this, but of course \n is incorrect:

Item "REPLACE" "command-sequence word-replace foo \n bar \n all"

Thanks for all your help.

Best wishes,
Jack


Vincent van Ravesteijn wrote:
When you say "the space between the last character of one paragraph and the first of the next one," are you talking about a hard return (made by hitting the ENTER key), or are you talking about a soft return (made by hitting CTRL + ENTER)?
Just ENTER.

Best,
Jack


"Vincent van Ravesteijn wrote:
Item "REPLACE" "command-sequence word-replace foo \n bar \n all"

I believe the '\n' can be used to send a newline character to the LyX Server--but it doesn't appear to work in a command sequence.
But maybe I just don't know the right syntax to get that character.

Thoughts?
No, not really. The '\n' will be just interpreted as '\' and 'n'. I've no clue how you could avoid this. We could have made the LFUN somewhat more user-friendly, but ......well ... we didn't.

In the command buffer: To get the <newline> there, you could do the following: copy a newline from the lyx main text (beware not to copy a space+newline), paste this into the command buffer, delete all but the first 'character' you pasted.
I've tried multiple variations of this. I'm afraid I don't understand what you mean by " delete all but the first 'character'
you pasted."
If I select the space between the last character of one paragraph and the first of the next one, and when I copy-paste this into the command-buffer, there are two invisible characters pasted. The last one is then not needed.

So, I do:

word-replace foo
<paste>
<backspace>
bar
<paste>
<backspace>
As far as I can tell, it's not possible to paste a newline from the

LyX main text into the command buffer. But again, I didn't understand that last bit.

Thanks!
Good luck

Vincent







Reply via email to