From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74781: [PATCH] Add `browse-url-qutebrowser' Date: Wed, 11 Dec 2024 16:40:07 +0200 Message-ID: <865xnq4720.fsf@gnu.org> References: <87msh21z0i.fsf@daniel-mendler.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11884"; 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 15:41:22 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 1tLNty-0002rz-3c for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Dec 2024 15:41:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLNtk-0005Gw-S6; Wed, 11 Dec 2024 09:41:08 -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 1tLNtg-0005Gb-4r for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 09:41: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 1tLNte-0003Wi-KG for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 09:41:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=mhEeoU1I01X4bv0faImrG6U5Uox1sf9/r3S3Qtuu5Pw=; b=IbehXzGHbFzfx+4LBXRIzF0G5m61u3q1tFt9X1w8T0gQmaVl2GjPFIOWtwbM3UBU1jLDedckakuV33ZvC3opiKeo4BYo7btisrymBAuv66q7zwJq8pu4WPR+52ZuwXPbzt8GhsSL+4d9xP/e0iVeEBP1D5fa3I3b7bslxqpH+kFembntDprsyHdUf63A5Iwi4b/B2sa8MmeCjnuVB2SJqsuIc7S3LqxGH71ZdUFJqPe0QGUJsD7zUMrrNklNN2K6IfYZVByXEgeo2z0WIjSEOJPOi7aoQW6OFd4ODxAmnBCJS6fBbBaYAveZeeVsMG3EL0D24wi2VcKEXSqB3qOODQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLNte-0003oF-Dw for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 09:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Dec 2024 14:41: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.173392803114575 (code B ref 74781); Wed, 11 Dec 2024 14:41:02 +0000 Original-Received: (at 74781) by debbugs.gnu.org; 11 Dec 2024 14:40:31 +0000 Original-Received: from localhost ([127.0.0.1]:33709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLNt8-0003n0-UQ for submit@debbugs.gnu.org; Wed, 11 Dec 2024 09:40:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLNt6-0003mn-D8 for 74781@debbugs.gnu.org; Wed, 11 Dec 2024 09:40:29 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLNt0-0003SK-Iz; Wed, 11 Dec 2024 09:40:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=mhEeoU1I01X4bv0faImrG6U5Uox1sf9/r3S3Qtuu5Pw=; b=schBr2dmqg+W iTkUWuu72Ri8MYefZJMokjKf1zoSU4hWdskM0sb5cK1B3H+BkARAjPzYxIVdEF6QpsRhQDEUndUhM MhHQljFCW15zsYfyqJ5yiT4PRc1BsOXmGPFV0S81EYlhSg1Un6mEllffWD8cixE1IMzrwAaUlaZXq PPd1d1UY0BVnNNUjWg0It8WkSFuQXBYkzkF8+gqbdbmIapWCkGO5lHKTVF/noKsqF852U0IU1r8OB 30fMNiY7U9jnGsYQHcuUzzbmpOVICBhGGeG0fmN4q5zX6q0Y4RizRzvbm+8KuURQamQDPB7Kuu/cg 4CHIN69cYf7L+fTjbInwxQ==; In-Reply-To: <87msh21z0i.fsf@daniel-mendler.de> (bug-gnu-emacs@gnu.org) 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:296831 Archived-At: > Date: Wed, 11 Dec 2024 08:04:29 +0100 > From: Daniel Mendler via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > The browser launcher supports the NEW-WINDOW argument and > `browse-url-qutebrowser-new-window-is-tab' to open tabs. Furthermore > opening new URLs is speed up via Unix socket IPC if available. Thanks. > Furthermore opening new URLs is speed up via Unix socket IPC if > available. ^^^^^^^^ Typo: "sped up" > (browse-url-qutebrowser-program, browse-url-qutebrowser-arguments, > browse-url-qutebrowser-new-window-is-tab): New customizables. Our conventions are to format these kinds of identifier lists differently: (browse-url-qutebrowser-program, browse-url-qutebrowser-arguments) (browse-url-qutebrowser-new-window-is-tab): New customizables. IOW, the list should be closed at EOL, and then reopened on the next line. This makes searching for changes of a function/variable easier. > +(defcustom browse-url-qutebrowser-program "qutebrowser" > + "The name by which to invoke Qutebrowser." > + :type 'string) Please add a :version tag. > +(defcustom browse-url-qutebrowser-arguments nil > + "A list of strings to pass to Qutebrowser when it starts up." > + :type '(repeat (string :tag "Argument"))) Same here. > +(defcustom browse-url-qutebrowser-new-window-is-tab nil > + "Whether to open up new windows in a tab or a new window. The first line of this doc string should mention Qutebrowser, so that the various apropos commands could find this variable when the user wants to look up something Qutebrowser-related. > +If non-nil, then open the URL in a new tab rather than a new window if > +`browse-url-qutebrowser' is asked to open it in a new window." The "is asked to open it in a new window" part confused me: asked by whom? Is this something that Emacs does, or something else? > + :type 'boolean) The :version tag is missing. > +(defun browse-url-qutebrowser-send (cmd) > + "Send CMD to Qutebrowser via IPC." > + (let* ((dir (getenv "XDG_RUNTIME_DIR")) ^^^^^^^^^^^^^^^^^^^^^^^^^^ Why not use xdg-runtime-dir instead? > + (sock (and dir (expand-file-name > + (format "qutebrowser/ipc-%s" (md5 (user-login-name))) > + dir)))) I think Qutebrowser is available on Windows, where we don't (yet) support local sockets. So I think there should be some kind of test for running on Windows, and falling back to alternatives. Last, but not least: I think the fact that Emacs will now support Qutebrowser warrants a NEWS entry.