Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbol with spaces regression #824

Open
Ant1r opened this issue Dec 9, 2019 · 7 comments
Open

symbol with spaces regression #824

Ant1r opened this issue Dec 9, 2019 · 7 comments
Assignees

Comments

@Ant1r
Copy link
Contributor

@Ant1r Ant1r commented Dec 9, 2019

there is '(what I consider as) a serious regression between 0.49 and current master, related to how messages manage symbols containing space characters.

I will try to identify the responsible commits ASAP, but this is surely related to recent backslash escaping additions.

These screenshots illustrate the issue:

  • current master (3c12b76):
    pd-0 50 2

  • pd-0.49.1
    pd-0 49 1

(FYI: my specific problem is I cannot list anymore the content of a directory which name contains spaces; thus I cannot upgrade Pd for this particular project).

EDIT (@umlaeute): here's the test-patch (so you don't have to patch yourself)

#N canvas 1204 378 450 535 12;
#X msg 71 130 a b;
#X obj 71 155 fudiformat -u;
#X obj 71 180 list tosymbol;
#X obj 71 205 t a a;
#X msg 71 230 symbol \$1_c;
#X obj 71 255 t a a;
#X msg 71 280 symbol \$1_d;
#X obj 71 305 t a a;
#X symbolatom 121 305 0 0 0 0 - - -;
#X symbolatom 121 255 0 0 0 0 - - -;
#X symbolatom 121 205 0 0 0 0 - - -;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 1 10 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 5 1 9 0;
#X connect 6 0 7 0;
#X connect 7 1 8 0;

i also took the liberty and replaced the (wrong) "0.50-2" version with a link to the "current" master

@Spacechild1

This comment has been minimized.

Copy link
Contributor

@Spacechild1 Spacechild1 commented Dec 9, 2019

Does this also happen with the Pd 0.50.2 release? This is not the same as current master. Miller recently pushed a commit about spaces in symbols and noted that he might have broken something

@Ant1r

This comment has been minimized.

Copy link
Contributor Author

@Ant1r Ant1r commented Dec 9, 2019

you were right! It doesn't happen with (git tag) 0.50-2.

@millerpuckette

This comment has been minimized.

Copy link
Contributor

@millerpuckette millerpuckette commented Dec 9, 2019

almost certainly 2c17432 did it. I was worried that something would go wrong. Will try to fix.

@millerpuckette

This comment has been minimized.

Copy link
Contributor

@millerpuckette millerpuckette commented Dec 10, 2019

OK an attempted fix is up.

@umlaeute

This comment has been minimized.

Copy link
Contributor

@umlaeute umlaeute commented Dec 10, 2019

@millerpuckette hmm well, this will still put a backslash before every space in symbolbox, messageboxes and printouts.

[32(
|
[makefilename %c]
|
[set a_$1_b(
|
[a_\ _b(

This is better than before (where \ would accumulate backslashes whenever a new symbol was being generated), but still a regression, as right before 2c17432 they all printed nicely.

e.g. if i create a messagebox [a\ b( (with the first atom being literally a-BackSlash-Space-b and send that to a [symbol] a finally to a symbolbox, like the following...

[a\ b(
|
[symbol]
|
[symbolbox\

... then i get the following:

commit contents of symbolbox notes
b34090d a b the commit before 2c17432
2c17432 a\ b
a790096 a\ b

i do not fully understand what 2c17432 was trying to fix in the first place.

🤔

most likely it has to do with persistency.
saving my above patch to disk, will leave out the backslashes. so when re-loading the patch the messagebox has become [a b( (selector a, first atom symbol:b), which is not the same as what we saved (selector a b).
i think the problem comes from Pd trying to use the same symbol-representation for both the GUI-communication (and display; which are not the same thing) and file persistency.

@Ant1r

This comment has been minimized.

Copy link
Contributor Author

@Ant1r Ant1r commented Dec 10, 2019

Thanks a lot! This fixes my specific use case anyway.

@millerpuckette

This comment has been minimized.

Copy link
Contributor

@millerpuckette millerpuckette commented Dec 10, 2019

@millerpuckette hmm well, this will still put a backslash before every space in symbolbox, messageboxes and printouts.
[...]
This is better than before (where \ would accumulate backslashes whenever a new symbol was being generated), but still a regression, as right before 2c17432 they all printed nicely.

I think the previous behavior was wrong and this is a bug fix. For instance, the symbol "foo foo"
and the two symbols "foo" and "foo" printed out the same way before.

most likely it has to do with persistency.
saving my above patch to disk, will leave out the backslashes. so when re-loading the patch the messagebox has become [a b( (selector a, first atom symbol:b), which is not the same as what we saved (selector a b).
i think the problem comes from Pd trying to use the same symbol-representation for both the GUI-communication (and display; which are not the same thing) and file persistency.
That is indeed what I first set out to fix - that was clearly a bug, regardkess of whether we regard symbol-box printing as one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.