From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Stanton Subject: Re: Code blocks (partially) inherit buffer colors Date: Sat, 2 Mar 2013 22:09:33 +0000 Message-ID: References: <871ubzn0wq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBucd-0001co-Mf for emacs-orgmode@gnu.org; Sat, 02 Mar 2013 17:09:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBuca-0007Mg-SR for emacs-orgmode@gnu.org; Sat, 02 Mar 2013 17:09:39 -0500 Received: from gateway-a.haas.berkeley.edu ([128.32.222.29]:14150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBuca-0007MY-CB for emacs-orgmode@gnu.org; Sat, 02 Mar 2013 17:09:36 -0500 In-Reply-To: <871ubzn0wq.fsf@gmail.com> Content-Language: en-US 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: Eric Schulte Cc: "emacs-orgmode@gnu.org" Thanks for the suggestion, Eric. Following the instructions, I fired up Ema= cs, loaded files of various types, then ran the command org-html-htmlize-generate-css Unfortunately, this resulted in an error dump: Debugger entered--Lisp error: (error "Invalid face" popup-mouse-face) internal-get-lisp-face-attribute(popup-mouse-face :height nil) face-attribute(popup-mouse-face :height) (setq h (face-attribute f :height)) (while (progn (setq f (if --cl-var-- face (face-attribute f :inherit))) (= not (or (not f) (eq f (quote unspecified))))) (setq h (face-attribute f :he= ight)) (push (if (eq h (quote unspecified)) nil h) --cl-var--) (setq --cl-v= ar-- nil)) (let* ((f nil) (h nil) (--cl-var-- nil) (--cl-var-- t)) (while (progn (se= tq f (if --cl-var-- face (face-attribute f :inherit))) (not (or (not f) (eq= f (quote unspecified))))) (setq h (face-attribute f :height)) (push (if (e= q h (quote unspecified)) nil h) --cl-var--) (setq --cl-var-- nil)) (nrevers= e --cl-var--)) (catch (quote --cl-block-nil--) (let* ((f nil) (h nil) (--cl-var-- nil) (= --cl-var-- t)) (while (progn (setq f (if --cl-var-- face (face-attribute f = :inherit))) (not (or (not f) (eq f (quote unspecified))))) (setq h (face-at= tribute f :height)) (push (if (eq h (quote unspecified)) nil h) --cl-var--)= (setq --cl-var-- nil)) (nreverse --cl-var--))) (cl-block-wrapper (catch (quote --cl-block-nil--) (let* ((f nil) (h nil) = (--cl-var-- nil) (--cl-var-- t)) (while (progn (setq f (if --cl-var-- face = (face-attribute f :inherit))) (not (or (not f) (eq f ...)))) (setq h (face-= attribute f :height)) (push (if (eq h (quote unspecified)) nil h) --cl-var-= -) (setq --cl-var-- nil)) (nreverse --cl-var--)))) (block nil (let* ((f nil) (h nil) (--cl-var-- nil) (--cl-var-- t)) (while= (progn (setq f (if --cl-var-- face (face-attribute f :inherit))) (not (or = (not f) (eq f (quote unspecified))))) (setq h (face-attribute f :height)) (= push (if (eq h (quote unspecified)) nil h) --cl-var--) (setq --cl-var-- nil= )) (nreverse --cl-var--))) (loop for f =3D face then (face-attribute f :inherit) until (or (not f) (= eq f (quote unspecified))) for h =3D (face-attribute f :height) collect (if= (eq h (quote unspecified)) nil h)) (let ((size-list (loop for f =3D face then (face-attribute f :inherit) un= til (or (not f) (eq f (quote unspecified))) for h =3D (face-attribute f :he= ight) collect (if (eq h (quote unspecified)) nil h)))) (reduce (quote htmli= ze-merge-size) (cons nil size-list))) htmlize-face-size(ac-candidate-mouse-face) (let ((size (htmlize-face-size face))) (unless (eql size 1.0) (setf (html= ize-fstruct-size fstruct) size))) (if htmlize-running-xemacs (let* ((font-instance (face-font-instance face= )) (props (font-instance-properties font-instance))) (when (equalp (cdr (as= sq (quote WEIGHT_NAME) props)) "bold") (setf (htmlize-fstruct-boldp fstruct= ) t)) (when (or (equalp (cdr (assq (quote SLANT) props)) "i") (equalp (cdr = (assq (quote SLANT) props)) "o")) (setf (htmlize-fstruct-italicp fstruct) t= )) (setf (htmlize-fstruct-strikep fstruct) (face-strikethru-p face)) (setf = (htmlize-fstruct-underlinep fstruct) (face-underline-p face))) (dolist (att= r (quote (:weight :slant :underline :overline :strike-through))) (let ((val= ue (if (>=3D emacs-major-version 22) (face-attribute face attr nil t) (let = (...) (while ... ...) (face-attribute face attr))))) (when (and value (not = (eq value (quote unspecified)))) (htmlize-face-emacs21-attr fstruct attr va= lue)))) (let ((size (htmlize-face-size face))) (unless (eql size 1.0) (setf= (htmlize-fstruct-size fstruct) size)))) (let ((fstruct (make-htmlize-fstruct :foreground (htmlize-color-to-rgb (h= tmlize-face-foreground face)) :background (htmlize-color-to-rgb (htmlize-fa= ce-background face))))) (if htmlize-running-xemacs (let* ((font-instance (f= ace-font-instance face)) (props (font-instance-properties font-instance))) = (when (equalp (cdr (assq (quote WEIGHT_NAME) props)) "bold") (setf (htmlize= -fstruct-boldp fstruct) t)) (when (or (equalp (cdr (assq ... props)) "i") (= equalp (cdr (assq ... props)) "o")) (setf (htmlize-fstruct-italicp fstruct)= t)) (setf (htmlize-fstruct-strikep fstruct) (face-strikethru-p face)) (set= f (htmlize-fstruct-underlinep fstruct) (face-underline-p face))) (dolist (a= ttr (quote (:weight :slant :underline :overline :strike-through))) (let ((v= alue (if (>=3D emacs-major-version 22) (face-attribute face attr nil t) (le= t ... ... ...)))) (when (and value (not (eq value ...))) (htmlize-face-emac= s21-attr fstruct attr value)))) (let ((size (htmlize-face-size face))) (unl= ess (eql size 1.0) (setf (htmlize-fstruct-size fstruct) size)))) (setf (htm= lize-fstruct-css-name fstruct) (htmlize-face-css-name face)) fstruct) htmlize-face-to-fstruct(ac-candidate-mouse-face) (if (symbolp face) (htmlize-face-to-fstruct face) (htmlize-attrlist-to-fs= truct face)) (let ((fstruct (if (symbolp face) (htmlize-face-to-fstruct face) (htmlize= -attrlist-to-fstruct face)))) (setf (gethash face face-map) fstruct) (let* = ((css-name (htmlize-fstruct-css-name fstruct)) (new-name css-name) (i 0)) (= while (member new-name css-names) (setq new-name (format "%s-%s" css-name (= incf i)))) (unless (equal new-name css-name) (setf (htmlize-fstruct-css-nam= e fstruct) new-name)) (push new-name css-names))) (if (gethash face face-map) nil (let ((fstruct (if (symbolp face) (htmliz= e-face-to-fstruct face) (htmlize-attrlist-to-fstruct face)))) (setf (gethas= h face face-map) fstruct) (let* ((css-name (htmlize-fstruct-css-name fstruc= t)) (new-name css-name) (i 0)) (while (member new-name css-names) (setq new= -name (format "%s-%s" css-name (incf i)))) (unless (equal new-name css-name= ) (setf (htmlize-fstruct-css-name fstruct) new-name)) (push new-name css-na= mes)))) (unless (gethash face face-map) (let ((fstruct (if (symbolp face) (htmliz= e-face-to-fstruct face) (htmlize-attrlist-to-fstruct face)))) (setf (gethas= h face face-map) fstruct) (let* ((css-name (htmlize-fstruct-css-name fstruc= t)) (new-name css-name) (i 0)) (while (member new-name css-names) (setq new= -name (format "%s-%s" css-name (incf i)))) (unless (equal new-name css-name= ) (setf (htmlize-fstruct-css-name fstruct) new-name)) (push new-name css-na= mes)))) (while --cl-dolist-temp-- (setq face (car --cl-dolist-temp--)) (unless (g= ethash face face-map) (let ((fstruct (if (symbolp face) (htmlize-face-to-fs= truct face) (htmlize-attrlist-to-fstruct face)))) (setf (gethash face face-= map) fstruct) (let* ((css-name (htmlize-fstruct-css-name fstruct)) (new-nam= e css-name) (i 0)) (while (member new-name css-names) (setq new-name (forma= t "%s-%s" css-name (incf i)))) (unless (equal new-name css-name) (setf (htm= lize-fstruct-css-name fstruct) new-name)) (push new-name css-names)))) (set= q --cl-dolist-temp-- (cdr --cl-dolist-temp--))) (let ((--cl-dolist-temp-- faces) face) (while --cl-dolist-temp-- (setq fa= ce (car --cl-dolist-temp--)) (unless (gethash face face-map) (let ((fstruct= (if (symbolp face) (htmlize-face-to-fstruct face) (htmlize-attrlist-to-fst= ruct face)))) (setf (gethash face face-map) fstruct) (let* ((css-name (html= ize-fstruct-css-name fstruct)) (new-name css-name) (i 0)) (while (member ne= w-name css-names) (setq new-name (format "%s-%s" css-name ...))) (unless (e= qual new-name css-name) (setf (htmlize-fstruct-css-name fstruct) new-name))= (push new-name css-names)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-tem= p--)))) (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- faces) face) (w= hile --cl-dolist-temp-- (setq face (car --cl-dolist-temp--)) (unless (getha= sh face face-map) (let ((fstruct (if ... ... ...))) (setf (gethash face fac= e-map) fstruct) (let* ((css-name ...) (new-name css-name) (i 0)) (while (me= mber new-name css-names) (setq new-name ...)) (unless (equal new-name css-n= ame) (setf ... new-name)) (push new-name css-names)))) (setq --cl-dolist-te= mp-- (cdr --cl-dolist-temp--))))) (cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp= -- faces) face) (while --cl-dolist-temp-- (setq face (car --cl-dolist-temp-= -)) (unless (gethash face face-map) (let ((fstruct ...)) (setf (gethash fac= e face-map) fstruct) (let* (... ... ...) (while ... ...) (unless ... ...) (= push new-name css-names)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp-= -)))))) (block nil (let ((--cl-dolist-temp-- faces) face) (while --cl-dolist-temp= -- (setq face (car --cl-dolist-temp--)) (unless (gethash face face-map) (le= t ((fstruct (if ... ... ...))) (setf (gethash face face-map) fstruct) (let*= ((css-name ...) (new-name css-name) (i 0)) (while (member new-name css-nam= es) (setq new-name ...)) (unless (equal new-name css-name) (setf ... new-na= me)) (push new-name css-names)))) (setq --cl-dolist-temp-- (cdr --cl-dolist= -temp--))))) (dolist (face faces) (unless (gethash face face-map) (let ((fstruct (if (= symbolp face) (htmlize-face-to-fstruct face) (htmlize-attrlist-to-fstruct f= ace)))) (setf (gethash face face-map) fstruct) (let* ((css-name (htmlize-fs= truct-css-name fstruct)) (new-name css-name) (i 0)) (while (member new-name= css-names) (setq new-name (format "%s-%s" css-name (incf i)))) (unless (eq= ual new-name css-name) (setf (htmlize-fstruct-css-name fstruct) new-name)) = (push new-name css-names))))) (let ((face-map (make-hash-table :test (quote equal))) css-names) (dolist= (face faces) (unless (gethash face face-map) (let ((fstruct (if (symbolp f= ace) (htmlize-face-to-fstruct face) (htmlize-attrlist-to-fstruct face)))) (= setf (gethash face face-map) fstruct) (let* ((css-name (htmlize-fstruct-css= -name fstruct)) (new-name css-name) (i 0)) (while (member new-name css-name= s) (setq new-name (format "%s-%s" css-name ...))) (unless (equal new-name c= ss-name) (setf (htmlize-fstruct-css-name fstruct) new-name)) (push new-name= css-names))))) face-map) htmlize-make-face-map((default monky-header monky-section-title monky-bra= nch monky-diff-hunk-header monky-diff-add monky-diff-none monky-diff-del mo= nky-log-sha1 monky-log-message monky-log-head-label-local monky-log-head-la= bel-tags monky-log-head-label-bookmarks monky-log-head-label-phase monky-qu= eue-active monky-queue-positive-guard monky-queue-negative-guard yas--field= -debug-face dropdown-list-face dropdown-list-selection-face dvc-revision-na= me dvc-repository-name dvc-local-directory dvc-buffer dvc-marked dvc-exclud= ed dvc-bookmark-name dvc-id dvc-separator dvc-keyword dvc-comment dvc-ignor= ed dvc-unrecognized dvc-duplicate dvc-source dvc-nested-tree dvc-to-add dvc= -broken-link dvc-unmerged dvc-header dvc-conflict dvc-unknown dvc-modified = dvc-copy dvc-move dvc-deleted dvc-added dvc-meta-info dvc-messages dvc-high= light ...)) (let* ((buffer-faces (htmlize-faces-in-buffer)) (face-map (htmlize-make-f= ace-map (adjoin (quote default) buffer-faces))) (places (gensym)) (title (i= f (buffer-file-name) (file-name-nondirectory (buffer-file-name)) (buffer-na= me)))) (when htmlize-generate-hyperlinks (htmlize-create-auto-links)) (when= htmlize-replace-form-feeds (htmlize-shadow-form-feeds)) (with-current-buff= er htmlbuf (buffer-disable-undo) (insert (htmlize-method doctype) 10 (forma= t "\n" htmlize-version htmlize-ou= tput-type) "\n ") (put places (quote head-start) (point-marker)) (in= sert "\n" " " (htmlize-protect-string title) "\n" (= if htmlize-html-charset (format (concat " \n") htmlize-html-charset) "= ") htmlize-head-tags) (htmlize-method insert-head buffer-faces face-map) (i= nsert " ") (put places (quote head-end) (point-marker)) (insert "\n= ") (put places (quote body-start) (point-marker)) (insert (htmlize-method= body-tag face-map) "\n ") (put places (quote content-start) (point-mark= er)) (insert "
\n")) (let ((text-markup (htmlize-method-function (quote=
 text-markup))) next-change text face-list trailing-ellipsis fstruct-list l=
