Am 09.09.2011 um 19:45 schrieb Tommaso Cucinotta: > Il 09/09/2011 14:31, Jean-Marc Lasgouttes ha scritto: >> Le 09/09/2011 12:50, Tommaso Cucinotta a écrit : >>> in the patch I sent a few minutes ago, we have this working: >>> >>> -x "buffer-export latex /path/to/file name with space.tex" >>> >>> Would it be ok for people used to paths with spaces (guess mostly Win >>> users) ? >> >> Perosnally, I'd prefer to avoid this syntax of 'everything until the end of >> line', and stick with the good old >> -x "buffer-export latex \"/path/to/file name with space.tex\"" >> which LyX should be able to handle transparently with a few changes. > > How would you like to use that from the mini-command-buffer ? Something like > this ? > > Alt-x buffer-export latex "file name.tex" > > Also, is there any other LFUN that takes as argument a file-name ? In such a > case, how are spaces addressed ? > > Because, I just tried, and this does not work: > > ./src/lyx -x "file-open \"/tmp/a b c.lyx\"" > > while instead this works like a charm: > > ./src/lyx -x "file-open /tmp/a b c.lyx" > > Same thing with: > > ./src/lyx -x "buffer-new" -x "inset-insert graphics filename /tmp/a b.png" > > that works just fine! If I add the quotes as you suggest, instead, they are > embedded into the filename, so the image is not found.
There's not only this problem. There is no way to stop e. g. LFUN_FILE_OPEN from substituting the "variable" in /tmp/path/to/the$variable/filename.lyx ... So one cannot have a dollar sign in file names. And since it's used internally too it doesn't matter if you send it via lyx-server, command-line or try to open it with the normal file open dialog. > So, I would highly prefer to commit a patch that is at least coherent with > how other commands behave for now, and later if we really want to switch to > the other way we can do that for all the affected commands. I don't know how to fix that without breaking backwards compatibility... Stephan