From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MFQrGVmGgmK/fwAAbAwnHQ (envelope-from ) for ; Mon, 16 May 2022 19:14:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uA4lGVmGgmIvgQEA9RJhRA (envelope-from ) for ; Mon, 16 May 2022 19:14:01 +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 18A75382F for ; Mon, 16 May 2022 19:14:01 +0200 (CEST) Received: from localhost ([::1]:34658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqcyH-0003JG-7K for larch@yhetil.org; Mon, 16 May 2022 11:49:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqcQy-0000Vb-DM for emacs-orgmode@gnu.org; Mon, 16 May 2022 11:14:56 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:39848) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqcQw-0003vN-AE for emacs-orgmode@gnu.org; Mon, 16 May 2022 11:14:55 -0400 Received: by mail-lf1-x135.google.com with SMTP id y32so26387800lfa.6 for ; Mon, 16 May 2022 08:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=rshDpLqDZh53loJIcsxRQri/qiJG3uyhMmnrQtruc8w=; b=kaToWGZJajjC2qXBG3Lo7s/6rxQehTZ7OdynA9QYH0iM9a7NwGk5113uW/pyeuYF0W 10yCYsdnX/SvM2aTkobGSrQn0XOnHp1uTK9an59MNHODnE0yfhSvqB8/Dq7PQk090i3N /JkQiHQyzeoJoQ0KkuTwTLXqyeggE3t8nGqbvix+mqvIGd9L0YO7PK6865XK0g/gW+YD EffPG4N7AQ0tMn4VcAFedbWn0Wx4CGroK2B85rVu6QjRYCqyj7QXwaLh9mXIDcJj3bUq A4KY0jdthG6xu9w7uwtFx03iZjiNKLSqST5ODwQlIK1xU+NRw43IjWm32Nu5l28C3z6a r1Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=rshDpLqDZh53loJIcsxRQri/qiJG3uyhMmnrQtruc8w=; b=xNMJnxEA5XhXmoZu/VFgVmlT39s1lWdTtPOHmmekFk/Z7KCPA8LtKViysnfUBxNPXV o8It0OJEGzuCHJvzYaXjDjAJTV0/w6mZxXHOqUiwdI58W2Zng5i4cfxurWELQ4yc9HzL CwG1swCKrH7iRFTK39SVVJW/Xvd+Bklkg9lvkC6o+QNKK/cXTiQrfnWZcc4iJWXGoTyp P06YGPq95Qa1owkUwxTaCD5CVYysk6ovzI8FQk9k+WoeH9Nd3HzwV9WB4DetJJUmVzEF LlDxs7cNYeC1JGH4qzGkN19lefEZ4Bci4DJ92MBS5bj5/UFhQYuQDFc4k4sVPX9KbtyA 1zbg== X-Gm-Message-State: AOAM531pl99HeI9Yxq9i50DZmCdRSAVTBLVSFDxUtOqwdBZQkXyEzm08 5e9O6UdMzrtf9rBq618lB+mXOs3mycI= X-Google-Smtp-Source: ABdhPJzwiStuqG3NaO1sZ7zQN3pvd7Zl7quFrBAVOK7jK1FYhgzJKTX5i0YAQMt98xnRmkYx+F7V9g== X-Received: by 2002:a05:6512:33a7:b0:472:481b:9d6c with SMTP id i7-20020a05651233a700b00472481b9d6cmr13745262lfg.451.1652714092144; Mon, 16 May 2022 08:14:52 -0700 (PDT) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id u6-20020ac243c6000000b0047255d21110sm1334281lfl.63.2022.05.16.08.14.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 May 2022 08:14:51 -0700 (PDT) Message-ID: <7c75b724-1ea2-5e3e-cbe6-e1895fd35bd3@gmail.com> Date: Mon, 16 May 2022 22:14:39 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: Bug in 9.5.3 org--file-default-apps Content-Language: en-US To: Ihor Radchenko , Craig STCR 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> From: Max Nikulin In-Reply-To: <877d6lbsg5.fsf@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=manikulin@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: 26 X-Spam_score: 2.6 X-Spam_bar: ++ X-Spam_report: (2.6 / 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, NICE_REPLY_A=-0.001, RCVD_IN_BL_SPAMCOP_NET=1.347, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, 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-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=1652721241; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=rshDpLqDZh53loJIcsxRQri/qiJG3uyhMmnrQtruc8w=; b=OVJO2Rvywh1WW7MSwEVCtvepHiOC4UO4emeyTXI0lxLRsK0OvVkTpX3mp1UR1tzPVZqc7C eQA6nZLwLeS0M0aD80lEQe/Qe/DyFQboLvt1Ex58hVKT1HcZFkFGy2CSRXjMJNFwfrpC91 1ozXusF3y8GF3qO8+6gF9XWZ84a08WXkGkGzs8oG7/DVIgxrlc3qc5DVfDN85X6nyKRc3r CzRdcM9GDOwfixQtRfqhCY2MjQWP7EcUuK/RC39EEholsFgFekJlXMd1qvmD4PJCtzEXlT QNKi2YR3Iyid+M+55kHYaEb2QEJxPr0lLt6t6I3MnSZ6Y9g3lnot5aGjnaKoqA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652721241; a=rsa-sha256; cv=none; b=g1PRqySGqZglB6UCA+516mZ7DCItCATk2UvKsUY7dpcWf8Q+PYfyfm8xdKTldMYdGJUofN zKQEj7RpqODzka5AAjEieMJOLA2nR64v9rIw1ulYAIwhVFsm83v2Uc1wrQ+CYJHk1PMnHy g/tQQMfVk9pK/xwOzTJd1rQBhiqaBQoFLMyMtTxomYoeSHfh+tXh37ASkxQqt9EoABk6Nb 5SAKOrRA719XIabWuqsJXhfWerZQ2LoHr8fVFXxW3k/0qjVHU1wIHdEE6m3pDOR2T0j94V YYbwOj5enF27RFJFSxilRIdsj6MB4er0sOtoXrzLn8h2XeDcZd9fxBXVYob7BA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=kaToWGZJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 10.47 X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=kaToWGZJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 18A75382F X-Spam-Score: 10.47 X-Migadu-Spam: Yes X-Migadu-Scanner: scn1.migadu.com X-TUID: Uu6+OKIn5h1S On 16/05/2022 18:57, Ihor Radchenko wrote: > Craig STCR writes: >> But with the new form in 9.5.3, /home/user/myscript is opened by >> /bin/less, not emacs.  I assume mailcap is not consulted.  Which does >> not work well.  These behaviors are only for org.  Outside of org, emacs >> behaves correctly. > > mailcap does get consulted. What you are seeing happens because > mailcap.el (built-in Emacs library) is only able to recognise mime-types > by extension. So, your file is likely recognised as "nil" mimetype thus > making Org mode fallback to default mailcap handler, which is /bin/less > in your case. Sounds reasonable. However I just have tried a [[file:~/path/to/script]] link running Org main HEAD and the file is opened in emacs (26.3) other window. > I guess that Org can also try to use `file' command (when available) to > determine the mime type. Though ideally, it should be all handled by > mailcap.el Would you mind writing to emacs-devel mailing list and asking > to add the feature of using `file' command into mailcap.el? https://lists.gnu.org/archive/html/emacs-devel/2009-08/msg01057.html Re: using libmagic in Emacs? From: joakim Subject: Re: using libmagic in Emacs? Date: Mon, 24 Aug 2009 14:30:33 +0200 A never committed patch. It is sour from my point of view. https://lists.gnu.org/archive/html/emacs-devel/2009-08/msg01368.html From: Eli Zaretskii Subject: Re: using libmagic in Emacs? Date: Sun, 30 Aug 2009 06:09:23 +0300 >> From: Juri Linkov >> Date: Sun, 30 Aug 2009 02:19:12 +0300 >> >> I agree that running `file' is a simpler solution. > > PLEASE do not base Emacs infrastructure on external programs, unless > they come with Emacs. `file' is not available on every platform, and > even on those it is, the quality and extent of its database is unclear > and so cannot be relied upon. https://lists.gnu.org/archive/html/emacs-devel/2009-08/msg01072.html From: Richard Stallman > How hard would it be to change the code in Emacs to recognize these > using the existing mechanism?