>> On Sat, 28 Jan 2012 23:33:24 +0100, Bastien <b...@altern.org> wrote:
Hi Bastien,

Here comes the patch (I tested it with Xemacs 21.5 and GNU
emacs 23.1); I used the 
diff -u option and hope this is ok.

Uwe 

--- org-old.el	2012-01-31 18:37:53.000000000 +0100
+++ org.el	2012-01-31 19:01:19.667099891 +0100
@@ -1,4 +1,4 @@
-;;; org-old.el --- Outline-based notes management and organizer
+;;; org.el --- Outline-based notes management and organizer
 ;; Carstens outline-mode for keeping track of everything.
 ;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
 ;;
@@ -16966,7 +16966,7 @@
 	 (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.))))))
@@ -16995,24 +16995,32 @@
     (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
-			"-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
-	      (error "Failed to create png file from %s" texfile)
-	    (message "Failed to create png file from %s" texfile)
-	    nil)
-	;; Use the requested file name and clean up
-	(copy-file pngfile tofile 'replace)
-	(loop for e in '(".dvi" ".tex" ".aux" ".log" ".png") do
-	      (delete-file (concat texfilebase e)))
-	pngfile))))
+		  (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
+				(error "Failed to create png file from %s" texfile)
+			  (message "Failed to create png file from %s" texfile)
+			  nil)
+		  ;; Use the requested file name and clean up
+		  (copy-file pngfile tofile 'replace)
+		  (loop for e in '(".dvi" ".tex" ".aux" ".log" ".png") do
+			(delete-file (concat texfilebase e)))
+		  pngfile))))
 
 (defun org-splice-latex-header (tpl def-pkg pkg snippets-p &optional extra)
   "Fill a LaTeX header template TPL.
@@ -17077,7 +17085,12 @@
   "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."

Reply via email to