Fanael / edit-indirect

Edit regions in separate buffers
99 stars 23 forks source link

add language-detection support to improve automatic mode detection #25

Closed a13 closed 5 months ago

a13 commented 8 months ago

also, a basic README

a13 commented 5 months ago

@Fanael any feedback?

Fanael commented 5 months ago

Sorry for the late response.


I don't think the approach of (format "%s-mode" language) is reliable: language-detection returns cpp for C++, but the actual name of the major mode is c++-mode. This could be easily solved by providing a mapping from what language-detection returns to the major mode name, but this mapping should ideally be provided either by language-detection itself or a package developed in tandem with it in case new languages are added to the model.

Besides, I'm not a huge fan of "soft" dependencies, this should probably just be a separate package with hard dependencies on both edit-indirect and language-detection IMO.

Don't get me wrong, I like the idea (assuming it works well, I've never used language-detection myself), I just don't think edit-indirect is the best place for this function.