From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 uODAI/5KgmImkAAAbAwnHQ (envelope-from ) for ; Mon, 16 May 2022 15:00:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oKm1I/5KgmJX/QAAauVa8A (envelope-from ) for ; Mon, 16 May 2022 15:00:46 +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 3CFDD3AA19 for ; Mon, 16 May 2022 15:00:46 +0200 (CEST) Received: from localhost ([::1]:38376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqaL6-0003tC-6H for larch@yhetil.org; Mon, 16 May 2022 09:00:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqZLk-0003C6-Sg for emacs-orgmode@gnu.org; Mon, 16 May 2022 07:57:20 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:44640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqZLj-00029h-3P for emacs-orgmode@gnu.org; Mon, 16 May 2022 07:57:20 -0400 Received: by mail-pj1-x1035.google.com with SMTP id pq9-20020a17090b3d8900b001df622bf81dso1667044pjb.3 for ; Mon, 16 May 2022 04:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=mL1Hn89DSyExetMx8QhGaVvPiv93Ee1UdUSLfb7gUQg=; b=LC/JsBeUyAUYu4fE3IvwKf4pt5Zq5uvOnhd4y3xQBbnv98VsOpOWoOd2rCqkpXJkRQ +BZKtsy2mkXx2I/ptXNRKixCbT+LBWeSmGfrzolOZNeKn2Kx/tgr0UuAG1Z4KUZ1MQk2 kpDSUUYhtAtbK6ai2PjBkb/ApzU58DCCqa0lqu2hdPrnB15mLhmwn37soKON63F+rSst iHac/qBXeXsKWeI2/1LUzDsZ34lLDg7zsfYlPUNtmA+yhDucP0ZxbEEYAtKbZuM8Pe+a 1Whoq+9hCbqT1WV4bJuXqeQj/cGLwyybq+Mzk9OxIBjsEBTyE6BzEPDuMqsjH5g1yjz1 ESOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=mL1Hn89DSyExetMx8QhGaVvPiv93Ee1UdUSLfb7gUQg=; b=6OMSyjOs2Hnsrnt2pwsheyJrxrsH5gq4yBm1kKv/YQXIlfZep53WQ95RW3i3POEtgG mUpDsjlM8dtSdBTHezEwTu4VdzaG/kVSGWy3dTAvgDwk4SN5XM+zj3wNALkiw26M8lzR pVfSz0G0licvct/OFHDAmvLDvnlm3QMOlqGgVDjmFdYSRpx7XjhcRc0cSZCeOgOy/4zC XpiR4zvhDltN5PUF1jB5y4kMh3h0367VQ9pRGaIsKeIVW2JcaZ8xU9/TBvBh9BO5TOmy bY57/lWfU0IF2pB5zkU0LHCEXTmbM32KDiq+DU4QLwLxfkyeFbHEXp2k1CDM1E7xZb1F 0EWw== X-Gm-Message-State: AOAM530jpxHcVJsq8FO03M6xaApfjEfFHA+CNyAKU9E4ZA6eX6i5mNuM 86mCHQUTUkQn2KfuXETDcC4= X-Google-Smtp-Source: ABdhPJy4PynTbAN3+A53HDJ+osdorkfLCW8SQiWNEDSjcgT3b5I+9jP5jrtBkzXEYwUgruxE1ZGmfA== X-Received: by 2002:a17:90a:b703:b0:1dd:1e2f:97d7 with SMTP id l3-20020a17090ab70300b001dd1e2f97d7mr30304356pjr.62.1652702228288; Mon, 16 May 2022 04:57:08 -0700 (PDT) Received: from localhost ([38.75.137.213]) by smtp.gmail.com with ESMTPSA id jf22-20020a170903269600b001615f64aaabsm3438413plb.244.2022.05.16.04.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 04:57:07 -0700 (PDT) From: Ihor Radchenko To: Craig STCR Cc: emacs-orgmode@gnu.org Subject: Re: Bug in 9.5.3 org--file-default-apps In-Reply-To: <86692975-4d5f-6933-3227-c6b208f76862@gmail.com> 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> Date: Mon, 16 May 2022 19:57:46 +0800 Message-ID: <877d6lbsg5.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1035.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, 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=1652706046; 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=mL1Hn89DSyExetMx8QhGaVvPiv93Ee1UdUSLfb7gUQg=; b=UYIo4/5FFQ/YTOub19C1UduAeqcri6HGxfSZCDprnDw3I7zDMmO1EoWuXH6PjZIagzeg5i INyOnj1gv8pABMjU/NEVZujzKtv0WxO7j/lSOB/pOmtziU9zI677N6xl2I6rutlgtx9EdQ WlHA8quYlIJAy6gRPcu2DhL3rLID1NcIcDnuCXme10/60/KJqYepyX8RA7w9ktOjfZWIdW swPQTlj8JqN3yeS5bFmGR0lqOrhfhQlk8+oOs4wtdtx2/zQ+6K2w+eU4+AwrWYbakVf4yB 9z/qD78YT5HgO4eYKJjdIdYyAnw4q+oxDlOYsY5O2Q6qeYM3uVXPb5cAJbQ3cg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652706046; a=rsa-sha256; cv=none; b=jo9lXsyqYNp+uqw1DpSjmooanqOiLskGTVLtcvaR6FW8rQXO80d+zf0FUXMvVvUy/A29S8 nvx1gWvWY3QMU8DAEjo6cbm+51Fl7mUvBEkDJP5eiHrmeGqT3T5Sn8VWr1G6WCWDhzPjGO iRBE0K9L5QcNhnL2ftQZrtnsvL64Xc7KhQ1j3dXCAghdogWyjG5MiwpUzlyb0zafPsgGE+ bQgS7VM8Jxj7tQ3zM4etiBL+3egp8bC0hy6SoDxZoHIDKbRXpBDlRU3PYjD0dfxRU5JL8c O+Mx1K7mSpiNAoGlFXlbjI6QqkUN/KntWj5Vs7SqFAGPUliFq+z7K2wSmCdvTQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="LC/JsBeU"; 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: -5.33 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="LC/JsBeU"; 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: 3CFDD3AA19 X-Spam-Score: -5.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: JQGOnQADlrgj Craig STCR writes: > OK, I'll take a look as you suggested as soon as I can. > > So the form in 9.5.2 was a bug? Yes, 9.5.2 version of that function was a bug. > The problem I encounter with the new form in 9.5.3 is that when opening=20 > a shell script -- no file extension, e.g. /home/user/myscript -- 9.5.2=20 > would consult mailcap and open the script in Emacs.=C2=A0 The mailcap ent= ry is: > > application/x-shellscript; emacs27 %s; test=3Dtest -n "$DISPLAY" > > But with the new form in 9.5.3, /home/user/myscript is opened by=20 > /bin/less, not emacs.=C2=A0 I assume mailcap is not consulted.=C2=A0 Whic= h does=20 > not work well.=C2=A0 These behaviors are only for org.=C2=A0 Outside of o= rg, emacs=20 > 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. In Org 9.5.2 the error in org--file-default-apps made Org mode skip using mailcap and use the last possible fallback, which is opening in emacs. That fallback just happened to be the same with your setting in mailcap file. 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? Best, Ihor