From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: dired-guess-shell-alist-* is not enough Date: Wed, 29 Nov 2023 22:29:56 -0500 Message-ID: <87plzryl3f.fsf@gnu.org> Reply-To: sds@gnu.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16575"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 30 04:31:17 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 1r8Xll-00048b-DD for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Nov 2023 04:31:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8Xkb-0005wp-1I; Wed, 29 Nov 2023 22:30:05 -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 1r8XkZ-0005we-2u for emacs-devel@gnu.org; Wed, 29 Nov 2023 22:30:03 -0500 Original-Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r8XkX-0002z0-0N; Wed, 29 Nov 2023 22:30:02 -0500 Original-Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-77d8d1b7952so21067185a.2; Wed, 29 Nov 2023 19:29:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701314998; x=1701919798; darn=gnu.org; h=mime-version:message-id:date:mail-followup-to:reply-to :return-receipt-to:user-agent:subject:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=Qma49pq0/1PKTGflLgRh0AykJc6pQCaO5bnF+NECdSQ=; b=hqpx3hSlkStoNLRYwyd/uqNcwvumI2GwigToUSKYGGgtZkuiu+Xo0knl7ZV7tCEGR6 4+HveHyphPr4yjinL55+fBIpdRYjgJSqIMIcNSUJa8LxIn5jByPOYULjUw5aoVzD1APM 1+xr7j4JscXN+eQL63hho32B2Fg4PXv5qQ2oM93Frt78/pHauwDJexNP/CsTsIqJZyrh xY7be0su7ulokAe/ExpPVi9WFJLe2NwOMPigXZ1R6UGvU44TalUeqSB9XDPYsVww1V7y wtQmjNNeHzE+2Lk6B94I4mqXUOBNvCMdRMRdzGZCb6HgeRmsxcn/WZoah2c6gU0rI5NX qzJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701314998; x=1701919798; h=mime-version:message-id:date:mail-followup-to:reply-to :return-receipt-to:user-agent:subject:to:from:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qma49pq0/1PKTGflLgRh0AykJc6pQCaO5bnF+NECdSQ=; b=tL2xWn/IdLWUITLT5zuobr/1KVI3XcCzJssNmxpVqpX4L2G7k0ZExb9XAlgKaiW4t+ KsJ6Ei8zXOIa3EgUezkOHATdaXXY177OmIOpUPevTPTL2z4mxdWQea6uJgqFUOiuynmz zCfl+fMZy36bCt1x4t32NaO9B7QvQvPwbxlBNe38/qRoNyyuBi81ook+/+mvbIsvezeP D8QixRe1IJqCIIppCADf5mImxNpz2ztTtybOEm6WXWqgd70/KDd14TBUwPlsJs0ydOLU 5dsAQUShWQK5yyI/u742fE7DcyzYqxnlaRF2ojSuFSRHpzOtTNZzIqmJ1zbgh59HQLP3 GM0w== X-Gm-Message-State: AOJu0YwOmTwHz9VqiVxHVSdsfmgw7RZoIeOLiWnMlxpVW/sumaqGh8Q5 N82vJ6pmvpk9ejJiUoySf+gu54Cpdg== X-Google-Smtp-Source: AGHT+IFC6JZpDsw9zLhG1lA1Y68fl5njKoj6uh8jmMEuPrzjwY0Zy5wh0CfFSDcsJuE8u/68H3dV+Q== X-Received: by 2002:a05:620a:149b:b0:77d:cd92:896c with SMTP id w27-20020a05620a149b00b0077dcd92896cmr4026957qkj.8.1701314997754; Wed, 29 Nov 2023 19:29:57 -0800 (PST) Original-Received: from pop-os (pool-108-30-110-42.nycmny.fios.verizon.net. [108.30.110.42]) by smtp.gmail.com with ESMTPSA id ea2-20020a05620a488200b00774830b40d4sm98512qkb.47.2023.11.29.19.29.57 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Nov 2023 19:29:57 -0800 (PST) X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Mail-Followup-To: emacs-devel@gnu.org Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=sam.steingold@gmail.com; helo=mail-qk1-x731.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:313373 Archived-At: --=-=-= Content-Type: text/plain Hi, when neither `dired-guess-shell-alist-user' nor `dired-guess-shell-alist-default' have anything, one might want to delegate to the OS ("open" or "start"). Here is a patch that implements it: --=-=-= Content-Type: text/x-diff Content-Disposition: inline Content-Description: patch diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 47e97c96ce1..320afa48bfe 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1290,7 +1290,8 @@ dired-guess-default nil))))) (if (length= programs 1) (car programs) - programs))) + (or programs + dired-guess-shell-default)))) ;;;###autoload (defun dired-guess-shell-command (prompt files) diff --git a/lisp/dired.el b/lisp/dired.el index 97645c731c8..eeea88fdae9 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -468,6 +468,18 @@ dired-guess-shell-alist-user :type '(alist :key-type regexp :value-type (repeat sexp)) :version "29.1") +(defcustom dired-guess-shell-default + (cond ((memq system-type '(gnu/linux darwin)) + "open") + ((memq system-type '(windows-nt ms-dos)) + "start")) + "The fall-back command when nothing specific is found. +Used when neither `dired-guess-shell-alist-user' nor +`dired-guess-shell-alist-default' supply anything." + :group 'dired-guess + :type 'string + :version "30.1") + (defcustom dired-guess-shell-gnutar (catch 'found (dolist (exe '("tar" "gtar")) --=-=-= Content-Type: text/plain -- Sam Steingold (https://aphar.dreamwidth.org/) on Pop 22.04 (jammy) X 11.0.12101004 https://lastingimpactpsychology.com https://steingoldpsychology.com https://mideasttruth.com https://honestreporting.com Send $10 for a brochure on how to make money selling brochures. --=-=-=--