Make Pollen compatible with new module-suffixes facility #34

Closed
opened 9 years ago by notio · 40 comments
notio commented 9 years ago (Migrated from github.com)

I believe this is a Racket issue rather than a Pollen issue, but perhaps I'm missing something, or there is a config/pref that could be added to the Pollen guide.

This instruction, in quick.scrbl...

Save this file with the name hello.txt.pp in any convenient directory. 

... appears to be broken using a clean install of the 64-bit Mac OS X Racket distribution (racket-6.1.1-x86_64-macosx.dmg).

It appears this version of DrRacket is unable to save a file without appending the .rkt extension. In the Save dialog (or the Save Definitions As... dialog, or the Save Other > Save Definitions As Text... dialog) I can delete the .rkt extension in the dialog but it saves with the .rkt extension applied anyway.

If, in the Save dialog, I remove the .rkt extension and the file exists it will ask if I want to overwrite it, which I do, and it thinks it does, but the file as shown by the Finder actually has the .rkt extension (correctly overwritten).

The summary here is that a browser pointed at the project server cannot just reload the page, because that page hasn't changed. The "hello.txt.pp.rkt" page has changed.

This only worked initially because when I first started the tutorial I manually changed the filename in the Finder, thinking, "Oh, I forgot to delete the default extension in the Save dialog, I'll just change the name." So then there was a page at http://localhost:8080/hello.txt but it never changes when saving via DrRacket...

If I had a solution I'd make a pull request against the docs, but I'm currently stumped. Pointers? Take it to Racket?

I believe this is a Racket issue rather than a Pollen issue, but perhaps I'm missing something, or there is a config/pref that could be added to the Pollen guide. This instruction, in quick.scrbl... ``` Save this file with the name hello.txt.pp in any convenient directory. ``` ... appears to be broken using a clean install of the 64-bit Mac OS X Racket distribution (racket-6.1.1-x86_64-macosx.dmg). It appears this version of DrRacket is unable to save a file without appending the .rkt extension. In the Save dialog (or the Save Definitions As... dialog, or the Save Other > Save Definitions As Text... dialog) I can delete the .rkt extension in the dialog but it saves with the .rkt extension applied anyway. If, in the Save dialog, I remove the .rkt extension and the file exists it will ask if I want to overwrite it, which I do, and it thinks it does, but the file as shown by the Finder actually has the .rkt extension (correctly overwritten). The summary here is that a browser pointed at the project server cannot just reload the page, because that page hasn't changed. The "hello.txt.pp.rkt" page has changed. This only worked initially because when I first started the tutorial I manually changed the filename in the Finder, thinking, "Oh, I forgot to delete the default extension in the Save dialog, I'll just change the name." So then there was a page at http://localhost:8080/hello.txt but it never changes when saving via DrRacket... If I had a solution I'd make a pull request against the docs, but I'm currently stumped. Pointers? Take it to Racket?
notio commented 9 years ago (Migrated from github.com)

I also reported this just now using the DrRacket "Submit Bug Report..." function in the Help menu.

I also reported this just now using the DrRacket "Submit Bug Report..." function in the Help menu.
mbutterick commented 9 years ago (Migrated from github.com)

Sorry about the trouble. This problem has been reported once before, as issue #14, which also has some tips on working around it.

A question was also submitted to the Racket list at that time, though the author of DrRacket was not able to account for it either.

Unfortunately I’ve never been able to reproduce it on my copies of OS X. Nor has it surfaced repeatedly by people using Pollen. Which makes me wonder if there’s some third ingredient responsible for this bug.

Anyhow, if the Save boxes in DrRacket are not cooperating, you can just save the file with any name you want and change it in the Finder (either directly or through the Get Info box). Or start the file in any text editor (e.g., Sublime Text) and then open it in DrRacket. Or you can just create & edit your files in a text editor other than DrRacket.

Sorry about the trouble. This problem has been reported once before, as issue #14, which also has some tips on working around it. A question was also submitted to the Racket list at that time, though the author of DrRacket [was not able](http://lists.racket-lang.org/users/archive/2014-June/063038.html) to account for it either. Unfortunately I’ve never been able to reproduce it on my copies of OS X. Nor has it surfaced repeatedly by people using Pollen. Which makes me wonder if there’s some third ingredient responsible for this bug. Anyhow, if the Save boxes in DrRacket are not cooperating, you can just save the file with any name you want and change it in the Finder (either directly or through the Get Info box). Or start the file in any text editor (e.g., Sublime Text) and then open it in DrRacket. Or you can just create & edit your files in a text editor other than DrRacket.
daf-code commented 9 years ago (Migrated from github.com)

