In your current settings the line
(sh-mode . emacs) is not valid.
Documentation states that only following entries:
system are allowed.
This means if your shell-scripts do not have a special filename pattern you have to work around.
To work around you could:
A) add, at the end of
org-file-apps alist (after
(auto-mode . emacs)), the line:
(t . emacs).
Then everything which drops to there will be loaded into emacs.
But beware: This means you have to catch other stuff, you never want loaded in emacs before this line.
B) misuse the groups feature. This is way more cool. Documentation states this:
Regular expression which contains (non-shy) groups: Match links where the whole link, including "::", and anything after that, matches
the regexp. In a custom command string, %1, %2, etc. are replaced with
the parts of the link that were matched by the groups. For backwards
compatibility, if a command string is given that does not use any of
the group matches, this case is handled identically to the second one
(i.e. match against file name only). In a custom lisp form, you can
access the group matches with (match-string n link).
Example: (".pdf::(\d+)'" . "evince -p %1 %s")
to open [[file:document.pdf::5]] with evince at page 5.
Also it states that sexp are allowed as command:
sexp A Lisp form which will be evaluated. The file path will
be available in the Lisp variable `file'.
So you could do:
1) set your
org-file-apps (adapt this to your needs):
'(("\\.log\\'" . emacs)
(".*::\\(editme\\)\\'" . (my-find-file-wrapper file))))
2) define your own opening function:
(defun my-find-file-wrapper (f)
3) write your links with following style
Note: instead of using
my-find-file-wrapper you could use a regular elisp function which eats the file parameter.
Of course if all your shell scripts have the extension
.sh, you could just replace
(sh-mode . emacs) with
("\\.sh\\'" . emacs) . ;)