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.devel Subject: Re: emacs-29 additional key binding suggestions Date: Tue, 25 Apr 2023 17:19:47 +0200 Message-ID: <87v8hk7zvw.fsf@gmail.com> References: <87leipe0oi.fsf@gmail.com> <831qkf6k28.fsf@gnu.org> <877cu67d34.fsf@gmail.com> <87edoecuak.fsf@gmail.com> <871qkd50m7.fsf@gmail.com> <875y9ld9lt.fsf@gmail.com> <83mt2xy1vy.fsf@gnu.org> <87jzy1bk2e.fsf@gmail.com> <83a5yxxz4z.fsf@gnu.org> <878rehmmv3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35519"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Visuwesh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 25 17:20:39 2023 Return-path: Envelope-to: ged-emacs-devel@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 1prKT9-00097Q-Hz for ged-emacs-devel@m.gmane-mx.org; Tue, 25 Apr 2023 17:20:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prKSR-0007ZI-GO; Tue, 25 Apr 2023 11:19:55 -0400 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 1prKSP-0007YX-Ny for emacs-devel@gnu.org; Tue, 25 Apr 2023 11:19:53 -0400 Original-Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prKSO-0000IV-2M; Tue, 25 Apr 2023 11:19:53 -0400 Original-Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f173af665fso38877695e9.3; Tue, 25 Apr 2023 08:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682435990; x=1685027990; h=mime-version:message-id:date:gmane-reply-to-list:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NG216boAhnj6Fi7g65VXGD1fzDNzDprLj0fmAxYYXaM=; b=VAfHXxoNpmav1rKC2LwaO/Z+8ziAnJclw2mpcANVPF2vEoHPEjhepaC/DvxIHejzVh NK/vxXP2G65ftAeAiz8jqFiSGjvo0pXHoHeQ8ic72Ynsn/MJ2LrxxRKRxh1A2ybS/0Sz ybBMfaekuWi0IYP34Sa7mAOMZx3qfHPXXZrNqBQC4OichvcjGhcTMywJ8oPUPTz3crxK tfZWXkNuImvrhmPj1YabP36ucvHasI5xI3Icu9a5Av/Ivh2zAO4Bvng87CNu9OpuoOBv ++OKXCCrCpLc4mHFZpIWKoR52fLTaQVuqruadb+5+XdXyv+5cpgvrS1aZn/HGYtYt7vy V18Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682435990; x=1685027990; h=mime-version:message-id:date:gmane-reply-to-list:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NG216boAhnj6Fi7g65VXGD1fzDNzDprLj0fmAxYYXaM=; b=dmQCPmVtks+QmoXfwexXguOqxo8n5GfrQMRoRE7IYTEZ8tL6YnSuAxUcLRzuADrqC5 TA0CCdkv4hNpmmd7cbU9aV8E5ZLNHFr1vs9fDfP3AB4lC7An9tmwTKgUQ6cQteFY0Pfa uNCeYUMmNLStq5+24O69nhSu9i4K20l2w+EdT2aV8x8kJ60HzMYDu6GjyjD4ZiRx87nG d+47T2wP39qPlLApk5ZjTkG5xKfDrUEQ5qJKr2YIECfGaXw7tBD9ZRnviY4f8OTM2fX4 dGpc+2L1JHHeIrcN/VEJ6fOgwg25uD1LPwxYxN8paZvyo/H8o0klMOBI4FQhl8l3T/dg z5sQ== X-Gm-Message-State: AAQBX9eV1kpumQsUXFEpnAqJSDJ2Z4BqDxxy8WIQaV2bmrg6MaxBjHtK w8a9ypkZEoQHf9v4Fn+PHt/64KEE4a0= X-Google-Smtp-Source: AKy350aHlCwDor7tBf2X2+V+Kr2oz3qK66+pKGTrykUMwSq1jConrxR9UTKYL8a4Gbxtj3fT4a4tPg== X-Received: by 2002:a05:6000:12:b0:2f8:5d92:aa12 with SMTP id h18-20020a056000001200b002f85d92aa12mr12308476wrx.66.1682435989539; Tue, 25 Apr 2023 08:19:49 -0700 (PDT) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id b9-20020adfee89000000b002f777345d21sm13283692wro.95.2023.04.25.08.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 08:19:49 -0700 (PDT) In-Reply-To: <878rehmmv3.fsf@gmail.com> (Visuwesh's message of "Mon, 24 Apr 2023 18:57:28 +0530") Gmane-Reply-To-List: yes Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=rpluim@gmail.com; helo=mail-wm1-x332.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305659 Archived-At: >>>>> On Mon, 24 Apr 2023 18:57:28 +0530, Visuwesh said: Visuwesh> AFAIK, C-u to mean to use the secondary browser is a fairly common Visuwesh> pattern. See browse-url-button-open and browse-url-button-open-url as Visuwesh> well. This works for me. commit 43f96d990a4 Author: Robert Pluim AuthorDate: Tue Apr 25 12:28:47 2023 +0200 Commit: Robert Pluim CommitDate: Tue Apr 25 17:17:36 2023 +0200 Allow dired to invoke secondary browser 'browse-url-of-dired-file' always invokes the primary browser, but sometimes it's handy to call a different browser, which is why 'browse-url-secondary-browser-function' exists. * lisp/net/browse-url.el (browse-url-of-dired-file): Call 'browse-url-secondary-browser-function' when invoked with a prefix argument. * etc/NEWS: Announce the change. diff --git a/etc/NEWS b/etc/NEWS index 80ff535dba6..bcca31edb0d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1669,6 +1669,13 @@ the following to your Init file: *** New command 'dired-do-eww'. This command visits the file on the current line with EWW. +--- +*** 'browse-url-of-dired-file' can now call the secondary browser. +When invoked with a non-nil prefix arg, this will now call +'browse-url-secondary-browser-function' instead of the default +browser. 'browse-url-of-dired-file' is bound to 'W' by default in +dired mode. + --- *** New user option 'dired-omit-lines'. This is used by 'dired-omit-mode', and now allows you to hide based on diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 0177d12f236..39513b8f602 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -825,10 +825,17 @@ browse-url-delete-temp-file (&optional localp no-error-if-not-filep)) ;;;###autoload -(defun browse-url-of-dired-file () - "In Dired, ask a WWW browser to display the file named on this line." - (interactive) +(defun browse-url-of-dired-file (&optional secondary) + "In Dired, ask a WWW browser to display the file named on this line. +With prefix arg, use the secondary browser instead (e.g. EWW if +`browse-url-secondary-browser-function' is set to +`eww-browse-url'." + (interactive "P") (let ((tem (dired-get-filename t t)) + (browse-url-browser-function + (if secondary + browse-url-secondary-browser-function + browse-url-browser-function)) ;; Some URL handlers open files in Emacs. We want to always ;; open in a browser, so disable those. (browse-url-default-handlers nil)) Robert --