FYI, I'm having this problem as well. I'm just touching the files in Terminal to create them with the right names before editing them in DrRacket. I'm on 10.8.5 — that might have something to do with it. Pollen is awesome.

FYI, I'm having this problem as well. I'm just touching the files in Terminal to create them with the right names before editing them in DrRacket. I'm on 10.8.5 — that might have something to do with it. Pollen is awesome.
mbutterick commented 9 years ago (Migrated from github.com)

Coincidentally, earlier today I pushed a workaround (7bfd403023) for this issue (and issue https://github.com/mbutterick/pollen/issues/14).

Instead of naming source files with a double extension like index.html.pm, you can optionally use the escape character _ for the inner extension. Thus your source file can be named index_html.pm, but it will still output to index.html.

You can also change the escape character on a per-project basis. This is noted in the new docs under “File formats.” (use raco pkg update --update-deps pollen to get the patch & new docs).

I never determined why this was happening in the first place (indeed, I’ve never been able to reproduce it on my own machine). But, since there are at least some combinations of software that object to double extensions, better to just have an approved way of handling it.

Coincidentally, earlier today I pushed a workaround (https://github.com/mbutterick/pollen/commit/7bfd403023e86e39a9c3a63f6ec5fa6e51b21506) for this issue (and issue https://github.com/mbutterick/pollen/issues/14). Instead of naming source files with a double extension like `index.html.pm`, you can optionally use the escape character `_` for the inner extension. Thus your source file can be named `index_html.pm`, but it will still output to `index.html`. You can also change the escape character on a per-project basis. This is noted in the new docs under “File formats.” (use `raco pkg update --update-deps pollen` to get the patch & new docs). I never determined why this was happening in the first place (indeed, I’ve never been able to reproduce it on my own machine). But, since there are at least some combinations of software that object to double extensions, better to just have an approved way of handling it.
daf-code commented 9 years ago (Migrated from github.com)

OK — updated all in raco pkg.

The behavior of DrRacket would seem to be unchanged when trying to save a Pollen file with .pmd despite escaping the inner extension. It seems DrRacket is examining the end of the filename string each time a character is changed and when it the end of the string doesn't match a known valid extension, it checks the Hide extension box and appends a hidden .rkt.

Editing a new file, the save dialog opens with the "Hide extension" option unchecked and the filename field empty. Lets say we want to name the file test.html.pmd . As soon as t is typed, the hide extension field is auto-checked (and a hidden .rkt extension is appended). Upon entering test.h the box unchecks itself (and the extension is removed). At test.ht it checks itself again. At test.htm it unchecks, and stays unchecked at test.html. Then, either test.html! or test.html. will cause the box to check itself again (and append a hidden .rkt). The process repeats as DrRacket apparently examines the end of the filename string, looking for a valid final extension. If it doesn't find one it likes, it forces the checkbox on and appends .rkt.

DrRacket accepts .pp and .pm as valid extensions, leaves the Hide extension box cleared and does not append .rkt . That is not the case for .pmd . Whether or not escaping the inner html with ! .

screen shot 2015-07-26 at 6 39 49 am

screen shot 2015-07-26 at 6 40 02 am

screen shot 2015-07-26 at 6 40 12 am

OK — updated all in raco pkg. The behavior of DrRacket would seem to be unchanged when trying to save a Pollen file with `.pmd` despite escaping the inner extension. It seems DrRacket is examining the end of the filename string each time a character is changed and when it the end of the string doesn't match a known valid extension, it checks the `Hide extension` box and appends a hidden `.rkt`. Editing a new file, the save dialog opens with the "Hide extension" option unchecked and the filename field empty. Lets say we want to name the file `test.html.pmd` . As soon as `t` is typed, the `hide extension` field is auto-checked (and a hidden `.rkt` extension is appended). Upon entering `test.h` the box unchecks itself (and the extension is removed). At `test.ht` it checks itself again. At `test.htm` it unchecks, and stays unchecked at `test.html`. Then, either `test.html!` or `test.html.` will cause the box to check itself again (and append a hidden `.rkt`). The process repeats as DrRacket apparently examines the end of the filename string, looking for a valid final extension. If it doesn't find one it likes, it forces the checkbox on and appends `.rkt`. DrRacket accepts `.pp` and `.pm` as valid extensions, leaves the `Hide extension` box cleared and does not append `.rkt` . That is not the case for `.pmd` . Whether or not escaping the inner `html` with `!` . ![screen shot 2015-07-26 at 6 39 49 am](https://cloud.githubusercontent.com/assets/12973363/8894159/341259ee-3361-11e5-9573-b3e5d80cc545.png) ![screen shot 2015-07-26 at 6 40 02 am](https://cloud.githubusercontent.com/assets/12973363/8894161/3749e1b8-3361-11e5-939d-c0bbc862665d.png) ![screen shot 2015-07-26 at 6 40 12 am](https://cloud.githubusercontent.com/assets/12973363/8894162/3af24ad0-3361-11e5-9ba1-f2e8212a6fa1.png)
mbutterick commented 9 years ago (Migrated from github.com)

Thank you for the report. I think I need to try this myself on a clean OS X install. I wonder if OS X perhaps intuits the approved file types from the Spotlight index or something similar. When I try to save with a pmd extension in DrRacket, I get the dialog box shown below. However, if I try extensions like pmdd or mpd, I get the same behavior you describe. So there seems to be a sense in which my system has relented on the validity of pmd.

screen shot 2015-07-26 at 10 02 21 am

Thank you for the report. I think I need to try this myself on a clean OS X install. I wonder if OS X perhaps intuits the approved file types from the Spotlight index or something similar. When I try to save with a `pmd` extension in DrRacket, I get the dialog box shown below. However, if I try extensions like `pmdd` or `mpd`, I get the same behavior you describe. So there seems to be a sense in which my system has relented on the validity of `pmd`. ![screen shot 2015-07-26 at 10 02 21 am](https://cloud.githubusercontent.com/assets/1425051/8894952/9e436ce2-337d-11e5-9ecd-2cf75c3fd18f.gif)
mbutterick commented 9 years ago (Migrated from github.com)

One more diganostic. The approved file types are viewable in OS X by running this command:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump

When I search in this file for .pmd I discover that it’s been registered on my system as a Pagemaker file extension (probably by some Adobe software). That might explain why the results on this bug are erratic: people who happen to have .pmd already registered by some other program don’t have a problem.

Do you find any reference to .pmd in this file?

Still suggests that testing on a clean system will be instructive.

One more diganostic. The approved file types are viewable in OS X by running this command: ``` shell /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump ``` When I search in this file for `.pmd` I discover that it’s been registered on my system as a Pagemaker file extension (probably by some Adobe software). That might explain why the results on this bug are erratic: people who happen to have `.pmd` already registered by some other program don’t have a problem. Do you find any reference to `.pmd` in this file? Still suggests that testing on a clean system will be instructive.
daf-code commented 9 years ago (Migrated from github.com)

My launchregister dump doesn't seem to have anything for pmd.

My launchregister dump doesn't seem to have anything for pmd.
mbutterick commented 9 years ago (Migrated from github.com)

Hm, then it seems likely that Pollen should be registering its source-file types during installation on OS X. (Looks like the preferred procedure is to use lsregister, a process described here.).

This seems, however, like it might be the tip of a larger-than-Pollen iceberg, because Racket is designed to create new languages (that are not Racket and thus probably don’t use the .rkt etc. extensions). So file-extension registration is potentially an endemic issue. @rfindler, do you want to weigh in before I blunder ahead?

Hm, then it seems likely that Pollen should be registering its source-file types during installation on OS X. (Looks like the preferred procedure is to use `lsregister`, a process [described here.](http://apple.stackexchange.com/a/175395)). This seems, however, like it might be the tip of a larger-than-Pollen iceberg, because Racket is designed to create new languages (that are not Racket and thus probably don’t use the `.rkt` etc. extensions). So file-extension registration is potentially an endemic issue. @rfindler, do you want to weigh in before I blunder ahead?
rfindler commented 9 years ago (Migrated from github.com)

Sorry I don't have any good advice. @mflatt has some good ideas I bet.

Sorry I don't have any good advice. @mflatt has some good ideas I bet.
daf-code commented 9 years ago (Migrated from github.com)

Let it be known that I am a novice and on most days I'm lucky if I can find my parentheses with both hands. That said, perhaps there could be an option added to the 'Warnings' or 'General' preference panels to disable extension hiding and the save panel's filename extension safety checks. There's already one that disables the changed format warning. (Toggling it doesn't alter this aspect of extension checking.) Those who want to use unregistered extensions can probably tolerate having .rkt in the save dialog when saving standard files.

Alternatively, might it be possible to use the Open With contextual menu in the Finder to associate targeted extensions with DrRacket? I tried setting it permanently (in the Other... subdialog, check 'Always Open With'); it didn't change the save panel's behavior, or produce anything in lsregister. Perhaps that functionality requires an existing entry in the lsregister db....

Let it be known that I am a novice and on most days I'm lucky if I can find my parentheses with both hands. That said, perhaps there could be an option added to the 'Warnings' or 'General' preference panels to disable extension hiding and the save panel's filename extension safety checks. There's already one that disables the changed format warning. (Toggling it doesn't alter this aspect of extension checking.) Those who want to use unregistered extensions can probably tolerate having `.rkt` in the save dialog when saving standard files. Alternatively, might it be possible to use the Open With contextual menu in the Finder to associate targeted extensions with DrRacket? I tried setting it permanently (in the Other... subdialog, check 'Always Open With'); it didn't change the save panel's behavior, or produce anything in lsregister. Perhaps that functionality requires an existing entry in the lsregister db....
mbutterick commented 9 years ago (Migrated from github.com)

Well, the deeper problem is that DrRacket, because it’s a cross-platform app, delegates the Save dialog to the underlying OS. So if there’s an OS-specific wart — as there is here — there’s not much on the Racket end of things that can (or should) be done to laser it.

I’m not sure that a fix can be rolled into raco pkg install anyhow. I’d bet a dollar that changing the lsregister database requires superuser access (meaning, a password). (I’ll try it and make sure.) But if so, then raco pkg install would stop being a fully automated process, and that is kapu.

I think it would be wiser for me to just put a little script in the package that will add Pollen’s source extensions to OS X if you want them / need them. And if that script needs a password, nobody will be bothered.

Well, the deeper problem is that DrRacket, because it’s a cross-platform app, delegates the Save dialog to the underlying OS. So if there’s an OS-specific wart — as there is here — there’s not much on the Racket end of things that can (or should) be done to laser it. I’m not sure that a fix can be rolled into `raco pkg install` anyhow. I’d bet a dollar that changing the `lsregister` database requires superuser access (meaning, a password). (I’ll try it and make sure.) But if so, then `raco pkg install` would stop being a fully automated process, and that is kapu. I think it would be wiser for me to just put a little script in the package that will add Pollen’s source extensions to OS X if you want them / need them. And if that script needs a password, nobody will be bothered.
mbutterick commented 9 years ago (Migrated from github.com)

I’ve just pushed an update with a file called tools/os x/register-pollen-source-extensions.app.This is a tiny app that holds the Pollen file extensions to OS X. The idea is that you register this app with OS X, and thereby its file extensions, and after that they will be recognized throughout the system (including the Save dialog in DrRacket).

  1. Get the Pollen update (raco pkg update --update-deps pollen)

  2. Determine the path to the lsregister tool on your system. On mine it’s

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister
  1. In the Terminal, use lsregister to register the file extensions with this Terminal command:
path/to/lsregister path/to/register-pollen-source-extensions.app
  1. Restart.

  2. Let me know if that helped.

Sorry about the lumpy fix but once I know it works for someone other than myself, I can add a shell script that will smooth things out.

I’ve just pushed an update with a file called `tools/os x/register-pollen-source-extensions.app`.This is a tiny app that holds the Pollen file extensions to OS X. The idea is that you register this app with OS X, and thereby its file extensions, and after that they will be recognized throughout the system (including the Save dialog in DrRacket). 1) Get the Pollen update (`raco pkg update --update-deps pollen`) 2) Determine the path to the `lsregister` tool on your system. On mine it’s ``` /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister ``` 3) In the Terminal, use `lsregister` to register the file extensions with this Terminal command: ``` path/to/lsregister path/to/register-pollen-source-extensions.app ``` 4) Restart. 5) Let me know if that helped. Sorry about the lumpy fix but once I know it works for someone other than myself, I can add a shell script that will smooth things out.
mbutterick commented 9 years ago (Migrated from github.com)

I found this SE post helpful in putting this together.

I found this [SE post](http://apple.stackexchange.com/a/175395) helpful in putting this together.
mbutterick commented 9 years ago (Migrated from github.com)

I just tried installing Pollen on a clean OS X Yosemite machine. Good news and weird news. The good news is that the fix seems to work. The weird news is that it seems to auto-execute when the pollen package is installed — no messing with lsregister necessary. I classify that as “weird” news rather than “especially good” because I didn’t plan for that to happen & not clear why it does. However, the new DrRacket recognizes all the Pollen file extensions. So … lacking any evidentiary basis to keep this issue open, it is now closed.

I just tried installing Pollen on a clean OS X Yosemite machine. Good news and weird news. The good news is that the fix seems to work. The weird news is that it seems to auto-execute when the `pollen` package is installed — no messing with `lsregister` necessary. I classify that as “weird” news rather than “especially good” because I didn’t plan for that to happen & not clear why it does. However, the new DrRacket recognizes all the Pollen file extensions. So … lacking any evidentiary basis to keep this issue open, it is now closed.
otherjoel commented 9 years ago (Migrated from github.com)

Running DrRacket 6.2.1 (64 bit) on an up-to-date Yosemite, I continue to have this issue and it's pretty annoying. Basically if any keypress results in the last four characters not being equal to .rkt, the "Hide Extension" checkbox is immediately selected and the .rkt extension appended invisibly. (This is true even if I type out hello.txt.pp, uncheck Hide Extension which changes it to hello.txt.pp.rkt and then highlight the .rkt extension and delete it with a single keystroke.)

I first updated pollen using raco pkg and rebooted. When that did not work I removed it and reinstalled it (also using raco), and rebooted. Finally I ran the lsregister command manually, and rebooted, still no luck.

Note, at this point if I do "Get Info" on a file hello.txt.pp, the dialog lists it as "Kind: Pollen preprocessor source file".

Barring a fix, the only workarounds involve either a) saving the file with .rkt and somehow renaming it afterwards, or b) creating the file (e.g. touch hello.txt.pp) and then opening it.

Running DrRacket 6.2.1 (64 bit) on an up-to-date Yosemite, I continue to have this issue and it's pretty annoying. Basically if any keypress results in the last four characters **not** being equal to `.rkt`, the "Hide Extension" checkbox is immediately selected and the `.rkt` extension appended invisibly. (This is true even if I type out `hello.txt.pp`, uncheck Hide Extension which changes it to `hello.txt.pp.rkt` and then highlight the `.rkt` extension and delete it with a single keystroke.) I first updated pollen using `raco pkg` and rebooted. When that did not work I removed it and reinstalled it (also using `raco`), and rebooted. Finally I ran the `lsregister` command manually, and rebooted, still no luck. Note, at this point if I do "Get Info" on a file `hello.txt.pp`, the dialog lists it as "Kind: Pollen preprocessor source file". Barring a fix, the only workarounds involve either a) saving the file with .rkt and somehow renaming it afterwards, or b) creating the file (e.g. `touch hello.txt.pp`) and then opening it.
mbutterick commented 9 years ago (Migrated from github.com)

When you “ran the lsregister command,” you mean you ran it like so — with the register-pollen-source-extensions.app as the argument?

path/to/lsregister path/to/register-pollen-source-extensions.app
When you “ran the `lsregister` command,” you mean you ran it like so — with the `register-pollen-source-extensions.app` as the argument? ``` path/to/lsregister path/to/register-pollen-source-extensions.app ```
mbutterick commented 9 years ago (Migrated from github.com)

Note, at this point if I do "Get Info" on a file hello.txt.pp, the dialog lists it as "Kind: Pollen preprocessor source file".

This is interesting to me because the only way this line will show up is from the little database of file extensions packaged with register-pollen-source-extensions.app.

If you change the extension of the file to ptree and do Get Info, what does it say?

> Note, at this point if I do "Get Info" on a file hello.txt.pp, the dialog lists it as "Kind: Pollen preprocessor source file". This is interesting to me because the only way this line will show up is from the little database of file extensions packaged with `register-pollen-source-extensions.app`. If you change the extension of the file to `ptree` and do Get Info, what does it say?
otherjoel commented 9 years ago (Migrated from github.com)

When you “ran the lsregister command,” you mean you ran it like so — with the register-pollen-source-extensions.app as the argument?

Yep, exactly so.

This is interesting to me because the only way this line will show up is from the little database of file extensions packaged with register-pollen-source-extensions.app.

If you change the extension of the file to ptree and do Get Info, what does it say?

Yes, that’s what I was thinking. If I change the extension to .ptree Get Info says “Pollen pagetree source file”.

> When you “ran the lsregister command,” you mean you ran it like so — with the `register-pollen-source-extensions.app` as the argument? Yep, exactly so. > This is interesting to me because the only way this line will show up is from the little database of file extensions packaged with `register-pollen-source-extensions.app`. > > If you change the extension of the file to `ptree` and do Get Info, what does it say? Yes, that’s what I was thinking. If I change the extension to `.ptree` Get Info says “Pollen pagetree source file”.
mbutterick commented 9 years ago (Migrated from github.com)

