From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6MOEOD2Xi2KpJQEAbAwnHQ (envelope-from ) for ; Mon, 23 May 2022 16:16:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GFssOD2Xi2IsjAAAauVa8A (envelope-from ) for ; Mon, 23 May 2022 16:16:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 756E43312E for ; Mon, 23 May 2022 16:16:29 +0200 (CEST) Received: from localhost ([::1]:48326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nt8rE-0004NG-L4 for larch@yhetil.org; Mon, 23 May 2022 10:16:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nt8po-0003sb-FF for emacs-orgmode@gnu.org; Mon, 23 May 2022 10:15:00 -0400 Received: from mail-oa1-x2b.google.com ([2001:4860:4864:20::2b]:34747) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nt8pm-0007sz-Gi for emacs-orgmode@gnu.org; Mon, 23 May 2022 10:15:00 -0400 Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-f189b07f57so18649613fac.1 for ; Mon, 23 May 2022 07:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to; bh=Z/BUW+j43FJxSS1bL54n5quxV2wo5w7NYjdHAAlMBns=; b=AsKEDL+mSqmXZ7etGoDAwjuBbUyHp2hyQKohz2+p/+iUesUdPbrYvTi6W9jePFmjDD suMH9LBE/xVFA0W3Utqd3nl6jnzsmenk/AASa2eRoYPHkp+QyhEe+Q6GtjInuHOZJCpe sdWbkmN1qsmza2S9o9cwNWdij6aHovRVyFL6C8e3Fh0gi7dAd5PWnEoAGtA21D+dHa02 T2hNQI7jt+RCFT0QX7hP0Gf1QPNytYS99wOLbL4NaY7CEa1Wpy9729NIwlGu6kIwiig9 bZwF2r8uqQS0eEHC7X/7GVOEQI7svOiaeNHabPZMe9V2ZOwM3kh/aZwvqpESrBONn37+ FCbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to; bh=Z/BUW+j43FJxSS1bL54n5quxV2wo5w7NYjdHAAlMBns=; b=TLZuOcSY2HjHTkFev5Kgh5AM1y34odP3B7dJApQUaDWIFrheaB37pOAtIOeFsCgCbD +YzvlkR+wWjJiWhjK2Xl8FawQGAEH+dlVEljk1HmgKRwHqMRLP0iOCoyBCXM8SzoM6JS ezi8K+DBD8Ct7miW5pElXQsVOa4OrGjoDIndqUvzFHRe1W6Wa6tqXSvf1AccIQ/XYfkH Fc8wrJCASITVXWDPwtWIDzrcRPEjOY4nT4cOI6Kid1hGH+S+d5DMS8BV2nAWhtSh0xlE PfG1g3EhHgWElxzdsF6pxufJcZGAZrzk5dreaK3q6pWmkHS2ZAe3Vd+wJB6DT/6Vj64a wiIw== X-Gm-Message-State: AOAM5300afLQ3AdbAS8VDd6kJbIuwclXXmepeq0SXeAAJ80YfdZCkotg NwAum4Wjap2MyEMCT4RnMMo= X-Google-Smtp-Source: ABdhPJwp0sFiTXaU59HTMyy29GlDoThhSbTjtXX2w3X62j12cKxkkq5QPskvbfQW4sihlBSeRiUcMg== X-Received: by 2002:a05:6870:d215:b0:f2:5fc9:6492 with SMTP id g21-20020a056870d21500b000f25fc96492mr3164284oac.112.1653315297262; Mon, 23 May 2022 07:14:57 -0700 (PDT) Received: from [10.65.33.48] ([96.44.191.132]) by smtp.gmail.com with ESMTPSA id 184-20020aca05c1000000b0032698578409sm4072922oif.38.2022.05.23.07.14.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 May 2022 07:14:56 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------McCGRN76a21506Vp6cxL8ZQ5" Message-ID: <4a2b36e9-800f-f02f-c566-3a38e14d9d8c@gmail.com> Date: Mon, 23 May 2022 10:14:55 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: Bug in 9.5.3 org--file-default-apps Content-Language: en-US From: Craig STCR To: Ihor Radchenko , Max Nikulin Cc: emacs-orgmode@gnu.org References: <963d5f94-3fdf-a01b-bc91-edc99222cb34@gmail.com> <87czgeaxir.fsf@localhost> <6615610d-93ae-171f-b554-3f4cc79354cc@gmail.com> <87a6bhc1w6.fsf@localhost> <86692975-4d5f-6933-3227-c6b208f76862@gmail.com> <877d6lbsg5.fsf@localhost> <7c75b724-1ea2-5e3e-cbe6-e1895fd35bd3@gmail.com> <877d6j2htv.fsf@localhost> <87ilq14p6p.fsf@localhost> <87v8u0396t.fsf@localhost> <87ilpz3bi0.fsf@localhost> <0d8e9eb3-8b4f-127b-2293-2dfd182cd2cf@gmail.com> In-Reply-To: Received-SPF: pass client-ip=2001:4860:4864:20::2b; envelope-from=craig.stcr1@gmail.com; helo=mail-oa1-x2b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-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-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653315389; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Z/BUW+j43FJxSS1bL54n5quxV2wo5w7NYjdHAAlMBns=; b=a9eWktwKj7jZNzL20nBMdc91Lsow7CVD3c7di/LQIx0iz7JD2uhP5S+X4WNHvJNWiCc9Gm cPY8qVgZRtXETGNMAp375OJG21bZ+UQxxs9C4y2k9ly6ZTLsorF2mbpCn3GaGiKj27V9lE qWyikw//m+K8O5lUdU9zXkZsxArtT3x0Y9iNKJa9EGvjMFZm/ZN+1gmqMECPNxo8vCto5e vtp5mUG4ImgYZLBCFHjEpCFtV41b3Iu79md7EubF/u5twqqTVnmLrscRTMcoWqjcNyLRZb 2i69/YL89JLN3fKrDBjXk4AqOhrClekWbe9n/Sp44unm4wUixj3gJURgMiDItQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653315389; a=rsa-sha256; cv=none; b=l0mvfPEfnYwvb6iMguDbhf2H1T3UrhxYFi5KlZb4XnWBILpugKByR85S+4MWMKpm6pF7FP FjrxhM4kbUIT2js3/q6Vgh4RPF/cCWkSyjWu7IsOnyobc6FMbTfzsnaHUmiZFEdg9wtQgQ jpJEgC0r3bahArQ2Zp8rq3qMVqunUSX24zHBPddQA2azN3BJQBs9uelQ8xSvjVJedDTjz6 4Av34wGk+ZLoX2VmtTgTUGutKhPQRtTUka+AxSWaWjZqE+nAD6oUgeoby7TO7LJTO8mUha v14fiVraaPOhmuFB9M1MUNeXHVhPlz5BSeIa2qq7aF6dG+MvMEBBYAwTWKeJ/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AsKEDL+m; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -9.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AsKEDL+m; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 756E43312E X-Spam-Score: -9.05 X-Migadu-Scanner: scn0.migadu.com X-TUID: TrayaZx50J6w This is a multi-part message in MIME format. --------------McCGRN76a21506Vp6cxL8ZQ5 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Everything I mentioned so far has been my Bionic desktop.  Which, incidentally was an upgrade from Xenial, not a clean install. But... in my Focal headless container, if I run: >$ run-mailcap myscript it invokes emacs.  Yay!  It works!  DISPLAY, EDITOR, and VISUAL are all unset or empty.  There's nothing in /etc/mailcap for emacs, and what *IS* in /etc/mailcap is (amongst others of course): application/x-shellscript; vim %s; needsterminal So I really need to spend some time reading man pages about mailcap, mime, etc because that's not what I would expect, and I'm really confused. On 5/23/22 8:59 AM, Craig STCR wrote: > I guess maybe I should have given a little better description of what > I tried that did NOT work?  But it's a little off-topic for this > mailing list.  Nevertheless, here it is... > > I created a ~/.mailcap file and put this in it, which I cut and pasted > from /etc/mailcap: > > application/x-shellscript; emacs27 %s; test=test -n "$DISPLAY" > > But obviously that's not going to change anything, since it's already > in the system mailcap file, /etc/mailcap.  DOH!  And sure enough, > running '>$ run-mailcap myscript' invokes 'less'.  But what I wasn't > expecting is that running '>$ update-mime -- local' gives me: "Error: > '/home/user/.mailcap' is not in required format -- not updated".   Not > sure why I'm getting that when I cut-and-pasted from /etc/mailcap. > > No worries.  I'll look in more depth later. > > > On 5/23/22 8:40 AM, Craig STCR wrote: >> Thanks all for your help! >> >> On 5/20/22 9:44 PM, Ihor Radchenko wrote: >>> Dear Craig, ... or provide plain/text handler in ~/.mailcap. >>> >> OK, I did a first-try on this and was unsuccessful, but I'm sure it's >> user error.  I need to refresh my knowledge on how to customize >> user-local mime database, and that will write-out a new ~/.mailcap, >> etc, I think?  I've done it before, but it was awhile ago, and I >> wasn't paying attention to ~/.mailcap when I did it.  I know for >> Gnome I can create a .desktop file.  But I know there's a way to >> customize user-local mime database without Gnome desktop.  I'll take >> a closer look when I have a little more time. >> >> >> On 5/20/22 9:44 PM, Ihor Radchenko wrote: >>> However, I am not sure what to do on Windows/Mac. >> Maybe try a quick-and-dirty, cross-platform solution that checks >> non-binary files for a first-line shebang?  Could use existing Emacs >> hooks that determine major-mode when opening files. >> >> Again, thanks all for your help! >> >> Best, >> -Craig >> > --------------McCGRN76a21506Vp6cxL8ZQ5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Everything I mentioned so far has been my Bionic desktop.  Which, incidentally was an upgrade from Xenial, not a clean install.  But... in my Focal headless container, if I run:
>$ run-mailcap myscript
it invokes emacs.  Yay!  It works!  DISPLAY, EDITOR, and VISUAL are all unset or empty.  There's nothing in /etc/mailcap for emacs, and what *IS* in /etc/mailcap is (amongst others of course):
application/x-shellscript; vim %s; needsterminal
So I really need to spend some time reading man pages about mailcap, mime, etc because that's not what I would expect, and I'm really confused.

On 5/23/22 8:59 AM, Craig STCR wrote:
I guess maybe I should have given a little better description of what I tried that did NOT work?  But it's a little off-topic for this mailing list.  Nevertheless, here it is...

I created a ~/.mailcap file and put this in it, which I cut and pasted from /etc/mailcap:

application/x-shellscript; emacs27 %s; test=test -n "$DISPLAY"
But obviously that's not going to change anything, since it's already in the system mailcap file, /etc/mailcap.  DOH!  And sure enough, running '>$ run-mailcap myscript' invokes 'less'.  But what I wasn't expecting is that running '>$ update-mime -- local' gives me: "Error: '/home/user/.mailcap' is not in required format -- not updated".   Not sure why I'm getting that when I cut-and-pasted from /etc/mailcap.

No worries.  I'll look in more depth later.


On 5/23/22 8:40 AM, Craig STCR wrote:
Thanks all for your help!

On 5/20/22 9:44 PM, Ihor Radchenko wrote:
Dear Craig, ... or provide plain/text handler in ~/.mailcap.

OK, I did a first-try on this and was unsuccessful, but I'm sure it's user error.  I need to refresh my knowledge on how to customize user-local mime database, and that will write-out a new ~/.mailcap, etc, I think?  I've done it before, but it was awhile ago, and I wasn't paying attention to ~/.mailcap when I did it.  I know for Gnome I can create a .desktop file.  But I know there's a way to customize user-local mime database without Gnome desktop.  I'll take a closer look when I have a little more time.


On 5/20/22 9:44 PM, Ihor Radchenko wrote:
However, I am not sure what to do on Windows/Mac.
Maybe try a quick-and-dirty, cross-platform solution that checks non-binary files for a first-line shebang?  Could use existing Emacs hooks that determine major-mode when opening files.

Again, thanks all for your help!

Best,
-Craig



--------------McCGRN76a21506Vp6cxL8ZQ5--