On 12/5/20 11:27 PM, Scott Kostyshak wrote: > On Sat, Dec 05, 2020 at 09:32:46PM -0500, Richard Kimberly Heck wrote: >> On 12/2/20 12:11 PM, Scott Kostyshak wrote: >>> On Wed, Dec 02, 2020 at 11:56:26AM -0500, Richard Kimberly Heck wrote: >>>> On 12/2/20 11:13 AM, Scott Kostyshak wrote: >>>>> On Wed, Dec 02, 2020 at 10:56:16AM -0500, Richard Kimberly Heck wrote: >>>>>> On 12/2/20 10:46 AM, Scott Kostyshak wrote: >>>>>>> I just remembered this feature exists and it is fun to test it. I have a >>>>>>> few questions/comments: >>>>>>> >>>>>>> 1. After I exit my text editor, should LyX detect that the process >>>>>>> exited and automatically reload and unlock the inset in LyX? >>>>>>> Currently I need to manually go to "End Editing Externally". >>>>>> I don't know any way to do this automatically. Probably there is one, but >>>>>> inter-process stuff is not something I really understand. >>>>> Fair enough. I guess ideally it would behave as follows: >>>>> >>>>> 1. On any file change (e.g., save from the external editor), LyX would >>>>> update the contents (but does not unlock the chunk). >>>>> 2. When the process exits, LyX updates the contents and unlocks the >>>>> chunk. >>>>> >>>>> For (1) I suppose we would need to use our FileMonitor class. For (2) it >>>>> seems it should be easy to check when a process exits. That said, if I >>>>> claim this is easy I should be willing to look into it and I'm not >>>>> volunteering :) >>>>> >>>>> There is still a corner case to deal with: the user might close the file >>>>> in the editor, but not exit the editor. (2) above would not pick this >>>>> up. I guess to handle this case we would need to use whatever Qt >>>>> abstraction tells us if a file is opened by a process. >>>> Yes, I think this is the case I had in mind that requires manual unlocking. >>>> For the other case, I had in mind some version where you open the file in >>>> one editor, then somehow open it again in another one and close the >>>> original. Then I wouldn't want to unlock. But maybe that's also a weird >>>> case. >>> Interesting, I didn't think of that situation. Maybe the user would >>> indeed try to do that if the file didn't open in their preferred editor >>> if they're not sure how to change the editor in preferences. >> Of course, the file is a temporary in the LyX user directory, so maybe >> that's unlikely. >> >> I've added a LOCK symbol when the inset is being edited. >> >> Are there other insets that should have this feature activated? > Thanks, tested and works well for listing. A couple of issues: > > 1. Go to Help > Specific manuals > Knitr > > Look at the "Chunk" inset. Note that you can still edit it externally even > though the document is opened as read only. I guess we should disable that > LFUN?
Should be fixed. > 2. I don't see the lock appear. Should also be fixed. There's still the problem about options, which I need to address. Riki -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel