[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] Re: Bug in 9.5.3 org--file-default-apps
From: |
Max Nikulin |
Subject: |
Re: [PATCH v2] Re: Bug in 9.5.3 org--file-default-apps |
Date: |
Sun, 29 May 2022 14:07:38 +0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 |
On 26/05/2022 11:23, Ihor Radchenko wrote:
diff --git a/lisp/org.el b/lisp/org.el
index d7da8efc4..45a179a8a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7975,7 +7975,12 @@ (defun org-open-file (path &optional in-emacs line
search)
(when (eq cmd 'mailcap)
(require 'mailcap)
(mailcap-parse-mailcaps)
- (let* ((mime-type (mailcap-extension-to-mime (or ext "")))
+ (let* ((mime-type (if (executable-find "file")
+ (shell-command-to-string
+ (format "%s --brief --mime-type %s"
Another corner case:
file --brief --mime-type tstorg-sh-symlink
inode/symlink
file --brief --mime-type --dereference tstorg-sh-symlink
text/x-shellscript
+ (executable-find "file")
+ (shell-quote-argument
(convert-standard-filename file))))
+ (mailcap-extension-to-mime (or ext ""))))
Actually MIME type for shell scripts varies a lot
(mailcap-extension-to-mime "sh") => "text/x-sh"
run-mailcap --norun examples/org/script/tstorg.sh
Error: no "view" mailcap rules found for type "application/x-sh"
And "text/x-shellscript" as above.
- Re: Bug in 9.5.3 org--file-default-apps, (continued)
- Re: Bug in 9.5.3 org--file-default-apps, Max Nikulin, 2022/05/20
- Re: Bug in 9.5.3 org--file-default-apps, Ihor Radchenko, 2022/05/20
- Re: Bug in 9.5.3 org--file-default-apps, Max Nikulin, 2022/05/21
- [PATCH] Re: Bug in 9.5.3 org--file-default-apps, Ihor Radchenko, 2022/05/22
- Re: [PATCH] Re: Bug in 9.5.3 org--file-default-apps, Max Nikulin, 2022/05/22
- [PATCH v2] Re: Bug in 9.5.3 org--file-default-apps, Ihor Radchenko, 2022/05/26
- Re: [PATCH v2] Re: Bug in 9.5.3 org--file-default-apps, Max Nikulin, 2022/05/29
- [PATCH v3] Re: Bug in 9.5.3 org--file-default-apps, Ihor Radchenko, 2022/05/30
- Re: [PATCH v3] Re: Bug in 9.5.3 org--file-default-apps, Max Nikulin, 2022/05/30
- Re: [PATCH v3] Re: Bug in 9.5.3 org--file-default-apps, Max Nikulin, 2022/05/31
- Re: [PATCH v2] Re: Bug in 9.5.3 org--file-default-apps,
Max Nikulin <=
- Re: Bug in 9.5.3 org--file-default-apps, Craig STCR, 2022/05/23
- Re: Bug in 9.5.3 org--file-default-apps, Craig STCR, 2022/05/23
- Re: Bug in 9.5.3 org--file-default-apps, Craig STCR, 2022/05/23
- Re: Bug in 9.5.3 org--file-default-apps, Craig STCR, 2022/05/23
- Re: Bug in 9.5.3 org--file-default-apps, Ihor Radchenko, 2022/05/25
- Re: Bug in 9.5.3 org--file-default-apps, Max Nikulin, 2022/05/23
- Re: Bug in 9.5.3 org--file-default-apps, Ihor Radchenko, 2022/05/25
- Re: Bug in 9.5.3 org--file-default-apps, Craig STCR, 2022/05/25
- Re: Bug in 9.5.3 org--file-default-apps, Ihor Radchenko, 2022/05/25
- Message not available
- Message not available
- Re: Bug in 9.5.3 org--file-default-apps, Craig STCR, 2022/05/16