On 26.11.07, Richard Heck wrote:
> G. Milde wrote:

>> 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).

>> 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).

> This is do-able now. Just add your favorite editor as the "Viewer" for LyX 
> files in Tools>Preferences>File Formats, and check the "Document Format" 
> box. 

I actually did so already (and wrote about it later down in my last post).
There are some problems still, however:

* M-x buffer-view lyx will open the document source in my editor, fine.
  However, it opens a temprorary copy in the lyx-tmpdir, so all my changes
  (in the editor) are lost!

* what is the difference between adding my editor as "Viewer" or as 
  "Editor", i.e. what commands are available to use this settings?
  
* what is the effect of the "Document Format" box?

Is there an lfun to open the original source for editing (once the Editor is
added to the "File Formats"?

> Easier than the other thing you mentioned.

>>   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]

> This seems like a pretty minor change. If you're brave enough to edit the 
> LyX file natively, then you're brave enough for the existing warning.

I agree that this is not urgent. Still it reflects an important shift in the
view on buffer-reload: 

  In any multi-tasking OS, there is a more than zero chance that
  re-loading the file on disk will not revert to a previous state but
  to update the doc to a new state. 
  (another example for this would be updating a document under a version
  control sytem like SVN while it is open in LyX, no bravery here ;-).

Thanks

Günter

Reply via email to