emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: Bastien <bzg@altern.org>
Cc: emacs-orgmode@gnu.org
Subject: patch (was:  Solved)
Date: Tue, 31 Jan 2012 19:09:23 +0100	[thread overview]
Message-ID: <87aa53rbfw.fsf_-_@gilgamesch.quim.ucm.es> (raw)
In-Reply-To: <878vkrxxsb.fsf@gnu.org> (Bastien's message of "Sat, 28 Jan 2012 23:33:24 +0100")

[-- Attachment #1: Type: text/plain, Size: 211 bytes --]

>> On Sat, 28 Jan 2012 23:33:24 +0100, Bastien <bzg@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 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org.patch --]
[-- Type: text/x-diff, Size: 3037 bytes --]

--- 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."

  parent reply	other threads:[~2012-01-31 18:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-28 20:20 Xemacs: org-preview-latex-fragment, png not readable Uwe Brauer
2012-01-28 20:59 ` Solved (was: Xemacs: org-preview-latex-fragment, png not readable.) Uwe Brauer
2012-01-28 22:33   ` Solved Bastien
2012-01-29  0:13     ` Solved Nick Dokos
2012-01-29 14:57       ` change call-process also for GNU emacs? (was: Solved) Uwe Brauer
2012-01-29 17:42         ` Nick Dokos
2012-01-31 18:09     ` Uwe Brauer [this message]
2012-03-16 17:57       ` patch Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aa53rbfw.fsf_-_@gilgamesch.quim.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: patch (was:  Solved)' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).