* Tag search and "invalid face" error from htmlize-buffer
@ 2007-11-11 17:06 Wanrong Lin
2007-11-12 5:24 ` Bastien
2007-11-13 11:01 ` Carsten Dominik
0 siblings, 2 replies; 7+ messages in thread
From: Wanrong Lin @ 2007-11-11 17:06 UTC (permalink / raw)
To: emacs-orgmode
Hi,
I wonder anyone has seen this:
After I do a tag search (for TODO items), if I do "htmlize-buffer" on
the search result, I will get an "invalid face" error. Since I have
quite some customization on my org-mode, I am not quite sure whether
this is my problem, or org-mode, or htmlize-buffer's problem.
Thank you.
Wanrong
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Tag search and "invalid face" error from htmlize-buffer
2007-11-11 17:06 Tag search and "invalid face" error from htmlize-buffer Wanrong Lin
@ 2007-11-12 5:24 ` Bastien
2007-11-12 14:53 ` Wanrong Lin
2007-11-12 19:54 ` Wanrong Lin
2007-11-13 11:01 ` Carsten Dominik
1 sibling, 2 replies; 7+ messages in thread
From: Bastien @ 2007-11-12 5:24 UTC (permalink / raw)
To: emacs-orgmode
Wanrong Lin <wanrong.lin@gmail.com> writes:
> After I do a tag search (for TODO items), if I do "htmlize-buffer" on
> the search result, I will get an "invalid face" error. Since I have
> quite some customization on my org-mode, I am not quite sure whether
> this is my problem, or org-mode, or htmlize-buffer's problem.
Can you send a backtrace?
(setq debug-on-error t)
--
Bastien
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Tag search and "invalid face" error from htmlize-buffer
2007-11-12 5:24 ` Bastien
@ 2007-11-12 14:53 ` Wanrong Lin
2007-11-12 19:54 ` Wanrong Lin
1 sibling, 0 replies; 7+ messages in thread
From: Wanrong Lin @ 2007-11-12 14:53 UTC (permalink / raw)
To: emacs-orgmode
Thanks for the trace suggestion. Here it is:
-----------------------
Debugger entered--Lisp error: (error "Invalid face")
internal-get-lisp-face-attribute(nil :foreground nil)
face-attribute(nil :foreground nil t)
face-foreground(nil nil t)
funcall(face-foreground nil nil t)
(setq color (funcall function face nil t))
(if (>= emacs-major-version 22) (setq color (funcall function face nil
t)) (setq color (funcall function face)) (when (and ... ... ... ...)
(setq color ...)))
(let* ((function ...) color) (if (>= emacs-major-version 22) (setq
color ...) (setq color ...) (when ... ...)) (when (and ... ...) (setq
color ...)) (when (or ... ... ...) (setq color nil)) (when (and ... ...)
(setq color ...)) color)
htmlize-face-color-internal(nil t)
(cond (htmlize-running-xemacs (and ... ...)) (t
(htmlize-face-color-internal face t)))
htmlize-face-foreground(nil)
(htmlize-color-to-rgb (htmlize-face-foreground face))
(make-htmlize-fstruct :foreground (htmlize-color-to-rgb
(htmlize-face-foreground face)) :background (htmlize-color-to-rgb
(htmlize-face-background face)))
(let ((fstruct ...)) (cond (htmlize-running-xemacs ...) (... ... ...)
(t ... ... ...)) (setf (htmlize-fstruct-css-name fstruct) (let ... ...
... ... ... ... ... name)) fstruct)
htmlize-face-to-fstruct(nil)
(if (symbolp face) (htmlize-face-to-fstruct face)
(htmlize-attrlist-to-fstruct face))
(let ((fstruct ...)) (setf (gethash face face-map) fstruct) (let* (...
... ...) (while ... ...) (unless ... ...) (push new-name css-names)))
(if (gethash face face-map) nil (let (...) (setf ... fstruct) (let*
... ... ... ...)))
(unless (gethash face face-map) (let (...) (setf ... fstruct) (let*
... ... ... ...)))
(while --cl-dolist-temp-- (setq face (car --cl-dolist-temp--)) (unless
(gethash face face-map) (let ... ... ...)) (setq --cl-dolist-temp-- (cdr
--cl-dolist-temp--)))
(let ((--cl-dolist-temp-- faces) face) (while --cl-dolist-temp-- (setq
face ...) (unless ... ...) (setq --cl-dolist-temp-- ...)) nil)
(catch (quote --cl-block-nil--) (let (... face) (while
--cl-dolist-temp-- ... ... ...) nil))
(cl-block-wrapper (catch (quote --cl-block-nil--) (let ... ... nil)))
(block nil (let (... face) (while --cl-dolist-temp-- ... ... ...) nil))
(dolist (face faces) (unless (gethash face face-map) (let ... ... ...)))
(let ((face-map ...) css-names) (dolist (face faces) (unless ... ...))
face-map)
htmlize-make-face-map((default highlight nil org-tag org-todo
org-warning org-agenda-structure))
(let* ((buffer-faces ...) (face-map ...) (htmlbuf ...) (places ...)
(title ...)) (with-current-buffer htmlbuf (buffer-disable-undo) (insert
... 10 ... "<html>\n ") (plist-put places ... ...) (insert "<head>\n"
" <title>" ... "</title>\n" ... htmlize-head-tags) (htmlize-method
insert-head buffer-faces face-map) (insert " </head>") (plist-put
places ... ...) (insert "\n ") (plist-put places ... ...) (insert ...
"\n ") (plist-put places ... ...) (insert "<pre>\n")) (let (...
next-change text face-list fstruct-list trailing-ellipsis) (goto-char
...) (while ... ... ... ... ... ... ... ... ... ...))
(with-current-buffer htmlbuf (insert "</pre>") (plist-put places ...
...) (insert "\n </body>") (plist-put places ... ...) (insert
"\n</html>\n") (when htmlize-generate-hyperlinks ...)
(htmlize-defang-local-variables) (when htmlize-replace-form-feeds ...
...) (goto-char ...) (when htmlize-html-major-mode ...) (set ... places)
(run-hooks ...) (buffer-enable-undo)) htmlbuf)
(save-excursion (save-excursion (run-hooks ...))
(htmlize-ensure-fontified) (clrhash htmlize-extended-character-cache)
(clrhash htmlize-memoization-table) (let* (... ... ... ... ...)
(with-current-buffer htmlbuf ... ... ... ... ... ... ... ... ... ... ...
...) (let ... ... ...) (with-current-buffer htmlbuf ... ... ... ... ...
... ... ... ... ... ... ... ...) htmlbuf))
htmlize-buffer-1()
(save-current-buffer (set-buffer (or buffer ...)) (htmlize-buffer-1))
(with-current-buffer (or buffer (current-buffer)) (htmlize-buffer-1))
(let ((htmlbuf ...)) (when (interactive-p) (switch-to-buffer htmlbuf))
htmlbuf)
htmlize-buffer()
call-interactively(htmlize-buffer)
execute-extended-command(nil)
call-interactively(execute-extended-command)
Bastien wrote:
> Wanrong Lin <wanrong.lin@gmail.com> writes:
>
>
>> After I do a tag search (for TODO items), if I do "htmlize-buffer" on
>> the search result, I will get an "invalid face" error. Since I have
>> quite some customization on my org-mode, I am not quite sure whether
>> this is my problem, or org-mode, or htmlize-buffer's problem.
>>
>
> Can you send a backtrace?
>
> (setq debug-on-error t)
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Tag search and "invalid face" error from htmlize-buffer
2007-11-12 5:24 ` Bastien
2007-11-12 14:53 ` Wanrong Lin
@ 2007-11-12 19:54 ` Wanrong Lin
2007-11-13 11:01 ` Bastien
1 sibling, 1 reply; 7+ messages in thread
From: Wanrong Lin @ 2007-11-12 19:54 UTC (permalink / raw)
To: Bastien; +Cc: emacs-orgmode
Just a little bit update.
I removed all my own customization for org-mode, except for setting the
org-agenda-files. The "invalid face" error is still there. So I am
pretty sure this is not coming from my own customization.
It seems that as long as the agenda buffer contains a line with a tag,
the error happens. If I manually delete those lines using "M-x
kill-line", the error goes away.
Wanrong
Bastien wrote:
> Wanrong Lin <wanrong.lin@gmail.com> writes:
>
>
>> After I do a tag search (for TODO items), if I do "htmlize-buffer" on
>> the search result, I will get an "invalid face" error. Since I have
>> quite some customization on my org-mode, I am not quite sure whether
>> this is my problem, or org-mode, or htmlize-buffer's problem.
>>
>
> Can you send a backtrace?
>
> (setq debug-on-error t)
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Tag search and "invalid face" error from htmlize-buffer
2007-11-11 17:06 Tag search and "invalid face" error from htmlize-buffer Wanrong Lin
2007-11-12 5:24 ` Bastien
@ 2007-11-13 11:01 ` Carsten Dominik
2007-11-13 15:24 ` Wanrong Lin
1 sibling, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2007-11-13 11:01 UTC (permalink / raw)
To: Wanrong Lin; +Cc: emacs-orgmode
On 11Nov2007, at 6:06 PM, Wanrong Lin wrote:
> Hi,
>
> I wonder anyone has seen this:
>
> After I do a tag search (for TODO items), if I do "htmlize-buffer"
> on the search result, I will get an "invalid face" error. Since I
> have quite some customization on my org-mode, I am not quite sure
> whether this is my problem, or org-mode, or htmlize-buffer's problem.
>
> Thank you.
Does this in .emacs fix the problem?
(eval-after-load "htmlize"
'(progn
(defadvice htmlize-faces-in-buffer (after org-no-nil-faces
activate)
"Make sure there are no nil faces"
(setq ad-return-value (delq nil ad-return-value)))))
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Tag search and "invalid face" error from htmlize-buffer
2007-11-13 11:01 ` Carsten Dominik
@ 2007-11-13 15:24 ` Wanrong Lin
0 siblings, 0 replies; 7+ messages in thread
From: Wanrong Lin @ 2007-11-13 15:24 UTC (permalink / raw)
To: emacs-orgmode
Carsten Dominik wrote:
>
> On 11Nov2007, at 6:06 PM, Wanrong Lin wrote:
>
>> Hi,
>>
>> I wonder anyone has seen this:
>>
>> After I do a tag search (for TODO items), if I do "htmlize-buffer" on
>> the search result, I will get an "invalid face" error. Since I have
>> quite some customization on my org-mode, I am not quite sure whether
>> this is my problem, or org-mode, or htmlize-buffer's problem.
>>
>> Thank you.
>
> Does this in .emacs fix the problem?
>
>
> (eval-after-load "htmlize"
> '(progn
> (defadvice htmlize-faces-in-buffer (after org-no-nil-faces activate)
> "Make sure there are no nil faces"
> (setq ad-return-value (delq nil ad-return-value)))))
>
This does help! Thank you guys very much. I need this badly because most
of time I run emacs on Windows and my emacs use htmlize-buffer to do
printing.
Logically, the problem probably should be solved in htmlize-buffer.
After all, if a buffer can be displayed, it should be able to be
htmlized. But I am happy with the workaround. :-)
Wanrong
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-11-13 15:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-11 17:06 Tag search and "invalid face" error from htmlize-buffer Wanrong Lin
2007-11-12 5:24 ` Bastien
2007-11-12 14:53 ` Wanrong Lin
2007-11-12 19:54 ` Wanrong Lin
2007-11-13 11:01 ` Bastien
2007-11-13 11:01 ` Carsten Dominik
2007-11-13 15:24 ` Wanrong Lin
Code repositories for project(s) associated with this public 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).