unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Re: ns-do-applescript
@ 2022-05-26 11:01 Pedro Andres Aranda Gutierrez
  2022-05-26 14:07 ` ns-do-applescript Howard Melman
  2022-05-26 15:07 ` ns-do-applescript Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-05-26 11:01 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

> Message: 18
> Date: Tue, 24 May 2022 16:11:00 -0400
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> To: Daniel Martín <mardani29@yahoo.es>
> Cc: Po Lu <luangruo@yahoo.com>,  emacs-devel@gnu.org
> Subject: Re: ns-do-applescript
> Message-ID: <jwv7d6an136.fsf-monnier+emacs@gnu.org>
> Content-Type: text/plain; charset=iso-8859-1

> Daniel Martín [2022-05-24 22:00:12] wrote:
> >  I don't object delegating to osascript as a subprocess, but there are
> > probably lots of packages and user customizations already calling
> > ns-do-applescript.  We should deprecate the API before removing it, and
> > the deprecation message should tell people how they can call osascript
> > in an equivalent way.

> Can we re-implement `ns-do-applescript` as an ELisp function that runs
`osascript`?
>
>
>       Stefan

hi

you mean something like:
;; (ns-do-applescript "tell application \"Emacs\" to activate"))
 (call-process "osascript" nil nil nil "-e" "tell application \"Emacs\" to
activate")

Isn't it easier to explain than to actually write a function? ;-)

Best, /PA
-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 2766 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ns-do-applescript
  2022-05-26 11:01 Re: ns-do-applescript Pedro Andres Aranda Gutierrez
@ 2022-05-26 14:07 ` Howard Melman
  2022-05-26 15:07 ` ns-do-applescript Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Howard Melman @ 2022-05-26 14:07 UTC (permalink / raw)
  To: emacs-devel

Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:

>> Can we re-implement `ns-do-applescript` as an ELisp function that runs
>> `osascript`?
>
> you mean something like:
> ;; (ns-do-applescript "tell application \"Emacs\" to activate"))
>  (call-process "osascript" nil nil nil "-e" "tell application \"Emacs\" to activate")
>
> Isn't it easier to explain than to actually write a function? ;-)

And the return value that ns-do-applescript handles?

-- 

Howard




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ns-do-applescript
  2022-05-26 11:01 Re: ns-do-applescript Pedro Andres Aranda Gutierrez
  2022-05-26 14:07 ` ns-do-applescript Howard Melman
@ 2022-05-26 15:07 ` Stefan Monnier
  2022-05-27  9:40   ` ns-do-applescript Pedro Andres Aranda Gutierrez
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2022-05-26 15:07 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: emacs-devel

> Isn't it easier to explain than to actually write a function? ;-)

I thought it was obvious that my question was in relation to avoid
breaking compatibility with potential user code out there.


        Stefan




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ns-do-applescript
  2022-05-26 15:07 ` ns-do-applescript Stefan Monnier
@ 2022-05-27  9:40   ` Pedro Andres Aranda Gutierrez
  0 siblings, 0 replies; 5+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-05-27  9:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

You are absolutely right...  maybe I was reading too fast :-) ... and
egocentric
in the sense that yes I used it, but hey I could live without
ns-do-applescript.
You are right in that there may be code out there which may benefit from
and an elisp implementation...

Best, /PA

On Thu, 26 May 2022 at 17:07, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> > Isn't it easier to explain than to actually write a function? ;-)
>
> I thought it was obvious that my question was in relation to avoid
> breaking compatibility with potential user code out there.
>
>
>         Stefan
>
>

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 1420 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Re: ns-do-applescript
@ 2022-05-31  6:34 Pedro Andres Aranda Gutierrez
  0 siblings, 0 replies; 5+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-05-31  6:34 UTC (permalink / raw)
  To: emacs-devel, Po Lu

[-- Attachment #1: Type: text/plain, Size: 2210 bytes --]

Message: 15
Date: Mon, 30 May 2022 10:50:10 +0800
From: Po Lu <luangruo@yahoo.com>
> To: Jon Snader <jcs@irreal.org>
> Cc: emacs-devel@gnu.org
> Subject: Re: Fwd: Re: ns-do-applescript
> Message-ID: <871qwbd999.fsf@yahoo.com>
> Content-Type: text/plain

> Jon Snader <jcs@irreal.org> writes:
...
>>> The ns-do-applescript call is (or could be considered) simply a call
>>> to an OS specific interface routine. It's useful for many things
>>> besides getting contacts and its presence in *in the macOS Emacs
>>> build* hurts no one, whereas its removal is sure to cause lots of
>>> inconvenience for Mac users and those writing packages for the
>>> platform.

> We don't want to make things convenient for Mac users, when those things
> are not possible on a free system.  Just as Emacs doesn't provide
> "OS-specific interface routines" to perform tasks on non-free operating
> systems that are not possible on free ones.

<flagelante>
Yes, I repent, I confess... I use Emacs on a macOS...
</flagelante>
as I write shell scripts (bash/zsh), gawk, Inkscape, GIMP, LaTEX, etc.
Exactly the same way I do this on my Linux system(s) and on the VMs I
create and share.

And while I'm using DBus in Linux for forward/backward searching between
*TeX and PDF, I do use ns-do-applescript for some of that magic on macOS.
Same goes for bringing the Emacs window to the top of the desktop and for
other functions.

I think all the traffic started because someone asked whether a pure elisp
alternative to ns-do-applescript could be found and call-process to
osascript was proposed. Humbly yours showed how to do such a thing (at
least on my very rudimentary use of osascript).

So, yes, you can write it in ELisp, but I can't tell you whether it makes
sense to scare people away from Emacs by not providing functionality
(IMvvHO that would be a pity). The argument "now you see what you could be
doing in Linux" has already given some fruits in my experience.

Best, /PA
-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 3112 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-31  6:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26 11:01 Re: ns-do-applescript Pedro Andres Aranda Gutierrez
2022-05-26 14:07 ` ns-do-applescript Howard Melman
2022-05-26 15:07 ` ns-do-applescript Stefan Monnier
2022-05-27  9:40   ` ns-do-applescript Pedro Andres Aranda Gutierrez
  -- strict thread matches above, loose matches on Subject: below --
2022-05-31  6:34 ns-do-applescript Pedro Andres Aranda Gutierrez

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).