From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id eMnuKbZOgmKMzAAAbAwnHQ (envelope-from ) for ; Mon, 16 May 2022 15:16:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aEcYKbZOgmIblQAAG6o9tA (envelope-from ) for ; Mon, 16 May 2022 15:16:38 +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 46DA121404 for ; Mon, 16 May 2022 15:16:38 +0200 (CEST) Received: from localhost ([::1]:36402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqaaT-0005UC-6R for larch@yhetil.org; Mon, 16 May 2022 09:16:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqZzP-0002pI-O1 for emacs-orgmode@gnu.org; Mon, 16 May 2022 08:38:19 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]:45959) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqZzN-0000RF-9P for emacs-orgmode@gnu.org; Mon, 16 May 2022 08:38:19 -0400 Received: by mail-ot1-x330.google.com with SMTP id s18-20020a056830149200b006063fef3e17so9927012otq.12 for ; Mon, 16 May 2022 05:38:16 -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:references:in-reply-to; bh=fLh14Hg8Dghg23Ib1+PPnN+0mtsAsUQDu7XMURMcLlk=; b=QRM3yiu9s3Q3q0CURRZRpdrjGk/qXvOhxZIPeGrqcQBaEk8/P1RTn0Jn8bVpI71XhB hoa9xQ+WLW74Nk8xn4x6c/3hRLL2lqArFkBdFwWIqS+PBtereCyW1EZ0F+2A2IWU+J7K ufaS3MxOrSU2UGyAzPHwRUpz67PMdmiaHtqxweBkizjtOaIl6BhAYe5KiYPMEcHvNPGe JWOuagEOiIm8ZJeWTI/7iE+BQk/ENoP012crtzdYgeGqbcZeMiqacyXLYzquT1UydUkL ePF+xX8jJNx755iwr86jc0H5mAiahnr1FvgcQ2g+8ZLU7jQDGpFhDgZlrzAxHWQkfdtI RVSQ== 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:references:in-reply-to; bh=fLh14Hg8Dghg23Ib1+PPnN+0mtsAsUQDu7XMURMcLlk=; b=weCoFkbDs8ZeT9srD4K9f+Z2+TFk73o9KTZMPwr3Q3b0Gp0fLEQzJqbOMqoJL7ifdL zS5mzTC4MYlTgR8DDHD9t0Cc641677vkD+TtzwSq8+RpEPIMEyc5erHFR5YIKAf8SlqS l2ZlBiv6M6Ppia4yn6P+7X1fFCwbbcvND1ZdodFv1EdFnBTPtRLrH1XwK8x/bPQYLNvw BO15m1c7lQoF6lwefp+mDtZNOFj9wropkZfo2Ulcq/qisQrYyIrSo7I2BFyyUc0qkQhW pa45Hj+q+DOGdqLMrJPD/6EMbePdHJ+eZcsotE3QqEDd6tw8guO3LilU5RQXKP5cWWFN CVPQ== X-Gm-Message-State: AOAM531ZZEzSDk5e74dgxDjECulfW/Jw9awezLccR9QqUrOlhYzFaBvR +y6D5uzgFOtWPTz+tSyZsNTJfZGCmIGwfg== X-Google-Smtp-Source: ABdhPJzq63pGdXDjjK1PN4nGkXf58ZqGlsEzao/KVbMlnSoyo+3oDyw62LlSgP6hkxS5uBArY98+4w== X-Received: by 2002:a05:6830:1e0b:b0:606:c6b:5d76 with SMTP id s11-20020a0568301e0b00b006060c6b5d76mr6122756otr.245.1652704695924; Mon, 16 May 2022 05:38:15 -0700 (PDT) Received: from [10.65.33.48] ([96.44.191.132]) by smtp.gmail.com with ESMTPSA id t18-20020a056870609200b000f1952c6bc1sm2037186oae.31.2022.05.16.05.38.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 May 2022 05:38:15 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------LQyiAwnHbgmehnBZDpng0r3S" Message-ID: Date: Mon, 16 May 2022 08:38:14 -0400 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 From: Craig STCR To: Ihor Radchenko , 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> In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::330; envelope-from=craig.stcr1@gmail.com; helo=mail-ot1-x330.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=1652706998; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=fLh14Hg8Dghg23Ib1+PPnN+0mtsAsUQDu7XMURMcLlk=; b=gB/pUMZxdUD47v+sZ/udEt/8FYIdDMBkqGy4exPqJJFPOpRVeoDqk0G3r0AN3th3lEFBlX RSZec6AgWpKhHY+C7+5yx6Ik03ONW5DcHbtKxyQSamPEwe6Q+sdwAZfgakCm3mebltrV4P WLEUieY9PHjexj+vTQpx+Z2ozIFnMh6ASflJPzKLYE+RNF8KoPRX1ijycw4Ztw+Ocew+8M oFymRX94MTL4HeHjI8v6xS/dtS+HyqBQ+lKPUud4tFTPeHIfWb8bwAyKB+BWva0VCeTpEk AyofnCa1e0V9LHXqH02D5M1m+ZB4pVN6ETRw+WIy+Xh70gKgSp/yeEI0RZCLMA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652706998; a=rsa-sha256; cv=none; b=f03r1MyJJ5Mr1dK2/j2cgfDz5IpNGF1OmVzOIaT3878XonC6WlqCh4QubdeNZH9HnxuzPu F5S5mHth+FExhIo+Ub1PZZaPDi0wmrEJDjFsqVoV6B3IsYlH4i4CTOCtpK5ec/4ojIOczM m3Z1zPdv4uUp/6GIHAheAcMCD1n1Ku0RJl5150NZmAv6cXX9Ibd9PUd9Y/M4vlpskpZ505 lRiPfYtU/fqvm6PTAspyj6idshWPZPu4HErr2BXbwOrSNEw8wmTMeDwKoG7toRORcwATZy kp1NYUfwvQmUbjNGBqSdc1aMGrPPgNUZts1Zp5Or1YvvftyoamhvyNT03jIQMg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QRM3yiu9; 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=QRM3yiu9; 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: 46DA121404 X-Spam-Score: -5.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: AvVuwEyEk5fW This is a multi-part message in MIME format. --------------LQyiAwnHbgmehnBZDpng0r3S Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit [ With 'Reply All' ] Here's a summary of what I currently observe: 1)  I was mistaken about the change from 9.5.2 to 9.5.3.  You are correct.  As you noted, the 9.5.2, 9.5.3 diff I previously mentioned was erroneous. 2) The problem I encounter with both 9.5.2 and 9.5.3 is that when opening a shell script -- no file extension, e.g. /home/user/myscript -- mailcap should be consulted and org should open the script file in Emacs.  The mailcap entry is: application/x-shellscript; emacs27 %s; test=test -n "$DISPLAY" But instead, org opens the script file using /bin/less, not emacs. 3) The misbehavior in #2 is new.  I don't know exactly when it started misbehaving but I suspect it happened after updating org to 9.5.3.  But other packages -- elpa, emacs binaries, OS binaries -- may have been updated at the same time, or before that, or after that, so hard to pin it down.  I can't even say for sure if the upgrade to org 9.5.3 was from org 9.5.2.  It may have been an upgrade from an org version older than 9.5.2. 4) Throughout this discussion, when I say "org opens" I am referring to the key sequence "C-c C-o" bound to org-open-at-point.  It opens script file with /bin/less, which is not what I would expect. , bound to org-open-at-mouse (which calls org-open-file?) has the same misbehavior. 5) , bound to org-find-file-at-mouse, *works as expected* and opens the script file in emacs.  Also, using a single prefix argument, "C-u C-c C-o" *works as expected* and opens the script file in emacs. 6) Last but not lease, when I *manually edit* org.el and change the last line of the org--file-default-apps function definition, removing underscore and space, and replacing with single quote like this: diff 8701c8700 <     (_ org-file-apps-gnu))) --- > ('org-file-apps-gnu))) I no longer observe the misbehavior described in #2 and #4. Instead, org *works as expected*, like it does with #5, and opens the script file in emacs, not /bin/less. I know your time is valuable.  No need for you to spend a lot of time on this if I am the only one having this problem.  It could be some random artifact in my installation, maybe something in my ~/.emacs.  My ~/.emacs has a lot in it.  And I have a work-around, since I can use #5. Best wishes, -C On 5/16/22 6:29 AM, Craig STCR wrote: > It's possible my elpa is FUBAR.  I will uninstall, rm .elc, > re-install, and re-compile org 9.5.3 when I get a chance. > > On 5/16/22 6:08 AM, Craig STCR wrote: >> OK, I'll take a look as you suggested as soon as I can. >> >> So the form in 9.5.2 was a bug? >> >> The problem I encounter with the new form in 9.5.3 is that when >> opening a shell script -- no file extension, e.g. /home/user/myscript >> -- 9.5.2 would consult mailcap and open the script in Emacs.  The >> mailcap entry is: >> >> application/x-shellscript; emacs27 %s; test=test -n "$DISPLAY" >> >> 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. >> >> I'll take a look as you suggested as soon as I can. >> >> Thanks, Ihor. >> >> >> On 5/16/22 4:33 AM, Ihor Radchenko wrote: >>> Craig STCR writes: >>> >>>> 9.5.3 does not return org-file-apps-gnu because org-file-apps-gnu is not >>>> quoted.  Should be (and was in 9.5.2): >>>> >>>> 'org-file-apps-gnu >>>> >>>> but in 9.5.3 it is: >>>> >>>> _ org-file-apps-gnu >>> Please try to run the following form: >>> >>> (pcase 'gnu/linux >>> (`darwin org-file-apps-macos) >>> (`windows-nt org-file-apps-windowsnt) >>> ('org-file-apps-gnu)) ;; => nil >>> >>> and then >>> >>> (pcase 'gnu/linux >>> (`darwin org-file-apps-macos) >>> (`windows-nt org-file-apps-windowsnt) >>> (_ org-file-apps-gnu)) ;; => ((remote . emacs) (system . mailcap) (t . mailcap)) >>> >>> The second case is returning a list, which org--file-default-apps >>> supposed to return. The previous behaviour was erroneous. You may refer >>> to M-x describe-function pcase to understand the code. >>> >>> Please, provide more details on the actual error you ran into. The >>> change in the org--file-default-apps is not a bug. >>> >>> Best, >>> Ihor >>> >> > --------------LQyiAwnHbgmehnBZDpng0r3S Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit [ With 'Reply All' ]

