Inspired by John Kitchin's presentation of org-links features in Org-mode 9, I tried to implement a simple functionality for "file" links. Since I am working on several machines, I wanted the link face to show if file exists on disk. So in
org-link-set-parameters func for "file" I've put this simple code:
:face '(lambda (path) (if (file-exists-p path) '(:foreground "green") '(:foreground "red")))
It works just fine unless file has Polish characters in its name ("ąęćłóśżź"). Especially after editing the link description with
org-insert-link with cursor on the link it's face becomes red (as non existent file), and the path becomes for example like this (assuming the file name is "żółć.org"):
I was changing the value of
file-name-coding-system variable but without any impact for described behaviour.
When I change value of the
:follow key to
'(lambda (path) (message "%s" (file-exists-p path))) it returns "t". I assume then that it has something to do with filtering file name by different emacs functions but I can't find which would be responsible for wrong behaviour of the ":face" parameter.
I'd appreciate any help to fix that.