Strange. That proves that the Pollen file extensions are indeed getting registered (which is good) but I would expect that to make them valid across OS X (DrRacket & elsewhere).

OTOH I notice now that other OS X programs don’t have the “Hide Extension” box that DrRacket does. So maybe DrRacket (= a cross-platform program) is making some broad assumptions about file naming that aren’t entirely accurate on OS X.

I’ll take a look at Windows Racket and see how it compares.

Strange. That proves that the Pollen file extensions are indeed getting registered (which is good) but I would expect that to make them valid across OS X (DrRacket & elsewhere). OTOH I notice now that other OS X programs don’t have the “Hide Extension” box that DrRacket does. So maybe DrRacket (= a cross-platform program) is making some broad assumptions about file naming that aren’t entirely accurate on OS X. I’ll take a look at Windows Racket and see how it compares.
mbutterick commented 9 years ago (Migrated from github.com)

Racket Central Command has advised me that a centralized facility for handling file extensions is in the offing, so patience is counseled.

In the meantime, a dumb-but-effective workaround would be to change your Pollen file extensions to those that DrRacket already recognizes, like rkt, rktd, and ss. You would do this by adding a config submodule to your directory-require.rkt like so:

#lang racket/base

(module config racket/base
  (provide (all-defined-out))
  (define markup-source-ext 'rkt)
  (define preproc-source-ext 'rktd)))

Then instead of filename.html.pm you would name your markup files e.g., filename.html.rkt and preprocessor files e.g. styles.css.rktd.

Racket Central Command has [advised me](https://groups.google.com/d/msg/racket-users/1vLsKSY7ZQU/8236M3aVEQAJ) that a centralized facility for handling file extensions is in the offing, so patience is counseled. In the meantime, a dumb-but-effective workaround would be to change your Pollen file extensions to those that DrRacket already recognizes, like `rkt`, `rktd`, and `ss`. You would do this by adding a `config` submodule to your `directory-require.rkt` like so: ``` #lang racket/base (module config racket/base (provide (all-defined-out)) (define markup-source-ext 'rkt) (define preproc-source-ext 'rktd))) ``` Then instead of `filename.html.pm` you would name your markup files e.g., `filename.html.rkt` and preprocessor files e.g. `styles.css.rktd`.
mbutterick commented 9 years ago (Migrated from github.com)

Apparently this centralized facility has been implemented in the development version of Racket. I need to do some work to make Pollen compatible with it. But assuming it works, that will be the best solution. I’ll leave this issue open as a reminder.

Apparently this centralized facility [has been implemented](https://groups.google.com/d/msg/racket-users/1vLsKSY7ZQU/K6vWD1XlEQAJ) in the development version of Racket. I need to do some work to make Pollen compatible with it. But assuming it works, that will be the best solution. I’ll leave this issue open as a reminder.
mbutterick commented 9 years ago (Migrated from github.com)

BTW I changed the default escape-extension character from ! to _ after noticing that this is a convention already used in Racket (for instance, with dep and zo files).

BTW I changed the default escape-extension character from `!` to `_` after noticing that this is a convention already used in Racket (for instance, with `dep` and `zo` files).
mbutterick commented 9 years ago (Migrated from github.com)

Pollen is now compatible with the current Racket development build, which includes support for language-specified file extensions, which in this case are pp pm pmd ptree and p.

This feature will probably take a while to show up in an official stable release, so if you want to use it, you’ll need to build Racket from GitHub source (= no big deal) or download a snapshot build (= easy).

Thank you to @mflatt for making this possible.

Pollen is [now compatible](fea8e7b1aec678a481e3e4f4cd31437535ea2dc4) with the current Racket development build, which includes support for language-specified file extensions, which in this case are `pp` `pm` `pmd` `ptree` and `p`. This feature will probably take a while to show up in an official stable release, so if you want to use it, you’ll need to build Racket from GitHub source (= no big deal) or download a snapshot build (= easy). Thank you to @mflatt for making this possible.
freefrancisco commented 7 years ago (Migrated from github.com)

I just installed the latest DrRacket (version 6.8) and trying to go through the pollen tutorial in Mac OS X I am having the same problems described in this old issue. Was it ever fixed? If so, is there a single place with instructions on how to modify the settings of DrRacket or the settings of OS X to force DrRacket to save files with extensions other than .rkt?

I just installed the latest DrRacket (version 6.8) and trying to go through the pollen tutorial in Mac OS X I am having the same problems described in this old issue. Was it ever fixed? If so, is there a single place with instructions on how to modify the settings of DrRacket or the settings of OS X to force DrRacket to save files with extensions other than .rkt?
mbutterick commented 7 years ago (Migrated from github.com)

What do you get if you run this program in DrRacket?

#lang racket
(require compiler/module-suffix)
(get-module-suffixes)
What do you get if you run this program in DrRacket? ```racket #lang racket (require compiler/module-suffix) (get-module-suffixes) ```
freefrancisco commented 7 years ago (Migrated from github.com)

I get this
'(#"rkt" #"pm" #"pmd" #"pp" #"ptree" #"scm" #"scrbl" #"ss")

I get this '(#"rkt" #"pm" #"pmd" #"pp" #"ptree" #"scm" #"scrbl" #"ss")
mbutterick commented 7 years ago (Migrated from github.com)

OK, that means the Pollen file extensions are recognized. Do you have the same file-saving problem with scm or scrbl files (also on that list) or are the problems restricted to the Pollen extensions (pp pm et al)

OK, that means the Pollen file extensions are recognized. Do you have the same file-saving problem with `scm` or `scrbl` files (also on that list) or are the problems restricted to the Pollen extensions (`pp` `pm` et al)
freefrancisco commented 7 years ago (Migrated from github.com)

I just tried the scm and scrbl extensions and they both work. When I type either of them the box to hide extension unchecks itself, but that doesn't happen with the Pollen extensions.

I just tried the scm and scrbl extensions and they both work. When I type either of them the box to hide extension unchecks itself, but that doesn't happen with the Pollen extensions.
mbutterick commented 7 years ago (Migrated from github.com)

And this is what version of Mac OS?

And this is what version of Mac OS?
freefrancisco commented 7 years ago (Migrated from github.com)

It's Sierra, 10.12.1

It's Sierra, 10.12.1
mbutterick commented 7 years ago (Migrated from github.com)

@rfindler / @mflatt — any intuitions about this before I start spelunking? Pollen is adding filename suffixes with the module-suffixes property in info.rkt.These suffixes are being reported correctly by (get-module-suffixes):

'(#"rkt" #"pm" #"pmd" #"pp" #"ptree" #"scm" #"scrbl" #"ss")

But there is nevertheless a difference in behavior between the “native” extensions (rkt scrbl ss) and ones added via module-suffixes.

The fact that this problem disappeared for 18 months and has now resurfaced makes me wonder if something related to the handling of suffixes has changed recently ... ? Hence my question about intuitions.

@rfindler / @mflatt — any intuitions about this before I start spelunking? Pollen is adding filename suffixes with the `module-suffixes` property in `info.rkt`.These suffixes are being reported correctly by `(get-module-suffixes)`: ```racket '(#"rkt" #"pm" #"pmd" #"pp" #"ptree" #"scm" #"scrbl" #"ss") ``` But there is nevertheless a difference in behavior between the “native” extensions (`rkt` `scrbl` `ss`) and ones added via `module-suffixes`. The fact that this problem disappeared for 18 months and has now resurfaced makes me wonder if something related to the handling of suffixes has changed recently ... ? Hence my question about intuitions.
mbutterick commented 7 years ago (Migrated from github.com)

PS I am also using Sierra and have not had this problem. The fact that this issue is not consistently reproducible has been noted before. But that was all prior to the addition of module-suffixes in Aug 2015.

PS I am also using Sierra and have not had this problem. The fact that this issue is not consistently reproducible has been [noted before](https://github.com/mbutterick/pollen/issues/34#issuecomment-68225801). But that was all prior to the addition of `module-suffixes` in [Aug 2015](https://groups.google.com/forum/#!msg/racket-users/1vLsKSY7ZQU/K6vWD1XlEQAJ).
rfindler commented 7 years ago (Migrated from github.com)

It may be instructive to put a printf here:

https://github.com/racket/gui/blob/master/gui-lib/framework/private/finder.rkt#L46

and here:

https://github.com/racket/gui/blob/master/gui-lib/framework/private/finder.rkt#L71

to see what the actual arguments being passed to get-file and put-file are in order to figure out if this is a bug in the framework/drracket or in some lower layer.

It may be instructive to put a printf here: https://github.com/racket/gui/blob/master/gui-lib/framework/private/finder.rkt#L46 and here: https://github.com/racket/gui/blob/master/gui-lib/framework/private/finder.rkt#L71 to see what the actual arguments being passed to `get-file` and `put-file` are in order to figure out if this is a bug in the framework/drracket or in some lower layer.
alex-lew commented 7 years ago (Migrated from github.com)

I am also having this issue. What's more, I was able to save as .pp the first few times I tried. Now I can't get it to work. I'm not sure what changed.

I am also having this issue. What's more, I was able to save as .pp the first few times I tried. Now I can't get it to work. I'm not sure what changed.
mbutterick commented 7 years ago (Migrated from github.com)

What version of Sierra?

BTW I’m using Sierra 10.12.3 and can’t reproduce this problem. @freefrancisco said he’s using Sierra 10.12.1.

What version of Sierra? BTW I’m using Sierra 10.12.3 and can’t reproduce this problem. @freefrancisco said he’s using Sierra 10.12.1.
freefrancisco commented 7 years ago (Migrated from github.com)

I just upgraded my Sierra to 10.12.3 and the problem went away!

I just upgraded my Sierra to 10.12.3 and the problem went away!
alex-lew commented 7 years ago (Migrated from github.com)

Interesting -- I'm using 10.12.4 beta!

Interesting -- I'm using 10.12.4 beta!
mbutterick commented 7 years ago (Migrated from github.com)

This seems to show that this is not a Racket or Pollen problem, but rather Mac OS. If the bug in Sierra 10.12.4 persists to the release version, I will revisit the issue then (as I will assumedly be able to reproduce it too)

This seems to show that this is not a Racket or Pollen problem, but rather Mac OS. If the bug in Sierra 10.12.4 persists to the release version, I will revisit the issue then (as I will assumedly be able to reproduce it too)
alex-lew commented 7 years ago (Migrated from github.com)

Just wanted to report back and say that I haven't been experiencing this issue anymore (I'm still on 12.4 beta, but I did upgrade to DrRacket v6.9, which I think may have reset some settings?).

Now that I'm a bit more experienced with Pollen, I also wanted to say a huge thank you for this incredible tool! As a teacher, I've been using it to write pretty assignments for my students and loving it. Hoping to use it for a personal website this summer as well. Thanks so much!

Just wanted to report back and say that I haven't been experiencing this issue anymore (I'm still on 12.4 beta, but I did upgrade to DrRacket v6.9, which I think may have reset some settings?). Now that I'm a bit more experienced with Pollen, I _also_ wanted to say a huge **thank you** for this incredible tool! As a teacher, I've been using it to write pretty assignments for my students and loving it. Hoping to use it for a personal website this summer as well. Thanks so much!
Sign in to join this conversation.
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#34
Loading…
There is no content yet.