fix(org): avoid (file-exists-p "file://")
on Windows
Emacs bug#70914 handles `file://whatever` incorrectly, potentially crashing emacs. Fixed in emacs commit 350ae75f5c1c47a03560e43e8699781c04c9078a: Avoid crashes on MS-Windows due to invalid UNC file names * src/w32.c (parse_root): Avoid crashes due to invalid (too short) UNC names, such as "\\". (Bug#70914)
This commit is contained in:
parent
63605189f3
commit
587f237e93
1 changed files with 4 additions and 0 deletions
|
@ -502,6 +502,10 @@ relative to `org-directory', unless it is an absolute path."
|
||||||
(org-link-set-parameters
|
(org-link-set-parameters
|
||||||
"file" :face (lambda (path)
|
"file" :face (lambda (path)
|
||||||
(if (or
|
(if (or
|
||||||
|
;; file uris is not a valid path on windows
|
||||||
|
;; ref https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-05/threads.html#00729
|
||||||
|
;; emacs <= 29 crashes for (file-exists-p "file://whatever")
|
||||||
|
(if (featurep :system 'windows) (string-prefix-p "//" path))
|
||||||
(file-remote-p path)
|
(file-remote-p path)
|
||||||
;; filter out network shares on windows (slow)
|
;; filter out network shares on windows (slow)
|
||||||
(if (featurep :system 'windows) (string-prefix-p "\\\\" path))
|
(if (featurep :system 'windows) (string-prefix-p "\\\\" path))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue