From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id E+RLK9S142A+VAAAgWs5BA (envelope-from ) for ; Tue, 06 Jul 2021 03:45:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EIeDJtS142BhAwAA1q6Kng (envelope-from ) for ; Tue, 06 Jul 2021 01:45:56 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D55AD22197 for ; Tue, 6 Jul 2021 03:45:55 +0200 (CEST) Received: from localhost ([::1]:35888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0a9q-0005LH-EV for larch@yhetil.org; Mon, 05 Jul 2021 21:45:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0a9Q-0005JJ-4B for emacs-orgmode@gnu.org; Mon, 05 Jul 2021 21:45:29 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:36675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0a9O-0002cr-9L for emacs-orgmode@gnu.org; Mon, 05 Jul 2021 21:45:27 -0400 Received: by mail-pg1-x536.google.com with SMTP id f5so10590215pgv.3 for ; Mon, 05 Jul 2021 18:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=4uC8B5N36pKUffrvCmCH1BPYuNHJvxlELrCEDE/AK8Y=; b=rCgWGy4gNj/VmNna91dc+Y28UvJwR7RK8lklYGqGX5JE0KBAcOZZ+6MfviQJdB82lZ 1eThBCEh+eFXZ33YBJG4R4n4rJwaS1eWLKwP7zvRuj98mV37/tZeFvFlSm0udFBMUE+g YvxerSVAR2tAOq81yTbFojavV4OsLNnn9sM8AkcG8GmfywMvPlNtZzGP54Hhym27ZwGT ChpYa/jTlwd/KMPqERad9DqPSkD05BDraCgNLG6wQArYfK8LC08qwPZqVzEyGfwcBMfz qNZquPKWKCruIQegco/+2FG3dd0Skt3YyLK1yPlV+uu305umXNpKYCJ50G6dZfVQa7kY VXoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=4uC8B5N36pKUffrvCmCH1BPYuNHJvxlELrCEDE/AK8Y=; b=XHF+sAaHZ768hmsJ6K+mQZ38s7u90MYr9S9/E1GDOtwWuMM3aAXOApQUK+MH44QKlR 8SjMOQlsrJuzhIJLc1o0ZSHjjcSv91flAOXjgxiJnoFQcHrnXEXOC8sCnKE9FwwYvWbQ F8bTHkkrn+N5m8UW1lGtXSqgAVJV2j4caacvo2bX1UXinjfUofnkLucoIAsmZJipLKHq HnyzuqfbRtSfzBKBlgtfvfvIOwv151s34AYVZO4HvMed+RLmGeAgKAEItPrhpXlRV6jd ItGneehjRDykOV+liYI6rJW6WTd9HmBtDUtc7TeqvWyIWcrQwBizip0z8MSkia6EAbEX r3IA== X-Gm-Message-State: AOAM533PBJ+hFsd1T2lz9YoZiHkoSnNfTdc4Cx29AzTO/e6lEzG34awh AKvyulYnCDa6jFNHYmr4ow== X-Google-Smtp-Source: ABdhPJy6sl/q0NiHGp2oCcAVw87smg7G/pqeDNnCLKnjk1Xx+0pa+aix4o5UDzrXjYQW3NjMc1UybA== X-Received: by 2002:a65:5086:: with SMTP id r6mr18286162pgp.237.1625535924779; Mon, 05 Jul 2021 18:45:24 -0700 (PDT) Received: from smtpclient.apple ([150.109.103.155]) by smtp.gmail.com with ESMTPSA id v6sm16262628pgk.33.2021.07.05.18.45.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jul 2021 18:45:24 -0700 (PDT) From: stardiviner Message-Id: <7318E1D0-613A-4301-8097-779D3FEF1105@gmail.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_77984CBD-918D-4E7F-9DAD-11224F363C28" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: [new patch] Re: [PATCH] make org-notify support for macOS desktop notification Date: Tue, 6 Jul 2021 09:45:21 +0800 In-Reply-To: <87im1ol2lb.fsf@gmail.com> To: Tim Cross References: <5B57CD8B-AA91-4C63-A449-A07364083AEE@gmail.com> <87im1ol2lb.fsf@gmail.com> X-Mailer: Apple Mail (2.3654.100.0.2.22) Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=numbchild@gmail.com; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org-mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625535956; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4uC8B5N36pKUffrvCmCH1BPYuNHJvxlELrCEDE/AK8Y=; b=AYcZO98jN3WHkEWaB62Hp6qToAJOdjVnbWTtFUXRkLuSQ1EswKq6qwvsguya1MRm9oDzCv TTSq9PTzkoxVdM7ojMwIiB7FOD6YX5kCV6h1+HYfQKGY32pcKuZfrXwxxHllWcwjnHXmOz f/ddK2wj2WdpMhO2VOwDNDBe7IkNKkwJ2FRmbpKJeLPkWgX2+1XmcmbQq1TwjmwJmCoHZn meum1YVR+2IFmz9FRR2Ydb4CeAi1vRHxwimEyA8oLhuH/NtW318ffqKFz/ehq5XPBn9gJS lD7MNUWG5T2fRgfauoWVX1v1Zod8Iihw6ZghAwaEn6XiWqB6dypA1IguxdKOOQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625535956; a=rsa-sha256; cv=none; b=XSsJPKuA5BePnI0ePbcx8X8ka+Jv3E73MQykMg/EpnFVGZJG22fnS03So7BD3MB5Q66mjN Nresy6dYHSEojzxaliZTbtKSkHA9KeIfA5Iqba1LOQFtNue9vHYQTDFHQLsRTjTTUuVoVG l0UjJc+CjbV4AYOxZU9RZqUBn41Ws6HfTfzllwHSQDcctDvkr/tg2HjPQMR7gmmhpL43kL FfRjCoab95BspjSD1MPHiWB7We8WwA1nxm10Hf5BMQnskcR1YLeObLnffr6m+n8nWnAeWm 6GgFA7BdV0+RIZBLq5DCpcnTSL2WeAj6iBUdDkT/PTPRd1RAiec1NdpJC1o8nA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=rCgWGy4g; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=rCgWGy4g; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: D55AD22197 X-Spam-Score: -2.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: PnFPXduUcFZO --Apple-Mail=_77984CBD-918D-4E7F-9DAD-11224F363C28 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Here is the new patch which invokes notifications though Emacs built-in = API `ns-do-applescript`. --Apple-Mail=_77984CBD-918D-4E7F-9DAD-11224F363C28 Content-Disposition: attachment; filename=0001-org-clock.el-Make-org-notify-support-macOS-notificat.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-org-clock.el-Make-org-notify-support-macOS-notificat.patch" Content-Transfer-Encoding: quoted-printable =46rom=209dcf98905cd2d11c899f8a13238601345a6361cc=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20stardiviner=20=0ADate:=20= Sun,=204=20Jul=202021=2008:13:43=20+0800=0ASubject:=20[PATCH]=20= org-clock.el:=20Make=20org-notify=20support=20macOS=20notification=0A=0A= *=20lisp/org-clock.el=20(org-show-notification):=20Add=20support=20for=20= macOS=0Anotification.=0A---=0A=20lisp/org-clock.el=20|=204=20++++=0A=201=20= file=20changed,=204=20insertions(+)=0A=0Adiff=20--git=20= a/lisp/org-clock.el=20b/lisp/org-clock.el=0Aindex=20cd930e875..efc3a2f3b=20= 100644=0A---=20a/lisp/org-clock.el=0A+++=20b/lisp/org-clock.el=0A@@=20= -859,6=20+859,10=20@@=20use=20libnotify=20if=20available,=20or=20fall=20= back=20on=20a=20message."=0A=20=09=20=20=20=20= org-show-notification-timeout=0A=20=09=20=20=20=20nil=0A=20=09=20=20=20=20= (lambda=20()=20(w32-notification-close=20id)))))=0A+=20=20=20=20=20=20=20= =20((fboundp=20'ns-do-applescript)=0A+=20=20=20=20=20=20=20=20=20= (ns-do-applescript=0A+=20=20=20=20=20=20=20=20=20=20(format=20"display=20= notification=20\"%s\"=20with=20title=20\"Org=20mode=20notification\""=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (replace-regexp-in-string=20"\""=20"#"=20notification))))=0A=20=09= ((fboundp=20'notifications-notify)=0A=20=09=20(notifications-notify=0A=20= =09=20=20:title=20"Org=20mode=20message"=0A--=20=0A2.30.1=20(Apple=20= Git-130)=0A=0A= --Apple-Mail=_77984CBD-918D-4E7F-9DAD-11224F363C28 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jul 6, 2021, at 8:06 AM, Tim Cross wrote: >=20 >=20 > stardiviner writes: >=20 >>> On Jul 5, 2021, at 7:55 PM, Maxim Nikulin = wrote: >>>=20 >>> On 05/07/2021 10:50, stardiviner wrote: >>>> I updated the patch, I found the package `osx-lib` contains = solution. >>>> So I removed the directly osascript process invocation. >>>=20 >>> I have no objections any more. On the other hand I have no access to = macOS, so >>> I have not tested this patch. Feel free to ignore comments from this = message, >>> they are mostly matter of taste. >>>=20 >>> I expect that a simple script "notify-send" may allow to avoid = modification of >>> code. Something like (untested, unsure concerning "quoted form of = ...") >>>=20 >>> #!/usr/bin/env osascript >>> display notification (item 1 of argv) >>>=20 >>> However if osx-lib in is installed automatically, it may be more = convenient. >>> Unsure if some of currently supported linux distributions have = notify-send >>> that can not handle title as the first argument. >>>=20 >>>> - ((fboundp 'notifications-notify) >>>> + ((and (eq system-type 'gnu/linux) (fboundp = 'notifications-notify)) >>>=20 >>> Does it mean that `notifications-notify' is bound but it does not = work on >>> macOS? If so, maybe it is better to put new clause for 'darwin above = and to >>> drop 'gnu/linux here. =46rom my point of view, it is preferable to = avoid >>> additional requirement for `notifications-notify'. If someone will = create a >>> feature request for `notifications-notify' for macOS, it will just = work >>> without installing of additional packages as soon as such feature is >>> implemented. >>>=20 >>>=20 >> I indeed tried `notifications-notify`. And it does not work, reports = error that >> it needs dbus. PS. I used the Homebrew formulae version Emacs. >> I considered the order of conditions. Because notifications and = notify-send etc >> requires dbus. So I guess only Linux supports that. So add = system-type detection >> will be better. WDYT? >=20 > I think you can add dbus support to macOS using homebrew and that = might > resolve the issue. At the very least, this will need to be = investigated > because otherwise, adding this patch may break configurations for = users > who have added dbus support via homebrew and have notifications = working, > but have not installed the osx-lib package. >=20 > My only small concern with your proposed changes is that it will add a > dependency on a new package osx-lib, which I think is only available = in > melpa. At the very least, this will need to be documented somewhere. > However, I'm not sure what the situation is wrt adding code which > depends on an external package which is not available in either elpa = or > nongnuELPA? As org mode is a part of GNU Emacs, I suspect that any = code > which 'encourages' the use of melpa packages will not be acceptable.=20= >=20 > --=20 > Tim Cross >=20 --Apple-Mail=_77984CBD-918D-4E7F-9DAD-11224F363C28--