0

I have an org file, which contains the following text:

#+begin_src elisp
(insert-image
     (create-image "/home/searene/Pictures/Selection_007.png"))
#+end_src

When I press C-c C-c to evaluate the code, I want the image to insert in the current file, but that's not the result. The result is just a t, as follows:

#+begin_src elisp
 (insert-image
     (create-image "/home/searene/Pictures/Selection_007.png"))
#+end_src

#+RESULTS:
: t

Why? How can I insert the image by executing the code?

4
  • It works for me. Does it work if you place the cursor on the line after the #+end_src of the code block and do C-c C-c? What about if you copy the code to the *scratch* buffer, and press C-j with the cursor after the closing paren? If C-j does not work, try C-x C-e at the same place. – NickD Jul 17 '20 at 16:05
  • @NickD Thanks, strangely it works in the scratch buffer by evaluating it with C-x C-e, but it doesn't work in the org file, whether using C-c C-c or C-c C-e, both of the results are t. By the way, I'm using Spacemacs, not sure if it matters. – Searene Jul 18 '20 at 1:20
  • @Searene I get the same results as you, both in standard Spacemacs and pure vanilla using emacs -Q. I get the t result also in an ielm buffer. I don't understand why you're creating an image resource rather than just referring to the file path with [[/my/path/img.png]] – gregoryg Jul 18 '20 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.