On 24.11.07, Richard Heck wrote:
> Ryan Cross wrote:
>> [EMAIL PROTECTED]> wrote:
>>> On Sun, Nov 25, 2007 at 10:26:26AM +1100, Ryan Cross wrote:
>> I think this feature could be solved by actually doing a preview/edit
>> of the actual Lyx file format and not the LaTeX. Most of the edits I
>> want to do could probably be done by editing the Lyx file format.
...
> This sort of request is quite commonly made, and it's been on the
> developers' radar, more or less, for a while. Obviously, the View Source
> preview is a step in this direction. But, as Andre remarked, it's
> non-trivial to get this right, and the number of people who would use it
> seems small. In any event, no one has stepped up to do the work needed to
> implement it. Anyone who wants to do so is of course welcome!
Actually, I'd prefer to do the source file editing in my favourite text
editor (where I know the advanced keybindings and can easily programm
plug-ins).
Unfortunately, currently to do things like replacing by regular
expression or replacing in math or change of box-type etc. I have to:
1. save the lyx document
2. open my favourite text editor
3. search for the lyx document file and open it in the editor
4. do the changes on the lyx source and save them
5. Re-open the document in LyX with "&File>&Revert to Saved"
6. Be very brave: A warning opens, that says:
Any changes will be lost. Are you sure you want to
revert to the saved version
of the document ...<path to file>
[Revert] [Cancel]
however, my last (external) changes will only be permanent if I defy
this warning and go ahead to Revert.
What I'd like to see (and what IMO should be relatively easy) is
a) a LyX command that (saves the current document and) opens the source
file with a command that can be defined in the settings dialogue
(defaulting to the content of the EDITOR environment variable in
unix).
b) a reloading command that is aware of the possibility that the version
on disk is more recent than the opon one, e.g.
"&File>&Revert to Saved ==>"&File>&Reload, with the warning
All changes since the last save will be lost.
Are you sure you want to reload the document from
...<path to file>
[Reload] [Cancel]
Actually, I can already set an "Editor" command for the LyX file format
in the Tools>Preferences>File format tab and after that
M-x buffer-view lyx
will take over steps 1-3 in the above list.
Now I only need a way to insert "buffer-view lyx" into the menu, e.g. as
'Edit>Edit LyX source'. (Is there an analogon to the "\bind_file" command
in the bind files for ui files or do I need to copy and change the
complete definition set?)
Günter