Looking into the code related to 'pty problem with
start-process-shell-command, I have realized that the following case is
not handled correctly:
#+begin_src elisp
(setq org-file-apps '(("\\.pdf::\\([0-9]+\\)\\'" . "xpdf %s %1")))
#+end_src
I hope, I adapted an example from [[help:org-file-apps]] correctly. When
I try to open the following link using C-c C-o
[[file:test-%1f.pdf::42]]
I get
Running xpdf /home/ubuntu/examples/org/test-\42f.pdf 42...done
I believe, it should be
Running xpdf /home/ubuntu/examples/org/test-%1f.pdf 42...done
Or
Running xpdf /home/ubuntu/examples/org/test-\%1f.pdf 42...done
Org mode version 9.4.4 (release_9.4.4-164-g7a9a8a
The source of the problem is that %s substitution is expanded at first
and regexp groups are replaced later. Ideally, it should be performed in
a single pass. I have found format-spec function but I am unsure
concerning it, maybe it is avoided intentionally.