[racket-dev] open untagged files in blank language level?

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Oct 6 14:20:09 EDT 2011

+1, but for different reasons than editing html files...  I'd like to
see the "use the language defined in the source" become the default
for all purposes -- so at least when you open a file that does have a
`#lang' line, or when you type it in, the non-"use the language
defined in the source" languages should make it ask you if you want to
switch to it (to the "use the language defined in the source"
language).

If anything, just the name of the "use the language defined in the
source" language is a very long one, which is unfortunate since it's
often the one that gets recommended often.


Two hours ago, John Clements wrote:
> Currently, opening a file that doesn't begin with a #lang line
> results in a window whose language level is inherited from the
> buffer that was foremost when the open-file was issued (IIUC). I
> think this is a mistake. I think that instead, the language level
> should revert to "Use the language defined in the source."
> 
> My first argument for this is a bit silly and technical; this
> behavior is inconsistent with the other behavior of the "save"
> toolbar button show/hide, which appears to be that the button is
> shown when the text that DrR would save is different from the
> last-saved version. This means that changing language levels shows
> the "save" button, and therefore (I claim) so should opening a file
> without #lang info in a non-use-defined-in-source language level.
> 
> However, I think an even better fix is just to open such files in
> the use-lang-defined-in-source language level.
> 
> Upside of this change: people who edit, say, .html or .txt files in
> DrRacket won't get an ugly surprise when they save them. This is
> more insidious in the case of files such as .html which are intended
> to be interpreted by a different tool (in this case a web browser),
> which will barf on the inserted #lang line.
> 
> Downside of this change: people who *create student-language files
> outside of DrR* will then have to set the language level when
> opening those files. This seems uncommon to me.
-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.