I have written this function to insert an org-style link to a file:
(defun jay/insert-file-link (fname)
"Insert link to file (called by Midnight Commander)."
(interactive "s")
(insert "[[")
(insert fname)
(insert "][")
(insert fname)
(insert "]]"))
When I am in a buffer with the cursor after this:
(jay/insert-file-link "foobar")
and hit C-x C-e it correctly inserts and I see
(jay/insert-file-link "foobar")[[foobar][foobar]]
However when I try it from the command line,
emacsclient -e "(jay/insert-file-link \"/tmp/foo\")"
it doesn't do anything in the buffer (it prints nil on the command line as expected)
Any clues as to what I'm dong wrong? Thanks.
org-insert-link
directly? – Jaseem Oct 8 '14 at 8:02