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:
and hit C-x C-e it correctly inserts and I see
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.