emacs-format-all-the-code
emacs-format-all-the-code copied to clipboard
Better OS choices for install commands
I was lazy and started with the Emacs system-type variable. Its value range is kind of weird:
Special values:
‘gnu’ compiled for a GNU Hurd system.
‘gnu/linux’ compiled for a GNU/Linux system.
‘gnu/kfreebsd’ compiled for a GNU system with a FreeBSD kernel.
‘darwin’ compiled for Darwin (GNU-Darwin, macOS, ...).
‘ms-dos’ compiled as an MS-DOS application.
‘windows-nt’ compiled as a native W32 application.
‘cygwin’ compiled using the Cygwin library.
Anything else (in Emacs 26, the possibilities are: aix, berkeley-unix,
hpux, usg-unix-v) indicates some sort of Unix system.
I'll make another variable that checks uname or something so we can get handier values.
Is anyone here a hardcore Linux user? How should we differentiate between the distros, is debian/centos (i.e. apt/yum) good enough or should it be more specific? Do all apt-based distros have mostly the same names for the same packages, and likewise for all yum-based distros, or is it more complicated than that?
How should we differentiate between the distros
/etc/os-release is probably the best choice for that.
Do all apt-based distros have mostly the same names for the same packages, and likewise for all yum-based distros, or is it more complicated than that?
Sometimes yes, sometimes not. Also some distros don't have certain packages and some do. To be honest, I would suggest that every user should installs the tool via their preferred method, as a complete list of all tools is going to be a huge maintenance burden.
Thanks for the tips!
I guess the right thing to do would be to gather a complete list of formatter package names for e.g. the top 3 apt distros and the top 3 yum distros. If there are very few differences, just separate by apt/yum and use the names in the most popular apt distro and the most popular yum distro. Otherwise forget about the whole endeavor.
I'll postpone that task for a few months. Right now format-all has only a few hundred downloads so I don't think very many people would benefit, but maybe in the future :)