From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#74781: [PATCH] Add `browse-url-qutebrowser' Date: Wed, 11 Dec 2024 10:58:30 +0100 Message-ID: <87a5d28rsp.fsf@gmail.com> References: <87msh21z0i.fsf@daniel-mendler.de> <87ed2e8vzv.fsf@gmail.com> <87jzc61tc3.fsf@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37180"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74781@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 11 11:00:30 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tLJW7-0009Qd-Vr for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Dec 2024 11:00:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLJVt-0002Am-Az; Wed, 11 Dec 2024 05:00:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLJVk-000259-1t for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 05:00:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLJVi-0005wr-MV for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 05:00:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=LOPDGPk31Tt6kF8N9cK1CR64CHhDmbvlyxFfTuRCesA=; b=VHbZ3bR6nPCnBnvPflvjONIE69pKrKhIflDFHrwtQJtXSshTbFINRvt9eVonmWoqemSQ69Y50+8NaOc6bKbq+o1e3NY0Y/8eY5Imdlx4gzVLZBohqfnzm2MocY5MdZcu7lropCM3SEhHZeyXXe2BXgvE5NPJffHZleJix/j2V66aSBLBH4t4qunBVkOojx9l3HTnSkxiRsdFkRbKE5UdoRgdhfHtl+DZ2H6vYMwrdox4apogD5ojwVChWqZZ+HYN/fr5PZTAF4Qud+Xp2vdv3KysDjrp7gQb0ldEuu36o5nGY24sPWn9RElyFFsAI46L77THSBt/iuR2GvYzvXdRow==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLJVi-0002al-Dl for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 05:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Dec 2024 10:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74781 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74781-submit@debbugs.gnu.org id=B74781.17339111829872 (code B ref 74781); Wed, 11 Dec 2024 10:00:02 +0000 Original-Received: (at 74781) by debbugs.gnu.org; 11 Dec 2024 09:59:42 +0000 Original-Received: from localhost ([127.0.0.1]:32974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLJVN-0002Z8-Lp for submit@debbugs.gnu.org; Wed, 11 Dec 2024 04:59:42 -0500 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:47119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLJVK-0002Ym-Rb for 74781@debbugs.gnu.org; Wed, 11 Dec 2024 04:59:40 -0500 Original-Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-385e27c75f4so4758076f8f.2 for <74781@debbugs.gnu.org>; Wed, 11 Dec 2024 01:59:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733911111; x=1734515911; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LOPDGPk31Tt6kF8N9cK1CR64CHhDmbvlyxFfTuRCesA=; b=Q1yMIySzYQxv0n84QAZftMEpC3mpq47LHhiys/1D4XqwMuWyYmlWfFMRR5YlsLIKQi 974+2jvENrPx5e5PNyH82BalGnvElhVz1E0HhDdBxxAtrvpeMOJPHalOsn43QsNTJ07e hwM0QlSFJwV+dS+R253zOS3rDVabaiIE6LlEAR2RRvbuTrX/7O7tBAIjOsgb1bBaje0v 4Ei78Qp0Jq0FZFA97PtC/PjoXdlw/cSxMb7+qVQryN09mw5qVr68AvTDliZ3x9OTUEFV Sc+AJvRvSEeyXB7SqGR6m/Lx7xRYIKWXe8QWYCsClr7gDPEyNPEekMFZmitNJHlUFfmb pXlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733911111; x=1734515911; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LOPDGPk31Tt6kF8N9cK1CR64CHhDmbvlyxFfTuRCesA=; b=mHwtM6J8hHI2ks/rOyl467609Dty0QBa2KySzt84l9xjARw7YA4mZe8MHf5bADZObL 0oOX9BC/CcgQ50SmjeZUVt5vT08TKV5K7r+G+rJf12V1X4u+WjvwPYo5V4Gy/JT8yMEn cGyCnsPmfucMIGCu8w5rTKVqfytPTZuebia+XogXL0XoLKcp/VXjTJLpzStTX7UnTQNp owwGeizxnwz5nzlf+xAYd5SHI+33Ar6o80PLYJcD4Ob3tIXG0+00/PGt2s8et2+RPKTn 3lyT4ls1AnHxPt/2c2htpDzxgLHyx5aX5zD+y97wfRYhFDB/5SM6v7MsoC3BPB8tB5oS jjpQ== X-Gm-Message-State: AOJu0YylB578iqmnlGqJoieQRbYpvZurXe1YIgHhxIQ30ewf7SRYrKCR RStYx/IMk8EpgaacvqFYOJMM+CJIUR+6SglfH+8nLobuyOyaWHbu1N+3cg== X-Gm-Gg: ASbGncu3rjFegqPeJHQ90ROf9c56z80g4TFRLohxrrUdrN1oijrzSHy8l1w5F5wWSoq a0hm/MPcTjwxkfJJNqdOTrAq+U2UR55wwUCSPpFCQoIpXbQCHfof9AiJnl4XuRKM7la5ruuj4vu 7tP6nHTfancEbH57WjRYgHiEtA0nNU5VIwCQxSQZCRahjN4D9ozJMg1E8mVVBKRaTn3o8X0RBVg kQBrvMpWpD8FE6EoZCO6oe4M59HW3hEJOM/BXjKzw== X-Google-Smtp-Source: AGHT+IFTBLi4c8pCPdtNFHGBCf3Pe4j67vSmC9lNagYkBaAz5evpEolN7Xzme0N15+PiOmb0L1o7Fg== X-Received: by 2002:a05:6000:2b02:b0:385:ecdf:a30a with SMTP id ffacd0b85a97d-3864ce9fb55mr1249918f8f.33.1733911111279; Wed, 11 Dec 2024 01:58:31 -0800 (PST) Original-Received: from rltb ([2a01:e0a:3f3:fb51:a443:b1bf:de94:83c1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-387825296desm885410f8f.111.2024.12.11.01.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 01:58:30 -0800 (PST) In-Reply-To: <87jzc61tc3.fsf@daniel-mendler.de> (Daniel Mendler's message of "Wed, 11 Dec 2024 10:07:08 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296813 Archived-At: >>>>> On Wed, 11 Dec 2024 10:07:08 +0100, Daniel Mendler said: Daniel> Hi Robert, Daniel> thank you for looking at the patch. I have a few questions. Daniel> +(defcustom browse-url-qutebrowser-program "qutebrowser" Daniel> + "The name by which to invoke Qutebrowser." Daniel> + :type 'string) Daniel> + Daniel> +(defcustom browse-url-qutebrowser-arguments nil Daniel> + "A list of strings to pass to Qutebrowser when it starts up." Daniel> + :type '(repeat (string :tag "Argument"))) Daniel> + >>=20 >> :version tags please Daniel> Other similar variables have been added recently and lack the v= ersion Daniel> tags. I didn't add the tags for consistency with the other vari= ables. I Daniel> wonder if the Emacs help system does recognize automatically wh= en Daniel> variables got added? Then those should be fixed as well. The emacs help system applies heuristics which are not always accurate, and don=CA=BCt always return an answer, hence the version tags. Daniel> (defcustom browse-url-new-window-flag nil Daniel> "Non-nil means always open a new browser window with appropriat= e browsers. Daniel> Passing an interactive argument to \\[browse-url], or specific = browser Daniel> @@ -1294,6 +1308,60 @@ browse-url-epiphany-sentinel Daniel> browse-url-epiphany-program Daniel> (append browse-url-epiphany-startup-arguments (list url)))))) >>=20 Daniel> +(defun browse-url-qutebrowser-send (cmd) Daniel> + "Send CMD to Qutebrowser via IPC." Daniel> + (let* ((dir (getenv "XDG_RUNTIME_DIR")) >>=20 >> We have `xdg-runtime-dir' in xdg.el Daniel> The goal was to avoid loading `xdg.el' unnecessarily for this t= rivial Daniel> function, which is just a wrapper around `getenv'. Do you sugge= st to use Daniel> `declare-function' and require xdg inside `browse-url-qutebrows= er-send'? That would work. >> Perhaps I=CA=BCm being paranoid, but maybe you should check the stat= us of >> `proc' before sending it a string. Daniel> `process-send-string' throwns an error if opening the file fail= ed, so a Daniel> status check won't be beneficial. Also note that `make-network-= process' Daniel> fails if opening the socket file fails. Thanks again. OK, so I was too paranoid =F0=9F=98=80 Robert --=20