Here's a summary of what I currently observe:

1)  I was mistaken about the change from 9.5.2 to 9.5.3.  You are correct.  As you noted, the 9.5.2, 9.5.3 diff I previously mentioned was erroneous.

2) The problem I encounter with both 9.5.2 and 9.5.3 is that when opening a shell script -- no file extension, e.g. /home/user/myscript -- mailcap should be consulted and org should open the script file in Emacs.  The mailcap entry is:
application/x-shellscript; emacs27 %s; test=test -n "$DISPLAY"
But instead, org opens the script file using /bin/less, not emacs.

3) The misbehavior in #2 is new.  I don't know exactly when it started misbehaving but I suspect it happened after updating org to 9.5.3.  But other packages -- elpa, emacs binaries, OS binaries -- may have been updated at the same time, or before that, or after that, so hard to pin it down.  I can't even say for sure if the upgrade to org 9.5.3 was from org 9.5.2.  It may have been an upgrade from an org version older than 9.5.2.

4) Throughout this discussion, when I say "org opens" I am referring to the key sequence "C-c C-o" bound to org-open-at-point.  It opens script file with /bin/less, which is not what I would expect.  <mouse-1>, bound to org-open-at-mouse (which calls org-open-file?) has the same misbehavior.

5) <mouse-3>, bound to org-find-file-at-mouse, works as expected and opens the script file in emacs.  Also, using a single prefix argument, "C-u C-c C-o" works as expected and opens the script file in emacs.

6) Last but not lease, when I manually edit org.el and change the last line of the org--file-default-apps function definition, removing underscore and space, and replacing with single quote like this:
diff
8701c8700
<     (_ org-file-apps-gnu)))
---
>     ('org-file-apps-gnu)))
I no longer observe the misbehavior described in #2 and #4.  Instead, org works as expected, like it does with #5, and opens the script file in emacs, not /bin/less.

I know your time is valuable.  No need for you to spend a lot of time on this if I am the only one having this problem.  It could be some random artifact in my installation, maybe something in my ~/.emacs.  My ~/.emacs has a lot in it.  And I have a work-around, since I can use #5.

Best wishes,
-C

On 5/16/22 6:29 AM, Craig STCR wrote:
It's possible my elpa is FUBAR.  I will uninstall, rm .elc, re-install, and re-compile org 9.5.3 when I get a chance.

On 5/16/22 6:08 AM, Craig STCR wrote:
OK, I'll take a look as you suggested as soon as I can.

So the form in 9.5.2 was a bug?

The problem I encounter with the new form in 9.5.3 is that when opening a shell script -- no file extension, e.g. /home/user/myscript -- 9.5.2 would consult mailcap and open the script in Emacs.  The mailcap entry is:
application/x-shellscript; emacs27 %s; test=test -n "$DISPLAY"
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.

I'll take a look as you suggested as soon as I can.

Thanks, Ihor.


On 5/16/22 4:33 AM, Ihor Radchenko wrote:
Craig STCR <craig.stcr1@gmail.com> writes:

9.5.3 does not return org-file-apps-gnu because org-file-apps-gnu is not 
quoted.  Should be (and was in 9.5.2):

    'org-file-apps-gnu

but in 9.5.3 it is:

    _ org-file-apps-gnu
Please try to run the following form:

(pcase 'gnu/linux
    (`darwin org-file-apps-macos)
    (`windows-nt org-file-apps-windowsnt)
    ('org-file-apps-gnu)) ;; => nil
   
and then

(pcase 'gnu/linux
    (`darwin org-file-apps-macos)
    (`windows-nt org-file-apps-windowsnt)
    (_ org-file-apps-gnu)) ;; => ((remote . emacs) (system . mailcap) (t . mailcap))

The second case is returning a list, which org--file-default-apps
supposed to return. The previous behaviour was erroneous. You may refer
to M-x describe-function <RET> pcase <RET> to understand the code.

Please, provide more details on the actual error you ran into. The
change in the org--file-default-apps is not a bug.

Best,
Ihor




--------------LQyiAwnHbgmehnBZDpng0r3S--