list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: (Stefan Haller)
To: (Pat Thoyts)
Cc: (Paul Mackerras), (Git Mailing List)
Subject: Re: [PATCH] git-gui: bring Wish process to front on Mac
Date: Thu, 6 Jun 2013 19:12:07 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Pat Thoyts <> wrote:

> On 6 June 2013 09:17, Stefan Haller <> wrote:
> > +## On Mac, bring the current Wish process window to front
> > +
> > +if {[tk windowingsystem] eq "aqua"} {
> > +       exec osascript -e [format {
> > +               tell application "System Events"
> > +                       set frontmost of processes whose unix id is %d to true
> > +               end tell
> > +       } [pid] ]
> > +}
> Seems fine to me. I can't test this as I have no access to this
> platform. Possibly you should run this in a catch statement so it can
> ignore any errors and I would tend to use the 'auto_execok' command to
> ensure that osascript actually exists. Something like
>   set arg [format {tell application......}]
>   catch {exec {*}[auto_execok osascript] -e $arg [pid]}
> but possibly this is guaranteed to exist on all macs which would make
> the above redundant. What I'm thinking is you dont want the app to
> exit just because something goes wrong in this call.

I don't think we need auto_execok here, as osascript is available on
every Mac system. We might even specify the exact path, it's always
/usr/bin/osascript. Is that preferable?

I agree that "catch" might be a good idea though. It raises two
questions though:

1) Should we make the same change in gitk then? It already has the same
   code without the catch (released in 1.8.3 already, btw).

2) Should we think about some way of sharing code between gitk and
   git gui, so that these kinds of changes don't have to be made twice?

Stefan Haller
Berlin, Germany

  reply	other threads:[~2013-06-06 17:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06  8:17 Stefan Haller
2013-06-06 14:09 ` Pat Thoyts
2013-06-06 17:12   ` Stefan Haller [this message]
2013-06-07 21:56     ` [PATCH v2] " Stefan Haller
2013-06-14 17:54       ` Junio C Hamano
2013-06-15 23:07         ` Pat Thoyts
2013-06-06 18:15   ` [PATCH] " Junio C Hamano
2013-06-07 21:58     ` Stefan Haller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH] git-gui: bring Wish process to front on Mac' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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

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