Currently, the function glob_setfilename() is defined in g_canvas.c like this:
void glob_setfilename(void *dummy, t_symbol *filesym, t_symbol *dirsym)
That means when you send names from tcl using [pd filename], any spaces in the directory name get dropped. I propose adding this to g_canvas.c and then using that for the 'pd filename' callback instead. glob_setfilename() would then be left since it is used interally and in some extenrals:
void glob_setfilename_gimme(void *dummy, t_symbol *s, int argc, t_atom *argv)
How does that sound? Any better approach?
.hc
------------------------------------------------------------------------ ----
"[T]he greatest purveyor of violence in the world today [is] my own government." - Martin Luther King, Jr.
Hans-Christoph Steiner wrote:
How does that sound?
Hacky. What about multiple consecutive spaces? etc
Any better approach?
Some sort of escaping mechanism to allow spaces (and other characters) to be safely transmitted in symbols in both directions.
.hc
Claude
On Apr 28, 2008, at 4:43 AM, Claude Heiland-Allen wrote:
Hans-Christoph Steiner wrote:
How does that sound?
Hacky. What about multiple consecutive spaces? etc
Multiple consecutive spaces would be turned into one space. That is true. I am sure there are other names that won't make it thru.
Any better approach?
Some sort of escaping mechanism to allow spaces (and other characters) to be safely transmitted in symbols in both directions.
That would be nice, but not so easy, for whatever reason. I think that has been on the table for years. Do you have any ideas on an escape mechanism?
In the mean time, I've used this binbuf technique in some externals and it has worked pretty well. I think it is a decent hack until there is a real escape mechanism.
.hc
.hc
Claude
------------------------------------------------------------------------ ----
'You people have such restrictive dress for women,’ she said, hobbling away in three inch heels and panty hose to finish out another pink-collar temp pool day. - “Hijab Scene #2", by Mohja Kahf
Doh, I think I just found Miller's technique: pdtk_enquote. I'll try that to see if it works.
.hc
On Apr 28, 2008, at 11:56 AM, Hans-Christoph Steiner wrote:
On Apr 28, 2008, at 4:43 AM, Claude Heiland-Allen wrote:
Hans-Christoph Steiner wrote:
How does that sound?
Hacky. What about multiple consecutive spaces? etc
Multiple consecutive spaces would be turned into one space. That is true. I am sure there are other names that won't make it thru.
Any better approach?
Some sort of escaping mechanism to allow spaces (and other characters) to be safely transmitted in symbols in both directions.
That would be nice, but not so easy, for whatever reason. I think that has been on the table for years. Do you have any ideas on an escape mechanism?
In the mean time, I've used this binbuf technique in some externals and it has worked pretty well. I think it is a decent hack until there is a real escape mechanism.
.hc
.hc
Claude
'You people have such restrictive dress for women,’ she said, hobbling away in three inch heels and panty hose to finish out another pink-collar temp pool day. - “Hijab Scene #2", by Mohja Kahf
------------------------------------------------------------------------ ----
¡El pueblo unido jamás será vencido!
On Mon, 28 Apr 2008, Hans-Christoph Steiner wrote:
Doh, I think I just found Miller's technique: pdtk_enquote. I'll try that to see if it works.
it seems that pdtk_enquote destroys commas and semicolons even though pd accepts them when backslashed, and destroys doublequotes even though pd accepts them as-is, and it neglects to backslash backslashes and dollars, and its documentation is wrong (it's not "to a tcl function", it's "to a pd function").
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
On Apr 28, 2008, at 11:18 PM, Mathieu Bouchard wrote:
On Mon, 28 Apr 2008, Hans-Christoph Steiner wrote:
Doh, I think I just found Miller's technique: pdtk_enquote. I'll try that to see if it works.
it seems that pdtk_enquote destroys commas and semicolons even though pd accepts them when backslashed, and destroys doublequotes even though pd accepts them as-is, and it neglects to backslash backslashes and dollars, and its documentation is wrong (it's not "to a tcl function", it's "to a pd function").
Patches welcome! :)
.hc
------------------------------------------------------------------------ ----
If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of everyone, and the receiver cannot dispossess himself of it. - Thomas Jefferson
On Mon, 28 Apr 2008, Hans-Christoph Steiner wrote:
That means when you send names from tcl using [pd filename], any spaces in the directory name get dropped. I propose adding this to g_canvas.c and then using that for the 'pd filename' callback instead. glob_setfilename() would then be left since it is used interally and in some extenrals: void glob_setfilename_gimme(void *dummy, t_symbol *s, int argc, t_atom *argv) How does that sound? Any better approach?
Miller's Pd can already read spaces in symbols if you backslash them. It just won't write them properly, but that's not a problem here.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec