On Sun, Dec 12, 2010 at 05:06:35AM +0000, Philip Hudson wrote:
> On 12 Dec, 2010, at 12:20 am, John J. Foerch wrote:
> 
> >On Sat, Dec 11, 2010 at 10:15:09PM +0000, Philip Hudson wrote:
> >>When I M-x save a link (or `s'), and the link points to file
> >>`foo.el', I am prompted to save a file named `foo.html'. How come?
> >
> >There's an open bug report: http://bugs.conkeror.org/issue126
> 
> Good to know, and it also gives an effective workaround in the
> report: follow the link and then save 0.
> 
> <architecture context snipped>
> 
> >Conkeror is not
> >pre-fetching the file to check its mime-type.  Without knowing the
> >mime-type, it raises the conflict, how do you know which extensions to
> >keep, and which to replace by ".html".
> 
> Naive first-thought solution: a user pref, expressed as a JS list of
> extensions not to replace with "html". Default contents: just "el".
> 
> Second-thought solution: the inverse, a list of extensions always to
> replace with "html". Default contents: the extensions you mentioned
> ("aspx" etc) plus other standards.
> 
> Third-thought: both the above, plus a third pref, a boolean, as to
> which behavior to default to. Default setting: retain the link
> extension.
> 
> Drawbacks: Too many prefs?
> 
> All the above presumes there's a good reason not to use a pre-fetch
> HTTP HEAD request to determine the MIME type.
> 
> <snip>
> 
> >I'm quite certain there is room for
> >improvement, but I believe the final solution won't sacrifice our
> >nicely
> >designed modularity just for the sake of a little DWYM sugar.
> 
> Agreed.
> 
> Thanks for the enlightenment, John. It is just so great as a user to
> get a detailed and clear response so quickly.
> 


I've done some work on the suggest_file_name procedure, and improved some
of its suggestions.  It now favors preserving extensions, on the grounds
that a fair look at a list of standard extensions and mime types shows
that in the vast majority of cases, preserving the extension is the right
thing to do.  At some point we'll just have to add in an optional
pre-fetch feature to deal with the minority of cases like ".php", etc.

Now would be a good time for anybody who wants to help test, to update
your conkeror, try the 'save' command in various situations and see
whether filename suggestions are reasonable.

-- 
John Foerch
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to