emacs org-mode inline images not updating

huangapple go评论44阅读模式
英文:

emacs org-mode inline images not updating

问题

I am having a strange problem with org-mode. When I update/change a linked image it does not update in the buffer.

My test uses babel for convenience, but this is true for all images. I already have the following set:
(add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images)

When I run the following, I see a plot image as expected.

#+BEGIN_SRC R :results output graphics file :file test.png 
	plot(1:2, 1:2, type='p')
	abline(h=1,lty=2)
	abline(v=1.5)
#+END_SRC

But when I change the plotting code (by commenting out one of the abline commands), the displayed result image doesn't update.

It's as if emacs has cached the image, but I cannot find any way to clear that cache.

英文:

I am having a strange problem with org-mode. When I update/change a linked image it does not update in the buffer.

My test uses babel for convenience, but this is true for all images. I already have the following set:
(add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images)

When I run the following, I see a plot image as expected.

#+BEGIN_SRC R :results output graphics file :file test.png 
	plot(1:2, 1:2, type='p')
	abline(h=1,lty=2)
	abline(v=1.5)
#+END_SRC

But when I change the plotting code (by commenting out one of the abline commands), the displayed result image doesn't update.

It's as if emacs has cached the image, but I cannot find any way to clear that cache.

答案1

得分: 0

可能是由于Emacs图像缓存引起的。
添加(add-hook 'org-babel-after-execute-hook 'clear-image-cache)对我有用。

英文:

It may caused by emacs image cache.
Add (add-hook 'org-babel-after-execute-hook 'clear-image-cache) works for me.

huangapple
  • 本文由 发表于 2023年5月10日 19:03:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76217638.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定