From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GEQ6HtRJ5GDZTAEAgWs5BA (envelope-from ) for ; Tue, 06 Jul 2021 14:17:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eBoDGtRJ5GBpXgAAB5/wlQ (envelope-from ) for ; Tue, 06 Jul 2021 12:17:24 +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 D614829D28 for ; Tue, 6 Jul 2021 14:17:23 +0200 (CEST) Received: from localhost ([::1]:57038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0k0w-0002du-C9 for larch@yhetil.org; Tue, 06 Jul 2021 08:17:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0jxd-0000Ri-0Z for emacs-orgmode@gnu.org; Tue, 06 Jul 2021 08:13:57 -0400 Received: from ciao.gmane.io ([116.202.254.214]:51150) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0jxZ-0006Dq-Kk for emacs-orgmode@gnu.org; Tue, 06 Jul 2021 08:13:56 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1m0jxU-0009J8-4k for emacs-orgmode@gnu.org; Tue, 06 Jul 2021 14:13:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Maxim Nikulin Subject: Re: [PATCH] make org-notify support for macOS desktop notification Date: Tue, 6 Jul 2021 19:13:42 +0700 Message-ID: References: <5B57CD8B-AA91-4C63-A449-A07364083AEE@gmail.com> <87im1ol2lb.fsf@gmail.com> <7318E1D0-613A-4301-8097-779D3FEF1105@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: <7318E1D0-613A-4301-8097-779D3FEF1105@gmail.com> Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , 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=1625573844; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XuN7aQEL2uTQ74C8W/wjMqdq8lYYjVA/VnmxfI3LAuI=; b=TsYJ8YUkMXV9oeNPG6zzEVDYV+BBIytGJx2bTupEy6/Ka0vHy0QQOo9lee4P4/04wsIEQj 6KivAoPcUmlD8wzALHoZEDEGbUHIsPiYv8kuZ5a+9W/MgP2PLgTcVL4zSpVR+GCUH4sQ9S mFF4xV7P8D/iuuHksYiidG/R+c4by/6LRPr9PK/mq6Hrb87WZGvo5Slv27aP98L0FcdOuU 5L9/uaJwe4Kx5kIbMTjjRGfbqBW+PNzXEVMjWmP7g9QlA+Ev9tR8wltN6XlSnUpY5zTuOl fpHuS4wJHt88kZX3Ae1X3i4QsbjuvBAsTNxf/u2E4aydHV/X+AHMgUS9XoGdUA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625573844; a=rsa-sha256; cv=none; b=TCWIlf+wZyaZok1GFBpjI7YbRqR23JFqxomRZN36V4H5TLAB8djoTI2VChzkhrNwiCn1ki N/PEJV9XQEtGVQgpDpfoaXVSoV+PmeSVQ1JlDszrFVf/a7wXb0ufvuvawYJJ4l65nG8mWc C26TLeBdRXDJgLMv2rZQNzLgcQLqop+xzeHhCeJUe8gF+B0mdqqCaesPNeYN7MBWMLdq50 0TftwMy3eHKRhqtdYuGxLEInULOxzQeuIhX6DF2GRqLMD88Dm4dQC6DZKwau8GZChaM9PC qlPxFEtcH/dTbLn/subRN57lqsjKEAWBvB5Y+DiMqaj0moumAq5j9++GcrTG6A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: -1.81 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: D614829D28 X-Spam-Score: -1.81 X-Migadu-Scanner: scn0.migadu.com X-TUID: Sod0kLLQPD5h On 06/07/2021 08:45, stardiviner wrote: > Here is the new patch which invokes notifications though Emacs built-in API `ns-do-applescript`. I suspect, you considered your original patch as small and simple, didn't you? > + (format "display notification \"%s\" with title \"Org mode notification\"" > + (replace-regexp-in-string "\"" "#" notification)))) Last character of notification might be "\" so it might escape the closing quote. Some less common quote character like "´" may be less confusing than "#" in this confusing if proper escaping is a challenge. I am unsure how many people are still using 8-bit charsets. It seems there is no way to pass argv through `ns-do-applescript'. Is there at least a helper to escape strings similar to `shell-quote-argument'? Otherwise it is not friendly to developers since everyone has to do it himself. On 06/07/2021 07:06, Tim Cross wrote: > I suspect that any code > which 'encourages' the use of melpa packages will not be acceptabl If there are license problems with `osx-lib-notify2', I expect, it can be utilized through `org-show-notification-handler'. However users have to manually add such customization that is not really convenient. If `org-show-notification' depends on runtime configuration (whether DBus socket is available), maybe it is reasonable to rewrite the function and to add a convention that e.g. 'default return value causes attempt to call next handler in the responsibility chain. The intention is to allow fallback from `org-show-notification-handler' to standard notifiers or graceful degradation from `notifications-notify' to `message' if dbus connection is not available (e.g. Emacs is running in a minimal container). Such changes however out of scope of this patch.