From 220740a35be2a87e7d3fdcf42fe710017d0d067a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 2 Jan 2013 18:54:10 -0800 Subject: [PATCH 01/22] etags.el fix for compressed files * lisp/progmodes/etags.el (tags-compression-info-list): Doc fix. (tag-find-file-of-tag-noselect): Check auto-compression-mode rather than 'jka-compr being loaded. Fixes: debbugs:13338 --- lisp/ChangeLog | 4 ++++ lisp/progmodes/etags.el | 11 ++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 04ba7f802ca..34c13ad67fd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2013-01-03 Glenn Morris + * progmodes/etags.el (tags-compression-info-list): Doc fix. + (tag-find-file-of-tag-noselect): Check auto-compression-mode + rather than 'jka-compr being loaded. (Bug#13338) + * subr.el (eval-after-load): Don't purecopy the form, so that it can be nconc'd later on; reverts 2009-11-11 change. (Bug#13331) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 3799fbc1e2d..dc16a2ce762 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -67,11 +67,8 @@ Use the `etags' program to make a tags table file." ;;;###autoload (defcustom tags-compression-info-list (purecopy '("" ".Z" ".bz2" ".gz" ".xz" ".tgz")) - "List of extensions tried by etags when jka-compr is used. -An empty string means search the non-compressed file. -These extensions will be tried only if jka-compr was activated -\(i.e. via customize of `auto-compression-mode' or by calling the function -`auto-compression-mode')." + "List of extensions tried by etags when `auto-compression-mode' is on. +An empty string means search the non-compressed file." :version "24.1" ; added xz :type '(repeat string) :group 'etags) @@ -1180,7 +1177,7 @@ error message." "Find the right line in the specified FILE." ;; If interested in compressed-files, search files with extensions. ;; Otherwise, search only the real file. - (let* ((buffer-search-extensions (if (featurep 'jka-compr) + (let* ((buffer-search-extensions (if auto-compression-mode tags-compression-info-list '(""))) the-buffer @@ -1204,7 +1201,7 @@ error message." (setq file-search-extensions (cdr file-search-extensions)) (setq the-buffer (find-file-noselect (concat file (car file-search-extensions)))))) (if (not the-buffer) - (if (featurep 'jka-compr) + (if auto-compression-mode (error "File %s (with or without extensions %s) not found" file tags-compression-info-list) (error "File %s not found" file)) (set-buffer the-buffer)))) From 5b00b74939065b125efab8ea826c851356425003 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 2 Jan 2013 22:33:25 -0800 Subject: [PATCH 02/22] * term.el (term-default-fg-color, term-default-bg-color): Fix custom type. --- lisp/ChangeLog | 3 +++ lisp/term.el | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 34c13ad67fd..d200d9733f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-01-03 Glenn Morris + * term.el (term-default-fg-color, term-default-bg-color): + Fix custom type. + * progmodes/etags.el (tags-compression-info-list): Doc fix. (tag-find-file-of-tag-noselect): Check auto-compression-mode rather than 'jka-compr being loaded. (Bug#13338) diff --git a/lisp/term.el b/lisp/term.el index aa873075bfd..8c6ac2a4adf 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -772,14 +772,14 @@ Buffer local variable.") (defcustom term-default-fg-color nil "If non-nil, default color for foreground in Term mode." :group 'term - :type 'string) + :type '(choice (const nil) (string :tag "color"))) (make-obsolete-variable 'term-default-fg-color "use the face `term' instead." "24.3") (defcustom term-default-bg-color nil "If non-nil, default color for foreground in Term mode." :group 'term - :type 'string) + :type '(choice (const nil) (string :tag "color"))) (make-obsolete-variable 'term-default-bg-color "use the face `term' instead." "24.3") From c7b56654128650a9ac8e9336a0eb1c742958cc19 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 3 Jan 2013 07:17:45 -0500 Subject: [PATCH 03/22] Auto-commit of generated files. --- autogen/config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen/config.in b/autogen/config.in index 8fe2170d89d..95aed317c51 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -2,7 +2,7 @@ /* GNU Emacs site configuration template file. -Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2012 +Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2013 Free Software Foundation, Inc. This file is part of GNU Emacs. From d2be4dccb9088cc7e27aeb6b01ef23ed20da2447 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 3 Jan 2013 10:31:45 -0800 Subject: [PATCH 04/22] term-handle-colors-array fix * lisp/term.el (term-handle-colors-array): Ensure face attributes are fully specified, not nil. Fixes: debbugs:13337 --- lisp/ChangeLog | 3 +++ lisp/term.el | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d200d9733f8..90b6e683e0a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-01-03 Glenn Morris + * term.el (term-handle-colors-array): Ensure face attributes + are fully specified, not nil. (Bug#13337) + * term.el (term-default-fg-color, term-default-bg-color): Fix custom type. diff --git a/lisp/term.el b/lisp/term.el index 8c6ac2a4adf..1a0dd0cc86f 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -3216,18 +3216,24 @@ See `term-prompt-regexp'." (let ((color (if term-ansi-current-reverse (face-foreground - (elt ansi-term-color-vector term-ansi-current-color)) + (elt ansi-term-color-vector term-ansi-current-color) + nil 'default) (face-background - (elt ansi-term-color-vector term-ansi-current-bg-color))))) + (elt ansi-term-color-vector term-ansi-current-bg-color) + nil 'default)))) (setq term-current-face (list :background color :foreground color)) ) ;; No need to bother with anything else if it's invisible. (setq term-current-face (list :foreground - (face-foreground (elt ansi-term-color-vector term-ansi-current-color)) + (face-foreground + (elt ansi-term-color-vector term-ansi-current-color) + nil 'default) :background - (face-background (elt ansi-term-color-vector term-ansi-current-bg-color)) + (face-background + (elt ansi-term-color-vector term-ansi-current-bg-color) + nil 'default) :inverse-video term-ansi-current-reverse)) (when term-ansi-current-bold From 4217dc299c3b466e674271f8eb8a0a88e5b3795f Mon Sep 17 00:00:00 2001 From: Ari Roponen Date: Thu, 3 Jan 2013 10:38:55 -0800 Subject: [PATCH 05/22] * doc/lispref/hash.texi (Defining Hash): Fix typo (tiny change) Fixes: debbugs:13345 --- doc/lispref/ChangeLog | 4 ++++ doc/lispref/hash.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 400290394ba..4deea30005f 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2013-01-03 Ari Roponen (tiny change) + + * hash.texi (Defining Hash): Fix typo. (Bug#13345) + 2013-01-03 Glenn Morris * processes.texi (System Processes): diff --git a/doc/lispref/hash.texi b/doc/lispref/hash.texi index 753e71882b0..655f31ab114 100644 --- a/doc/lispref/hash.texi +++ b/doc/lispref/hash.texi @@ -293,7 +293,7 @@ compared case-insensitively. @example (defun case-fold-string= (a b) - (compare-strings a nil nil b nil nil t)) + (eq t (compare-strings a nil nil b nil nil t))) (defun case-fold-string-hash (a) (sxhash (upcase a))) From c2cf1829ddd72c4fa24e7def8d94e8b2ee937a03 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 4 Jan 2013 08:56:51 +0900 Subject: [PATCH 06/22] * epg.el (epg--start): Ignore errors when /dev/fd/0 does not exist. --- lisp/ChangeLog | 5 +++++ lisp/epg.el | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3aae01b9f1e..f327b929e56 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-01-03 Daiki Ueno + + * epg.el (epg--start): Ignore errors when /dev/fd/0 does not + exist. (Bug#13344) + 2013-01-03 Glenn Morris * mail/rmail.el (rmail-set-header-1): Ignore case. diff --git a/lisp/epg.el b/lisp/epg.el index 6be3ba15a97..ff32661ada9 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -1167,9 +1167,11 @@ This function is for internal use only." ;; use `terminal-name' here to get the real pty name for the child ;; process, though /dev/fd/0" is not portable. (with-temp-buffer - (when (= (call-process "tty" "/dev/fd/0" t) 0) - (delete-backward-char 1) - (setq terminal-name (buffer-string)))) + (condition-case nil + (when (= (call-process "tty" "/dev/fd/0" t) 0) + (delete-backward-char 1) + (setq terminal-name (buffer-string))) + (file-error))) (when terminal-name (setq process-environment (cons (concat "GPG_TTY=" terminal-name) From 342532db2bf1f9d9efcd2073b6f4395db548df5a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 3 Jan 2013 17:31:52 -0800 Subject: [PATCH 07/22] * lisp/erc/erc-backend.el (312): Fix typo. Fixes: debbugs:13235 --- lisp/erc/ChangeLog | 4 ++++ lisp/erc/erc-backend.el | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 0366addacfc..3a625eb215e 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,7 @@ +2013-01-04 Glenn Morris + + * erc-backend.el (312): Fix typo. (Bug#13235) + 2012-11-30 Glenn Morris * erc.el (erc-accidental-paste-threshold-seconds): Add :version. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index c8b7286c7dd..3d3ac791f08 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1633,8 +1633,8 @@ See `erc-display-server-message'." nil (define-erc-response-handler (312) "Server name response in WHOIS." nil - (pcase-let ((`(,nick ,server-host)) - (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,nick ,server-host) + (cdr (erc-response.command-args parsed)))) (erc-display-message parsed 'notice 'active 's312 ?n nick ?s server-host ?c (erc-response.contents parsed)))) From f032a318307096c87c4c19928e623e30175d9b1a Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 4 Jan 2013 10:58:07 +0900 Subject: [PATCH 08/22] Make underwave look more triangular and also degrade gracefully for small fonts. (Bug#13000) --- src/ChangeLog | 7 +++++++ src/nsterm.m | 12 ++++++------ src/w32term.c | 4 ++-- src/xterm.c | 4 ++-- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ea882770765..8699dc12d9b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2013-01-04 YAMAMOTO Mitsuharu + + * nsterm.m (ns_draw_underwave): + * w32term.c (w32_draw_underwave): + * xterm.c (x_draw_underwave): Make underwave look more triangular + and also degrade gracefully for small fonts. (Bug#13000) + 2012-12-31 Glenn Morris * keymap.c (Fkey_description): Doc fix. (Bug#13323) diff --git a/src/nsterm.m b/src/nsterm.m index d9ebf714a9a..fce43587b11 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2554,7 +2554,7 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr) Draw a wavy line under glyph string s. The wave fills wave_height pixels from y. - x wave_length = 3 + x wave_length = 2 -- y * * * * * |* * * * * * * * * @@ -2564,14 +2564,14 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr) static void ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x) { - int wave_height = 3, wave_length = 3; + int wave_height = 3, wave_length = 2; int y, dx, dy, odd, xmax; NSPoint a, b; NSRect waveClip; dx = wave_length; dy = wave_height - 1; - y = s->ybase + 1; + y = s->ybase - wave_height + 3; xmax = x + width; /* Find and set clipping rectangle */ @@ -2580,10 +2580,10 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x) NSRectClip (waveClip); /* Draw the waves */ - a.x = x - ((int)(x) % dx); + a.x = x - ((int)(x) % dx) + 0.5; b.x = a.x + dx; odd = (int)(a.x/dx) % 2; - a.y = b.y = y; + a.y = b.y = y + 0.5; if (odd) a.y += dy; @@ -2594,7 +2594,7 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x) { [NSBezierPath strokeLineFromPoint:a toPoint:b]; a.x = b.x, a.y = b.y; - b.x += dx, b.y = y + odd*dy; + b.x += dx, b.y = y + 0.5 + odd*dy; odd = !odd; } diff --git a/src/w32term.c b/src/w32term.c index d7a76ccf773..84afd8c300b 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -356,7 +356,7 @@ w32_restore_glyph_string_clip (struct glyph_string *s) void w32_draw_underwave (struct glyph_string *s, COLORREF color) { - int wave_height = 2, wave_length = 3; + int wave_height = 3, wave_length = 2; int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax; XRectangle wave_clip, string_clip, final_clip; RECT w32_final_clip, w32_string_clip; @@ -365,7 +365,7 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color) dx = wave_length; dy = wave_height - 1; x0 = s->x; - y0 = s->ybase + 1; + y0 = s->ybase - wave_height + 3; width = s->width; xmax = x0 + width; diff --git a/src/xterm.c b/src/xterm.c index 47a38eeefae..32b19b5cffb 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2656,14 +2656,14 @@ x_draw_stretch_glyph_string (struct glyph_string *s) static void x_draw_underwave (struct glyph_string *s) { - int wave_height = 2, wave_length = 3; + int wave_height = 3, wave_length = 2; int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax; XRectangle wave_clip, string_clip, final_clip; dx = wave_length; dy = wave_height - 1; x0 = s->x; - y0 = s->ybase + 1; + y0 = s->ybase - wave_height + 3; width = s->width; xmax = x0 + width; From 4240dd3cef858e4431bb349925c755d793c560b3 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 4 Jan 2013 11:05:33 +0900 Subject: [PATCH 09/22] Don't use previous underline thickness or position if previous underline type is underwave. --- src/ChangeLog | 5 +++++ src/nsterm.m | 1 + src/w32term.c | 3 ++- src/xterm.c | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8699dc12d9b..9e315700e8a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,6 +5,11 @@ * xterm.c (x_draw_underwave): Make underwave look more triangular and also degrade gracefully for small fonts. (Bug#13000) + * nsterm.m (ns_draw_text_decoration): + * w32term.c (x_draw_glyph_string): + * xterm.c (x_draw_glyph_string): Don't use previous underline + thickness and position if previous underline type is underwave. + 2012-12-31 Glenn Morris * keymap.c (Fkey_description): Doc fix. (Bug#13323) diff --git a/src/nsterm.m b/src/nsterm.m index fce43587b11..a57e744d3c2 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2634,6 +2634,7 @@ ns_draw_text_decoration (struct glyph_string *s, struct face *face, /* If the prev was underlined, match its appearance. */ if (s->prev && s->prev->face->underline_p + && s->prev->face->underline_type == FACE_UNDER_LINE && s->prev->underline_thickness > 0) { thickness = s->prev->underline_thickness; diff --git a/src/w32term.c b/src/w32term.c index 84afd8c300b..8b9414b9cfb 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2464,7 +2464,8 @@ x_draw_glyph_string (struct glyph_string *s) unsigned long thickness, position; int y; - if (s->prev && s->prev->face->underline_p) + if (s->prev && s->prev->face->underline_p + && s->prev->face->underline_type == FACE_UNDER_LINE) { /* We use the same underline style as the previous one. */ thickness = s->prev->underline_thickness; diff --git a/src/xterm.c b/src/xterm.c index 32b19b5cffb..fb407c87611 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2825,7 +2825,8 @@ x_draw_glyph_string (struct glyph_string *s) unsigned long thickness, position; int y; - if (s->prev && s->prev->face->underline_p) + if (s->prev && s->prev->face->underline_p + && s->prev->face->underline_type == FACE_UNDER_LINE) { /* We use the same underline style as the previous one. */ thickness = s->prev->underline_thickness; From ee0d39381afabe6ca81701e786fa506239e261d2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 3 Jan 2013 18:17:49 -0800 Subject: [PATCH 10/22] Merge from gnulib. This incorporates: 2013-01-04 stdio: remove now-unnecessary stdio.c 2013-01-04 fprintftime: depend on stdio, not ignore-value 2013-01-04 fwrite: silence __wur only for older glibc versions 2013-01-04 fwrite: silence __wur without using inline * lib/stdio.c: Remove. * lib/stdio.in.h, lib/strftime.c: Update from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. --- ChangeLog | 11 +++++++++++ lib/gnulib.mk | 1 - lib/stdio.c | 3 --- lib/stdio.in.h | 27 ++++++++------------------- lib/strftime.c | 11 +---------- m4/gnulib-comp.m4 | 1 - 6 files changed, 20 insertions(+), 34 deletions(-) delete mode 100644 lib/stdio.c diff --git a/ChangeLog b/ChangeLog index d56d74b20db..68c0d85b5cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2013-01-04 Paul Eggert + + Merge from gnulib, incorporating: + 2013-01-04 stdio: remove now-unnecessary stdio.c + 2013-01-04 fprintftime: depend on stdio, not ignore-value + 2013-01-04 fwrite: silence __wur only for older glibc versions + 2013-01-04 fwrite: silence __wur without using inline + * lib/stdio.c: Remove. + * lib/stdio.in.h, lib/strftime.c: Update from gnulib. + * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. + 2013-01-02 Paul Eggert Merge from gnulib, incorporating copyright-date changes and: diff --git a/lib/gnulib.mk b/lib/gnulib.mk index ca628a28da4..2347d84448d 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -774,7 +774,6 @@ EXTRA_DIST += stdint.in.h ## begin gnulib module stdio BUILT_SOURCES += stdio.h -libgnu_a_SOURCES += stdio.c # We need the following in order to create when the system # doesn't have one that works with the given compiler. diff --git a/lib/stdio.c b/lib/stdio.c deleted file mode 100644 index e6ed82996b7..00000000000 --- a/lib/stdio.c +++ /dev/null @@ -1,3 +0,0 @@ -#include -#define _GL_STDIO_INLINE _GL_EXTERN_INLINE -#include "stdio.h" diff --git a/lib/stdio.in.h b/lib/stdio.in.h index d9a67dc4d41..d6af99ca77d 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -46,11 +46,6 @@ #ifndef _@GUARD_PREFIX@_STDIO_H #define _@GUARD_PREFIX@_STDIO_H -_GL_INLINE_HEADER_BEGIN -#ifndef _GL_STDIO_INLINE -# define _GL_STDIO_INLINE _GL_INLINE -#endif - /* Get va_list. Needed on many systems, including glibc 2.8. */ #include @@ -580,21 +575,17 @@ _GL_CXXALIAS_RPL (fwrite, size_t, _GL_CXXALIAS_SYS (fwrite, size_t, (const void *ptr, size_t s, size_t n, FILE *stream)); -/* Work around glibc bug 11959 +/* Work around bug 11959 when fortifying glibc 2.4 through 2.15 , which sometimes causes an unwanted diagnostic for fwrite calls. - This affects only function declaration attributes, so it's not - needed for C++. */ -# if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL -_GL_STDIO_INLINE size_t _GL_ARG_NONNULL ((1, 4)) -rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream) -{ - size_t r = fwrite (ptr, s, n, stream); - (void) r; - return r; -} + This affects only function declaration attributes under certain + versions of gcc, and is not needed for C++. */ +# if (0 < __USE_FORTIFY_LEVEL \ + && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \ + && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \ + && !defined __cplusplus) # undef fwrite -# define fwrite rpl_fwrite +# define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; }) # endif # endif _GL_CXXALIASWARN (fwrite); @@ -1338,8 +1329,6 @@ _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - " "POSIX compliance"); #endif -_GL_INLINE_HEADER_END - #endif /* _@GUARD_PREFIX@_STDIO_H */ #endif /* _@GUARD_PREFIX@_STDIO_H */ #endif diff --git a/lib/strftime.c b/lib/strftime.c index 1d58f2a160b..213ced860de 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -26,7 +26,6 @@ #else # include # if FPRINTFTIME -# include "ignore-value.h" # include "fprintftime.h" # else # include "strftime.h" @@ -209,15 +208,7 @@ extern char *tzname[]; else if (to_uppcase) \ fwrite_uppcase (p, (s), _n); \ else \ - { \ - /* We are ignoring the value of fwrite here, in spite of the \ - fact that technically, that may not be valid: the fwrite \ - specification in POSIX 2008 defers to that of fputc, which \ - is intended to be consistent with the one from ISO C, \ - which permits failure due to ENOMEM *without* setting the \ - stream's error indicator. */ \ - ignore_value (fwrite ((s), _n, 1, p)); \ - } \ + fwrite (s, _n, 1, p); \ } \ while (0) \ ) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 06dd51a4d53..b7109c5f87f 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -712,7 +712,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h - lib/stdio.c lib/stdio.in.h lib/stdlib.in.h lib/strftime.c From 553081a514e463013c1603ecff64cf7cb0473767 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 3 Jan 2013 21:42:08 -0500 Subject: [PATCH 11/22] * src/fileio.c (Ffile_acl): Undocument return format. * doc/lispref/files.texi (File Attributes): Idem. --- doc/lispref/ChangeLog | 4 ++++ doc/lispref/files.texi | 2 +- src/ChangeLog | 4 ++++ src/fileio.c | 8 ++++---- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 4815ac2a482..f9f3aad9ab2 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2013-01-04 Stefan Monnier + + * files.texi (File Attributes): Undocument return format of file-acl. + 2013-01-03 Glenn Morris * processes.texi (System Processes): diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index c323a6e72ad..114eb1f38ea 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1363,7 +1363,7 @@ security APIs. @defun file-acl filename This function returns the ACL entries of the file @var{filename}. The -return value is a platform-dependent string containing the textual +return value is a platform-dependent object containing some representation of the ACL entries. Don't use it for anything except passing it to the @code{set-file-acl} function (@pxref{Changing Files, set-file-acl}). diff --git a/src/ChangeLog b/src/ChangeLog index 7342f7c6add..fa27e299ad7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2013-01-04 Stefan Monnier + + * fileio.c (Ffile_acl): Undocument return format. + 2013-01-02 Glenn Morris * keymap.c (Fkey_description): Doc fix. (Bug#13323) diff --git a/src/fileio.c b/src/fileio.c index 05f615f0c88..5e9b36ee44a 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3084,11 +3084,11 @@ or if Emacs was not compiled with SELinux support. */) } DEFUN ("file-acl", Ffile_acl, Sfile_acl, 1, 1, 0, - doc: /* Return ACL entries of file named FILENAME, as a string. + doc: /* Return ACL entries of file named FILENAME. +The entries are returned in a format suitable for use in `set-file-acl' +but is otherwise undocumented and subject to change. Return nil if file does not exist or is not accessible, or if Emacs -was unable to determine the ACL entries. The latter can happen for -local files if Emacs was not compiled with ACL support, or for remote -files if the file handler returns nil for the file's ACL entries. */) +was unable to determine the ACL entries. */) (Lisp_Object filename) { Lisp_Object absname; From 96dd18b1101638ddf0d38dfc3266888b225db26b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 3 Jan 2013 21:45:59 -0500 Subject: [PATCH 12/22] * lisp/doc-view.el (doc-view-scale-internally): New var. (doc-view-enlarge, doc-view-insert-image): Obey it. --- lisp/ChangeLog | 5 +++++ lisp/doc-view.el | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f327b929e56..fa2948569e1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-01-04 Stefan Monnier + + * doc-view.el (doc-view-scale-internally): New var. + (doc-view-enlarge, doc-view-insert-image): Obey it. + 2013-01-03 Daiki Ueno * epg.el (epg--start): Ignore errors when /dev/fd/0 does not diff --git a/lisp/doc-view.el b/lisp/doc-view.el index ad1ff848112..24434d294c6 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -173,9 +173,17 @@ Higher values result in larger images." :type 'number :group 'doc-view) +(defcustom doc-view-scale-internally t + "Whether we should try to rescale images ourselves. +If nil, the document is re-rendered every time the scaling factor is modified. +This only has an effect if the image libraries linked with Emacs support +scaling." + :type 'boolean) + (defcustom doc-view-image-width 850 "Default image width. -Has only an effect if imagemagick support is compiled into emacs." +Has only an effect if `doc-view-scale-internally' is non-nil and support for +scaling is compiled into emacs." :version "24.1" :type 'number :group 'doc-view) @@ -669,8 +677,9 @@ OpenDocument format)." (defun doc-view-enlarge (factor) "Enlarge the document by FACTOR." (interactive (list doc-view-shrink-factor)) - (if (eq (plist-get (cdr (doc-view-current-image)) :type) - 'imagemagick) + (if (and doc-view-scale-internally + (eq (plist-get (cdr (doc-view-current-image)) :type) + 'imagemagick)) ;; ImageMagick supports on-the-fly-rescaling. (let ((new (ceiling (* factor doc-view-image-width)))) (unless (equal new doc-view-image-width) @@ -1133,10 +1142,11 @@ ARGS is a list of image descriptors." (setq doc-view-pending-cache-flush nil)) (let ((ol (doc-view-current-overlay)) (image (if (and file (file-readable-p file)) - (if (not (fboundp 'imagemagick-types)) + (if (not (and doc-view-scale-internally + (fboundp 'imagemagick-types))) (apply 'create-image file 'png nil args) (unless (member :width args) - (setq args (append args (list :width doc-view-image-width)))) + (setq args `(,@args :width ,doc-view-image-width))) (apply 'create-image file 'imagemagick nil args)))) (slice (doc-view-current-slice))) (setf (doc-view-current-image) image) From 4a74c818809349ea30ddb5b2e1498c9f8a08d37e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 3 Jan 2013 21:53:48 -0500 Subject: [PATCH 13/22] * lisp/view.el (view--enable, view--disable): Rename from view-mode-enable and view-mode-disable and assume it's called from view-mode. (view-mode-enable, view-mode-disable): Redefine as obsolete compatibility layer above view-mode. (view-mode-enter): Call `view-mode'. * lisp/files.el (after-find-file): Call `view-mode'. --- lisp/ChangeLog | 10 ++++++++++ lisp/files.el | 3 +-- lisp/view.el | 34 +++++++++++++++------------------- src/ChangeLog | 2 +- src/fns.c | 2 +- test/indent/shell.sh | 12 ++++++++++++ 6 files changed, 40 insertions(+), 23 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fa2948569e1..6314c1218bb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2013-01-04 Stefan Monnier + * view.el (view--enable, view--disable): Rename from view-mode-enable + and view-mode-disable and assume it's called from view-mode. + (view-mode-enable, view-mode-disable): Redefine as obsolete + compatibility layer above view-mode. + (view-mode-enter): Call `view-mode'. + + * files.el (after-find-file): Call `view-mode'. + * doc-view.el (doc-view-scale-internally): New var. (doc-view-enlarge, doc-view-insert-image): Obey it. @@ -348,6 +356,8 @@ (lm-homepage): New function. (lm-with-file): Don't be confused if narrowing is in effect. +2012-12-19 Stefan Monnier + * vc/diff-mode.el (diff-post-command-hook): Don't ignore changes at the very beginning of a hunk (e.g. killing the first line). diff --git a/lisp/files.el b/lisp/files.el index 6a2945cbc79..ca5a415fb8e 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -209,7 +209,6 @@ have fast storage with limited space, such as a RAM disk." (declare-function dired-unmark "dired" (arg)) (declare-function dired-do-flagged-delete "dired" (&optional nomessage)) (declare-function dos-8+3-filename "dos-fns" (filename)) -(declare-function view-mode-disable "view" ()) (declare-function dosified-file-name "dos-fns" (file-name)) (defvar file-name-invalid-regexp @@ -2125,7 +2124,7 @@ unless NOMODES is non-nil." (setq buffer-read-only t)) (unless nomodes (when (and view-read-only view-mode) - (view-mode-disable)) + (view-mode -1)) (normal-mode t) ;; If requested, add a newline at the end of the file. (and (memq require-final-newline '(visit visit-save)) diff --git a/lisp/view.el b/lisp/view.el index 5a28415ec7a..2717c915c71 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -461,16 +461,13 @@ then \\[View-leave], \\[View-quit] and \\[View-kill-and-leave] will return to th Entry to view-mode runs the normal hook `view-mode-hook'." :lighter " View" :keymap view-mode-map - (if view-mode (view-mode-enable) (view-mode-disable))) + (if view-mode (view--enable) (view--disable))) -(defun view-mode-enable (&optional run-view-mode-hook) - "Turn on View mode. -Run `view-mode-hook' when RUN-VIEW-MODE-HOOK is non-nil." +(defun view--enable () ;; Always leave view mode before changing major mode. ;; This is to guarantee that the buffer-read-only variable is restored. - (add-hook 'change-major-mode-hook 'view-mode-disable nil t) - (setq view-mode t - view-page-size nil + (add-hook 'change-major-mode-hook 'view--disable nil t) + (setq view-page-size nil view-half-page-size nil view-old-buffer-read-only buffer-read-only buffer-read-only t) @@ -481,16 +478,18 @@ Run `view-mode-hook' when RUN-VIEW-MODE-HOOK is non-nil." (format "continue viewing %s" (if (buffer-file-name) (file-name-nondirectory (buffer-file-name)) - (buffer-name))))) - (force-mode-line-update) - (when run-view-mode-hook - (run-hooks 'view-mode-hook))) + (buffer-name)))))) + +(define-obsolete-function-alias 'view-mode-enable 'view-mode "24.4") (defun view-mode-disable () "Turn off View mode." - (remove-hook 'change-major-mode-hook 'view-mode-disable t) + (declare (obsolete view-mode "24.4")) + (view-mode -1)) + +(defun view--disable () + (remove-hook 'change-major-mode-hook 'view--disable t) (and view-overlay (delete-overlay view-overlay)) - (force-mode-line-update) ;; Calling toggle-read-only while View mode is enabled ;; sets view-read-only to t as a buffer-local variable ;; after exiting View mode. That arranges that the next toggle-read-only @@ -499,7 +498,6 @@ Run `view-mode-hook' when RUN-VIEW-MODE-HOOK is non-nil." ;; so that View mode stays off if toggle-read-only is called. (if (local-variable-p 'view-read-only) (kill-local-variable 'view-read-only)) - (setq view-mode nil) (if (boundp 'Helper-return-blurb) (setq Helper-return-blurb view-old-Helper-return-blurb)) (if buffer-read-only @@ -562,8 +560,7 @@ This function runs the normal hook `view-mode-hook'." (setq view-exit-action exit-action)) (unless view-mode - (view-mode-enable t) - (force-mode-line-update) + (view-mode 1) (unless view-inhibit-help-message (message "%s" (substitute-command-keys "\ @@ -590,7 +587,7 @@ current buffer. " (when view-mode (let ((buffer (window-buffer))) (unless view-no-disable-on-exit - (view-mode-disable)) + (view-mode -1)) (unless exit-only (cond @@ -601,8 +598,7 @@ current buffer. " (quit-window))) (when exit-action - (funcall exit-action buffer)) - (force-mode-line-update))))) + (funcall exit-action buffer)))))) (defun View-exit () "Exit View mode but stay in current buffer." diff --git a/src/ChangeLog b/src/ChangeLog index fa27e299ad7..5205ef4625e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -261,7 +261,7 @@ * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove. (redisplay_internal): Don't bother selecting the frame to get the - proper value of frame-local variables. + proper value of frame-local variables (bug#13225). 2012-12-20 Dmitry Antipov diff --git a/src/fns.c b/src/fns.c index 3beed018648..687c3f6ff39 100644 --- a/src/fns.c +++ b/src/fns.c @@ -86,7 +86,7 @@ Other values of LIMIT are ignored. */) before it's time to do a QUIT. This must be a power of 2. */ enum { QUIT_COUNT_HEURISTIC = 1 << 16 }; -/* Random data-structure functions */ +/* Random data-structure functions. */ DEFUN ("length", Flength, Slength, 1, 1, 0, doc: /* Return the length of vector, list or string SEQUENCE. diff --git a/test/indent/shell.sh b/test/indent/shell.sh index 6f3447c3aa9..790656501d1 100755 --- a/test/indent/shell.sh +++ b/test/indent/shell.sh @@ -5,6 +5,18 @@ setlock -n /tmp/getmail.lock && echo getmail isn\'t running # adsgsdg +case $X in + foo) + do_something + ;; + arg=*) # bug#12953 + do_something_else_based_on_arg + ;; + *) + default + ;; +esac + echo -n $(( 5 << 2 )) # This should not be treated as a heredoc (bug#12770). 2 From c0bd248ccb698c6b665a6fd1f50251b54285c98b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 3 Jan 2013 22:42:11 -0500 Subject: [PATCH 14/22] * lisp/subr.el (internal--called-interactively-p--get-frame): Find aliases of called-interactively-p as well. Fixes: debbugs:13237 --- lisp/ChangeLog | 3 +++ lisp/subr.el | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6314c1218bb..cc1e652eb5d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-01-04 Stefan Monnier + * subr.el (internal--called-interactively-p--get-frame): Find aliases + of called-interactively-p as well (bug#13237). + * view.el (view--enable, view--disable): Rename from view-mode-enable and view-mode-disable and assume it's called from view-mode. (view-mode-enable, view-mode-disable): Redefine as obsolete diff --git a/lisp/subr.el b/lisp/subr.el index 7ca0169abdb..11e882d9158 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3977,8 +3977,8 @@ the number of frames to skip (minus 1).") `(progn (defvar ,sym (let ((i 1)) - (while (not (eq (nth 1 (backtrace-frame i)) - 'called-interactively-p)) + (while (not (eq (indirect-function (nth 1 (backtrace-frame i)) t) + (indirect-function 'called-interactively-p))) (setq i (1+ i))) i)) ;; (unless (eq (nth 1 (backtrace-frame ,sym)) 'called-interactively-p) From bdd9367d4edddbbe745dad84eb33226d0ab969e4 Mon Sep 17 00:00:00 2001 From: Wesley Dawson Date: Fri, 4 Jan 2013 00:20:49 -0800 Subject: [PATCH 15/22] icomplete-prospects-height fix (tiny change) * icomplete.el (icomplete-completions): Honor icomplete-prospects-height once more following 2012-11-29 changes. Fixes: debbugs:13224 --- lisp/ChangeLog | 6 ++++++ lisp/icomplete.el | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cc1e652eb5d..0dbe5ac0eb7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-01-04 Wesley Dawson (tiny change) + + * icomplete.el (icomplete-completions): + Honor icomplete-prospects-height once more following + 2012-11-29 changes. (Bug#13224) + 2013-01-04 Stefan Monnier * subr.el (internal--called-interactively-p--get-frame): Find aliases diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 0493a5b49e8..9407de4f6d9 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -343,8 +343,10 @@ are exhibited within the square braces.)" (t (concat "…" (substring most compare)))) close-bracket))) ;;"-prospects" - more than one candidate - (prospects-len (+ (length determ) 6 ;; take {,...} into account - (string-width (buffer-string)))) + (prospects-len (+ (length determ) + (string-width icomplete-separator) + 3 ;; take {…} into account + (string-width (buffer-string)))) (prospects-max ;; Max total length to use, including the minibuffer content. (* (+ icomplete-prospects-height @@ -375,7 +377,9 @@ are exhibited within the square braces.)" (cond ((string-equal comp "") (setq most-is-exact t)) ((member comp prospects)) (t (setq prospects-len - (+ (string-width comp) 1 prospects-len)) + (+ (string-width comp) + (string-width icomplete-separator) + prospects-len)) (if (< prospects-len prospects-max) (push comp prospects) (setq limit t)))))) From 7fca93e239d479eb24bfbf043c8aa76d34d8879c Mon Sep 17 00:00:00 2001 From: Vivek Dasmohapatra Date: Fri, 4 Jan 2013 01:38:18 -0800 Subject: [PATCH 16/22] Import the htmlfontify manual --- doc/misc/ChangeLog | 4 + doc/misc/htmlfontify.texi | 2004 +++++++++++++++++++++++++++++++++++++ 2 files changed, 2008 insertions(+) create mode 100644 doc/misc/htmlfontify.texi diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index fb3bfc9a03f..fe1d81e77e2 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,7 @@ +2013-01-04 Vivek Dasmohapatra + + * htmlfontify.texi: New file. + 2012-12-22 Glenn Morris * viper.texi (Rudimentary Changes, Key Bindings, Key Bindings): diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi new file mode 100644 index 00000000000..03a849fab2c --- /dev/null +++ b/doc/misc/htmlfontify.texi @@ -0,0 +1,2004 @@ +\input texinfo +@c documentation for htmlfontify +@c written by Vivek Dasmohapatra + +@comment %**start of header (This is for running Texinfo on a region.) + +@setfilename htmlfontify.info +@settitle Htmlfontify User Manual + +@dircategory Emacs +@direntry +* Htmlfontify: (htmlfontify). A source code -> linked html + css transformer +@end direntry + +@exampleindent 2 +@comment %**end of header (This is for running Texinfo on a region.) + +@ifinfo + +This file documents Htmlfontify, a source code -> crosslinked + formatted + +syntax colourised html transformer. + +Copyright (c) 2002,2003 Vivek Dasmohapatra + +Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation Licence, +Version 1.1 or any later version published by the Free Software +Foundation; with no Invariant Sections, no Front-Cover Texts and +no Back-Cover Texts. A copy of the licence is included in the +section entitled "GNU Free Documentation Licence". + +@end ifinfo + +@titlepage +@title Htmlfontify User Manual +@sp 4 +@subtitle Htmlfontify version 0.20 +@sp 1 +@subtitle Jun 2002 +@sp 5 +@author Vivek Dasmohapatra +@page + +@vskip 0pt plus 1filll +@noindent +Copyright @copyright{} 2002 Vivek Dasmohapatra + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation Licence, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A +copy of the licence is included in the section entitled "GNU Free +Documentation Licence". + +@end titlepage +@page + +@node Top, Introduction, (dir), (dir) + +@menu +* Introduction:: About Htmlfontify. +* Usage & Examples:: How to use Htmlfontify. +* Customisation:: Fine tuning Htmlfontify's behaviour. +* Requirements:: External programs used by Htmlfontify. +* Index:: Index of Contents. +* COPYING:: The GNU Free Documentation Licence. +@end menu + +@node Introduction, Usage & Examples, Top, Top +@chapter Introduction +@cindex Introduction + +Htmlfontify provides a means of converting individual emacs buffers, +source files, or entire source trees to html, preserving formatting +and emacs colourisation / syntax highlighting as much as possible +through careful application of CSS stylesheets and html tags. + +It can also turn instances of functions, methods and ( for some +languages ) variables and other constructs and items into links +to their definitions, and create an index file ( or files ) of +all such symbols, also linked to their points of definition. + +Htmlfontify also provides several customisation items, which should +allow it to mesh more-or-less seamlessly with various templating or +publishing systems ( in the event, for instance, that you don't want +to produce the html pages directly ). + +@node Usage & Examples, Customisation, Introduction, Top +@chapter Usage & Examples +@cindex Usage & Examples + +Htmlfontify can be used both interactively and as part of another +elisp function. If you're running it in emacs21 ( its native land, +it were ), it will also run when attached to a terminal ( ie w/o X ) +or even when in batch mode. + +@menu +* Interactive:: Using htmlfontify interactively. +* Non-interactive:: Using htmlfontify from elisp. +* Variables:: Variables (other than customisation entries). +* Data Structures:: Important Data Structures. +* Examples:: Example(s) of htmlfontify in use. +@end menu + +@node Interactive, Non-interactive, , Usage & Examples +@section Interactive +@cindex Interactive +@cindex functions (interactive) + +Htmlfontify provides the following interactive functions: + +@table @code +@item htmlfontify-buffer +@findex htmlfontify-buffer +@anchor{htmlfontify-buffer} + +@lisp + +(htmlfontify-buffer &optional @var{srcdir} @var{file}) +@end lisp + +Create a new buffer, named for the current buffer + a .html extension, +containing an inline css-stylesheet and formatted css-markup html that +reproduces the look of the current emacs buffer as closely as possible. + +``Dangerous'' characters in the existing buffer are turned into html +entities, so you should even be able to do html-within-html fontified +display. + +You should, however, note that random control or eight-bit characters +such as ^L (\x0c) or ¤ (\xa4) won't get mapped yet. + +If the @var{srcdir} and @var{file} arguments are set, lookup etags +derived entries in the @ref{hfy-tags-cache} and add html anchors +and hyperlinks as appropriate. + +@item htmlfontify-run-etags +@findex htmlfontify-run-etags +@anchor{htmlfontify-run-etags} + +@lisp + +(htmlfontify-run-etags @var{srcdir}) +@end lisp + +Load the etags cache for @var{srcdir}. See @ref{hfy-load-tags-cache}. + +@item htmlfontify-copy-and-link-dir +@findex htmlfontify-copy-and-link-dir +@anchor{htmlfontify-copy-and-link-dir} + +@lisp + +(htmlfontify-copy-and-link-dir @var{srcdir} @var{dstdir} &optional @var{f-ext} @var{l-ext}) +@end lisp + +Trawl @var{srcdir} and write fontified-and-hyperlinked output in +@var{dstdir} @var{f-ext} and @var{l-ext} specify values for +@ref{hfy-extn} and @ref{hfy-link-extn}. + +You may also want to set @ref{hfy-page-header} and @ref{hfy-page-footer}. + +@item htmlfontify-load-rgb-file +@findex htmlfontify-load-rgb-file +@anchor{htmlfontify-load-rgb-file} + +@lisp + +(htmlfontify-load-rgb-file &optional @var{file}) +@end lisp + +Load an X11 style rgb.txt file (search @code{hfy-rgb-load-path} if +@var{file} is not specified). + +Note that this is not necessary if all you want is the standard X11 +(XFree86 4.1.0) colour name -> rgb triplet mapping, htmlfontify has +a copy built in, for use when it cannot contact an X server. + +Loads the variable @code{hfy-rgb-txt-colour-map}, which is used by +@ref{hfy-fallback-colour-values}. + +@item htmlfontify-unload-rgb-file +@findex htmlfontify-unload-rgb-file +@anchor{htmlfontify-unload-rgb-file} + +@lisp + +(htmlfontify-unload-rgb-file) +@end lisp + +Unload the currently loaded X11 style rgb.txt file ( if any ). +@end table + +@node Non-interactive, Variables, Interactive, Usage & Examples +@section Non-interactive +@cindex Noninteractive +@cindex functions (noninteractive) + +In addition to the aforementioned interactive methods, htmlfontify +provides the following non-interactive ones: + +@table @code +@comment AUTOGENERATED BLOCK + +@item hfy-face-to-style +@findex hfy-face-to-style +@anchor{hfy-face-to-style} + +@lisp + +(hfy-face-to-style @var{fn}) +@end lisp + +Take @var{fn}, a font or @code{defface} style font specification, +(as returned by @code{face-attr-construct} or @ref{hfy-face-attr-for-class}) +and return a @ref{hfy-style-assoc}. + +See also: @ref{hfy-face-to-style-i}, @ref{hfy-flatten-style}. + +@item hfy-fallback-colour-values +@findex hfy-fallback-colour-values +@anchor{hfy-fallback-colour-values} + +@lisp + +(hfy-fallback-colour-values @var{colour-string}) +@end lisp + +Use a fallback method for obtaining the rgb values for a colour. +If @ref{htmlfontify-load-rgb-file} has been called, it uses the +colour map specified, otherwise it uses htmlfontify's built in map. + +@item hfy-combined-face-spec +@findex hfy-combined-face-spec +@anchor{hfy-combined-face-spec} + +@lisp + +(hfy-combined-face-spec @var{face}) +@end lisp + +Return a @code{defface} style alist of possible specifications for +@var{face}, with any entries resulting from user customisation +(@code{custom-set-faces}) taking precedence. + +See also: @ref{hfy-default-face-def} + +@item hfy-word-regex +@findex hfy-word-regex +@anchor{hfy-word-regex} + +@lisp + +(hfy-word-regex @var{string}) +@end lisp + +Return a regex that matches @var{string} as the first @code{match-string}, +with non word characters on either side (vaguely emulating the perl @code{\b} +regex atom). + +@item hfy-force-fontification +@findex hfy-force-fontification +@anchor{hfy-force-fontification} + +@lisp + +(hfy-force-fontification) +@end lisp + +Emacs' fontification is designed for interactive use. As such, it sometimes +does things like deferring fontification until a section of the buffer is +exposed and rendered, or until emacs is idle for a while. Sometimes, in +non-interactive circumstances, or if it can't see X, it doesn't bother +with some of the harder stuff. While this is all great from the perspective +of a user waiting for emacs to load a 20000 line file and colourise it, +it's a pain from the point of view from non-interactive code. This function +lies, cheats, steals and generally bullies emacs into fontifying a buffer +from start to finish, with all the extra frills, whether it thinks it nneds +to or not. Oh yes: it operates on the current buffer. + +@item hfy-link-style-string +@findex hfy-link-style-string +@anchor{hfy-link-style-string} + +@lisp + +(hfy-link-style-string @var{style-string}) +@end lisp + +Replace the end of a css style declaration @var{style-string} with the contents +of the variable @ref{hfy-src-doc-link-style}, removing text matching the +regex @ref{hfy-src-doc-link-unstyle} first, if necessary. + + +@item hfy-prepare-index-i +@findex hfy-prepare-index-i +@anchor{hfy-prepare-index-i} + +@lisp + +(hfy-prepare-index-i @var{srcdir} @var{dstdir} @var{filename} &optional @var{stub} @var{map}) +@end lisp + +Prepare a tags index buffer for @var{srcdir}. +@ref{hfy-tags-cache} must already have an entry for @var{srcdir} for +this to work. @ref{hfy-page-header}, @ref{hfy-page-footer}, +@ref{hfy-link-extn} and @ref{hfy-extn} all play a part here. + +If @var{stub} is set, prepare an (appropriately named) index buffer +specifically for entries beginning with @var{stub}. + +If @var{map} is set, use that instead of @ref{hfy-tags-cache}. + +@item hfy-compile-stylesheet +@findex hfy-compile-stylesheet +@anchor{hfy-compile-stylesheet} + +@lisp + +(hfy-compile-stylesheet) +@end lisp + +Trawl the current buffer, construct and return a @ref{hfy-sheet-assoc}. + +@item hfy-css-name +@findex hfy-css-name +@anchor{hfy-css-name} + +@lisp + +(hfy-css-name @var{fn}) +@end lisp + +Strip some of the boring bits from a font-name and return a css style +name. If @var{fn} is a @code{defface} attribute list, either construct +a name for it, store it in the cache, and return it, or just fetch it +from the cache if it's already there. + +@item hfy-make-directory +@findex hfy-make-directory +@anchor{hfy-make-directory} + +@lisp + +(hfy-make-directory @var{dir}) +@end lisp + +Approx equivalent of mkdir -p @var{dir} + +@item hfy-triplet +@findex hfy-triplet +@anchor{hfy-triplet} + +@lisp + +(hfy-triplet @var{colour}) +@end lisp + +Takes a colour name (string) and return a CSS rgb(R, G, B) triplet string. +Uses the definition of "white" to map the numbers to the 0-255 range, so +if you've redefined white, (esp if you've redefined it to have a triplet +member lower than that of the colour you are processing, strange things +may happen). + +@item hfy-default-footer +@findex hfy-default-footer +@anchor{hfy-default-footer} + +@lisp + +(hfy-default-footer @var{file}) +@end lisp + +Default value for @ref{hfy-page-footer} + +@item hfy-list-files +@findex hfy-list-files +@anchor{hfy-list-files} + +@lisp + +(hfy-list-files @var{directory}) +@end lisp + +Return a list of files under @var{directory}. +Strips any leading "./" from each filename. + +@item hfy-colour-vals +@findex hfy-colour-vals +@anchor{hfy-colour-vals} + +@lisp + +(hfy-colour-vals @var{colour}) +@end lisp + +Where @var{colour} is a colour name or #XXXXXX style triplet, return a list of +3 (16 bit) rgb values for said colour. If a window system is unavailable, +calls @ref{hfy-fallback-colour-values}. + +@item hfy-href-stub +@findex hfy-href-stub +@anchor{hfy-href-stub} + +@lisp + +(hfy-href-stub @var{this-file} @var{def-files} @var{tag}) +@end lisp + +Return an href stub for a tag href: if @var{def-files} (list of files +containing definitions for the tag in question) contains only one entry, +the href should link straight to that file. Otherwise, the link should +be to the index file. + +We are not yet concerned with the file extensions/tag line number and +so on at this point. + +If @ref{hfy-split-index} is set, and the href wil be to an index file +rather than a source file, append a .X to @ref{hfy-index-file}, where +X is the uppercased first character of @var{tag}. + +See also: @ref{hfy-relstub}, @ref{hfy-index-file}. + +@item hfy-line-number +@findex hfy-line-number +@anchor{hfy-line-number} + +@lisp + +(hfy-line-number) +@end lisp + +Returns the line number of the point in the current buffer. + +@item hfy-merge-adjacent-spans +@findex hfy-merge-adjacent-spans +@anchor{hfy-merge-adjacent-spans} + +@lisp + +(hfy-merge-adjacent-spans @var{face-map}) +@end lisp + +Where @var{face-map} is a @ref{hfy-facemap-assoc} for the current buffer, +this function merges adjacent style blocks which are of the same value +and are separated by nothing more interesting than whitespace. + +@code{narf brain} + +(as interpreted from @var{face-map}) would become: + +@code{narf brain} + +Returns a modified copy of @var{face-map} (also a @ref{hfy-facemap-assoc}). + +@item hfy-mark-tag-names +@findex hfy-mark-tag-names +@anchor{hfy-mark-tag-names} + +@lisp + +(hfy-mark-tag-names @var{srcdir} @var{file}) +@end lisp + +Mark tags in @var{file} (lookup @var{srcdir} in @ref{hfy-tags-cache}) with the +'hfy-anchor property, with a value of "tag.line-number". + +@item hfy-weight +@findex hfy-weight +@anchor{hfy-weight} + +@lisp + +(hfy-weight @var{weight}) +@end lisp + +Derive a font-weight css specifier from an emacs weight spec symbol. + +@item hfy-size +@findex hfy-size +@anchor{hfy-size} + +@lisp + +(hfy-size @var{height}) +@end lisp + +Derive a css font-size specifier from an emacs font :height attribute. +Does not cope with the case where height is a function to be applied to +the height of the underlying font. + +@item hfy-default-header +@findex hfy-default-header +@anchor{hfy-default-header} + +@lisp + +(hfy-default-header @var{file} @var{style}) +@end lisp + +Default value for @ref{hfy-page-header} + +@item hfy-family +@findex hfy-family +@anchor{hfy-family} + +@lisp + +(hfy-family @var{family}) +@end lisp + +Derives a css font-family specifier from an emacs :family attribute. + +@item hfy-mark-tag-hrefs +@findex hfy-mark-tag-hrefs +@anchor{hfy-mark-tag-hrefs} + +@lisp + +(hfy-mark-tag-hrefs @var{srcdir} @var{file}) +@end lisp + +Mark href start points with the 'hfy-link prop (value: href string) + +Mark href end points with the 'hfy-endl prop (value t) + +Avoid overlapping links, and mark links in descending length of +tag name in order to prevent subtags from usurping supertags, +(eg "term" for "terminal"). + +@item hfy-box +@findex hfy-box +@anchor{hfy-box} + +@lisp + +(hfy-box @var{box}) +@end lisp + +Derive CSS border-* attributes from the emacs :box attribute. + +@item hfy-box-to-style +@findex hfy-box-to-style +@anchor{hfy-box-to-style} + +@lisp + +(hfy-box-to-style @var{spec}) +@end lisp + +Convert a complex :box emacs font attribute set to a list of CSS border-* +attributes. Don't call this directly - it is called by @ref{hfy-box} +when necessary. + +@item hfy-html-enkludge-buffer +@findex hfy-html-enkludge-buffer +@anchor{hfy-html-enkludge-buffer} + +@lisp + +(hfy-html-enkludge-buffer) +@end lisp + +Mark dangerous ["<>] characters with the 'hfy-quoteme property. + +See also @ref{hfy-html-dekludge-buffer}. + +@item hfy-buffer +@findex hfy-buffer +@anchor{hfy-buffer} + +@lisp + +(hfy-buffer) +@end lisp + +Generate and return an htmlfontify html output buffer for the current +buffer. May trample an existing buffer. + +@item hfy-fontified-p +@findex hfy-fontified-p +@anchor{hfy-fontified-p} + +@lisp + +(hfy-fontified-p) +@end lisp + +@code{font-lock} doesn't like to say a buffer's been fontified when in +batch mode, but we want to know if we should fontify or raw copy, so in +batch mode we check for non-default face properties. Otherwise we test +@code{font-lock-mode} and @code{font-lock-fontified} for truth. + +@item hfy-lookup +@findex hfy-lookup +@anchor{hfy-lookup} + +@lisp + +(hfy-lookup @var{face} @var{style}) +@end lisp + +Where @var{style} is a @ref{hfy-sheet-assoc} and @var{face} is an emacs face, +return the relevant @var{css} style name. + +@item hfy-fontify-buffer +@findex hfy-fontify-buffer +@anchor{hfy-fontify-buffer} + +@lisp + +(hfy-fontify-buffer &optional @var{srcdir} @var{file}) +@end lisp + +Implement the guts of @ref{htmlfontify-buffer} + +@item hfy-colour +@findex hfy-colour +@anchor{hfy-colour} + +@lisp + +(hfy-colour @var{colour}) +@end lisp + +Convert an emacs :foreground property to a CSS colour property. + +@item hfy-flatten-style +@findex hfy-flatten-style +@anchor{hfy-flatten-style} + +@lisp + +(hfy-flatten-style @var{style}) +@end lisp + +Take @var{style} (see @ref{hfy-face-to-style-i}, @ref{hfy-face-to-style}) +and merge any multiple attributes appropriately. Currently only font-size is +merged down to a single occurrence - others may need special handling, but I +haven't encountered them yet. Returns a @ref{hfy-style-assoc}. + +@item hfy-size-to-int +@findex hfy-size-to-int +@anchor{hfy-size-to-int} + +@lisp + +(hfy-size-to-int @var{spec}) +@end lisp + +Convert @var{spec}, a css font-size specifier, back to an emacs :height attribute +value. Used while merging multiple font-size attributes. + +@item hfy-sprintf-stylesheet +@findex hfy-sprintf-stylesheet +@anchor{hfy-sprintf-stylesheet} + +@lisp + +(hfy-sprintf-stylesheet @var{css} @var{file}) +@end lisp + +Generates a header, via @ref{hfy-page-header}, for @var{file}, containing the +stylesheet derived from @var{css}, which is a @ref{hfy-sheet-assoc}. Returns a +string containing the same. + +@item hfy-relstub +@findex hfy-relstub +@anchor{hfy-relstub} + +@lisp + +(hfy-relstub @var{file} &optional @var{start}) +@end lisp + +Return a "../" stub of the appropriate length for the current source +tree depth (as determined from @var{file}). iyswim. + +@item hfy-compile-face-map +@findex hfy-compile-face-map +@anchor{hfy-compile-face-map} + +@lisp + +(hfy-compile-face-map) +@end lisp + +Compile and return a @ref{hfy-facemap-assoc} for the current buffer. + +@item hfy-prepare-index +@findex hfy-prepare-index +@anchor{hfy-prepare-index} + +@lisp + +(hfy-prepare-index @var{srcdir} @var{dstdir}) +@end lisp + +Return as list of index buffer(s), as determined by @ref{hfy-split-index}. +Uses @ref{hfy-prepare-index-i} to do this. + +@item hfy-prepare-tag-map +@findex hfy-prepare-tag-map +@anchor{hfy-prepare-tag-map} + +@lisp + +(hfy-prepare-tag-map @var{srcdir} @var{dstdir}) +@end lisp + +Prepare the counterpart(s) to the index buffer(s) - a list of buffers with +the same structure, but listing ( and linking to ) instances of tags ( as +opposed to their definitions ). + +See also: @ref{hfy-prepare-index}, @ref{hfy-split-index} + +@item hfy-subtract-maps +@findex hfy-subtract-maps +@anchor{hfy-subtract-maps} + +@lisp + +(hfy-subtract-maps @var{srcdir}) +@end lisp + +Internal function - strips definitions of tags from the instance map. +See: @ref{hfy-tags-cache} and @ref{hfy-tags-rmap} + +@item hfy-face-to-style-i +@findex hfy-face-to-style-i +@anchor{hfy-face-to-style-i} + +@lisp + +(hfy-face-to-style-i @var{fn}) +@end lisp + +The guts of @ref{hfy-face-to-style}: @var{fn} should be a @code{defface} +font specification, as returned by @code{face-attr-construct} or +@ref{hfy-face-attr-for-class}. Note that this function does not get +font-sizes right if they are based on inherited modifiers (via the +:inherit) attribute, and any other modifiers that are cumulative if they +appear multiple times need to be merged by the user - @ref{hfy-flatten-style} +should do this. + +@item hfy-face-to-css +@findex hfy-face-to-css +@anchor{hfy-face-to-css} + +@lisp + +(hfy-face-to-css @var{fn}) +@end lisp + +Take @var{fn}, a font or @code{defface} specification (cf. +@code{face-attr-construct}) and return a CSS style specification. + +See also: @ref{hfy-face-to-style} + +@item hfy-html-quote +@findex hfy-html-quote +@anchor{hfy-html-quote} + +@lisp + +(hfy-html-quote @var{char-string}) +@end lisp + +Map a string (usu. 1 char long) to an html safe string (entity) if need be. + +@item hfy-link-style +@findex hfy-link-style +@anchor{hfy-link-style} + +@lisp + +(hfy-link-style @var{style-string}) +@end lisp + +Convert the CSS style spec @var{style-string} to it's equivalent +hyperlink style. + +See: @ref{hfy-link-style-fun}. + +@item hfy-p-to-face +@findex hfy-p-to-face +@anchor{hfy-p-to-face} + +@lisp + +(hfy-p-to-face @var{props}) +@end lisp + +Given @var{props}, a list of text-properties, return the value of the +face property, or nil. + +@item hfy-box-to-border-assoc +@findex hfy-box-to-border-assoc +@anchor{hfy-box-to-border-assoc} + +@lisp + +(hfy-box-to-border-assoc @var{spec}) +@end lisp + +Helper function for @ref{hfy-box-to-style}. + +@item hfy-face-attr-for-class +@findex hfy-face-attr-for-class +@anchor{hfy-face-attr-for-class} + +@lisp + +(hfy-face-attr-for-class @var{face} &optional @var{class}) +@end lisp + +Return the face attributes for @var{face}. If @var{class} is set, it +must be a @code{defface} alist key [see below]. Prior to version 0.18, +the first face specification returned by @ref{hfy-combined-face-spec} +which @emph{didn't} clash with @var{class} was returned. In versions +from 0.18 onwards, each font attribute list is scored, and the +non-conflicting list with the highest score is returned. ( A specification +with a class of @code{t} is considered to match any class you specify: +This matches emacs' behaviour when deciding on which face attributes to +use, to the best of my understanding ). + +If @var{class} is nil, then you just get get whatever +@code{face-attr-construct} returns, ie the current specification in +effect for @var{face}. + +See @ref{hfy-display-class} for details of valid values for @var{class}. + +@item hfy-face-at +@findex hfy-face-at +@anchor{hfy-face-at} + +@lisp + +(hfy-face-at P) +@end lisp + +Find face in effect at point P. If overlays are to be considered +(see @ref{hfy-optimisations}) then this may return a @code{defface} style +list of face properties instead of a face symbol. + +@item hfy-bgcol +@findex hfy-bgcol +@anchor{hfy-bgcol} + +@lisp + +(hfy-bgcol @var{colour}) +@end lisp + +As per @ref{hfy-colour} but for background colours. + +@item hfy-kludge-cperl-mode +@findex hfy-kludge-cperl-mode +@anchor{hfy-kludge-cperl-mode} + +@lisp + +(hfy-kludge-cperl-mode) +@end lisp + +cperl mode does its damndest not to do some of its fontification when not +in a windowing system - we try to trick it... + +@item hfy-href +@findex hfy-href +@anchor{hfy-href} + +@lisp + +(hfy-href @var{this-file} @var{def-files} @var{tag} @var{tag-map}) +@end lisp + +Return a relative href to the tag in question, based on + +@var{this-file} @ref{hfy-link-extn} @ref{hfy-extn} @var{def-files} @var{tag} and @var{tag-map} + +@var{this-file} is the current source file +@var{def-files} is a list of file containing possible link endpoints for @var{tag} +@var{tag} is the @var{tag} in question +@var{tag-map} is the entry in @ref{hfy-tags-cache}. + +@item hfy-shell +@findex hfy-shell +@anchor{hfy-shell} + +@lisp + +(hfy-shell) +@end lisp + +Returns a best guess at a bourne compatible shell to use: If the current +shell doesn't look promising, fall back to @ref{hfy-shell-file-name}. + +@item hfy-load-tags-cache +@findex hfy-load-tags-cache +@anchor{hfy-load-tags-cache} + +@lisp + +(hfy-load-tags-cache @var{srcdir}) +@end lisp + +Run @ref{hfy-etags-cmd} on @var{srcdir}: load @ref{hfy-tags-cache} and @ref{hfy-tags-sortl}. + +@item hfy-parse-tags-buffer +@findex hfy-parse-tags-buffer +@anchor{hfy-parse-tags-buffer} + +@lisp + +(hfy-parse-tags-buffer @var{srcdir} @var{buffer}) +@end lisp + +Parse a @var{buffer} containing etags formatted output, loading the +@ref{hfy-tags-cache} and @ref{hfy-tags-sortl} entries for @var{srcdir}. + +@item hfy-interq +@findex hfy-interq +@anchor{hfy-interq} + +@lisp + +(hfy-interq @var{set-a} @var{set-b}) +@end lisp + +Return the intersection ( using @code{eq} ) of 2 lists. + +@item hfy-text-p +@findex hfy-text-p +@anchor{hfy-text-p} + +@lisp + +(hfy-text-p @var{srcdir} @var{file}) +@end lisp + +Is @var{srcdir}/@var{file} text? Uses @ref{hfy-istext-command} to determine this. + +@item hfy-opt +@findex hfy-opt +@anchor{hfy-opt} + +@lisp + +(hfy-opt @var{symbol}) +@end lisp + +Is @ref{hfy-optimisations} member @var{symbol} set or not? + +@item hfy-dirname +@findex hfy-dirname +@anchor{hfy-dirname} + +@lisp + +(hfy-dirname @var{file}) +@end lisp + +Return everything preceding the last "/" from a relative filename, +on the assumption that this will produce a relative directory name. Hardly +bombproof, but good enough in the context in which it is being used. + +@item hfy-html-dekludge-buffer +@findex hfy-html-dekludge-buffer +@anchor{hfy-html-dekludge-buffer} + +@lisp + +(hfy-html-dekludge-buffer) +@end lisp + +Transform all dangerous characters marked with the 'hfy-quoteme property +using @ref{hfy-html-quote} + +See also @ref{hfy-html-enkludge-buffer}. + +@item hfy-copy-and-fontify-file +@findex hfy-copy-and-fontify-file +@anchor{hfy-copy-and-fontify-file} + +@lisp + +(hfy-copy-and-fontify-file @var{srcdir} @var{dstdir} @var{file}) +@end lisp + +open @var{file} in @var{srcdir} - if fontified, write a fontified copy to @var{dstdir} +adding an extension of @ref{hfy-extn}. Fontification is actually done by +@ref{htmlfontify-buffer}. If the buffer is not fontified, just copy it. + +@item hfy-decor +@findex hfy-decor +@anchor{hfy-decor} + +@lisp + +(hfy-decor @var{tag} @var{val}) +@end lisp + +Derive CSS text-decoration specifiers from various emacs font attributes. + +@item hfy-slant +@findex hfy-slant +@anchor{hfy-slant} + +@lisp + +(hfy-slant @var{slant}) +@end lisp + +Derive a font-style css specifier from the emacs :slant attribute - +CSS does not define the reverse-* styles, so just maps those to the +regular specifiers. + +@item hfy-tags-for-file +@findex hfy-tags-for-file +@anchor{hfy-tags-for-file} + +@lisp + +(hfy-tags-for-file @var{srcdir} @var{file}) +@end lisp + +List of etags tags that have definitions in this @var{file}. Looks up +the tags cache in @ref{hfy-tags-cache} using @var{srcdir} as the key. + +@item hfy-width +@findex hfy-width +@anchor{hfy-width} + +@lisp + +(hfy-width @var{width}) +@end lisp + +Convert an emacs :width attribute to a CSS font-stretch attribute. + +@comment /AUTOGENERATED BLOCK +@end table + +@node Variables, Data Structures, Non-interactive, Usage & Examples +@section Variables +@cindex variables + +Important variables which are not customisation items: + +@table @code + +@item hfy-tags-cache +@vindex hfy-tags-cache +@anchor{hfy-tags-cache} + +This is an alist of the form: + +@example +(("/src/dir/0" . tag-hash0) ("/src/dir/1" tag-hash1) ...) +@end example + +Each tag hash entry then contains entries of the form: + +@example +"tag_string" => (("file/name.ext" line char) ... ) +@end example + +ie an alist mapping (relative) file paths to line and character offsets. + +See @ref{hfy-load-tags-cache}. + +@item hfy-tags-rmap +@vindex hfy-tags-rmap +@anchor{hfy-tags-rmap} + +@code{hfy-tags-rmap} is an alist of the form: + +@lisp +(("/src/dir" . tag-rmap-hash)) +@end lisp + +Where tag-rmap-hash has entries of the form: + +@example +"tag_string" => ( "file/name.ext" line char ) +@end example + +Unlike @ref{hfy-tags-cache} these are the locations of occurrences of +tagged items, not the locations of their definitions. + +@item hfy-tags-sortl +@vindex hfy-tags-sortl +@anchor{hfy-tags-sortl} + +@code{hfy-tags-sortl} is an alist of the form: + +@example +(("/src/dir" . (tag0 tag1 tag2)) ... ) +@end example + +Where the tags are stored in descending order of length. + +See: @ref{hfy-load-tags-cache}. + +@end table + +@node Data Structures, Examples, Variables, Usage & Examples +@section Data Structures +@cindex Data Structures + +Some of the (informal) data structures used in Htmlfontify are detailed here: + +@table @code + +@item hfy-style-assoc +@cindex hfy-style-assoc +@anchor{hfy-style-assoc} + +An assoc representing/describing an emacs face. Properties may be repeated, +In which case later properties should be treated as if they were inherited +from a 'parent' font. (For some properties, only the first encountered value +is of any importance, for others the values might be cumulative, and for +others they might be cumulative in a complex way). + +Some examples: + +@lisp +(hfy-face-to-style 'default) => + + (("background" . "rgb(0, 0, 0)" ) + ("color" . "rgb(255, 255, 255)") + ("font-style" . "normal" ) + ("font-weight" . "500" ) + ("font-stretch" . "normal" ) + ("font-family" . "misc-fixed" ) + ("font-size" . "13pt" ) + ("text-decoration" . "none" )) + +(hfy-face-to-style 'Info-title-3-face) => + + (("font-weight" . "700" ) + ("font-family" . "helv" ) + ("font-size" . "120%" ) + ("text-decoration" . "none") ) +@end lisp + +@item hfy-sheet-assoc +@cindex hfy-sheet-assoc +@anchor{hfy-sheet-assoc} + +An assoc with elements of the form (face-name style-name . stlye-string): +The actual stylesheet for each page is derived from one of these. + +@lisp +'((default "default" . "@{ background: black; color: white@}") + (font-lock-string-face "string" . "@{ color: rgb(64,224,208) @}")) +@end lisp + +@item hfy-facemap-assoc +@cindex hfy-facemap-assoc +@anchor{hfy-facemap-assoc} + +An assoc of (point . @var{face-symbol}) or +(point . @code{defface} attribute list) and (point . 'end) elements, in +descending order of point value (ie from the file's end to its beginning). +The map is in reverse order because inserting a text to embed in the document- the string returned will +be used as the header for the htmlfontified version of the source file. + +See also: @ref{hfy-page-footer} + +@item hfy-src-doc-link-style +@vindex hfy-src-doc-link-style +@anchor{hfy-src-doc-link-style} + +String to add to the ' text to embed in the document- the string returned will -be used as the header for the htmlfontified version of the source file. +the @samp{} text to embed in the document---the string +returned will be used as the header for the htmlfontified version of +the source file. See also: @ref{hfy-page-footer} @@ -1338,7 +1338,7 @@ See also: @ref{hfy-page-footer} @vindex hfy-src-doc-link-style @anchor{hfy-src-doc-link-style} -String to add to the '