Extend #lang pollen’s get-info function to communicate file extensions #160

Closed
lexi-lambda wants to merge 1 commits from drracket-file-extension into master
lexi-lambda commented 7 years ago (Migrated from github.com)

With this change, files with #lang pollen at the top will default to Untitled.pm instead of Untitled.rkt when saving them for the first time in DrRacket, and it will not append .rkt to files saved with .pp, .pmd, or .pm extensions.

With this change, files with `#lang pollen` at the top will default to `Untitled.pm` instead of `Untitled.rkt` when saving them for the first time in DrRacket, and it will not append `.rkt` to files saved with `.pp`, `.pmd`, or `.pm` extensions.
mbutterick commented 7 years ago (Migrated from github.com)

I see the intention. But I also see bugs. Needs further study.

I see the intention. But I also see bugs. Needs further study.
lexi-lambda commented 7 years ago (Migrated from github.com)

Could you elaborate on what those bugs are?

Could you elaborate on what those bugs are?
mbutterick commented 7 years ago (Migrated from github.com)

How does this square with the module-suffixes designation in "info.rkt"?

How does this square with the `module-suffixes` designation in `"info.rkt"`?
lexi-lambda commented 7 years ago (Migrated from github.com)

They seem orthogonal to me… module-suffixes tells raco setup to look for files ending with those suffixes and treat them as Racket modules, but these get-info settings inform DrRacket that files with #lang pollen at the top should use one of these suffixes when the user opens the Save dialog. Is there some particular behavior you’re seeing that is causing problems?

They seem orthogonal to me… `module-suffixes` tells `raco setup` to look for files ending with those suffixes and treat them as Racket modules, but these `get-info` settings inform DrRacket that files with `#lang pollen` at the top should use one of these suffixes when the user opens the Save dialog. Is there some particular behavior you’re seeing that is causing problems?
mbutterick commented 7 years ago (Migrated from github.com)

Right. So your patch invites a DRY-violation bug.

On Dec 18, 2017, at 12:10 PM, Alexis King notifications@github.com wrote:

They seem orthogonal to me… module-suffixes tells raco setup to look for files ending with those suffixes and treat them as Racket modules, but these get-info settings inform DrRacket that files with #lang pollen at the top should use one of these suffixes when the user opens the Save dialog. Is there some particular behavior you’re seeing that is causing problems?


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

Right. So your patch invites a DRY-violation bug. > On Dec 18, 2017, at 12:10 PM, Alexis King <notifications@github.com> wrote: > > They seem orthogonal to me… module-suffixes tells raco setup to look for files ending with those suffixes and treat them as Racket modules, but these get-info settings inform DrRacket that files with #lang pollen at the top should use one of these suffixes when the user opens the Save dialog. Is there some particular behavior you’re seeing that is causing problems? > > — > You are receiving this because you modified the open/close state. > Reply to this email directly, view it on GitHub, or mute the thread. >
lexi-lambda commented 7 years ago (Migrated from github.com)

Ah! Well, that seems fixable. I can try and figure out a way to get that information out of the info.rkt file.

Ah! Well, that seems fixable. I can try and figure out a way to get that information out of the `info.rkt` file.
mbutterick commented 7 years ago (Migrated from github.com)

Your patch also suggests that you have not read the docs for pollen/setup and absorbed ramifications thereof.

On Dec 18, 2017, at 1:07 PM, Alexis King notifications@github.com wrote:

Ah! Well, that seems fixable. I can try and figure out a way to get that information out of the info.rkt file.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

Your patch also suggests that you have not read the docs for pollen/setup and absorbed ramifications thereof. > On Dec 18, 2017, at 1:07 PM, Alexis King <notifications@github.com> wrote: > > Ah! Well, that seems fixable. I can try and figure out a way to get that information out of the info.rkt file. > > — > You are receiving this because you modified the open/close state. > Reply to this email directly, view it on GitHub, or mute the thread. >
lexi-lambda commented 7 years ago (Migrated from github.com)

I don’t understand. Even if some users change the default extensions, does it not make sense to default to .pm over .rkt?

I don’t understand. Even if some users change the default extensions, does it not make sense to default to `.pm` over `.rkt`?
mbutterick commented 7 years ago (Migrated from github.com)

That’s a separate bug. pm has no special status.

On Dec 18, 2017, at 1:31 PM, Alexis King notifications@github.com wrote:

I don’t understand. Even if some users change the default extensions, does it not make sense to default to .pm over .rkt?


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

That’s a separate bug. `pm` has no special status. > On Dec 18, 2017, at 1:31 PM, Alexis King <notifications@github.com> wrote: > > I don’t understand. Even if some users change the default extensions, does it not make sense to default to .pm over .rkt? > > — > You are receiving this because you modified the open/close state. > Reply to this email directly, view it on GitHub, or mute the thread. >
lexi-lambda commented 7 years ago (Migrated from github.com)

It could well be some other extension, .pm just seemed to me like the most common one. I would certainly rather have DrRacket suggest .pm than .rkt, which is really the purpose of this change—it just configures what DrRacket inserts by default. The user can always change it to their liking.

I’m just unsure of what exactly you take issue with here. Currently, your language’s get-info function responds to this key with "rkt". Are you saying that is preferable to "pm", even if .pm isn’t correct all of the time?

It could well be some other extension, `.pm` just seemed to me like the most common one. I would certainly rather have DrRacket suggest `.pm` than `.rkt`, which is really the purpose of this change—it just configures what DrRacket inserts by *default*. The user can always change it to their liking. I’m just unsure of what exactly you take issue with here. Currently, your language’s `get-info` function responds to this key with `"rkt"`. Are you saying that is preferable to `"pm"`, even if `.pm` isn’t correct all of the time?
mbutterick commented 7 years ago (Migrated from github.com)

.rkt is a valid extension for a Pollen file.

`.rkt` is a valid extension for a Pollen file.
lexi-lambda commented 7 years ago (Migrated from github.com)

.rkt is also a valid extension for a Scribble file, but it defaults to .scrbl because most users want the latter. There has to be some default, so why not pick the one that will be correct the most often?

`.rkt` is also a valid extension for a Scribble file, but it defaults to `.scrbl` because most users want the latter. There has to be *some* default, so why not pick the one that will be correct the most often?
mbutterick commented 7 years ago (Migrated from github.com)

As I’ve already mentioned, there is no notion of a file extension that is “correct the most often”.

In any case, you asked me to elaborate. I did. If you want to fix your patch, OK. If you don’t, also OK.

As I’ve already mentioned, there is no notion of a file extension that is “correct the most often”. In any case, you asked me to elaborate. I did. If you want to fix your patch, OK. If you don’t, also OK.
This pull request cannot be reopened because the branch was deleted.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b drracket-file-extension master
git pull origin drracket-file-extension

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff drracket-file-extension
git push origin master
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#160
Loading…
There is no content yet.