From 150e2db668e98e911c3af7dcde91bd9303b035ae Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 16 Mar 2012 18:55:41 +0100 Subject: [PATCH] org.el: Fix XEmacs compatibility bug when creating images. * org.el (org-create-formula-image, org-dvipng-color): Fix XEmacs compatibility bug. TINYCHANGE Thanks to Uwe Brauer for this patch. --- lisp/org.el | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index f2a887f4e..c70b9244a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16988,7 +16988,7 @@ inspection." (dvifile (concat texfilebase ".dvi")) (pngfile (concat texfilebase ".png")) (fnh (if (featurep 'xemacs) - (font-height (get-face-font 'default)) + (font-height (face-font 'default)) (face-attribute 'default :height nil))) (scale (or (plist-get options (if buffer :scale :html-scale)) 1.0)) (dpi (number-to-string (* scale (floor (* 0.9 (if buffer fnh 140.)))))) @@ -17017,13 +17017,19 @@ inspection." (if (not (file-exists-p dvifile)) (progn (message "Failed to create dvi file from %s" texfile) nil) (condition-case nil - (call-process "dvipng" nil nil nil + (if (featurep 'xemacs) + (call-process "dvipng" nil nil nil "-fg" fg "-bg" bg - "-D" dpi - ;;"-x" scale "-y" scale "-T" "tight" "-o" pngfile dvifile) + (call-process "dvipng" nil nil nil + "-fg" fg "-bg" bg + "-D" dpi + ;;"-x" scale "-y" scale + "-T" "tight" + "-o" pngfile + dvifile)) (error nil)) (if (not (file-exists-p pngfile)) (if org-format-latex-signal-error @@ -17099,7 +17105,12 @@ SNIPPETS-P indicates if this is run to create snippet images for HTML." "Return an rgb color specification for dvipng." (apply 'format "rgb %s %s %s" (mapcar 'org-normalize-color - (color-values (face-attribute 'default attr nil))))) + (if (featurep 'xemacs) + (color-rgb-components + (face-property 'default + (cond ((eq attr :foreground) 'foreground) + ((eq attr :background) 'background)))) + (color-values (face-attribute 'default attr nil)))))) (defun org-normalize-color (value) "Return string to be used as color value for an RGB component." -- 2.11.4.GIT