From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uwe Brauer Subject: patch (was: Solved) Date: Tue, 31 Jan 2012 19:09:23 +0100 Message-ID: <87aa53rbfw.fsf_-_@gilgamesch.quim.ucm.es> References: <87sjizvasf.fsf@mat.ucm.es> <87bopnmtll.fsf@mat.ucm.es> <878vkrxxsb.fsf@gnu.org> Reply-To: Uwe Brauer Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsIJW-0005Xw-7I for emacs-orgmode@gnu.org; Tue, 31 Jan 2012 13:20:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RsIJR-00074s-Gr for emacs-orgmode@gnu.org; Tue, 31 Jan 2012 13:20:18 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:59513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsI97-0005U1-Jq for emacs-orgmode@gnu.org; Tue, 31 Jan 2012 13:09:33 -0500 Received: by wgbdt13 with SMTP id dt13so238196wgb.30 for ; Tue, 31 Jan 2012 10:09:32 -0800 (PST) In-Reply-To: <878vkrxxsb.fsf@gnu.org> (Bastien's message of "Sat, 28 Jan 2012 23:33:24 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain >> On Sat, 28 Jan 2012 23:33:24 +0100, Bastien 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=org.patch --- 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." --=-=-=--