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
Loading…
Reference in New Issue
There is no content yet.
Delete Branch 'drracket-file-extension'
Deleting a branch is permanent. It CANNOT be undone. Continue?
With this change, files with
#lang pollen
at the top will default toUntitled.pm
instead ofUntitled.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.I see the intention. But I also see bugs. Needs further study.
Could you elaborate on what those bugs are?
How does this square with the
module-suffixes
designation in"info.rkt"
?They seem orthogonal to me…
module-suffixes
tellsraco setup
to look for files ending with those suffixes and treat them as Racket modules, but theseget-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?Right. So your patch invites a DRY-violation bug.
Ah! Well, that seems fixable. I can try and figure out a way to get that information out of the
info.rkt
file.Your patch also suggests that you have not read the docs for pollen/setup and absorbed ramifications thereof.
I don’t understand. Even if some users change the default extensions, does it not make sense to default to
.pm
over.rkt
?That’s a separate bug.
pm
has no special status.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?.rkt
is a valid extension for a Pollen file..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?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.
Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.