Hi, Sean Whitton wrote: > On Mon, Nov 06 2017, Jonathan Nieder wrote:
>> Thus, every program that launches an editor or pager must use >> the EDITOR or PAGER environment variable to determine the editor >> or pager the user wishes to use. If these variables are not set, >> the programs /usr/bin/editor and /usr/bin/pager should be used, >> respectively. >> >> If read strictly, this says that I must use "/usr/bin/editor" instead >> of invoking "editor" from the $PATH. (I'm not sure I agree with that >> interpretation, but it came up in https://bugs.debian.org/682347.) >> Running "editor" from the $PATH instead of using that full path should >> be perfectly acceptable and IMHO is a better behavior, since it allows >> the user to put a custom editor in /usr/local/bin or $HOME/bin. > > ISTM that the intention is for the user to set EDITOR and PAGER to > select an editor or pager, rather than putting things called 'editor' > and 'pager' into PATH. I understand and agree, but that doesn't mean that packages should invoke editor using an absolute path. Policy describes package behavior, not user behavior. Further, a sysadmin on a shared machine doesn't have a way to set EDITOR for all users, but they can install an editor command to /usr/local/bin/. I've seen sysadmins at a university do something similar for e.g. a custom build of gcc. It would be more robust for the sysadmin to use alternatives instead, but I'm just saying it's more polite for a package to respect what the user was trying to do. > This seems sensible because 'editor' and 'pager' > are fairly generic terms and a user might have things in ~/bin/editor or > ~/bin/pager that don't edit or page, respectively. Really? That would be a reason for the 'editor' and 'pager' commands to be named something else. But on the contrary, I find 'editor' and 'pager' to be pretty clear names for what they do. Is there additional information or context I can provide to change your mind? Note that the change I am proposing is to allow packages to invoke 'editor' from $PATH, not to require them to do so. There are existing packages (e.g., Git) that already do this. This is similar to upstream packages invoking "less" or "more" from the $PATH instead of relying on it to be at a particular path. Jonathan