Liste des Groupes | Revenir à cl c |
On Fri, 7 Jun 2024 23:57:58 -0000 (UTC)Yes. What you do is you call the shell with a option "-editor" which tells it which editor to use. That' beter than messing about with environment variables. And it might be that you have a favourite editor, but for some reason it just won't run prpoerly under the shell. and with an option, you can just specify a different editoe. And with environment vaeiables, it's just messing about.
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Fri, 7 Jun 2024 14:24:29 +0300, Michael S wrote:You asked for something that is better *for user* than $EDITOR.
>On Fri, 7 Jun 2024 10:47:57 -0000 (UTC)>
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Fri, 07 Jun 2024 02:37:42 -0700, Keith Thompson wrote:>
As for portability, I'm not aware of the $EDITOR convention being>
used on non-POSIX systems.
Can non-POSIX systems offer anything better? Any worthwhile
alternative?
>
No.
Yes. The one below is better.
ShellExecute(NULL, "edit", filename, NULL, NULL, SW_NORMAL);
On Windows, that combines the command-line arguments into a single
string. Which then has to be teased apart by the receiving program.
Assuming the two ends can agree on consistent rules for doing so.
The one above is very clearly better for user than $EDITOR.
It is smarter - different editors are selected for different file types.
And it achieves that with zero effort on part of app developer.
I would be surprised if good Unices don't have something similar. But
those better ways of lounching editor are not in POSIX.
Les messages affichés proviennent d'usenet.