From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el) Date: Sat, 23 Oct 2021 01:16:48 -0700 Message-ID: References: <87d2cn67zo.fsf@mail.jurta.org> <87bns6dcul.fsf@mail.jurta.org> <87silbstsc.fsf@mail.jurta.org> <83lf2k5gna.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16319"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 18132@debbugs.gnu.org, rrt@sc3d.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 23 10:17:25 2021 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 1meCDU-00043B-Mk for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 10:17:24 +0200 Original-Received: from localhost ([::1]:51904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meCDT-00043z-GX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 04:17:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meCD8-00043f-Bx for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 04:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meCD8-0000pd-3G for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 04:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1meCD7-0007u8-VC for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 04:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Oct 2021 08:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18132 X-GNU-PR-Package: emacs Original-Received: via spool by 18132-submit@debbugs.gnu.org id=B18132.163497701730371 (code B ref 18132); Sat, 23 Oct 2021 08:17:01 +0000 Original-Received: (at 18132) by debbugs.gnu.org; 23 Oct 2021 08:16:57 +0000 Original-Received: from localhost ([127.0.0.1]:34300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meCD3-0007tn-CK for submit@debbugs.gnu.org; Sat, 23 Oct 2021 04:16:57 -0400 Original-Received: from mail-pf1-f181.google.com ([209.85.210.181]:38655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meCD1-0007tZ-GV for 18132@debbugs.gnu.org; Sat, 23 Oct 2021 04:16:56 -0400 Original-Received: by mail-pf1-f181.google.com with SMTP id k26so5730608pfi.5 for <18132@debbugs.gnu.org>; Sat, 23 Oct 2021 01:16:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=ovjPY4SOWG8lwVvQtFig6GhdGVmHDiEqB/j2uZaGWDE=; b=5A0dbq0Rc00aYqXUVNEWs9i/JEHyA8Usu9iiBb83Ay/TU9waqCulX9+Xp6xnzVtUHl NzJlxJvuNzWhU/QTjGqzhuJhsLFEU2XSXy+QwJzUn/wcGrq27ltpGHaCiydZaBp22O/K esUnC1eDP2oBG+6f1aOu39tefnf91gWEiairQ/Dtlc7V2dEY8WCag61wsB5msC3NnM5g 4iacLXoRlkCYlqONPAp94rS2GGFv8GSg/EuwdXPudxc+LEk8ux3RoMuCIxKaTmUuKV3S 9iIsiXm83ClKVItyg7jts22EW5TkT1SHsxqw3OlwERo7/xSgjUOp3kS5RnLK5PZQnRJS QrZw== X-Gm-Message-State: AOAM533jWnwwgxuL+LW5Gm25zf4dui6lmC2URU4fIboOaQoUCopVSXXw Gz6pBIbFyZ5vLTcU0BXMfpGkAJ6e35FqhA0v7Jc= X-Google-Smtp-Source: ABdhPJzpK79qu7vx4WQm4CpERNz1JSl+uig8VUkLKQnVI9udOOcz1IYC0amL+lA1IKs2mkkAVs5PLXXH+yxhfjI3Elg= X-Received: by 2002:aa7:978b:0:b0:44c:abf1:a8b8 with SMTP id o11-20020aa7978b000000b0044cabf1a8b8mr5091264pfp.35.1634977009641; Sat, 23 Oct 2021 01:16:49 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 23 Oct 2021 01:16:48 -0700 In-Reply-To: <83lf2k5gna.fsf@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" Xref: news.gmane.io gmane.emacs.bugs:217955 Archived-At: Eli Zaretskii writes: > It's not only that. Emacs's ability to run programs given a file can > extend and surpass those of the underlying OS, and the ability of > Emacs users to configure and customize that in a unified > system-independent manner are either better or simply not available at > all in the OS-level tools which offer similar functionality. > > So I think it would be nice to extend dired-guess-shell-* so that it > could delegate to the OS-level capabilities like xdg-open or > w32-shell-execute, but we should preserve the abilities to override or > extend that with Emacs-level associations between files and programs. That sounds like exactly the right thing to do. So we need to add stuff here, without taking anything away. However, I will add that while we maintain our current capabilities for customization, we might want to consider removing or updating some entries from `dired-guess-shell-alist-default'. For example, we currently recommend xpdf for PDF:s, which, sure, is presumably available "everywhere", but also is pretty lacking in features and just plain clunky compared to something like evince. To make matters even worse, emacs -Q --eval "(progn (require 'dired-x) (dired \"~\"))" happily offers up xpdf as the default command for PDF:s even though I don't even have xpdf installed! So perhaps it's not that ubiquitous these days... you have to specifically install it to even have it. Looking even more closely at this, I guess `xdg-open' could be used as some final fallback, but it doesn't seem to add anything that isn't already available from mailcap? And we already have `mailcap-file-default-commands', so why not just provide a default based on that? On my machine, I get the very reasonable: (mailcap-file-default-commands '("foo.pdf")) => ("evince" "xdg-open") So why not just move the guessing stuff over to dired.el, re-base it on mailcap, and minimize the list in `dired-guess-shell-alist-default' to something more reasonable. Perhaps that list could be just nil by default if we have the usual mailcap stuff?