From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: [bug] "Invalid face" when exporting code block to HTML Date: Thu, 05 Jan 2012 23:06:48 +0100 Message-ID: <80aa61ls7b.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, Not a good day for me, today... * Summary Quite "simple": the following block generates an "Invalid face" error when exported to HTML. #+begin_src sh svn checkout http://svn/trunk/dev/ mydev #+end_src This worked yesterday. Does it ring a bell to someone? Could some recent commit be responsible of this? * Version info GNU Emacs 24.0.92.1 (i386-mingw-nt5.1.2600) of 2011-12-07 on MARVIN Org-mode version 7.8.03 (release_7.8.03.31.g28541) * Backtrace #+begin_src emacs-lisp Debugger entered--Lisp error: (error "Invalid face") internal-get-lisp-face-attribute(nil :height nil) face-attribute(nil :height) (setq h (face-attribute f :height)) (while (progn (setq f (if --cl-var-- face (face-attribute f :inherit))) (= not (eq f (quote unspecified)))) (setq h (face-attribute f :height)) (push = (if (eq h (quote unspecified)) nil h) --cl-var--) (setq --cl-var-- 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 (eq f (quote un= specified)))) (setq h (face-attribute f :height)) (push (if (eq h (quote un= specified)) nil h) --cl-var--) (setq --cl-var-- nil)) (nreverse --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 (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)) (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 (eq f (quote unspecified)))) (setq h (fa= ce-attribute f :height)) (push (if (eq h (quote unspecified)) nil h) --cl-v= ar--) (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 (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 (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 (eq f (quote unspecified)) for h =3D (face-attribute f :height) collect= (if (eq h (quote unspecified)) nil h)))) (reduce (quote htmlize-merge-size= ) (cons nil size-list))) htmlize-face-size(default) (let ((size (htmlize-face-size face))) (unless (eql size 1.0) (setf (html= ize-fstruct-size fstruct) size))) (cond (htmlize-running-xemacs (let* ((font-instance (face-font-instance f= ace)) (props (font-instance-properties font-instance))) (when (equalp (cdr = (assq (quote WEIGHT_NAME) props)) "bold") (setf (htmlize-fstruct-boldp fstr= uct) 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)) (setf (htmlize-fstruct-= underlinep fstruct) (face-underline-p face)))) ((fboundp (quote face-attrib= ute)) (dolist (attr (quote (:weight :slant :underline :overline :strike-thr= ough))) (let ((value (if (>=3D emacs-major-version 22) (face-attribute face= attr nil t) (let ... ... ...)))) (when (and value (not (eq value ...))) (h= tmlize-face-emacs21-attr fstruct attr value)))) (let ((size (htmlize-face-s= ize face))) (unless (eql size 1.0) (setf (htmlize-fstruct-size fstruct) siz= e)))) (t (when (fboundp (quote face-bold-p)) (setf (htmlize-fstruct-boldp f= struct) (face-bold-p face))) (when (fboundp (quote face-italic-p)) (setf (h= tmlize-fstruct-italicp fstruct) (face-italic-p face))) (setf (htmlize-fstru= ct-underlinep fstruct) (face-underline-p face)))) (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))))) (cond (htmlize-running-xemacs (let* ((font-instance= (face-font-instance face)) (props (font-instance-properties font-instance)= )) (when (equalp (cdr (assq ... props)) "bold") (setf (htmlize-fstruct-bold= p fstruct) t)) (when (or (equalp (cdr ...) "i") (equalp (cdr ...) "o")) (se= tf (htmlize-fstruct-italicp fstruct) t)) (setf (htmlize-fstruct-strikep fst= ruct) (face-strikethru-p face)) (setf (htmlize-fstruct-underlinep fstruct) = (face-underline-p face)))) ((fboundp (quote face-attribute)) (dolist (attr = (quote (:weight :slant :underline :overline :strike-through))) (let ((value= (if ... ... ...))) (when (and value (not ...)) (htmlize-face-emacs21-attr = fstruct attr value)))) (let ((size (htmlize-face-size face))) (unless (eql = size 1.0) (setf (htmlize-fstruct-size fstruct) size)))) (t (when (fboundp (= quote face-bold-p)) (setf (htmlize-fstruct-boldp fstruct) (face-bold-p face= ))) (when (fboundp (quote face-italic-p)) (setf (htmlize-fstruct-italicp fs= truct) (face-italic-p face))) (setf (htmlize-fstruct-underlinep fstruct) (f= ace-underline-p face)))) (setf (htmlize-fstruct-css-name fstruct) (let ((na= me (downcase (symbol-name face)))) (when (string-match "\\`font-lock-" name= ) (setq name (replace-match "" t t name))) (when (string-match "-face\\'" n= ame) (setq name (replace-match "" t t name))) (while (string-match "[^-a-zA= -Z0-9]" name) (setq name (replace-match "X" t t name))) (when (string-match= "\\`[-0-9]" name) (setq name (concat "X" name))) (when (equal name "") (se= tq name "face")) (setq name (concat htmlize-css-name-prefix name)) name)) f= struct) htmlize-face-to-fstruct(default) (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 (:foreground "black" :background "#FF993F"= ) (:foreground "black" :background "#FFF33F") (:foreground "black" :backgro= und "#B0FF3F") (:foreground "black" :background "#4BFF4B") (:foreground "bl= ack" :background "#3FFFB0") (:foreground "black" :background "#3FF3FF") (:f= oreground "black" :background "#3F99FF") (:foreground "white" :background "= #3F3FFF"))) (let* ((buffer-faces (htmlize-faces-in-buffer)) (face-map (htmlize-make-f= ace-map (adjoin (quote default) buffer-faces))) (htmlbuf (generate-new-buff= er (if (buffer-file-name) (htmlize-make-file-name (file-name-nondirectory (= buffer-file-name))) "*html*"))) (places (quote (nil nil))) (title (if (buff= er-file-name) (file-name-nondirectory (buffer-file-name)) (buffer-name)))) = (with-current-buffer htmlbuf (buffer-disable-undo) (insert (htmlize-method = doctype) 10 (format "\n" htmlize-= version htmlize-output-type) "\n ") (plist-put places (quote head-st= art) (point-marker)) (insert "\n" " " (htmlize-protect-stri= ng title) "\n" (if htmlize-html-charset (format (concat " \n")= htmlize-html-charset) "") htmlize-head-tags) (htmlize-method insert-head b= uffer-faces face-map) (insert " ") (plist-put places (quote head-en= d) (point-marker)) (insert "\n ") (plist-put places (quote body-start) (po= int-marker)) (insert (htmlize-method body-tag face-map) "\n ") (plist-pu= t places (quote content-start) (point-marker)) (insert "
\n")) (let ((i=
nsert-text-method (htmlize-method-function (quote insert-text))) next-chang=
e text face-list fstruct-list trailing-ellipsis) (goto-char (point-min)) (w=
hile (not (eobp)) (setq next-change (htmlize-next-change (point) (quote fac=
e))) (setq face-list (htmlize-faces-at-point) fstruct-list (delq nil (mapca=
r (lambda (f) (gethash f face-map)) face-list))) (setq text (htmlize-buffer=
-substring-no-invisible (point) next-change)) (when trailing-ellipsis (setq=
 text (htmlize-trim-ellipsis text))) (when (> (length text) 0) (setq traili=
ng-ellipsis (get-text-property (1- (length text)) (quote htmlize-ellipsis) =
text))) (setq text (htmlize-untabify text (current-column))) (setq text (ht=
mlize-protect-string text)) (when (> (length text) 0) (funcall insert-text-=
method text fstruct-list htmlbuf)) (goto-char next-change))) (with-current-=
buffer htmlbuf (insert "
") (plist-put places (quote content-end) (poi= nt-marker)) (insert "\n ") (plist-put places (quote body-end) (poin= t-marker)) (insert "\n\n") (when htmlize-generate-hyperlinks (htmliz= e-make-hyperlinks)) (htmlize-defang-local-variables) (when htmlize-replace-= form-feeds (goto-char (point-min)) (let ((source (htmlize-protect-string "\= n\f")) (replacement (if (stringp htmlize-replace-form-feeds) htmlize-replac= e-form-feeds "
"))) (while (search-forward source nil t) (r=
eplace-match replacement t t)))) (goto-char (point-min)) (when htmlize-html=
-major-mode (funcall htmlize-html-major-mode)) (set (make-local-variable (q=
uote htmlize-buffer-places)) places) (run-hooks (quote htmlize-after-hook))=
 (buffer-enable-undo)) htmlbuf)
  (save-excursion (save-excursion (run-hooks (quote htmlize-before-hook))) =
(htmlize-ensure-fontified) (clrhash htmlize-extended-character-cache) (clrh=
ash htmlize-memoization-table) (let* ((buffer-faces (htmlize-faces-in-buffe=
r)) (face-map (htmlize-make-face-map (adjoin (quote default) buffer-faces))=
) (htmlbuf (generate-new-buffer (if (buffer-file-name) (htmlize-make-file-n=
ame (file-name-nondirectory ...)) "*html*"))) (places (quote (nil nil))) (t=
itle (if (buffer-file-name) (file-name-nondirectory (buffer-file-name)) (bu=
ffer-name)))) (with-current-buffer htmlbuf (buffer-disable-undo) (insert (h=
tmlize-method doctype) 10 (format "