Deutsch English Français Italiano |
<20240609113604.0000684b@yahoo.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: Running an editor from ANSI C Date: Sun, 9 Jun 2024 11:36:04 +0300 Organization: A noiseless patient Spider Lines: 56 Message-ID: <20240609113604.0000684b@yahoo.com> References: <v3pge7$uf2i$1@dont-email.me> <v3r2pl$16mtl$1@dont-email.me> <v3r7v8$1b57j$1@dont-email.me> <v3rek5$1c4i5$1@dont-email.me> <v3rrtm$1e6g8$1@dont-email.me> <v3ru84$1eafb$1@dont-email.me> <87o78dzw1a.fsf@nosuchdomain.example.com> <v3te2i$1ms1q$1@dont-email.me> <87frtpznoa.fsf@nosuchdomain.example.com> <v3uimm$20jte$3@dont-email.me> <871q59yty1.fsf@nosuchdomain.example.com> <v3uogs$21g4g$6@dont-email.me> <20240607142429.0000067b@yahoo.com> <v406q5$29fla$5@dont-email.me> <20240608221349.00001252@yahoo.com> <v43lau$39uge$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Date: Sun, 09 Jun 2024 10:35:50 +0200 (CEST) Injection-Info: dont-email.me; posting-host="6a2ea81ad9dc1fc6d46f58b03380a32f"; logging-data="3492441"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1879lJJLKCdxD1jwj4cnYOTVdOHWKGdgL8=" Cancel-Lock: sha1:fTLkLEHQHxEMeTQwvHrvoabsgWE= X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32) Bytes: 3556 On Sun, 9 Jun 2024 07:24:14 -0000 (UTC) Lawrence D'Oliveiro <ldo@nz.invalid> wrote: > On Sat, 8 Jun 2024 22:13:49 +0300, Michael S wrote: >=20 > > On Fri, 7 Jun 2024 23:57:58 -0000 (UTC) > > Lawrence D'Oliveiro <ldo@nz.invalid> wrote: > > =20 > >> On Fri, 7 Jun 2024 14:24:29 +0300, Michael S wrote: > >> =20 > >>> On Fri, 7 Jun 2024 10:47:57 -0000 (UTC) > >>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote: > >>> =20 > >>>> On Fri, 07 Jun 2024 02:37:42 -0700, Keith Thompson wrote: > >>>> =20 > >>>>> As for portability, I'm not aware of the $EDITOR convention > >>>>> being used on non-POSIX systems. =20 > >>>>=20 > >>>> Can non-POSIX systems offer anything better? Any worthwhile > >>>> alternative? > >>>>=20 > >>>> No. =20 > >>>=20 > >>> Yes. The one below is better. > >>> ShellExecute(NULL, "edit", filename, NULL, NULL, SW_NORMAL); =20 > >>=20 > >> 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. =20 > >=20 > > You asked for something that is better *for user* than $EDITOR. > > The one above is very clearly better for user than $EDITOR. =20 >=20 > Neglecting the various potential pitfalls in how the invocation > works, fine. > Imaginary pitfalls in this case. All you want to pass to editor is a file name. Pay attention how the 4th parameter in the call is NULL. > > It is smarter - different editors are selected for different file > > types. And it achieves that with zero effort on part of app > > developer. =20 >=20 > If that=E2=80=99s what you want, then we have xdg-open for that > <https://askubuntu.com/questions/1279623/what-is-xdg-open>. >=20 Which is non-POSIX. Which was my point - there are not just "worthwhile" alternatives to POSIX ways, but obviously superior alternatives. Both on POSIX-compliant and on none-POSIX-compliant systems. > VISUAL and EDITOR are about editing text files, that=E2=80=99s all.