changeset 520:52175326855d dev

Avoid neglection of image re-generation by 'insert-image-file
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 09 Jan 2018 13:33:50 +0900
parents a6a80e2b6f5a
children cef987df070f
files yatexprc.el
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/yatexprc.el	Tue Jan 09 13:28:03 2018 +0900
+++ b/yatexprc.el	Tue Jan 09 13:33:50 2018 +0900
@@ -1,7 +1,7 @@
 ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*-
 ;;; 
 ;;; (c)1993-2018 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Fri Jan  5 22:48:43 2018 on firestorm
+;;; Last modified Tue Jan  9 13:18:05 2018 on firestorm
 ;;; $Id$
 
 ;;; Code:
@@ -491,10 +491,12 @@
 	 t)
 	(remove-images (point-min) (point-max))
 	(erase-buffer)
-	(insert-image
-	 (setq image (create-image
-		      (if data-p imagesrc (expand-file-name imagesrc))
-		      nil data-p)))
+	(if data-p
+	    (insert-image
+	     (setq image (create-image imagesrc nil data-p)))
+	  ;; create-image does not re-create img-object for the same file
+	  (insert-image-file (expand-file-name imagesrc))
+	  (setq image (plist-get (text-properties-at (point)) 'intangible)))
 	(YaTeX-preview-image-mode)
 	(let ((height (1+ (cdr (image-size image)))))
 	  (enlarge-window