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 kKQKB7v9omAuMgAAgWs5BA (envelope-from ) for ; Tue, 18 May 2021 01:35:23 +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 kLCjArv9omCtRgAAB5/wlQ (envelope-from ) for ; Mon, 17 May 2021 23:35:23 +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 49BAC2BC76 for ; Tue, 18 May 2021 01:35:22 +0200 (CEST) Received: from localhost ([::1]:47504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1limld-0005n5-2Z for larch@yhetil.org; Mon, 17 May 2021 19:35:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liml1-0005mx-Gx for emacs-orgmode@gnu.org; Mon, 17 May 2021 19:34:43 -0400 Received: from mailrelay2-3.pub.mailoutpod1-cph3.one.com ([46.30.212.11]:18430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1limky-0005wV-MR for emacs-orgmode@gnu.org; Mon, 17 May 2021 19:34:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntumwa-nziza.com; s=20191106; h=content-type:mime-version:message-id:date:in-reply-to:subject:cc:to:from: references:from; bh=My/8u9PycHLBtI9WCDuWT+Xbn9jFOGrPCirBdLAXD5o=; b=d8IeIUJwOxw9kbM2qnsinUCbvjdTBQpOrDTShDUhCGCvou/5/nZloySw/gCiTPZ6//ir/NxBKdQDq IWm1EKfzkoIYmZPsS67RoyX3qKXAD60wIIWYqraAeed5nMeh9trWg9P7628Lxr5lX3hqkOm0STsbkR nhLhquCf+wuFElnn87NHmPzDxqLpby5U6d8C6Hr5Z7X/LZb/N+aCJ020b2+boqhIluf5QLGHWAHXuH qWYfpwYfaD1ENzNtM0klYf3JyBotNHabHYi7N/G30pv7KKnKVEfbQd1nPQC6PcLQYNfp9LPAXB2wQ3 ZGHh1xgpOSzeLTSSW16jzciXrJdcJKQ== X-HalOne-Cookie: b784e4b83aad5bf949835e49a115477e04a362bd X-HalOne-ID: 6f333c1d-b768-11eb-b56c-d0431ea8a290 Received: from localhost (p5dd83b85.dip0.t-ipconnect.de [93.216.59.133]) by mailrelay2.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 6f333c1d-b768-11eb-b56c-d0431ea8a290; Mon, 17 May 2021 23:34:33 +0000 (UTC) References: <871ra6rhqx.fsf@bzg.fr> User-agent: mu4e 1.4.15; emacs 28.0.50 From: =?utf-8?Q?Aim=C3=A9?= Bertrand Ntumwa-Nziza To: Bastien Subject: Re: [PATCH] Link handling for qutebrowser org-mac-link.el In-reply-to: <871ra6rhqx.fsf@bzg.fr> Date: Tue, 18 May 2021 01:34:33 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: none client-ip=46.30.212.11; envelope-from=aime.bertrand@ntumwa-nziza.com; helo=mailrelay2-3.pub.mailoutpod1-cph3.one.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=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: , Cc: emacs-orgmode@gnu.org 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=1621294522; 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=XPu3IyzUd0PWy9V7jZkT/AsqHyAZ3eKAEdCo50F8330=; b=g2BX/yqKOXXf44gMQ2vYdiLoWCpOiTXq9SO46z84fd9Kf6eZjTGL0OqQkQ4n8FVOywFd93 05thvizrpJMuKdSZXMURj4G47FxqlyHVCxqdNxZE5H65GV9wwU5Ot4M7bBN+U+ypdYrPDi XOoLD4gykkuq0ROyEAVmZbKtToYUyt1kxLqPinTr34wK9CXnKTdbiBn142Z8H6QG3OJZsG XigAE1vmEFzwvykMICSiGniLMso8+QGHH2XWQ7goRW7nWtWN0UHrT57IlLCwOATG4TPlpa o0vTP5zjenIuIt/ELyNLzKRQ7zpJzuX0LTpjHZl4geZGp5DTYat3nosOxPF0Qw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621294522; a=rsa-sha256; cv=none; b=cRQnsKwYxaZCBOkD03szgf0PKXZzjD8gnaGDpP18wIzND70QCUU0XveD2M2i/2ZOzP5BFR z52mfdHOUiUn6tGVwPoBLvKeYEPG+KidDCXulgDkaNxD3VCymI3QVEBzH5I7+kXujjp5w5 yzcXmDjOXw/K6tBJt2riUzcd3jv4p4Gsq1yY6NX4b+cEiBr6F8l3T1IASMS8VxpMZ8UodZ TksvRJTEl2U0LdBCK/F+EGR83hCUJj031aHz8mLCoGUwqKQ77beOg/9jX9AJQjNH+C5l6x bnoTS4Zq24C0eV+Kkjkz9p5TVsmIjzNVXv1jMecnM3jrjHD7a6oe/ecvpf9KRw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=ntumwa-nziza.com header.s=20191106 header.b=d8IeIUJw; dmarc=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.34 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=ntumwa-nziza.com header.s=20191106 header.b=d8IeIUJw; dmarc=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: 49BAC2BC76 X-Spam-Score: -1.34 X-Migadu-Scanner: scn0.migadu.com X-TUID: kJYiMzzjxk1y --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Bonjour Bastien, as per your wish and hint (thanx). See attached. Salut Aim=C3=A9 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-mac-link.el-Add-support-for-qutebrowser.patch >From 5356ee77c368541113618a391b8480709c5eeb0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aim=C3=A9=20Bertrand?= Date: Tue, 18 May 2021 01:23:51 +0200 Subject: [PATCH] org-mac-link.el: Add support for qutebrowser * lisp/org-mac-link.el (org-mac-grab-qutebrowser-app-p): Variable for menu option (org-mac-grab-link): Menu option for qutebrowser (org-as-mac-qutebrowser-get-frontmost-url): Retrieve url and title --- lisp/org-mac-link.el | 55 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/lisp/org-mac-link.el b/lisp/org-mac-link.el index f6d6da3..d887128 100644 --- a/lisp/org-mac-link.el +++ b/lisp/org-mac-link.el @@ -218,6 +218,12 @@ :group 'org-mac-link :type 'string) +(defcustom org-mac-grab-qutebrowser-app-p t + "Add menu option [q]utebrowser to grab links from qutebrowser.app." + :tag "Grab qutebrowser.app links" + :group 'org-mac-link + :type 'boolean) + ;; In mac.c, removed in Emacs 23. (declare-function do-applescript "org-mac-message" (script)) @@ -254,7 +260,8 @@ When done, go grab the link, and insert it at point." ("e" "evernote" org-mac-evernote-note-insert-selected ,org-mac-grab-Evernote-app-p) ("t" "ogether" org-mac-together-insert-selected ,org-mac-grab-Together-app-p) ("S" "kim" org-mac-skim-insert-page ,org-mac-grab-Skim-app-p) - ("A" "crobat" org-mac-acrobat-insert-page ,org-mac-grab-Acrobat-app-p))) + ("A" "crobat" org-mac-acrobat-insert-page ,org-mac-grab-Acrobat-app-p) + ("q" "utebrowser" org-mac-qutebrowser-insert-frontmost-url ,org-mac-grab-qutebrowser-app-p))) (menu-string (make-string 0 ?x)) input) @@ -1013,6 +1020,52 @@ list of message:// links to flagged mail after heading." (org-insert-heading nil t) (insert org-heading "\n" (org-mac-message-get-links "f")))))) + +;; Handle links from qutebrowser.app + +(defun org-as-mac-qutebrowser-get-frontmost-url () + (let ((result + (do-applescript + (concat + "set oldClipboard to the clipboard\n" + "set frontmostApplication to path to frontmost application\n" + "tell application \"qutebrowser\"\n" + " activate\n" + " delay 0.15\n" + " tell application \"System Events\"\n" + " keystroke \"y\"\n" + " keystroke \"y\"\n" + " end tell\n" + " delay 0.15\n" + " set theUrl to the clipboard\n" + " set the clipboard to oldClipboard\n" + " delay 0.15\n" + " tell application \"System Events\"\n" + " keystroke \"y\"\n" + " keystroke \"T\"\n" + " end tell\n" + " delay 0.15\n" + " set theTitle to the clipboard\n" + " set the clipboard to oldClipboard\n" + " set theResult to (get theUrl) & \"::split::\" & (get theTitle)\n" + "end tell\n" + "activate application (frontmostApplication as text)\n" + "set links to {}\n" + "copy theResult to the end of links\n" + "return links as string\n")))) + (car (split-string result "[\r\n]+" t)))) + +;;;###autoload +(defun org-mac-qutebrowser-get-frontmost-url () + (interactive) + (message "Applescript: Getting qutebrowser url...") + (org-mac-paste-applescript-links (org-as-mac-qutebrowser-get-frontmost-url))) + +;;;###autoload +(defun org-mac-qutebrowser-insert-frontmost-url () + (interactive) + (insert (org-mac-qutebrowser-get-frontmost-url))) + (provide 'org-mac-link) -- 2.30.1 (Apple Git-130) --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Bastien @ 2021-05-16 14:21 : > Hi Aim=C3=A9, > >> hope to have done this right as a first time. > > Thanks for the effort - but the patch is not in a readable=20 > format for > me. I suggest you clone org-mode.git* and run C-x v =3D in the=20 > modified > file to get a proper patch in the buffer, save this buffer as a=20 > patch > and attach it (vs. include it) to your email. > > If you want your patch to be perfect, you can check this page=20 > too: > https://orgmode.org/worg/org-contribute.html#commit-messages > > Thanks in advance, --=-=-=--