George T. Halifax <
georget...@gmail.com> writes:
> No you've got it. I'm basically griping over having to type the extra 3 characters.
>
> But the reason why I'm griping is that I don't feel as though I should ever have to type them, because the vast majority of the time the tex file is what I will be
> opening, and rarely do I ever touch the other files with different extensions. If I can comminicate this to helm somehow, then I can save typing those characters
> every time I open a tex file (which happens quite a lot -- those characters do add up, not to mention that it requires that slightly greater amount of conscious
> thought which can be enough to derail trains of thought). When I think about opening the file, I shouldn't have to consciously decide to open the tex file, I should
> only need to make the conscious decision if I decide to open one of the other files.
>
> Besides, I think it highlights an greater issue: namely that certain
> people may not find the alphabetic sorting to be the most efficient
> for them, most of the time.
It is not and helm-find-files is not sorting alphabetically.
> Ideally, there would be some mechanism by which users could write and
> customize their own "sort function" which sorts the files optimally
> for their needs.
(defmethod helm-setup-user-source ((source helm-source-ffiles))
(oset source :filtered-candidate-transformer 'my-own-sort-function))
Be sure to load helm-files or use some eval-after-load with this.
You will have to write a sort function with two args "S1" and "S2" and
`my-own-sort-function' will take two args "CANDIDATES" and "_SOURCE".
Sorting will happen on "CANDIDATES", "_SOURCE" will stay unused.
--
Thierry
Get my Gnupg key:
gpg --keyserver
pgp.mit.edu --recv-keys 59F29997