+2009-11-26 Vivek Dasmohapatra <vivek@etla.org>
+
+ Various minor fixes.
+ * htmlfontify.el (hfy-default-header): Add toggle_invis since
+ Javascript belongs in the header, not the body.
+ (hfy-javascript): Remove.
+ (hfy-fontify-buffer): Don't insert it any more.
+ (hfy-face-at): Handle (face0 face1 face2) style face properties.
+ Fix bug in invis handling when there were no invis props in a chunk.
+
2009-11-26 Stefan Monnier <monnier@iro.umontreal.ca>
* vc-bzr.el (vc-bzr-annotate-command): Make operation asynchronous.
}
}
}
+
+ function toggle_invis( name )
+ {
+ var filter =
+ { acceptNode:
+ function( node )
+ { var classname = node.id;
+ if( classname )
+ { var classbase = classname.substr( 0, name.length );
+ if( classbase == name ) { return NodeFilter.FILTER_ACCEPT; } }
+ return NodeFilter.FILTER_SKIP; } };
+ var walker = document.createTreeWalker( document.body ,
+ NodeFilter.SHOW_ELEMENT ,
+ filter ,
+ false );
+ while( walker.nextNode() )
+ {
+ var e = walker.currentNode;
+ if( e.style.display == \"none\" ) { e.style.display = \"inline\"; }
+ else { e.style.display = \"none\"; }
+ }
+ }
--> </script>
</head>
<body onload=\"stripe('index'); return true;\">\n"
(if (listp f) ;; for things like (variable-pitch (:foreground "red"))
(setq extra-props (cons f extra-props))
(setq extra-props (cons :inherit (cons f extra-props)))))
- (setq face-name nil))
+ (setq base-face (car face-name)
+ face-name nil))
;; text-properties-at => (face (:foreground "red" ...))
;; or => (face (compilation-info underline)) list of faces
;; overlay-properties
(progn
;;(message "ยท %d: %s; %S; %s"
;; p face-name extra-props text-props)
- face-name) ;; no overlays or extra properties
+ (or face-name base-face)) ;; no overlays or extra properties
;; collect any face data and any overlay data for processing:
(when text-props
(setq overlay-data (cons text-props overlay-data)))
(lambda (P)
(let ((iprops (cadr (memq 'invisible P))))
;;(message "(hfy-prop-invisible-p %S)" iprops)
- (when (hfy-prop-invisible-p iprops)
+ (when (and iprops (hfy-prop-invisible-p iprops))
(setq extra-props
(cons :invisible (cons t extra-props))) ))
(let ((fprops (cadr (or (memq 'face P)
" --></style>\n"))
(funcall hfy-page-header file stylesheet)))
-(defconst hfy-javascript "
- <script type=\"text/javascript\">
- // <![CDATA[
-function toggle_invis( name )
-{
- var filter =
- { acceptNode:
- function( node )
- { var classname = node.id;
- if( classname )
- { var classbase = classname.substr( 0, name.length );
- if( classbase == name ) { return NodeFilter.FILTER_ACCEPT; } }
- return NodeFilter.FILTER_SKIP; } };
- var walker = document.createTreeWalker( document.body ,
- NodeFilter.SHOW_ELEMENT ,
- filter ,
- false );
- while( walker.nextNode() )
- {
- var e = walker.currentNode;
- if( e.style.display == \"none\" ) { e.style.display = \"inline\"; }
- else { e.style.display = \"none\"; }
- }
-}
- // ]]>
- </script>\n")
-
;; tag all the dangerous characters we want to escape
;; (ie any "<> chars we _didn't_ put there explicitly for css markup)
(defun hfy-html-enkludge-buffer ()
(goto-char (point-min))
;;(message "inserting stylesheet")
(insert (hfy-sprintf-stylesheet css-sheet file))
- (insert hfy-javascript)
(if (hfy-opt 'div-wrapper) (insert "<div class=\"default\">"))
(insert "\n<pre>")
(goto-char (point-max))