;;; htmlfontify.el --- htmlise a buffer/source tree with optional hyperlinks
-;; Copyright (C) 2002, 2003, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2009-2011 Free Software Foundation, Inc.
;; Emacs Lisp Archive Entry
;; Package: htmlfontify
;; Compatibility: Emacs23, Emacs22
;; Incompatibility: Emacs19, Emacs20, Emacs21
;; Last Updated: Thu 2009-11-19 01:31:21 +0000
+;; Version: 0.21
;; This file is part of GNU Emacs.
;; (`font-lock-fontify-region')
(require 'cus-edit)
-(eval-and-compile
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; I want these - can't be bothered requiring all of cl though.
- (if (not (fboundp 'caddr))
- (defun caddr (list)
- "Return the `car' of the `cddr' of LIST."
- (car (cddr list))))
-
- (if (not (fboundp 'cadddr))
- (defun cadddr (list)
- "Return the `cadr' of the `cddr' of LIST."
- (cadr (cddr list))))
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (autoload
- 'htmlfontify-load-rgb-file
- "hfy-cmap"
- "Load an rgb.txt file for color name -> rgb translation purposes."
- 'interactive)
-
- (autoload
- 'htmlfontify-unload-rgb-file
- "hfy-cmap"
- "Unload the current color name -> rgb translation map."
- 'interactive)
-
- (autoload
- 'hfy-fallback-colour-values
- "hfy-cmap"
- "Use a fallback method for obtaining the rgb values for a color."
- 'interactive)
- )
-
(defconst htmlfontify-version 0.21)
(defconst hfy-meta-tags
new-spec)))))
(if (or (memq :inherit face-spec) (eq 'default face))
face-spec
- (nconc face-spec (list :inherit 'default))) ))
+ (append face-spec (list :inherit 'default)))))
;; construct an assoc of (css-tag-name . css-tag-value) pairs
;; from a face or assoc of face attributes:
(setq n (apply '* m))
(nconc r (hfy-size (if x (round n) (* n 1.0)))) ))
+(defun hfy-face-resolve-face (fn)
+ (cond
+ ((facep fn)
+ (hfy-face-attr-for-class fn hfy-display-class))
+ ((and (symbolp fn)
+ (facep (symbol-value fn)))
+ ;; Obsolete faces like `font-lock-reference-face' are defined as
+ ;; aliases for another face.
+ (hfy-face-attr-for-class (symbol-value fn) hfy-display-class))
+ (t nil)))
+
+
(defun hfy-face-to-style (fn)
"Take FN, a font or `defface' style font specification,
\(as returned by `face-attr-construct' or `hfy-face-attr-for-class')
and return a `hfy-style-assoc'.\n
See also `hfy-face-to-style-i', `hfy-flatten-style'."
;;(message "hfy-face-to-style");;DBUG
- (let ((face-def (if (facep fn)
- (hfy-face-attr-for-class fn hfy-display-class) fn))
+ (let ((face-def (hfy-face-resolve-face fn))
(final-style nil))
(setq final-style (hfy-flatten-style (hfy-face-to-style-i face-def)))
(when font-lock-defaults
(font-lock-fontify-buffer)) ))
+;;;###autoload
(defun htmlfontify-buffer (&optional srcdir file)
"Create a new buffer, named for the current buffer + a .html extension,
containing an inline CSS-stylesheet and formatted CSS-markup HTML
(save-buffer)
(kill-buffer B)))
+;;;###autoload
(defun htmlfontify-copy-and-link-dir (srcdir dstdir &optional f-ext l-ext)
"Trawl SRCDIR and write fontified-and-hyperlinked output in DSTDIR.
F-EXT and L-EXT specify values for `hfy-extn' and `hfy-link-extn'.\n
(let ((file (hfy-initfile)))
(load file 'NOERROR nil nil) ))
+\f
+;;;### (autoloads (hfy-fallback-colour-values htmlfontify-load-rgb-file)
+;;;;;; "hfy-cmap" "hfy-cmap.el" "f7f81749b08e0aec14aac431f8b5ac8b")
+;;; Generated autoloads from hfy-cmap.el
+
+(autoload 'htmlfontify-load-rgb-file "hfy-cmap" "\
+Load an X11 style rgb.txt FILE.
+Search `hfy-rgb-load-path' if FILE is not specified.
+Loads the variable `hfy-rgb-txt-colour-map', which is used by
+`hfy-fallback-colour-values'.
+
+\(fn &optional FILE)" t nil)
+
+(autoload 'hfy-fallback-colour-values "hfy-cmap" "\
+Use a fallback method for obtaining the rgb values for a color.
+
+\(fn COLOUR-STRING)" nil nil)
+
+;;;***
+\f
+
(provide 'htmlfontify)
-;;; htmlfontify.el ends here
-;; arch-tag: 944e5e63-c81d-4baa-a82a-0275f9c30e61
+;; Local Variables:
+;; coding: utf-8
+;; End:
+
+;;; htmlfontify.el ends here