unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ns-do-applescript
@ 2022-05-24 21:21 Jon Snader
  2022-05-25  2:28 ` ns-do-applescript Po Lu
  0 siblings, 1 reply; 35+ messages in thread
From: Jon Snader @ 2022-05-24 21:21 UTC (permalink / raw)
  To: emacs-devel; +Cc: luangruo

I don't understand the urgent—or, indeed, any—need to eliminate 
this call. I've been using it for years to populate an Emacs 
buffer with the URL of the current page displayed in Safari. I 
used to use osascript as recommended by those advocating 
ns-do-applescript's removal but moved to ns-do-applescript when 
osascript became unacceptably slow. That issue may have been 
resolved but I've never felt the need to revisit the matter.

According the the 2020 Emacs survey, Mac users represent 26.6% of 
Emacs users (https://emacssurvey.org/2020/) so it's hardly a niche 
environment for Emacs. As macOS is the second largest user base, I 
don't see how it hurts to make Mac users' life marginally easier.



^ permalink raw reply	[flat|nested] 35+ messages in thread
* 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; 35+ 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] 35+ messages in thread
* RE: Re: ns-do-applescript
@ 2022-05-31  6:34 Pedro Andres Aranda Gutierrez
  2022-05-31 23:08 ` ns-do-applescript Stefan Monnier
  0 siblings, 1 reply; 35+ 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] 35+ messages in thread

end of thread, other threads:[~2022-06-01 22:57 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87bkvoo38y.fsf.ref@yahoo.com>
2022-05-23 12:14 ` ns-do-applescript Po Lu
2022-05-23 20:44   ` ns-do-applescript Filipp Gunbin
2022-05-24  0:26     ` ns-do-applescript Po Lu
2022-05-24 20:00       ` ns-do-applescript Daniel Martín
2022-05-24 20:11         ` ns-do-applescript Stefan Monnier
2022-05-25 13:57           ` ns-do-applescript Howard Melman
2022-05-26  8:27             ` ns-do-applescript Richard Stallman
2022-05-26 14:03               ` ns-do-applescript Howard Melman
2022-05-26 14:17                 ` ns-do-applescript Andreas Schwab
2022-05-26 14:51                   ` ns-do-applescript Howard Melman
2022-05-26 15:36                     ` ns-do-applescript Andreas Schwab
2022-05-26  8:24       ` ns-do-applescript Richard Stallman
2022-05-26  8:49         ` ns-do-applescript Po Lu
2022-05-27 22:49           ` ns-do-applescript Richard Stallman
2022-05-28  0:43             ` ns-do-applescript Po Lu
2022-05-29 21:21               ` ns-do-applescript Richard Stallman
2022-05-29 23:56                 ` ns-do-applescript Po Lu
2022-05-31 19:05                   ` ns-do-applescript chad
2022-06-01  0:35                     ` ns-do-applescript Po Lu
2022-06-01  1:10                       ` ns-do-applescript Stefan Monnier
2022-06-01 22:57                     ` ns-do-applescript Richard Stallman
2022-05-24 21:26     ` ns-do-applescript Richard Stallman
2022-05-24 23:01       ` ns-do-applescript Filipp Gunbin
2022-05-25  0:50       ` ns-do-applescript Po Lu
2022-05-25 12:09         ` ns-do-applescript Alexander Adolf
2022-05-24 21:21 ns-do-applescript Jon Snader
2022-05-25  2:28 ` ns-do-applescript Po Lu
2022-05-25  2:58   ` ns-do-applescript Tim Cross
2022-05-25  4:46     ` ns-do-applescript Po Lu
2022-05-25 10:05       ` ns-do-applescript Filipp Gunbin
2022-05-25 11:42       ` ns-do-applescript Pankaj Jangid
  -- strict thread matches above, loose matches on Subject: below --
2022-05-26 11:01 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
2022-05-31  6:34 ns-do-applescript Pedro Andres Aranda Gutierrez
2022-05-31 23:08 ` ns-do-applescript Stefan Monnier

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).