> > Basically, what I was suggesting is an option to allow "Filespec and
> > Alt-Sort to operate on the result of a rename mask (instead of actual
> > filenames)". For example, sorting on a rename mask of "///*.*" would
> > in fact sort by names starting with the 4th character.
>
> If I understand this right I would expect a large performance hit. Each
> file name would have to be stored twice (original and renamed version)
> and then the mask has to be applied to the renamed version. Then these
> renamed versions have to be taken for sorting. This would not only be a
> huge decrease in speed but would also require additional memory and a
> significant coding effort.
>
> A simple offset would just move the character pointer before comparing.
> No need to duplicate the name string nor to modify it.
>
Assuming that the sorting is performed by something like the built-in C function qsort(void *array, size_t count, size_t size, comparison_fn_t compare), there would be no need to duplicate the name strings nor to modify them, even if rename masks would be supported for the sort key. As far as I can see, basically the only thing needed would be to implement a new comparison function that applies the rename mask before comparing the strings.
And, as the complex comparison function could be selected for use only when such a "sort mask" is provided, there would be no performance impact for the current sort options. When sorting on rename masks, the complex comparison function would, of course, involve a performance penalty (depending on the complexity of the rename mask processing).