Context: I needed to insert tex files which filenames contained spaces into my document. LaTex can handle this efficiently if quotes are provided in the \include (like in \include{"bla bla/bla bla"}).
For easy moving along my document, I intended to use the "Open Included File" command. But that command doesn't handle the quoted filenames, as the quotes are taken into account as normal characters. So here I am with a line to be added to that command in order to correct that misbehaviour:
10: ... 11: if options.empty? 12: print "Did not find any appropriate item to open in #{ENV ['TM_SELECTED_TEXT'] ? "selection" : "current line" }" 13: else 14: options[0].each{|el| el.gsub!(/(^")?("$)?/, '')} #<-- Here it is! 15: filepath = `kpsewhich #{e_sh options[0]}`.chomp 16: if filepath.empty? 17: ...
I don't know how to commit changes in a bundle (according I am allowed to!). So now it's up to you, folks, to add it to the repository. Note that I quickly and unformally tested it, and everything seems ok.
Xavier Cambar
Xavier,
Thanks for the patch, sorry it took me so long to commit it.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Apr 20, 2007, at 12:27 PM, Xavier CAMBAR wrote:
Context: I needed to insert tex files which filenames contained spaces into my document. LaTex can handle this efficiently if quotes are provided in the \include (like in \include{"bla bla/bla bla"}).
For easy moving along my document, I intended to use the "Open Included File" command. But that command doesn't handle the quoted filenames, as the quotes are taken into account as normal characters. So here I am with a line to be added to that command in order to correct that misbehaviour:
10: ... 11: if options.empty? 12: print "Did not find any appropriate item to open in #{ENV ['TM_SELECTED_TEXT'] ? "selection" : "current line" }" 13: else 14: options[0].each{|el| el.gsub!(/(^")?("$)?/, '')} #<-- Here it is! 15: filepath = `kpsewhich #{e_sh options[0]}`.chomp 16: if filepath.empty? 17: ...
I don't know how to commit changes in a bundle (according I am allowed to!). So now it's up to you, folks, to add it to the repository. Note that I quickly and unformally tested it, and everything seems ok.
Xavier Cambar
Going on this way, I found out that the command was used to open files in a separate window. I am looking for a way to open incuded files in a tab. I thought of a recursive search, starting from the folder of the master file (if not defined, the currently opened one), or even better, opening the right file from the ones in the current project. Anyhow, there are many ways to make this efficient, but I have no idea how to open a file in a tab... Commands generally use 'mate', which (as far as I know) isn't able of this...
Well, any idea? Xavier
Le 4 mai 07 à 21:19, Charilaos Skiadas a écrit :
Xavier,
Thanks for the patch, sorry it took me so long to commit it.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Apr 20, 2007, at 12:27 PM, Xavier CAMBAR wrote:
Context: I needed to insert tex files which filenames contained spaces into my document. LaTex can handle this efficiently if quotes are provided in the \include (like in \include{"bla bla/bla bla"}).
For easy moving along my document, I intended to use the "Open Included File" command. But that command doesn't handle the quoted filenames, as the quotes are taken into account as normal characters. So here I am with a line to be added to that command in order to correct that misbehaviour:
10: ... 11: if options.empty? 12: print "Did not find any appropriate item to open in #{ENV ['TM_SELECTED_TEXT'] ? "selection" : "current line" }" 13: else 14: options[0].each{|el| el.gsub!(/(^")?("$)?/, '')} #<-- Here it is! 15: filepath = `kpsewhich #{e_sh options[0]}`.chomp 16: if filepath.empty? 17: ...
I don't know how to commit changes in a bundle (according I am allowed to!). So now it's up to you, folks, to add it to the repository. Note that I quickly and unformally tested it, and everything seems ok.
Xavier Cambar
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On May 5, 2007, at 11:14 AM, Xavier Cambar wrote:
Going on this way, I found out that the command was used to open files in a separate window. I am looking for a way to open incuded files in a tab. I thought of a recursive search, starting from the folder of the master file (if not defined, the currently opened one), or even better, opening the right file from the ones in the current project. Anyhow, there are many ways to make this efficient, but I have no idea how to open a file in a tab... Commands generally use 'mate', which (as far as I know) isn't able of this...
For me the command opens files in a new tab, and not in a separate window. Perhaps the files you are trying to open are not in the project/folder?
Well, any idea? Xavier
Haris Skiadas Department of Mathematics and Computer Science Hanover College
Le 5 mai 07 à 17:24, Charilaos Skiadas a écrit :
For me the command opens files in a new tab, and not in a separate window. Perhaps the files you are trying to open are not in the project/folder?
Yes, they are. Even better, whether the files are already opened in a tab or not doesn't change the result. They keep on (re)opening in a new window. Damn...
Xavier