ast-fstruct-list (close-markup (lambda nil))) (goto-char (point-min)) (whil=
e (not (eobp)) (setq next-change (htmlize-next-face-change (point))) (setq =
face-list (htmlize-faces-at-point) fstruct-list (delq nil (mapcar (lambda (=
f) (gethash f face-map)) face-list))) (multiple-value-setq (text trailing-e=
llipsis) (htmlize-extract-text (point) next-change trailing-ellipsis)) (whe=
n (> (length text) 0) (when (not (equalp fstruct-list last-fstruct-list)) (=
funcall close-markup) (setq last-fstruct-list fstruct-list close-markup (fu=
ncall text-markup fstruct-list htmlbuf))) (princ text htmlbuf)) (goto-char =
next-change)) (funcall close-markup)) (with-current-buffer htmlbuf (insert =
"
") (put places (quote content-end) (point-marker)) (insert "\n ") (put places (quote body-end) (point-marker)) (insert "\n\n") (= htmlize-defang-local-variables) (goto-char (point-min)) (when htmlize-html-= major-mode (funcall htmlize-html-major-mode)) (set (make-local-variable (qu= ote htmlize-buffer-places)) (symbol-plist places)) (run-hooks (quote htmliz= e-after-hook)) (buffer-enable-undo)) (setq completed t) htmlbuf) (unwind-protect (let* ((buffer-faces (htmlize-faces-in-buffer)) (face-map= (htmlize-make-face-map (adjoin (quote default) buffer-faces))) (places (ge= nsym)) (title (if (buffer-file-name) (file-name-nondirectory (buffer-file-n= ame)) (buffer-name)))) (when htmlize-generate-hyperlinks (htmlize-create-au= to-links)) (when htmlize-replace-form-feeds (htmlize-shadow-form-feeds)) (w= ith-current-buffer htmlbuf (buffer-disable-undo) (insert (htmlize-method do= ctype) 10 (format "\n" htmlize-ve= rsion htmlize-output-type) "\n ") (put places (quote head-start) (po= int-marker)) (insert "\n" " " (htmlize-protect-string title= ) "\n" (if htmlize-html-charset (format (concat " \n") htmlize= -html-charset) "") htmlize-head-tags) (htmlize-method insert-head buffer-fa= ces face-map) (insert " ") (put places (quote head-end) (point-mark= er)) (insert "\n ") (put places (quote body-start) (point-marker)) (insert= (htmlize-method body-tag face-map) "\n ") (put places (quote content-st= art) (point-marker)) (insert "
\n")) (let ((text-markup (htmlize-method=
-function (quote text-markup))) next-change text face-list trailing-ellipsi=
s fstruct-list last-fstruct-list (close-markup (lambda nil))) (goto-char (p=
oint-min)) (while (not (eobp)) (setq next-change (htmlize-next-face-change =
(point))) (setq face-list (htmlize-faces-at-point) fstruct-list (delq nil (=
mapcar (lambda ... ...) face-list))) (multiple-value-setq (text trailing-el=
lipsis) (htmlize-extract-text (point) next-change trailing-ellipsis)) (when=
 (> (length text) 0) (when (not (equalp fstruct-list last-fstruct-list)) (f=
uncall close-markup) (setq last-fstruct-list fstruct-list close-markup (fun=
call text-markup fstruct-list htmlbuf))) (princ text htmlbuf)) (goto-char n=
ext-change)) (funcall close-markup)) (with-current-buffer htmlbuf (insert "=
") (put places (quote content-end) (point-marker)) (insert "\n ") (put places (quote body-end) (point-marker)) (insert "\n\n") (h= tmlize-defang-local-variables) (goto-char (point-min)) (when htmlize-html-m= ajor-mode (funcall htmlize-html-major-mode)) (set (make-local-variable (quo= te htmlize-buffer-places)) (symbol-plist places)) (run-hooks (quote htmlize= -after-hook)) (buffer-enable-undo)) (setq completed t) htmlbuf) (when (not = completed) (kill-buffer htmlbuf)) (htmlize-delete-tmp-overlays)) (let ((htmlbuf (generate-new-buffer (if (buffer-file-name) (htmlize-make-= file-name (file-name-nondirectory (buffer-file-name))) "*html*"))) (complet= ed nil)) (unwind-protect (let* ((buffer-faces (htmlize-faces-in-buffer)) (f= ace-map (htmlize-make-face-map (adjoin (quote default) buffer-faces))) (pla= ces (gensym)) (title (if (buffer-file-name) (file-name-nondirectory (buffer= -file-name)) (buffer-name)))) (when htmlize-generate-hyperlinks (htmlize-cr= eate-auto-links)) (when htmlize-replace-form-feeds (htmlize-shadow-form-fee= ds)) (with-current-buffer htmlbuf (buffer-disable-undo) (insert (htmlize-me= thod doctype) 10 (format "\n" htm= lize-version htmlize-output-type) "\n ") (put places (quote head-sta= rt) (point-marker)) (insert "\n" " " (htmlize-protect-strin= g title) "\n" (if htmlize-html-charset (format (concat " \n") = htmlize-html-charset) "") htmlize-head-tags) (htmlize-method insert-head bu= ffer-faces face-map) (insert " ") (put places (quote head-end) (poi= nt-marker)) (insert "\n ") (put places (quote body-start) (point-marker)) = (insert (htmlize-method body-tag face-map) "\n ") (put places (quote con= tent-start) (point-marker)) (insert "
\n")) (let ((text-markup (htmlize=
-method-function (quote text-markup))) next-change text face-list trailing-=
ellipsis fstruct-list last-fstruct-list (close-markup (lambda nil))) (goto-=
char (point-min)) (while (not (eobp)) (setq next-change (htmlize-next-face-=
change (point))) (setq face-list (htmlize-faces-at-point) fstruct-list (del=
q nil (mapcar ... face-list))) (multiple-value-setq (text trailing-ellipsis=
) (htmlize-extract-text (point) next-change trailing-ellipsis)) (when (> (l=
ength text) 0) (when (not ...) (funcall close-markup) (setq last-fstruct-li=
st fstruct-list close-markup ...)) (princ text htmlbuf)) (goto-char next-ch=
ange)) (funcall close-markup)) (with-current-buffer htmlbuf (insert "
= ") (put places (quote content-end) (point-marker)) (insert "\n ") (= put places (quote body-end) (point-marker)) (insert "\n\n") (htmlize= -defang-local-variables) (goto-char (point-min)) (when htmlize-html-major-m= ode (funcall htmlize-html-major-mode)) (set (make-local-variable (quote htm= lize-buffer-places)) (symbol-plist places)) (run-hooks (quote htmlize-after= -hook)) (buffer-enable-undo)) (setq completed t) htmlbuf) (when (not comple= ted) (kill-buffer htmlbuf)) (htmlize-delete-tmp-overlays))) (save-excursion (save-excursion (run-hooks (quote htmlize-before-hook))) = (htmlize-ensure-fontified) (clrhash htmlize-extended-character-cache) (clrh= ash htmlize-memoization-table) (let ((htmlbuf (generate-new-buffer (if (buf= fer-file-name) (htmlize-make-file-name (file-name-nondirectory ...)) "*html= *"))) (completed nil)) (unwind-protect (let* ((buffer-faces (htmlize-faces-= in-buffer)) (face-map (htmlize-make-face-map (adjoin ... buffer-faces))) (p= laces (gensym)) (title (if (buffer-file-name) (file-name-nondirectory ...) = (buffer-name)))) (when htmlize-generate-hyperlinks (htmlize-create-auto-lin= ks)) (when htmlize-replace-form-feeds (htmlize-shadow-form-feeds)) (with-cu= rrent-buffer htmlbuf (buffer-disable-undo) (insert (htmlize-method doctype)= 10 (format "\n" htmlize-version = htmlize-output-type) "\n ") (put places (quote head-start) (point-ma= rker)) (insert "\n" " " (htmlize-protect-string title) "</t= itle>\n" (if htmlize-html-charset (format ... htmlize-html-charset) "") htm= lize-head-tags) (htmlize-method insert-head buffer-faces face-map) (insert = " </head>") (put places (quote head-end) (point-marker)) (insert "\n ") (= put places (quote body-start) (point-marker)) (insert (htmlize-method body-= tag face-map) "\n ") (put places (quote content-start) (point-marker)) (= insert "<pre>\n")) (let ((text-markup (htmlize-method-function ...)) next-c= hange text face-list trailing-ellipsis fstruct-list last-fstruct-list (clos= e-markup (lambda nil))) (goto-char (point-min)) (while (not (eobp)) (setq n= ext-change (htmlize-next-face-change ...)) (setq face-list (htmlize-faces-a= t-point) fstruct-list (delq nil ...)) (multiple-value-setq (text trailing-e= llipsis) (htmlize-extract-text ... next-change trailing-ellipsis)) (when (>= ... 0) (when ... ... ...) (princ text htmlbuf)) (goto-char next-change)) (= funcall close-markup)) (with-current-buffer htmlbuf (insert "</pre>") (put = places (quote content-end) (point-marker)) (insert "\n </body>") (put plac= es (quote body-end) (point-marker)) (insert "\n</html>\n") (htmlize-defang-= local-variables) (goto-char (point-min)) (when htmlize-html-major-mode (fun= call htmlize-html-major-mode)) (set (make-local-variable (quote htmlize-buf= fer-places)) (symbol-plist places)) (run-hooks (quote htmlize-after-hook)) = (buffer-enable-undo)) (setq completed t) htmlbuf) (when (not completed) (ki= ll-buffer htmlbuf)) (htmlize-delete-tmp-overlays)))) htmlize-buffer-1() (save-restriction (narrow-to-region beg end) (htmlize-buffer-1)) (let ((htmlbuf (save-restriction (narrow-to-region beg end) (htmlize-buff= er-1)))) (when (interactive-p) (switch-to-buffer htmlbuf)) htmlbuf) htmlize-region(1 209) org-html-htmlize-generate-css() call-interactively(org-html-htmlize-generate-css t nil) execute-extended-command(nil) call-interactively(execute-extended-command nil nil) -----Original Message----- From: Eric Schulte [mailto:schulte.eric@gmail.com]=20 Sent: Thursday, February 28, 2013 9:29 PM To: Richard Stanton Cc: emacs-orgmode@gnu.org Subject: Re: [O] Code blocks (partially) inherit buffer colors Richard Stanton <stanton@haas.berkeley.edu> writes: > When I export a code block to HTML, I've noticed that some (but not > all) of the characters in the resulting HTML file have the same=20 > background color as my Emacs buffer at the time I exported. For=20 > example, if I export > > ----------- > > #+begin_src python > a =3D 5 > #+end_src > > ------------ > > the code block in the resulting HTML file has a very pale background,=20 > except for the characters "a" and "5", both of which are displayed=20 > with a dark blue background that looks like it's the same as the=20 > background color in my Emacs buffer. This looks rather odd... > > I can work around this problem by changing the color-theme in my Emacs=20 > buffer before exporting, but is there a better solution? > > Thanks. > > Richard Stanton See the documentation of the `org-export-htmlize-output-type' variable. -- Eric Schulte http://cs.unm.edu/~eschulte