aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-01-05 00:04:41 +0100
committerJoakim Verona2013-01-05 00:04:41 +0100
commitb18e01b65e651d3b626b4edcaaa2aa636fe25b69 (patch)
tree2832e227a4c45d3a4d423f972df29fb7f8616b14
parent55b74b54b179f340bdb311070273f26da3fbd0c9 (diff)
parent1bd71e9fe16541bc48868a00ff372018961380b0 (diff)
downloademacs-b18e01b65e651d3b626b4edcaaa2aa636fe25b69.tar.gz
emacs-b18e01b65e651d3b626b4edcaaa2aa636fe25b69.zip
auto upstream
-rw-r--r--ChangeLog15
-rw-r--r--autogen/Makefile.in17
-rw-r--r--doc/lispref/ChangeLog8
-rw-r--r--doc/lispref/files.texi2
-rw-r--r--doc/lispref/hash.texi2
-rw-r--r--doc/misc/ChangeLog16
-rw-r--r--doc/misc/Makefile.in13
-rw-r--r--doc/misc/htmlfontify.texi1609
-rw-r--r--doc/misc/makefile.w32-in13
-rw-r--r--info/dir1
-rw-r--r--lib/gnulib.mk1
-rw-r--r--lib/stdio.c3
-rw-r--r--lib/stdio.in.h27
-rw-r--r--lib/strftime.c11
-rw-r--r--lisp/ChangeLog58
-rw-r--r--lisp/doc-view.el20
-rw-r--r--lisp/epg.el13
-rw-r--r--lisp/erc/ChangeLog4
-rw-r--r--lisp/erc/erc-backend.el4
-rw-r--r--lisp/files.el3
-rw-r--r--lisp/icomplete.el10
-rw-r--r--lisp/net/tramp-sh.el28
-rw-r--r--lisp/progmodes/etags.el11
-rw-r--r--lisp/subr.el4
-rw-r--r--lisp/term.el18
-rw-r--r--lisp/view.el34
-rw-r--r--m4/gnulib-comp.m41
-rw-r--r--src/ChangeLog18
-rw-r--r--src/fileio.c8
-rw-r--r--src/fns.c2
-rw-r--r--src/nsterm.m13
-rw-r--r--src/w32term.c7
-rw-r--r--src/xterm.c7
-rwxr-xr-xtest/indent/shell.sh12
34 files changed, 1886 insertions, 127 deletions
diff --git a/ChangeLog b/ChangeLog
index d56d74b20db..a6d5148c777 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
12013-01-04 Glenn Morris <rgm@gnu.org>
2
3 * info/dir: Add htmlfontify.
4
52013-01-04 Paul Eggert <eggert@cs.ucla.edu>
6
7 Merge from gnulib, incorporating:
8 2013-01-04 stdio: remove now-unnecessary stdio.c
9 2013-01-04 fprintftime: depend on stdio, not ignore-value
10 2013-01-04 fwrite: silence __wur only for older glibc versions
11 2013-01-04 fwrite: silence __wur without using inline
12 * lib/stdio.c: Remove.
13 * lib/stdio.in.h, lib/strftime.c: Update from gnulib.
14 * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
15
12013-01-02 Paul Eggert <eggert@cs.ucla.edu> 162013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2 17
3 Merge from gnulib, incorporating copyright-date changes and: 18 Merge from gnulib, incorporating copyright-date changes and:
diff --git a/autogen/Makefile.in b/autogen/Makefile.in
index 25c816c953e..4e20c48e651 100644
--- a/autogen/Makefile.in
+++ b/autogen/Makefile.in
@@ -119,8 +119,8 @@ am__libgnu_a_SOURCES_DIST = allocator.c c-ctype.h c-ctype.c \
119 c-strcase.h c-strcasecmp.c c-strncasecmp.c careadlinkat.c \ 119 c-strcase.h c-strcasecmp.c c-strncasecmp.c careadlinkat.c \
120 close-stream.c md5.c sha1.c sha256.c sha512.c dtoastr.c \ 120 close-stream.c md5.c sha1.c sha256.c sha512.c dtoastr.c \
121 dtotimespec.c filemode.c gettext.h gettime.c stat-time.c \ 121 dtotimespec.c filemode.c gettext.h gettime.c stat-time.c \
122 stdio.c strftime.c timespec.c timespec-add.c timespec-sub.c \ 122 strftime.c timespec.c timespec-add.c timespec-sub.c u64.c \
123 u64.c unistd.c utimens.c 123 unistd.c utimens.c
124am__objects_1 = 124am__objects_1 =
125am_libgnu_a_OBJECTS = allocator.$(OBJEXT) c-ctype.$(OBJEXT) \ 125am_libgnu_a_OBJECTS = allocator.$(OBJEXT) c-ctype.$(OBJEXT) \
126 c-strcasecmp.$(OBJEXT) c-strncasecmp.$(OBJEXT) \ 126 c-strcasecmp.$(OBJEXT) c-strncasecmp.$(OBJEXT) \
@@ -128,9 +128,9 @@ am_libgnu_a_OBJECTS = allocator.$(OBJEXT) c-ctype.$(OBJEXT) \
128 sha1.$(OBJEXT) sha256.$(OBJEXT) sha512.$(OBJEXT) \ 128 sha1.$(OBJEXT) sha256.$(OBJEXT) sha512.$(OBJEXT) \
129 dtoastr.$(OBJEXT) dtotimespec.$(OBJEXT) filemode.$(OBJEXT) \ 129 dtoastr.$(OBJEXT) dtotimespec.$(OBJEXT) filemode.$(OBJEXT) \
130 $(am__objects_1) gettime.$(OBJEXT) stat-time.$(OBJEXT) \ 130 $(am__objects_1) gettime.$(OBJEXT) stat-time.$(OBJEXT) \
131 stdio.$(OBJEXT) strftime.$(OBJEXT) timespec.$(OBJEXT) \ 131 strftime.$(OBJEXT) timespec.$(OBJEXT) timespec-add.$(OBJEXT) \
132 timespec-add.$(OBJEXT) timespec-sub.$(OBJEXT) u64.$(OBJEXT) \ 132 timespec-sub.$(OBJEXT) u64.$(OBJEXT) unistd.$(OBJEXT) \
133 unistd.$(OBJEXT) utimens.$(OBJEXT) 133 utimens.$(OBJEXT)
134libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS) 134libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS)
135depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp 135depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
136am__depfiles_maybe = depfiles 136am__depfiles_maybe = depfiles
@@ -920,9 +920,9 @@ DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src
920libgnu_a_SOURCES = allocator.c c-ctype.h c-ctype.c c-strcase.h \ 920libgnu_a_SOURCES = allocator.c c-ctype.h c-ctype.c c-strcase.h \
921 c-strcasecmp.c c-strncasecmp.c careadlinkat.c close-stream.c \ 921 c-strcasecmp.c c-strncasecmp.c careadlinkat.c close-stream.c \
922 md5.c sha1.c sha256.c sha512.c dtoastr.c dtotimespec.c \ 922 md5.c sha1.c sha256.c sha512.c dtoastr.c dtotimespec.c \
923 filemode.c $(am__append_1) gettime.c stat-time.c stdio.c \ 923 filemode.c $(am__append_1) gettime.c stat-time.c strftime.c \
924 strftime.c timespec.c timespec-add.c timespec-sub.c u64.c \ 924 timespec.c timespec-add.c timespec-sub.c u64.c unistd.c \
925 unistd.c utimens.c 925 utimens.c
926libgnu_a_LIBADD = $(gl_LIBOBJS) 926libgnu_a_LIBADD = $(gl_LIBOBJS)
927libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) 927libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
928EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c euidaccess.c execinfo.c \ 928EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c euidaccess.c execinfo.c \
@@ -1025,7 +1025,6 @@ distclean-compile:
1025@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig2str.Po@am__quote@ 1025@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig2str.Po@am__quote@
1026@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-time.Po@am__quote@ 1026@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-time.Po@am__quote@
1027@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ 1027@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
1028@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Po@am__quote@
1029@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@ 1028@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@
1030@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoimax.Po@am__quote@ 1029@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoimax.Po@am__quote@
1031@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol.Po@am__quote@ 1030@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol.Po@am__quote@
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 4815ac2a482..e701f61c6b0 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,11 @@
12013-01-04 Ari Roponen <ari.roponen@gmail.com> (tiny change)
2
3 * hash.texi (Defining Hash): Fix typo. (Bug#13345)
4
52013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
6
7 * files.texi (File Attributes): Undocument return format of file-acl.
8
12013-01-03 Glenn Morris <rgm@gnu.org> 92013-01-03 Glenn Morris <rgm@gnu.org>
2 10
3 * processes.texi (System Processes): 11 * 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.
1363 1363
1364@defun file-acl filename 1364@defun file-acl filename
1365This function returns the ACL entries of the file @var{filename}. The 1365This function returns the ACL entries of the file @var{filename}. The
1366return value is a platform-dependent string containing the textual 1366return value is a platform-dependent object containing some
1367representation of the ACL entries. Don't use it for anything except 1367representation of the ACL entries. Don't use it for anything except
1368passing it to the @code{set-file-acl} function (@pxref{Changing Files, 1368passing it to the @code{set-file-acl} function (@pxref{Changing Files,
1369set-file-acl}). 1369set-file-acl}).
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.
293 293
294@example 294@example
295(defun case-fold-string= (a b) 295(defun case-fold-string= (a b)
296 (compare-strings a nil nil b nil nil t)) 296 (eq t (compare-strings a nil nil b nil nil t)))
297(defun case-fold-string-hash (a) 297(defun case-fold-string-hash (a)
298 (sxhash (upcase a))) 298 (sxhash (upcase a)))
299 299
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index f902ca511f1..b0c39ce8507 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,19 @@
12013-01-04 Glenn Morris <rgm@gnu.org>
2
3 * Makefile.in (INFO_TARGETS, DVI_TARGETS, PDF_TARGETS):
4 Add htmlfontify.
5 (htmlfontify, $(buildinfodir)/htmlfontify$(INFO_EXT))
6 (htmlfontify.dvi, htmlfontify.pdf): New targets.
7 * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add htmlfontify.
8 ($(infodir)/htmlfontify$(INFO_EXT), htmlfontify.dvi): New targets.
9
10 * htmlfontify.texi: Miscellaneous fixes and updates.
11 Set copyright to FSF, update license to GFDL 1.3+.
12
132013-01-04 Vivek Dasmohapatra <vivek@etla.org>
14
15 * htmlfontify.texi: New file.
16
12013-01-02 Jay Belanger <jay.p.belanger@gmail.com> 172013-01-02 Jay Belanger <jay.p.belanger@gmail.com>
2 18
3 * calc.texi (Free-Form Dates): Expand on the date reading 19 * calc.texi (Free-Form Dates): Expand on the date reading
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index edfef9cbb5b..3dac35aafee 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -43,7 +43,7 @@ MAKEINFO_OPTS = --force -I$(emacsdir)
43INFO_TARGETS = ada-mode auth autotype bovine calc ccmode cl \ 43INFO_TARGETS = ada-mode auth autotype bovine calc ccmode cl \
44 dbus dired-x ebrowse ede ediff edt eieio \ 44 dbus dired-x ebrowse ede ediff edt eieio \
45 emacs-mime epa erc ert eshell eudc efaq \ 45 emacs-mime epa erc ert eshell eudc efaq \
46 flymake forms gnus emacs-gnutls idlwave info.info \ 46 flymake forms gnus emacs-gnutls htmlfontify idlwave info.info \
47 mairix-el message mh-e newsticker nxml-mode \ 47 mairix-el message mh-e newsticker nxml-mode \
48 org pcl-cvs pgg rcirc remember reftex sasl \ 48 org pcl-cvs pgg rcirc remember reftex sasl \
49 sc semantic ses sieve smtpmail speedbar srecode tramp \ 49 sc semantic ses sieve smtpmail speedbar srecode tramp \
@@ -75,6 +75,7 @@ DVI_TARGETS = \
75 forms.dvi \ 75 forms.dvi \
76 gnus.dvi \ 76 gnus.dvi \
77 emacs-gnutls.dvi \ 77 emacs-gnutls.dvi \
78 htmlfontify.dvi \
78 idlwave.dvi \ 79 idlwave.dvi \
79 info.dvi \ 80 info.dvi \
80 mairix-el.dvi \ 81 mairix-el.dvi \
@@ -129,6 +130,7 @@ PDF_TARGETS = \
129 flymake.pdf \ 130 flymake.pdf \
130 forms.pdf \ 131 forms.pdf \
131 gnus.pdf \ 132 gnus.pdf \
133 htmlfontify.pdf \
132 emacs-gnutls.pdf \ 134 emacs-gnutls.pdf \
133 idlwave.pdf \ 135 idlwave.pdf \
134 info.pdf \ 136 info.pdf \
@@ -440,6 +442,15 @@ gnus.pdf: ${srcdir}/gnus.texi ${srcdir}/gnus-faq.texi ${gfdl}
440 cp gnustmp.pdf $@ 442 cp gnustmp.pdf $@
441 rm gnustmp.* 443 rm gnustmp.*
442 444
445htmlfontify : $(buildinfodir)/htmlfontify$(INFO_EXT)
446$(buildinfodir)/htmlfontify$(INFO_EXT): ${srcdir}/htmlfontify.texi ${gfdl}
447 $(mkinfodir)
448 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/htmlfontify.texi
449htmlfontify.dvi: ${srcdir}/htmlfontify.texi ${gfdl}
450 $(ENVADD) $(TEXI2DVI) ${srcdir}/htmlfontify.texi
451htmlfontify.pdf: ${srcdir}/htmlfontify.texi ${gfdl}
452 $(ENVADD) $(TEXI2PDF) ${srcdir}/htmlfontify.texi
453
443# NB this one needs --no-split even without a .info extension. 454# NB this one needs --no-split even without a .info extension.
444idlwave : $(buildinfodir)/idlwave$(INFO_EXT) 455idlwave : $(buildinfodir)/idlwave$(INFO_EXT)
445$(buildinfodir)/idlwave$(INFO_EXT): ${srcdir}/idlwave.texi ${gfdl} 456$(buildinfodir)/idlwave$(INFO_EXT): ${srcdir}/idlwave.texi ${gfdl}
diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi
new file mode 100644
index 00000000000..d6904740778
--- /dev/null
+++ b/doc/misc/htmlfontify.texi
@@ -0,0 +1,1609 @@
1\input texinfo
2@comment %**start of header
3@setfilename ../../info/htmlfontify
4@settitle Htmlfontify User Manual
5@exampleindent 2
6@comment %**end of header
7
8@copying
9This manual documents Htmlfontify, a source code -> crosslinked +
10formatted + syntax colorised html transformer.
11
12Copyright @copyright{} 2002, 2003, 2013 Free Software Foundation, Inc.
13
14@quotation
15Permission is granted to copy, distribute and/or modify this document
16under the terms of the GNU Free Documentation License, Version 1.3 or
17any later version published by the Free Software Foundation; with no
18Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
19and with the Back-Cover Texts as in (a) below. A copy of the license
20is included in the section entitled ``GNU Free Documentation License''.
21
22(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
23modify this GNU manual.''
24@end quotation
25@end copying
26
27@dircategory Emacs misc features
28@direntry
29* Htmlfontify: (htmlfontify). Convert source code to html.
30@end direntry
31
32@titlepage
33@title Htmlfontify User Manual
34@sp 4
35@subtitle Htmlfontify version 0.20
36@sp 1
37@subtitle Jun 2002
38@sp 5
39@author Vivek Dasmohapatra
40@page
41
42@vskip 0pt plus 1filll
43@noindent
44@insertcopying
45@end titlepage
46
47@contents
48
49@ifnottex
50@node Top
51@top Htmlfontify
52
53@insertcopying
54@end ifnottex
55
56@menu
57* Introduction:: About Htmlfontify.
58* Usage & Examples:: How to use Htmlfontify.
59* Customisation:: Fine-tuning Htmlfontify's behaviour.
60* Requirements:: External programs used by Htmlfontify.
61* GNU Free Documentation License:: The license for this documentation.
62* Index:: Index of contents.
63@end menu
64
65@node Introduction
66@chapter Introduction
67@cindex Introduction
68
69Htmlfontify provides a means of converting individual Emacs buffers,
70source files, or entire source trees to html, preserving formatting
71and Emacs colorisation / syntax highlighting as much as possible
72through careful application of CSS stylesheets and html tags.
73
74It can also turn instances of functions, methods and (for some
75languages) variables and other constructs and items into links
76to their definitions, and create an index file (or files) of
77all such symbols, also linked to their points of definition.
78
79Htmlfontify also provides several customisation items, which should
80allow it to mesh more-or-less seamlessly with various templating or
81publishing systems (in the event, for instance, that you don't want
82to produce the html pages directly).
83
84@node Usage & Examples
85@chapter Usage & Examples
86@cindex Usage & Examples
87
88Htmlfontify can be used both interactively and as part of another
89elisp function. If you're running it in a modern Emacs, it will also
90run when attached to a terminal (i.e., without X) or even when in
91batch mode.
92
93@menu
94* Interactive:: Using Htmlfontify interactively.
95* Non-interactive:: Using Htmlfontify from elisp.
96* Variables:: Variables (other than customisation entries).
97* Data Structures:: Important data structures.
98* Examples:: Example(s) of Htmlfontify in use.
99@end menu
100
101@node Interactive
102@section Interactive
103@cindex Interactive
104@cindex functions (interactive)
105
106Htmlfontify provides the following interactive functions:
107
108@table @code
109@item htmlfontify-buffer
110@findex htmlfontify-buffer
111@anchor{htmlfontify-buffer}
112
113@lisp
114
115(htmlfontify-buffer &optional @var{srcdir} @var{file})
116@end lisp
117
118Create a new buffer, named for the current buffer + a .html extension,
119containing an inline CSS-stylesheet and formatted CSS-markup html that
120reproduces the look of the current Emacs buffer as closely as possible.
121
122``Dangerous'' characters in the existing buffer are turned into html
123entities, so you should even be able to do html-within-html fontified
124display.
125
126You should, however, note that random control or eight-bit characters
127such as ^L (\x0c) or ¤ (\xa4) won't get mapped yet.
128
129If the @var{srcdir} and @var{file} arguments are set, lookup etags
130derived entries in the @ref{hfy-tags-cache} and add html anchors
131and hyperlinks as appropriate.
132
133@item htmlfontify-run-etags
134@findex htmlfontify-run-etags
135@anchor{htmlfontify-run-etags}
136
137@lisp
138
139(htmlfontify-run-etags @var{srcdir})
140@end lisp
141
142Load the etags cache for @var{srcdir}. See @ref{hfy-load-tags-cache}.
143
144@item htmlfontify-copy-and-link-dir
145@findex htmlfontify-copy-and-link-dir
146@anchor{htmlfontify-copy-and-link-dir}
147
148@lisp
149
150(htmlfontify-copy-and-link-dir @var{srcdir} @var{dstdir} &optional @var{f-ext} @var{l-ext})
151@end lisp
152
153Trawl @var{srcdir} and write fontified-and-hyperlinked output in
154@var{dstdir}. @var{f-ext} and @var{l-ext} specify values for
155@ref{hfy-extn} and @ref{hfy-link-extn}.
156
157You may also want to set @ref{hfy-page-header} and @ref{hfy-page-footer}.
158
159@item htmlfontify-load-rgb-file
160@findex htmlfontify-load-rgb-file
161@anchor{htmlfontify-load-rgb-file}
162
163@lisp
164
165(htmlfontify-load-rgb-file &optional @var{file})
166@end lisp
167
168Load an X11 style rgb.txt file (search @code{hfy-rgb-load-path} if
169@var{file} is not specified).
170
171Note that this is not necessary if all you want is the standard X11
172(XFree86 4.1.0) color name -> rgb triplet mapping. Htmlfontify has
173a copy built in, for use when it cannot contact an X server.
174
175Loads the variable @code{hfy-rgb-txt-color-map}, which is used by
176@ref{hfy-fallback-color-values}.
177
178@item htmlfontify-unload-rgb-file
179@findex htmlfontify-unload-rgb-file
180@anchor{htmlfontify-unload-rgb-file}
181
182@lisp
183
184(htmlfontify-unload-rgb-file)
185@end lisp
186
187Unload the currently loaded X11 style rgb.txt file (if any).
188@end table
189
190@node Non-interactive
191@section Non-interactive
192@cindex Noninteractive
193@cindex functions (noninteractive)
194
195In addition to the aforementioned interactive methods, Htmlfontify
196provides the following non-interactive ones:
197
198@table @code
199@comment AUTOGENERATED BLOCK
200
201@item hfy-face-to-style
202@findex hfy-face-to-style
203@anchor{hfy-face-to-style}
204
205@lisp
206
207(hfy-face-to-style @var{fn})
208@end lisp
209
210Take @var{fn}, a font or @code{defface} style font specification,
211(as returned by @code{face-attr-construct} or @ref{hfy-face-attr-for-class})
212and return a @ref{hfy-style-assoc}.
213
214See also: @ref{hfy-face-to-style-i}, @ref{hfy-flatten-style}.
215
216@item hfy-fallback-color-values
217@findex hfy-fallback-color-values
218@anchor{hfy-fallback-color-values}
219
220@lisp
221
222(hfy-fallback-color-values @var{color-string})
223@end lisp
224
225Use a fallback method for obtaining the rgb values for a color.
226If @ref{htmlfontify-load-rgb-file} has been called, it uses the
227color map specified, otherwise it uses Htmlfontify's built in map.
228
229@item hfy-combined-face-spec
230@findex hfy-combined-face-spec
231@anchor{hfy-combined-face-spec}
232
233@lisp
234
235(hfy-combined-face-spec @var{face})
236@end lisp
237
238Return a @code{defface} style alist of possible specifications for
239@var{face}, with any entries resulting from user customisation
240(@code{custom-set-faces}) taking precedence.
241
242See also: @ref{hfy-default-face-def}
243
244@item hfy-word-regex
245@findex hfy-word-regex
246@anchor{hfy-word-regex}
247
248@lisp
249
250(hfy-word-regex @var{string})
251@end lisp
252
253Return a regex that matches @var{string} as the first @code{match-string},
254with non word characters on either side (vaguely emulating the perl @code{\b}
255regex atom).
256
257@item hfy-force-fontification
258@findex hfy-force-fontification
259@anchor{hfy-force-fontification}
260
261@lisp
262
263(hfy-force-fontification)
264@end lisp
265
266Emacs's fontification is designed for interactive use. As such, it sometimes
267does things like deferring fontification until a section of the buffer is
268exposed and rendered, or until Emacs is idle for a while. Sometimes, in
269non-interactive circumstances, or if it can't see X, it doesn't bother
270with some of the harder stuff. While this is all great from the perspective
271of a user waiting for Emacs to load a 20000 line file and colorise it,
272it's a pain from the point of view from non-interactive code. This function
273lies, cheats, steals and generally bullies Emacs into fontifying a buffer
274from start to finish, with all the extra frills, whether it thinks it nneds
275to or not. Oh yes: it operates on the current buffer.
276
277@item hfy-link-style-string
278@findex hfy-link-style-string
279@anchor{hfy-link-style-string}
280
281@lisp
282
283(hfy-link-style-string @var{style-string})
284@end lisp
285
286Replace the end of a CSS style declaration @var{style-string} with the contents
287of the variable @ref{hfy-src-doc-link-style}, removing text matching the
288regex @ref{hfy-src-doc-link-unstyle} first, if necessary.
289
290
291@item hfy-prepare-index-i
292@findex hfy-prepare-index-i
293@anchor{hfy-prepare-index-i}
294
295@lisp
296
297(hfy-prepare-index-i @var{srcdir} @var{dstdir} @var{filename} &optional @var{stub} @var{map})
298@end lisp
299
300Prepare a tags index buffer for @var{srcdir}.
301@ref{hfy-tags-cache} must already have an entry for @var{srcdir} for
302this to work. @ref{hfy-page-header}, @ref{hfy-page-footer},
303@ref{hfy-link-extn} and @ref{hfy-extn} all play a part here.
304
305If @var{stub} is set, prepare an (appropriately named) index buffer
306specifically for entries beginning with @var{stub}.
307
308If @var{map} is set, use that instead of @ref{hfy-tags-cache}.
309
310@item hfy-compile-stylesheet
311@findex hfy-compile-stylesheet
312@anchor{hfy-compile-stylesheet}
313
314@lisp
315
316(hfy-compile-stylesheet)
317@end lisp
318
319Trawl the current buffer, construct and return a @ref{hfy-sheet-assoc}.
320
321@item hfy-css-name
322@findex hfy-css-name
323@anchor{hfy-css-name}
324
325@lisp
326
327(hfy-css-name @var{fn})
328@end lisp
329
330Strip some of the boring bits from a font-name and return a CSS style
331name. If @var{fn} is a @code{defface} attribute list, either construct
332a name for it, store it in the cache, and return it, or just fetch it
333from the cache if it's already there.
334
335@item hfy-make-directory
336@findex hfy-make-directory
337@anchor{hfy-make-directory}
338
339@lisp
340
341(hfy-make-directory @var{dir})
342@end lisp
343
344Approximate equivalent of @code{mkdir -p @var{dir}}.
345
346@item hfy-triplet
347@findex hfy-triplet
348@anchor{hfy-triplet}
349
350@lisp
351
352(hfy-triplet @var{color})
353@end lisp
354
355Takes a color name (string) and return a CSS rgb(R, G, B) triplet string.
356Uses the definition of ``white'' to map the numbers to the 0-255 range, so
357if you've redefined white, (especially if you've redefined it to have
358a triplet member lower than that of the color you are processing,
359strange things may happen).
360
361@item hfy-default-footer
362@findex hfy-default-footer
363@anchor{hfy-default-footer}
364
365@lisp
366
367(hfy-default-footer @var{file})
368@end lisp
369
370Default value for @ref{hfy-page-footer}
371
372@item hfy-list-files
373@findex hfy-list-files
374@anchor{hfy-list-files}
375
376@lisp
377
378(hfy-list-files @var{directory})
379@end lisp
380
381Return a list of files under @var{directory}.
382Strips any leading @samp{./} from each filename.
383
384@item hfy-color-vals
385@findex hfy-color-vals
386@anchor{hfy-color-vals}
387
388@lisp
389
390(hfy-color-vals @var{color})
391@end lisp
392
393Where @var{color} is a color name or #XXXXXX style triplet, return a list of
3943 (16 bit) rgb values for said color. If a window system is unavailable,
395calls @ref{hfy-fallback-color-values}.
396
397@item hfy-href-stub
398@findex hfy-href-stub
399@anchor{hfy-href-stub}
400
401@lisp
402
403(hfy-href-stub @var{this-file} @var{def-files} @var{tag})
404@end lisp
405
406Return an href stub for a tag href: if @var{def-files} (list of files
407containing definitions for the tag in question) contains only one entry,
408the href should link straight to that file. Otherwise, the link should
409be to the index file.
410
411We are not yet concerned with the file extensions/tag line number and
412so on at this point.
413
414If @ref{hfy-split-index} is set, and the href will be to an index file
415rather than a source file, append a @samp{.X} to @ref{hfy-index-file}, where
416@samp{X} is the uppercased first character of @var{tag}.
417
418See also: @ref{hfy-relstub}, @ref{hfy-index-file}.
419
420@item hfy-line-number
421@findex hfy-line-number
422@anchor{hfy-line-number}
423
424@lisp
425
426(hfy-line-number)
427@end lisp
428
429Returns the line number of the point in the current buffer.
430
431@item hfy-merge-adjacent-spans
432@findex hfy-merge-adjacent-spans
433@anchor{hfy-merge-adjacent-spans}
434
435@lisp
436
437(hfy-merge-adjacent-spans @var{face-map})
438@end lisp
439
440Where @var{face-map} is a @ref{hfy-facemap-assoc} for the current buffer,
441this function merges adjacent style blocks which are of the same value
442and are separated by nothing more interesting than whitespace.
443
444@code{<span class="foo">narf</span> <span class="foo">brain</span>}
445
446(as interpreted from @var{face-map}) would become:
447
448@code{<span class="foo">narf brain</span>}
449
450Returns a modified copy of @var{face-map} (also a @ref{hfy-facemap-assoc}).
451
452@item hfy-mark-tag-names
453@findex hfy-mark-tag-names
454@anchor{hfy-mark-tag-names}
455
456@lisp
457
458(hfy-mark-tag-names @var{srcdir} @var{file})
459@end lisp
460
461Mark tags in @var{file} (lookup @var{srcdir} in @ref{hfy-tags-cache}) with the
462@code{hfy-anchor} property, with a value of @samp{tag.line-number}.
463
464@item hfy-weight
465@findex hfy-weight
466@anchor{hfy-weight}
467
468@lisp
469
470(hfy-weight @var{weight})
471@end lisp
472
473Derive a font-weight CSS specifier from an Emacs weight specification symbol.
474
475@item hfy-size
476@findex hfy-size
477@anchor{hfy-size}
478
479@lisp
480
481(hfy-size @var{height})
482@end lisp
483
484Derive a CSS font-size specifier from an Emacs font @code{:height} attribute.
485Does not cope with the case where height is a function to be applied to
486the height of the underlying font.
487
488@item hfy-default-header
489@findex hfy-default-header
490@anchor{hfy-default-header}
491
492@lisp
493
494(hfy-default-header @var{file} @var{style})
495@end lisp
496
497Default value for @ref{hfy-page-header}
498
499@item hfy-family
500@findex hfy-family
501@anchor{hfy-family}
502
503@lisp
504
505(hfy-family @var{family})
506@end lisp
507
508Derives a CSS font-family specifier from an Emacs @code{:family} attribute.
509
510@item hfy-mark-tag-hrefs
511@findex hfy-mark-tag-hrefs
512@anchor{hfy-mark-tag-hrefs}
513
514@lisp
515
516(hfy-mark-tag-hrefs @var{srcdir} @var{file})
517@end lisp
518
519Mark href start points with the @code{hfy-link} property (value: href string).
520
521Mark href end points with the @code{hfy-endl} property (value @code{t}).
522
523Avoid overlapping links, and mark links in descending length of
524tag name in order to prevent subtags from usurping supertags;
525e.g., ``term'' for ``terminal'').
526
527@item hfy-box
528@findex hfy-box
529@anchor{hfy-box}
530
531@lisp
532
533(hfy-box @var{box})
534@end lisp
535
536Derive CSS border-* attributes from the Emacs @code{:box} attribute.
537
538@item hfy-box-to-style
539@findex hfy-box-to-style
540@anchor{hfy-box-to-style}
541
542@lisp
543
544(hfy-box-to-style @var{spec})
545@end lisp
546
547Convert a complex @code{:box} Emacs font attribute set to a list of
548CSS border-* attributes. Don't call this directly---it is called by
549@ref{hfy-box} when necessary.
550
551@item hfy-html-enkludge-buffer
552@findex hfy-html-enkludge-buffer
553@anchor{hfy-html-enkludge-buffer}
554
555@lisp
556
557(hfy-html-enkludge-buffer)
558@end lisp
559
560Mark dangerous @samp{["<>]} characters with the @code{hfy-quoteme} property.
561
562See also @ref{hfy-html-dekludge-buffer}.
563
564@item hfy-buffer
565@findex hfy-buffer
566@anchor{hfy-buffer}
567
568@lisp
569
570(hfy-buffer)
571@end lisp
572
573Generate and return an Htmlfontify html output buffer for the current
574buffer. May trample an existing buffer.
575
576@item hfy-fontified-p
577@findex hfy-fontified-p
578@anchor{hfy-fontified-p}
579
580@lisp
581
582(hfy-fontified-p)
583@end lisp
584
585@code{font-lock} doesn't like to say a buffer's been fontified when in
586batch mode, but we want to know if we should fontify or raw copy, so in
587batch mode we check for non-default face properties. Otherwise we test
588@code{font-lock-mode} and @code{font-lock-fontified} for truth.
589
590@item hfy-lookup
591@findex hfy-lookup
592@anchor{hfy-lookup}
593
594@lisp
595
596(hfy-lookup @var{face} @var{style})
597@end lisp
598
599Where @var{style} is a @ref{hfy-sheet-assoc} and @var{face} is an Emacs face,
600return the relevant @var{css} style name.
601
602@item hfy-fontify-buffer
603@findex hfy-fontify-buffer
604@anchor{hfy-fontify-buffer}
605
606@lisp
607
608(hfy-fontify-buffer &optional @var{srcdir} @var{file})
609@end lisp
610
611Implement the guts of @ref{htmlfontify-buffer}.
612
613@item hfy-color
614@findex hfy-color
615@anchor{hfy-color}
616
617@lisp
618
619(hfy-color @var{color})
620@end lisp
621
622Convert an Emacs :foreground property to a CSS color property.
623
624@item hfy-flatten-style
625@findex hfy-flatten-style
626@anchor{hfy-flatten-style}
627
628@lisp
629
630(hfy-flatten-style @var{style})
631@end lisp
632
633Take @var{style} (see @ref{hfy-face-to-style-i}, @ref{hfy-face-to-style})
634and merge any multiple attributes appropriately. Currently only font-size is
635merged down to a single occurrence---others may need special handling, but I
636haven't encountered them yet. Returns a @ref{hfy-style-assoc}.
637
638@item hfy-size-to-int
639@findex hfy-size-to-int
640@anchor{hfy-size-to-int}
641
642@lisp
643
644(hfy-size-to-int @var{spec})
645@end lisp
646
647Convert @var{spec}, a CSS font-size specifier, back to an Emacs
648@code{:height} attribute value. Used while merging multiple font-size
649attributes.
650
651@item hfy-sprintf-stylesheet
652@findex hfy-sprintf-stylesheet
653@anchor{hfy-sprintf-stylesheet}
654
655@lisp
656
657(hfy-sprintf-stylesheet @var{css} @var{file})
658@end lisp
659
660Generates a header, via @ref{hfy-page-header}, for @var{file}, containing the
661stylesheet derived from @var{css}, which is a @ref{hfy-sheet-assoc}. Returns a
662string containing the same.
663
664@item hfy-relstub
665@findex hfy-relstub
666@anchor{hfy-relstub}
667
668@lisp
669
670(hfy-relstub @var{file} &optional @var{start})
671@end lisp
672
673Return a @samp{../} stub of the appropriate length for the current source
674tree depth (as determined from @var{file}). @c iyswim.
675
676@item hfy-compile-face-map
677@findex hfy-compile-face-map
678@anchor{hfy-compile-face-map}
679
680@lisp
681
682(hfy-compile-face-map)
683@end lisp
684
685Compile and return a @ref{hfy-facemap-assoc} for the current buffer.
686
687@item hfy-prepare-index
688@findex hfy-prepare-index
689@anchor{hfy-prepare-index}
690
691@lisp
692
693(hfy-prepare-index @var{srcdir} @var{dstdir})
694@end lisp
695
696Return as list of index buffer(s), as determined by @ref{hfy-split-index}.
697Uses @ref{hfy-prepare-index-i} to do this.
698
699@item hfy-prepare-tag-map
700@findex hfy-prepare-tag-map
701@anchor{hfy-prepare-tag-map}
702
703@lisp
704
705(hfy-prepare-tag-map @var{srcdir} @var{dstdir})
706@end lisp
707
708Prepare the counterpart(s) to the index buffer(s)---a list of buffers with
709the same structure, but listing (and linking to) instances of tags (as
710opposed to their definitions).
711
712See also: @ref{hfy-prepare-index}, @ref{hfy-split-index}
713
714@item hfy-subtract-maps
715@findex hfy-subtract-maps
716@anchor{hfy-subtract-maps}
717
718@lisp
719
720(hfy-subtract-maps @var{srcdir})
721@end lisp
722
723Internal function---strips definitions of tags from the instance map.
724See: @ref{hfy-tags-cache} and @ref{hfy-tags-rmap}
725
726@item hfy-face-to-style-i
727@findex hfy-face-to-style-i
728@anchor{hfy-face-to-style-i}
729
730@lisp
731
732(hfy-face-to-style-i @var{fn})
733@end lisp
734
735The guts of @ref{hfy-face-to-style}. @var{fn} should be a @code{defface}
736font specification, as returned by @code{face-attr-construct} or
737@ref{hfy-face-attr-for-class}. Note that this function does not get
738font-sizes right if they are based on inherited modifiers (via the
739:inherit) attribute, and any other modifiers that are cumulative if they
740appear multiple times need to be merged by the user---@ref{hfy-flatten-style}
741should do this.
742
743@item hfy-face-to-css
744@findex hfy-face-to-css
745@anchor{hfy-face-to-css}
746
747@lisp
748
749(hfy-face-to-css @var{fn})
750@end lisp
751
752Take @var{fn}, a font or @code{defface} specification (c.f.
753@code{face-attr-construct}) and return a CSS style specification.
754
755See also: @ref{hfy-face-to-style}
756
757@item hfy-html-quote
758@findex hfy-html-quote
759@anchor{hfy-html-quote}
760
761@lisp
762
763(hfy-html-quote @var{char-string})
764@end lisp
765
766Map a string (usually 1 character long) to an html safe string
767(entity) if need be.
768
769@item hfy-link-style
770@findex hfy-link-style
771@anchor{hfy-link-style}
772
773@lisp
774
775(hfy-link-style @var{style-string})
776@end lisp
777
778Convert the CSS style spec @var{style-string} to its equivalent
779hyperlink style.
780
781See: @ref{hfy-link-style-fun}.
782
783@item hfy-p-to-face
784@findex hfy-p-to-face
785@anchor{hfy-p-to-face}
786
787@lisp
788
789(hfy-p-to-face @var{props})
790@end lisp
791
792Given @var{props}, a list of text-properties, return the value of the
793face property, or nil.
794
795@item hfy-box-to-border-assoc
796@findex hfy-box-to-border-assoc
797@anchor{hfy-box-to-border-assoc}
798
799@lisp
800
801(hfy-box-to-border-assoc @var{spec})
802@end lisp
803
804Helper function for @ref{hfy-box-to-style}.
805
806@item hfy-face-attr-for-class
807@findex hfy-face-attr-for-class
808@anchor{hfy-face-attr-for-class}
809
810@lisp
811
812(hfy-face-attr-for-class @var{face} &optional @var{class})
813@end lisp
814
815Return the face attributes for @var{face}. If @var{class} is set, it
816must be a @code{defface} alist key [see below]. Prior to version 0.18,
817the first face specification returned by @ref{hfy-combined-face-spec}
818which @emph{didn't} clash with @var{class} was returned. In versions
819from 0.18 onwards, each font attribute list is scored, and the
820non-conflicting list with the highest score is returned. (A specification
821with a class of @code{t} is considered to match any class you specify.
822This matches Emacs's behaviour when deciding on which face attributes to
823use, to the best of my understanding ).
824
825If @var{class} is nil, then you just get get whatever
826@code{face-attr-construct} returns; i.e., the current specification in
827effect for @var{face}.
828
829See @ref{hfy-display-class} for details of valid values for @var{class}.
830
831@item hfy-face-at
832@findex hfy-face-at
833@anchor{hfy-face-at}
834
835@lisp
836
837(hfy-face-at P)
838@end lisp
839
840Find face in effect at point P. If overlays are to be considered
841(see @ref{hfy-optimisations}) then this may return a @code{defface} style
842list of face properties instead of a face symbol.
843
844@item hfy-bgcol
845@findex hfy-bgcol
846@anchor{hfy-bgcol}
847
848@lisp
849
850(hfy-bgcol @var{color})
851@end lisp
852
853As per @ref{hfy-color} but for background colors.
854
855@item hfy-kludge-cperl-mode
856@findex hfy-kludge-cperl-mode
857@anchor{hfy-kludge-cperl-mode}
858
859@lisp
860
861(hfy-kludge-cperl-mode)
862@end lisp
863
864cperl mode does its damndest not to do some of its fontification when not
865in a windowing system---we try to trick it@dots{}
866
867@item hfy-href
868@findex hfy-href
869@anchor{hfy-href}
870
871@lisp
872
873(hfy-href @var{this-file} @var{def-files} @var{tag} @var{tag-map})
874@end lisp
875
876Return a relative href to the tag in question, based on
877
878@var{this-file} @ref{hfy-link-extn} @ref{hfy-extn} @var{def-files} @var{tag} and @var{tag-map}
879
880@var{this-file} is the current source file
881@var{def-files} is a list of file containing possible link endpoints for @var{tag}
882@var{tag} is the @var{tag} in question
883@var{tag-map} is the entry in @ref{hfy-tags-cache}.
884
885@item hfy-shell
886@findex hfy-shell
887@anchor{hfy-shell}
888
889@lisp
890
891(hfy-shell)
892@end lisp
893
894Returns a best guess at a Bourne compatible shell to use: If the current
895shell doesn't look promising, fall back to @ref{hfy-shell-file-name}.
896
897@item hfy-load-tags-cache
898@findex hfy-load-tags-cache
899@anchor{hfy-load-tags-cache}
900
901@lisp
902
903(hfy-load-tags-cache @var{srcdir})
904@end lisp
905
906Run @ref{hfy-etags-cmd} on @var{srcdir}: load @ref{hfy-tags-cache} and @ref{hfy-tags-sortl}.
907
908@item hfy-parse-tags-buffer
909@findex hfy-parse-tags-buffer
910@anchor{hfy-parse-tags-buffer}
911
912@lisp
913
914(hfy-parse-tags-buffer @var{srcdir} @var{buffer})
915@end lisp
916
917Parse a @var{buffer} containing etags formatted output, loading the
918@ref{hfy-tags-cache} and @ref{hfy-tags-sortl} entries for @var{srcdir}.
919
920@item hfy-interq
921@findex hfy-interq
922@anchor{hfy-interq}
923
924@lisp
925
926(hfy-interq @var{set-a} @var{set-b})
927@end lisp
928
929Return the intersection (using @code{eq}) of 2 lists.
930
931@item hfy-text-p
932@findex hfy-text-p
933@anchor{hfy-text-p}
934
935@lisp
936
937(hfy-text-p @var{srcdir} @var{file})
938@end lisp
939
940Is @var{srcdir}/@var{file} text? Uses @ref{hfy-istext-command} to determine this.
941
942@item hfy-opt
943@findex hfy-opt
944@anchor{hfy-opt}
945
946@lisp
947
948(hfy-opt @var{symbol})
949@end lisp
950
951Is @ref{hfy-optimisations} member @var{symbol} set or not?
952
953@item hfy-dirname
954@findex hfy-dirname
955@anchor{hfy-dirname}
956
957@lisp
958
959(hfy-dirname @var{file})
960@end lisp
961
962Return everything preceding the last @samp{/} from a relative filename,
963on the assumption that this will produce a relative directory name. Hardly
964bombproof, but good enough in the context in which it is being used.
965
966@item hfy-html-dekludge-buffer
967@findex hfy-html-dekludge-buffer
968@anchor{hfy-html-dekludge-buffer}
969
970@lisp
971
972(hfy-html-dekludge-buffer)
973@end lisp
974
975Transform all dangerous characters marked with the @code{hfy-quoteme} property
976using @ref{hfy-html-quote}
977
978See also @ref{hfy-html-enkludge-buffer}.
979
980@item hfy-copy-and-fontify-file
981@findex hfy-copy-and-fontify-file
982@anchor{hfy-copy-and-fontify-file}
983
984@lisp
985
986(hfy-copy-and-fontify-file @var{srcdir} @var{dstdir} @var{file})
987@end lisp
988
989Open @var{file} in @var{srcdir}---if fontified, write a fontified copy to @var{dstdir}
990adding an extension of @ref{hfy-extn}. Fontification is actually done by
991@ref{htmlfontify-buffer}. If the buffer is not fontified, just copy it.
992
993@item hfy-decor
994@findex hfy-decor
995@anchor{hfy-decor}
996
997@lisp
998
999(hfy-decor @var{tag} @var{val})
1000@end lisp
1001
1002Derive CSS text-decoration specifiers from various Emacs font attributes.
1003
1004@item hfy-slant
1005@findex hfy-slant
1006@anchor{hfy-slant}
1007
1008@lisp
1009
1010(hfy-slant @var{slant})
1011@end lisp
1012
1013Derive a font-style CSS specifier from the Emacs :slant
1014attribute---CSS does not define the reverse-* styles, so just maps
1015those to the regular specifiers.
1016
1017@item hfy-tags-for-file
1018@findex hfy-tags-for-file
1019@anchor{hfy-tags-for-file}
1020
1021@lisp
1022
1023(hfy-tags-for-file @var{srcdir} @var{file})
1024@end lisp
1025
1026List of etags tags that have definitions in this @var{file}. Looks up
1027the tags cache in @ref{hfy-tags-cache} using @var{srcdir} as the key.
1028
1029@item hfy-width
1030@findex hfy-width
1031@anchor{hfy-width}
1032
1033@lisp
1034
1035(hfy-width @var{width})
1036@end lisp
1037
1038Convert an Emacs @code{:width} attribute to a CSS font-stretch attribute.
1039
1040@comment /AUTOGENERATED BLOCK
1041@end table
1042
1043@node Variables
1044@section Variables
1045@cindex variables
1046
1047Important variables that are not customisation items:
1048
1049@table @code
1050
1051@item hfy-tags-cache
1052@vindex hfy-tags-cache
1053@anchor{hfy-tags-cache}
1054
1055This is an alist of the form:
1056
1057@example
1058(("/src/dir/0" . tag-hash0) ("/src/dir/1" tag-hash1) @dots{} )
1059@end example
1060
1061Each tag hash entry then contains entries of the form:
1062
1063@example
1064"tag_string" => (("file/name.ext" line char) @dots{} )
1065@end example
1066
1067i.e., an alist mapping (relative) file paths to line and character offsets.
1068
1069See @ref{hfy-load-tags-cache}.
1070
1071@item hfy-tags-rmap
1072@vindex hfy-tags-rmap
1073@anchor{hfy-tags-rmap}
1074
1075@code{hfy-tags-rmap} is an alist of the form:
1076
1077@lisp
1078(("/src/dir" . tag-rmap-hash))
1079@end lisp
1080
1081Where tag-rmap-hash has entries of the form:
1082
1083@example
1084"tag_string" => ( "file/name.ext" line char )
1085@end example
1086
1087Unlike @ref{hfy-tags-cache} these are the locations of occurrences of
1088tagged items, not the locations of their definitions.
1089
1090@item hfy-tags-sortl
1091@vindex hfy-tags-sortl
1092@anchor{hfy-tags-sortl}
1093
1094@code{hfy-tags-sortl} is an alist of the form:
1095
1096@example
1097(("/src/dir" . (tag0 tag1 tag2)) @dots{} )
1098@end example
1099
1100Where the tags are stored in descending order of length.
1101
1102See: @ref{hfy-load-tags-cache}.
1103
1104@end table
1105
1106@node Data Structures
1107@section Data Structures
1108@cindex Data Structures
1109
1110Some of the (informal) data structures used in Htmlfontify are detailed here:
1111
1112@table @code
1113
1114@item hfy-style-assoc
1115@cindex hfy-style-assoc
1116@anchor{hfy-style-assoc}
1117
1118An assoc representing/describing an Emacs face. Properties may be repeated,
1119in which case later properties should be treated as if they were inherited
1120from a ``parent'' font. (For some properties, only the first encountered value
1121is of any importance, for others the values might be cumulative, and for
1122others they might be cumulative in a complex way.)
1123
1124Some examples:
1125
1126@lisp
1127(hfy-face-to-style 'default) =>
1128
1129 (("background" . "rgb(0, 0, 0)" )
1130 ("color" . "rgb(255, 255, 255)")
1131 ("font-style" . "normal" )
1132 ("font-weight" . "500" )
1133 ("font-stretch" . "normal" )
1134 ("font-family" . "misc-fixed" )
1135 ("font-size" . "13pt" )
1136 ("text-decoration" . "none" ))
1137
1138(hfy-face-to-style 'Info-title-3-face) =>
1139
1140 (("font-weight" . "700" )
1141 ("font-family" . "helv" )
1142 ("font-size" . "120%" )
1143 ("text-decoration" . "none") )
1144@end lisp
1145
1146@item hfy-sheet-assoc
1147@cindex hfy-sheet-assoc
1148@anchor{hfy-sheet-assoc}
1149
1150An assoc with elements of the form @samp{(face-name style-name . style-string)}.
1151The actual stylesheet for each page is derived from one of these.
1152
1153@lisp
1154'((default "default" . "@{ background: black; color: white@}")
1155 (font-lock-string-face "string" . "@{ color: rgb(64,224,208) @}"))
1156@end lisp
1157
1158@item hfy-facemap-assoc
1159@cindex hfy-facemap-assoc
1160@anchor{hfy-facemap-assoc}
1161
1162An assoc of @code{(point . @var{face-symbol})} or
1163@code{(point . @code{defface} attribute list)} and @code{(point
1164. end)} elements, in descending order of point value (i.e., from the
1165file's end to its beginning). The map is in reverse order because
1166inserting a @samp{<style>} tag (or any other string) at @var{point}
1167invalidates the map for all entries with a greater value of point. By
1168traversing the map from greatest to least @var{point}, we still
1169invalidate the map as we go, but only those points we have already
1170dealt with (and therefore no longer care about) will be invalid at any
1171time.
1172
1173@lisp
1174'((64820 . end)
1175 (64744 . font-lock-comment-face)
1176 (64736 . end)
1177 (64722 . font-lock-string-face)
1178 (64630 . end)
1179 (64623 . font-lock-string-face)
1180 (64449 . end)
1181 ;; Big similar section elided. You get the idea.
1182 (5459 . end)
1183 (5431 . (:inherit font-lock-keyword-face :background "7e7e7e"))
1184 (5431 . end)
1185 (4285 . font-lock-constant-face)
1186 (4285 . end)
1187 (4221 . font-lock-comment-face)
1188 (4221 . end)
1189 (4197 . font-lock-constant-face)
1190 (4197 . end)
1191 (1 . font-lock-comment-face))
1192@end lisp
1193
1194@end table
1195
1196@node Examples
1197@section Examples
1198@cindex Examples
1199
1200The following is a lump of code I use to fontify source code on my
1201site, @url{http://rtfm.etla.org/} (which was the reason, incidentally,
1202that Htmlfontify was written in the first place).
1203
1204@lisp
1205(defvar rtfm-section nil)
1206
1207;; Constructs an appropriate header string to fit in with rtfm's
1208;; templating system, based on the file and the stylesheet string
1209(defun rtfm-build-page-header (file style)
1210 (format "#define TEMPLATE red+black.html
1211#define DEBUG 1
1212#include <build/menu-dirlist|>\n
1213html-css-url := /css/red+black.css
1214title := rtfm.etla.org ( %s / src/%s )
1215bodytag :=
1216head <=STYLESHEET;\n
1217%s
1218STYLESHEET
1219main-title := rtfm / %s / src/%s\n
1220main-content <=MAIN_CONTENT;\n" rtfm-section file style rtfm-section file))
1221
1222;; the footer:
1223(defun rtfm-build-page-footer (file) "\nMAIN_CONTENT\n")
1224
1225(defun rtfm-fontify-buffer (section)
1226 (interactive "s section[eg- emacs / p4-blame]: ")
1227 (require 'htmlfontify)
1228 (let ((hfy-page-header 'rtfm-build-page-header)
1229 (hfy-page-footer 'rtfm-build-page-footer)
1230 (rtfm-section section))
1231 (htmlfontify-buffer)
1232 )
1233 )
1234
1235;; Here's the function I actually call---it asks me for a section label,
1236;; and source and destination directories, and then binds a couple of
1237;; customisation variable in a let before calling htmlfontify:
1238(defun rtfm-build-source-docs (section srcdir destdir)
1239 (interactive
1240 "s section[eg- emacs / p4-blame]:\nD source-dir: \nD output-dir: ")
1241 (require 'htmlfontify)
1242 (hfy-load-tags-cache srcdir)
1243 (let ((hfy-page-header 'rtfm-build-page-header)
1244 (hfy-page-footer 'rtfm-build-page-footer)
1245 (rtfm-section section)
1246 (hfy-index-file "index")
1247 (auto-mode-alist (append auto-mode-alist
1248 '(("dbi\\(shell\\|gtk\\)$" . cperl-mode)
1249 ("\\.xpm$" . c-mode ))))
1250 )
1251 (htmlfontify-run-etags srcdir)
1252 (htmlfontify-copy-and-link-dir srcdir destdir ".src" ".html")))
1253@end lisp
1254
1255@node Customisation
1256@chapter Customisation
1257@cindex variables (customisation)
1258
1259Htmlfontify provides the following variable and customisation entries:
1260
1261@table @code
1262@comment AUTOGENERATED BLOCK
1263
1264@item hfy-link-style-fun
1265@vindex hfy-link-style-fun
1266@anchor{hfy-link-style-fun}
1267
1268Set this to a function, which will be called with one argument
1269(a @samp{@{ foo: bar; @dots{}@}} CSS style-string)---it should return a copy of
1270its argument, altered so as to make any changes you want made for text which
1271is a hyperlink, in addition to being in the class to which that style would
1272normally be applied.
1273
1274@item hfy-html-quote-regex
1275@vindex hfy-html-quote-regex
1276@anchor{hfy-html-quote-regex}
1277
1278Regex to match (with a single back-reference per match) strings in HTML
1279which should be quoted with @ref{hfy-html-quote}
1280(and @pxref{hfy-html-quote-map}) to make them safe.
1281
1282@item hfy-page-footer
1283@vindex hfy-page-footer
1284@anchor{hfy-page-footer}
1285
1286As @ref{hfy-page-header}, but generates the output footer
1287(and takes only 1 argument, the filename).
1288
1289@item hfy-display-class
1290@vindex hfy-display-class
1291@anchor{hfy-display-class}
1292
1293Display class to use to determine which display class to use when
1294calculating a face's attributes. This is useful when, for example, you
1295are running Emacs on a tty or in batch mode, and want Htmlfontify to have
1296access to the face spec you would use if you were connected to an X display.
1297
1298Some valid class specification elements are:
1299
1300@lisp
1301 '(class color)
1302 '(class grayscale)
1303 '(background dark)
1304 '(background light)
1305 '(type x-toolkit)
1306 '(type tty)
1307 '(type motif)
1308 '(type lucid)
1309@end lisp
1310
1311Multiple values for a tag may be combined, to indicate that any one or more
1312of these values in the specification key constitutes a match, eg:
1313
1314'((class color grayscale) (type tty)) would match any of:
1315@lisp
1316 '((class color))
1317 '((class grayscale))
1318 '((class color grayscale)))
1319 '((class color foo))
1320 '((type tty))
1321 '((type tty) (class color))
1322@end lisp
1323and so on.
1324
1325@item hfy-page-header
1326@vindex hfy-page-header
1327@anchor{hfy-page-header}
1328
1329Function called with two arguments (the filename relative to the top
1330level source directory being etag'd and fontified), and a string containing
1331the @samp{<style>@dots{}</style>} text to embed in the document---the string
1332returned will be used as the header for the htmlfontified version of
1333the source file.
1334
1335See also: @ref{hfy-page-footer}
1336
1337@item hfy-src-doc-link-style
1338@vindex hfy-src-doc-link-style
1339@anchor{hfy-src-doc-link-style}
1340
1341String to add to the @samp{<style> a} variant of an Htmlfontify CSS class.
1342
1343@item hfy-fast-lock-save
1344@vindex hfy-fast-lock-save
1345@anchor{hfy-fast-lock-save}
1346
1347Minimum size of a buffer for cached fontification.
1348This value is temporarily assigned to @code{fast-lock-minimum-size} during
1349html-fontification.
1350
1351Only buffers more than this can have associated Font Lock cache files saved.
1352
1353If nil, means cache files are never created.
1354
1355If a list, each element should be a cons pair of the form
1356@code{(@var{major-mode} . @var{size})}, where @var{major-mode}
1357is a symbol or t (meaning the default). For example:
1358
1359@lisp
1360 ((c-mode . 25600 )
1361 (c++-mode . 25600 )
1362 (rmail-mode . 1048576))
1363@end lisp
1364
1365means that the minimum size is 25K for buffers in C or C++ modes, one megabyte
1366for buffers in Rmail mode, and size is irrelevant (i.e., no saves) otherwise.
1367
1368@item hfy-split-index
1369@vindex hfy-split-index
1370@anchor{hfy-split-index}
1371
1372Whether or not to split the index @ref{hfy-index-file} alphabetically
1373on the first letter of each tag. Useful when the index would otherwise
1374be large and take a long time to render or be difficult to navigate.
1375
1376@item hfy-find-cmd
1377@vindex hfy-find-cmd
1378@anchor{hfy-find-cmd}
1379
1380``find'' command used to harvest a list of files to attempt to fontify.
1381
1382@item hfy-extn
1383@vindex hfy-extn
1384@anchor{hfy-extn}
1385
1386File extension used for output files
1387
1388@item hfy-default-face-def
1389@vindex hfy-default-face-def
1390@anchor{hfy-default-face-def}
1391
1392Fallback @code{defface} specification for the face @code{default}, used
1393when @ref{hfy-display-class} has been set (the normal Htmlfontify way of
1394extracting potentially non-current face information doesn't necessarily
1395work for @code{default}).
1396
1397For example, I customise this to:
1398
1399@lisp
1400((t :background "black" :foreground "white" :family "misc-fixed"))
1401@end lisp
1402
1403@item hfy-init-kludge-hooks
1404@vindex hfy-init-kludge-hooks
1405@anchor{hfy-init-kludge-hooks}
1406
1407List of functions to call when starting htmlfontify-buffer to do any
1408kludging necessary to get highlighting modes to bahave as you want, even
1409when not running under a window system.
1410
1411@item hfy-shell-file-name
1412@vindex hfy-shell-file-name
1413@anchor{hfy-shell-file-name}
1414
1415Should be set to a Bourne compatible shell, which will be invoked
1416for the more complex shell interactions needed by Htmlfontify.
1417Currently this is only required/used when using GNU etags, see
1418@ref{hfy-etags-cmd-alist} for details.
1419
1420@item hfy-optimisations
1421@vindex hfy-optimisations
1422@anchor{hfy-optimisations}
1423
1424Optimisations to turn on. So far, the following have been implemented:
1425
1426@table @option
1427@item merge-adjacent-tags
1428If two (or more) span tags are adjacent, identical and separated by nothing
1429more than whitespace, they will be merged into one span.
1430
1431@item zap-comment-links
1432Suppress hyperlinking of tags found in comments.
1433
1434@item zap-string-links
1435Suppress hyperlinking of tags found in strings.
1436
1437@item div-wrapper
1438Add @samp{<div class="default"> </div>} tags around the fontified body.
1439(Some people like this because they cut and paste the html into
1440a page with different colors than the fontified code.)
1441
1442@item keep-overlays
1443Preserve overlay highlighting (c.f. @code{ediff} or @code{goo-font-lock})
1444as well as basic faces. Can result in extremely verbose highlighting
1445if there are many overlays (as is the case with @code{goo-font-lock}).
1446
1447@end table
1448
1449And the following are planned but not yet available:
1450
1451@table @option
1452@item kill-context-leak
1453Suppress hyperlinking between files highlighted by different modes.
1454
1455@end table
1456
1457Note: like compiler optimisations, these optimise the _output_ of the code,
1458not the processing of the source itself, and are therefore likely to slow
1459Htmlfontify down, at least a little. Except for skip-refontification,
1460which can never slow you down, but may result in incomplete fontification.
1461
1462@item hfy-src-doc-link-unstyle
1463@vindex hfy-src-doc-link-unstyle
1464@anchor{hfy-src-doc-link-unstyle}
1465
1466Regex to remove from the <style> a variant of an Htmlfontify CSS class.
1467
1468@item hfy-link-extn
1469@vindex hfy-link-extn
1470@anchor{hfy-link-extn}
1471
1472File extension used for href links---useful where the Htmlfontify
1473output files are going to be processed again, with a rersulting change
1474in file extension. If @code{nil}, then any code using this should fall back
1475to @ref{hfy-extn}.
1476
1477@item hfy-istext-command
1478@vindex hfy-istext-command
1479@anchor{hfy-istext-command}
1480
1481Command to run with the name of a file, to see whether it is a text file
1482or not. The command should emit a string containing the word @samp{text} if
1483the file is a text file, and a string not containing @samp{text} otherwise.
1484
1485@item hfy-etags-cmd-alist
1486@vindex hfy-etags-cmd-alist
1487@anchor{hfy-etags-cmd-alist}
1488
1489An alist of possible shell commands that will generate etags output that
1490Htmlfontify can use. @samp{%s} will be replaced by @ref{hfy-etags-bin}.
1491
1492@item hfy-etags-bin
1493@vindex hfy-etags-bin
1494@anchor{hfy-etags-bin}
1495
1496The location of the etags binary (we begin by assuming it's in your path).
1497
1498Note that if etags is not in your path, you will need to alter the shell
1499commands in @ref{hfy-etags-cmd-alist}.
1500
1501[As of version 0.17, this requirement has been removed: it should
1502 all just work(tm).]
1503
1504@item hfy-etags-cmd
1505@vindex hfy-etags-cmd
1506@anchor{hfy-etags-cmd}
1507
1508An etags shell command to run in the source directory to generate a tags
1509file for the whole source tree from there on down. The command should emit
1510the etags output on standard output.
1511
1512Two canned commands are provided---they drive Emacs's etags and
1513exuberant-ctags's etags respectively.
1514
1515@item hfy-etag-regex
1516@vindex hfy-etag-regex
1517@anchor{hfy-etag-regex}
1518
1519Regex used to parse an etags entry: must have 3 subexps, corresponding,
1520in order, to:
1521
1522@enumerate
1523 The tag
1524 The line
1525 The character (point) at which the tag occurs
1526@end enumerate
1527
1528@item hfy-index-file
1529@vindex hfy-index-file
1530@anchor{hfy-index-file}
1531
1532Name (sans extension) of the index file produced during
1533fontification-and-hyperlinking.
1534
1535@item hfy-instance-file
1536@vindex hfy-instance-file
1537@anchor{hfy-instance-file}
1538
1539Name (sans extension) of the tag usage index file produced during
1540fontification-and-hyperlinking.
1541
1542@item hfy-html-quote-map
1543@vindex hfy-html-quote-map
1544@anchor{hfy-html-quote-map}
1545
1546An alist of character -> entity mappings used to make the text html-safe.
1547
1548@comment /AUTOGENERATED BLOCK
1549@end table
1550
1551@node Requirements
1552@chapter Requirements
1553@cindex Requirements, Prerequisites
1554
1555Htmlfontify has a couple of external requirements:
1556
1557@itemize @bullet
1558
1559@item
1560GNU Emacs 20.7+ or 21.1+
1561
1562Other versions may work---these have been used successfully by the
1563author. If you intend to use Htmlfontify in batch mode, 21.1+ is
1564pretty much required. The author does not know if XEmacs, NTemacs,
1565or J.Random Emacs will run Htmlfontify, but reports/patches/bags of
1566money are always welcome.
1567
1568@item
1569A copy of etags (exuberant-ctags or GNU etags). Htmlfontify attempts
1570to autodetect the version you have and customise itself accordingly,
1571but you should be able to override this.
1572
1573See: @ref{Customisation}
1574
1575@item
1576A copy of find (e.g., GNU find) that provides the @code{-path} predicate.
1577
1578You may be able to work around this with a suitable clever shell
1579command and the customisation entry: @ref{hfy-find-cmd}
1580
1581@item
1582A copy of sed (e.g., GNU sed).
1583
1584@item
1585A copy of the @code{file} command.
1586
1587@end itemize
1588
1589@node GNU Free Documentation License
1590@appendix GNU Free Documentation License
1591@include doclicense.texi
1592
1593@node Index
1594@unnumbered Index
1595
1596@table @var
1597@item Concepts
1598@printindex cp
1599
1600@item Functions
1601@printindex fn
1602
1603@item Variables & Customisation
1604@printindex vr
1605
1606@end table
1607
1608@setchapternewpage odd
1609@bye
diff --git a/doc/misc/makefile.w32-in b/doc/misc/makefile.w32-in
index ac1446cb668..11c76dcfcf7 100644
--- a/doc/misc/makefile.w32-in
+++ b/doc/misc/makefile.w32-in
@@ -56,7 +56,7 @@ INFO_TARGETS = $(infodir)/ccmode$(INFO_EXT) \
56 $(infodir)/auth$(INFO_EXT) $(infodir)/eieio$(INFO_EXT) $(infodir)/ede$(INFO_EXT) \ 56 $(infodir)/auth$(INFO_EXT) $(infodir)/eieio$(INFO_EXT) $(infodir)/ede$(INFO_EXT) \
57 $(infodir)/semantic$(INFO_EXT) $(infodir)/edt$(INFO_EXT) $(infodir)/emacs-gnutls$(INFO_EXT) \ 57 $(infodir)/semantic$(INFO_EXT) $(infodir)/edt$(INFO_EXT) $(infodir)/emacs-gnutls$(INFO_EXT) \
58 $(infodir)/srecode$(INFO_EXT) $(infodir)/bovine$(INFO_EXT) \ 58 $(infodir)/srecode$(INFO_EXT) $(infodir)/bovine$(INFO_EXT) \
59 $(infodir)/wisent$(INFO_EXT) 59 $(infodir)/wisent$(INFO_EXT) $(infodir)/htmlfontify$(INFO_EXT)
60DVI_TARGETS = calc.dvi cc-mode.dvi cl.dvi dbus.dvi dired-x.dvi \ 60DVI_TARGETS = calc.dvi cc-mode.dvi cl.dvi dbus.dvi dired-x.dvi \
61 ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \ 61 ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \
62 sieve.dvi pgg.dvi mh-e.dvi \ 62 sieve.dvi pgg.dvi mh-e.dvi \
@@ -68,7 +68,7 @@ DVI_TARGETS = calc.dvi cc-mode.dvi cl.dvi dbus.dvi dired-x.dvi \
68 remember.dvi nxml-mode.dvi \ 68 remember.dvi nxml-mode.dvi \
69 epa.dvi mairix-el.dvi sasl.dvi auth.dvi eieio.dvi ede.dvi \ 69 epa.dvi mairix-el.dvi sasl.dvi auth.dvi eieio.dvi ede.dvi \
70 semantic.dvi edt.dvi emacs-gnutls.dvi srecode.dvi bovine.dvi \ 70 semantic.dvi edt.dvi emacs-gnutls.dvi srecode.dvi bovine.dvi \
71 wisent.dvi 71 wisent.dvi htmlfontify.dvi
72INFOSOURCES = info.texi 72INFOSOURCES = info.texi
73 73
74# The following rule does not work with all versions of `make'. 74# The following rule does not work with all versions of `make'.
@@ -374,6 +374,12 @@ $(infodir)/wisent$(INFO_EXT): wisent.texi
374wisent.dvi: wisent.texi 374wisent.dvi: wisent.texi
375 $(ENVADD) $(TEXI2DVI) $(srcdir)/wisent.texi 375 $(ENVADD) $(TEXI2DVI) $(srcdir)/wisent.texi
376 376
377$(infodir)/htmlfontify$(INFO_EXT): htmlfontify.texi
378 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ htmlfontify.texi
379htmlfontify.dvi: htmlfontify.texi
380 $(ENVADD) $(TEXI2DVI) $(srcdir)/htmlfontify.texi
381
382
377$(INFO_TARGETS): doclicense.texi 383$(INFO_TARGETS): doclicense.texi
378$(DVI_TARGETS): doclicense.texi 384$(DVI_TARGETS): doclicense.texi
379 385
@@ -406,7 +412,8 @@ clean: mostlyclean
406 $(infodir)/eieio* $(infodir)/ede* \ 412 $(infodir)/eieio* $(infodir)/ede* \
407 $(infodir)/semantic* $(infodir)edt* \ 413 $(infodir)/semantic* $(infodir)edt* \
408 $(infodir)/emacs-gnutls* $(infodir)/srecode* \ 414 $(infodir)/emacs-gnutls* $(infodir)/srecode* \
409 $(infodir)/bovine* $(infodir)/wisent* 415 $(infodir)/bovine* $(infodir)/wisent* \
416 $(infodir)/htmlfontify*
410 417
411distclean: clean 418distclean: clean
412 - $(DEL) makefile 419 - $(DEL) makefile
diff --git a/info/dir b/info/dir
index 4fa837e6a1e..55f7c71de79 100644
--- a/info/dir
+++ b/info/dir
@@ -74,6 +74,7 @@ Emacs misc features
74* Flymake: (flymake). A universal on-the-fly syntax checker. 74* Flymake: (flymake). A universal on-the-fly syntax checker.
75* Forms: (forms). Emacs package for editing data bases 75* Forms: (forms). Emacs package for editing data bases
76 by filling in forms. 76 by filling in forms.
77* Htmlfontify: (htmlfontify). Convert source code to html.
77* PCL-CVS: (pcl-cvs). Emacs front-end to CVS. 78* PCL-CVS: (pcl-cvs). Emacs front-end to CVS.
78* RefTeX: (reftex). Emacs support for LaTeX cross-references 79* RefTeX: (reftex). Emacs support for LaTeX cross-references
79 and citations. 80 and citations.
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
774## begin gnulib module stdio 774## begin gnulib module stdio
775 775
776BUILT_SOURCES += stdio.h 776BUILT_SOURCES += stdio.h
777libgnu_a_SOURCES += stdio.c
778 777
779# We need the following in order to create <stdio.h> when the system 778# We need the following in order to create <stdio.h> when the system
780# doesn't have one that works with the given compiler. 779# 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 @@
1#include <config.h>
2#define _GL_STDIO_INLINE _GL_EXTERN_INLINE
3#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 @@
46#ifndef _@GUARD_PREFIX@_STDIO_H 46#ifndef _@GUARD_PREFIX@_STDIO_H
47#define _@GUARD_PREFIX@_STDIO_H 47#define _@GUARD_PREFIX@_STDIO_H
48 48
49_GL_INLINE_HEADER_BEGIN
50#ifndef _GL_STDIO_INLINE
51# define _GL_STDIO_INLINE _GL_INLINE
52#endif
53
54/* Get va_list. Needed on many systems, including glibc 2.8. */ 49/* Get va_list. Needed on many systems, including glibc 2.8. */
55#include <stdarg.h> 50#include <stdarg.h>
56 51
@@ -580,21 +575,17 @@ _GL_CXXALIAS_RPL (fwrite, size_t,
580_GL_CXXALIAS_SYS (fwrite, size_t, 575_GL_CXXALIAS_SYS (fwrite, size_t,
581 (const void *ptr, size_t s, size_t n, FILE *stream)); 576 (const void *ptr, size_t s, size_t n, FILE *stream));
582 577
583/* Work around glibc bug 11959 578/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
584 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>, 579 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
585 which sometimes causes an unwanted diagnostic for fwrite calls. 580 which sometimes causes an unwanted diagnostic for fwrite calls.
586 This affects only function declaration attributes, so it's not 581 This affects only function declaration attributes under certain
587 needed for C++. */ 582 versions of gcc, and is not needed for C++. */
588# if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL 583# if (0 < __USE_FORTIFY_LEVEL \
589_GL_STDIO_INLINE size_t _GL_ARG_NONNULL ((1, 4)) 584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
590rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream) 585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
591{ 586 && !defined __cplusplus)
592 size_t r = fwrite (ptr, s, n, stream);
593 (void) r;
594 return r;
595}
596# undef fwrite 587# undef fwrite
597# define fwrite rpl_fwrite 588# define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; })
598# endif 589# endif
599# endif 590# endif
600_GL_CXXALIASWARN (fwrite); 591_GL_CXXALIASWARN (fwrite);
@@ -1338,8 +1329,6 @@ _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
1338 "POSIX compliance"); 1329 "POSIX compliance");
1339#endif 1330#endif
1340 1331
1341_GL_INLINE_HEADER_END
1342
1343#endif /* _@GUARD_PREFIX@_STDIO_H */ 1332#endif /* _@GUARD_PREFIX@_STDIO_H */
1344#endif /* _@GUARD_PREFIX@_STDIO_H */ 1333#endif /* _@GUARD_PREFIX@_STDIO_H */
1345#endif 1334#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 @@
26#else 26#else
27# include <config.h> 27# include <config.h>
28# if FPRINTFTIME 28# if FPRINTFTIME
29# include "ignore-value.h"
30# include "fprintftime.h" 29# include "fprintftime.h"
31# else 30# else
32# include "strftime.h" 31# include "strftime.h"
@@ -209,15 +208,7 @@ extern char *tzname[];
209 else if (to_uppcase) \ 208 else if (to_uppcase) \
210 fwrite_uppcase (p, (s), _n); \ 209 fwrite_uppcase (p, (s), _n); \
211 else \ 210 else \
212 { \ 211 fwrite (s, _n, 1, p); \
213 /* We are ignoring the value of fwrite here, in spite of the \
214 fact that technically, that may not be valid: the fwrite \
215 specification in POSIX 2008 defers to that of fputc, which \
216 is intended to be consistent with the one from ISO C, \
217 which permits failure due to ENOMEM *without* setting the \
218 stream's error indicator. */ \
219 ignore_value (fwrite ((s), _n, 1, p)); \
220 } \
221 } \ 212 } \
222 while (0) \ 213 while (0) \
223 ) 214 )
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3aae01b9f1e..5b54d34743c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,59 @@
12013-01-04 Daiki Ueno <ueno@gnu.org>
2
3 * epg.el: Silence byte-compiler warnings.
4 (epg--start): Use delete-char instead of delete-backward-char.
5 (epg-wait-for-completion): Pass FRAME arg to redraw-frame.
6
72013-01-04 Daiki Ueno <ueno@gnu.org>
8
9 * epg.el (epg--start): Don't call "tty" program on W32 platforms.
10 Suggested by Eli Zaretskii <eliz@gnu.org>.
11
122013-01-04 Michael Albinus <michael.albinus@gmx.de>
13
14 * net/tramp-sh.el (tramp-set-file-uid-gid): UID and GID must be
15 non-negative integers. Otherwise, the default values are used.
16 (tramp-convert-file-attributes): Convert uid and gid to integers.
17
182013-01-04 Glenn Morris <rgm@gnu.org>
19
20 * term.el (term-handle-colors-array): Ensure face attributes
21 are fully specified, not nil. (Bug#13337)
22
23 * term.el (term-default-fg-color, term-default-bg-color):
24 Fix custom type.
25
26 * progmodes/etags.el (tags-compression-info-list): Doc fix.
27 (tag-find-file-of-tag-noselect): Check auto-compression-mode
28 rather than 'jka-compr being loaded. (Bug#13338)
29
302013-01-04 Wesley Dawson <whd@lavabit.com> (tiny change)
31
32 * icomplete.el (icomplete-completions):
33 Honor icomplete-prospects-height once more following
34 2012-11-29 changes. (Bug#13224)
35
362013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
37
38 * subr.el (internal--called-interactively-p--get-frame): Find aliases
39 of called-interactively-p as well (bug#13237).
40
41 * view.el (view--enable, view--disable): Rename from view-mode-enable
42 and view-mode-disable and assume it's called from view-mode.
43 (view-mode-enable, view-mode-disable): Redefine as obsolete
44 compatibility layer above view-mode.
45 (view-mode-enter): Call `view-mode'.
46
47 * files.el (after-find-file): Call `view-mode'.
48
49 * doc-view.el (doc-view-scale-internally): New var.
50 (doc-view-enlarge, doc-view-insert-image): Obey it.
51
522013-01-03 Daiki Ueno <ueno@gnu.org>
53
54 * epg.el (epg--start): Ignore errors when /dev/fd/0 does not
55 exist. (Bug#13344)
56
12013-01-03 Glenn Morris <rgm@gnu.org> 572013-01-03 Glenn Morris <rgm@gnu.org>
2 58
3 * mail/rmail.el (rmail-set-header-1): Ignore case. 59 * mail/rmail.el (rmail-set-header-1): Ignore case.
@@ -338,6 +394,8 @@
338 (lm-homepage): New function. 394 (lm-homepage): New function.
339 (lm-with-file): Don't be confused if narrowing is in effect. 395 (lm-with-file): Don't be confused if narrowing is in effect.
340 396
3972012-12-19 Stefan Monnier <monnier@iro.umontreal.ca>
398
341 * vc/diff-mode.el (diff-post-command-hook): Don't ignore changes at the 399 * vc/diff-mode.el (diff-post-command-hook): Don't ignore changes at the
342 very beginning of a hunk (e.g. killing the first line). 400 very beginning of a hunk (e.g. killing the first line).
343 401
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."
173 :type 'number 173 :type 'number
174 :group 'doc-view) 174 :group 'doc-view)
175 175
176(defcustom doc-view-scale-internally t
177 "Whether we should try to rescale images ourselves.
178If nil, the document is re-rendered every time the scaling factor is modified.
179This only has an effect if the image libraries linked with Emacs support
180scaling."
181 :type 'boolean)
182
176(defcustom doc-view-image-width 850 183(defcustom doc-view-image-width 850
177 "Default image width. 184 "Default image width.
178Has only an effect if imagemagick support is compiled into emacs." 185Has only an effect if `doc-view-scale-internally' is non-nil and support for
186scaling is compiled into emacs."
179 :version "24.1" 187 :version "24.1"
180 :type 'number 188 :type 'number
181 :group 'doc-view) 189 :group 'doc-view)
@@ -669,8 +677,9 @@ OpenDocument format)."
669(defun doc-view-enlarge (factor) 677(defun doc-view-enlarge (factor)
670 "Enlarge the document by FACTOR." 678 "Enlarge the document by FACTOR."
671 (interactive (list doc-view-shrink-factor)) 679 (interactive (list doc-view-shrink-factor))
672 (if (eq (plist-get (cdr (doc-view-current-image)) :type) 680 (if (and doc-view-scale-internally
673 'imagemagick) 681 (eq (plist-get (cdr (doc-view-current-image)) :type)
682 'imagemagick))
674 ;; ImageMagick supports on-the-fly-rescaling. 683 ;; ImageMagick supports on-the-fly-rescaling.
675 (let ((new (ceiling (* factor doc-view-image-width)))) 684 (let ((new (ceiling (* factor doc-view-image-width))))
676 (unless (equal new doc-view-image-width) 685 (unless (equal new doc-view-image-width)
@@ -1133,10 +1142,11 @@ ARGS is a list of image descriptors."
1133 (setq doc-view-pending-cache-flush nil)) 1142 (setq doc-view-pending-cache-flush nil))
1134 (let ((ol (doc-view-current-overlay)) 1143 (let ((ol (doc-view-current-overlay))
1135 (image (if (and file (file-readable-p file)) 1144 (image (if (and file (file-readable-p file))
1136 (if (not (fboundp 'imagemagick-types)) 1145 (if (not (and doc-view-scale-internally
1146 (fboundp 'imagemagick-types)))
1137 (apply 'create-image file 'png nil args) 1147 (apply 'create-image file 'png nil args)
1138 (unless (member :width args) 1148 (unless (member :width args)
1139 (setq args (append args (list :width doc-view-image-width)))) 1149 (setq args `(,@args :width ,doc-view-image-width)))
1140 (apply 'create-image file 'imagemagick nil args)))) 1150 (apply 'create-image file 'imagemagick nil args))))
1141 (slice (doc-view-current-slice))) 1151 (slice (doc-view-current-slice)))
1142 (setf (doc-view-current-image) image) 1152 (setf (doc-view-current-image) image)
diff --git a/lisp/epg.el b/lisp/epg.el
index 6be3ba15a97..3f04aa2e07a 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -1166,10 +1166,13 @@ This function is for internal use only."
1166 ;; Set GPG_TTY and TERM for pinentry-curses. Note that we can't 1166 ;; Set GPG_TTY and TERM for pinentry-curses. Note that we can't
1167 ;; use `terminal-name' here to get the real pty name for the child 1167 ;; use `terminal-name' here to get the real pty name for the child
1168 ;; process, though /dev/fd/0" is not portable. 1168 ;; process, though /dev/fd/0" is not portable.
1169 (with-temp-buffer 1169 (unless (memq system-type '(ms-dos windows-nt))
1170 (when (= (call-process "tty" "/dev/fd/0" t) 0) 1170 (with-temp-buffer
1171 (delete-backward-char 1) 1171 (condition-case nil
1172 (setq terminal-name (buffer-string)))) 1172 (when (= (call-process "tty" "/dev/fd/0" t) 0)
1173 (delete-char -1)
1174 (setq terminal-name (buffer-string)))
1175 (file-error))))
1173 (when terminal-name 1176 (when terminal-name
1174 (setq process-environment 1177 (setq process-environment
1175 (cons (concat "GPG_TTY=" terminal-name) 1178 (cons (concat "GPG_TTY=" terminal-name)
@@ -1297,7 +1300,7 @@ This function is for internal use only."
1297 (> (float-time (or (nth 5 (file-attributes epg-agent-file)) 1300 (> (float-time (or (nth 5 (file-attributes epg-agent-file))
1298 '(0 0 0 0))) 1301 '(0 0 0 0)))
1299 (float-time epg-agent-mtime)))) 1302 (float-time epg-agent-mtime))))
1300 (redraw-frame)) 1303 (redraw-frame (selected-frame)))
1301 (epg-context-set-result-for 1304 (epg-context-set-result-for
1302 context 'error 1305 context 'error
1303 (nreverse (epg-context-result-for context 'error)))) 1306 (nreverse (epg-context-result-for context 'error))))
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 @@
12013-01-04 Glenn Morris <rgm@gnu.org>
2
3 * erc-backend.el (312): Fix typo. (Bug#13235)
4
12012-11-30 Glenn Morris <rgm@gnu.org> 52012-11-30 Glenn Morris <rgm@gnu.org>
2 6
3 * erc.el (erc-accidental-paste-threshold-seconds): Add :version. 7 * 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
1633 1633
1634(define-erc-response-handler (312) 1634(define-erc-response-handler (312)
1635 "Server name response in WHOIS." nil 1635 "Server name response in WHOIS." nil
1636 (pcase-let ((`(,nick ,server-host)) 1636 (pcase-let ((`(,nick ,server-host)
1637 (cdr (erc-response.command-args parsed))) 1637 (cdr (erc-response.command-args parsed))))
1638 (erc-display-message 1638 (erc-display-message
1639 parsed 'notice 'active 's312 1639 parsed 'notice 'active 's312
1640 ?n nick ?s server-host ?c (erc-response.contents parsed)))) 1640 ?n nick ?s server-host ?c (erc-response.contents parsed))))
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."
209(declare-function dired-unmark "dired" (arg)) 209(declare-function dired-unmark "dired" (arg))
210(declare-function dired-do-flagged-delete "dired" (&optional nomessage)) 210(declare-function dired-do-flagged-delete "dired" (&optional nomessage))
211(declare-function dos-8+3-filename "dos-fns" (filename)) 211(declare-function dos-8+3-filename "dos-fns" (filename))
212(declare-function view-mode-disable "view" ())
213(declare-function dosified-file-name "dos-fns" (file-name)) 212(declare-function dosified-file-name "dos-fns" (file-name))
214 213
215(defvar file-name-invalid-regexp 214(defvar file-name-invalid-regexp
@@ -2125,7 +2124,7 @@ unless NOMODES is non-nil."
2125 (setq buffer-read-only t)) 2124 (setq buffer-read-only t))
2126 (unless nomodes 2125 (unless nomodes
2127 (when (and view-read-only view-mode) 2126 (when (and view-read-only view-mode)
2128 (view-mode-disable)) 2127 (view-mode -1))
2129 (normal-mode t) 2128 (normal-mode t)
2130 ;; If requested, add a newline at the end of the file. 2129 ;; If requested, add a newline at the end of the file.
2131 (and (memq require-final-newline '(visit visit-save)) 2130 (and (memq require-final-newline '(visit visit-save))
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.)"
343 (t (concat "…" (substring most compare)))) 343 (t (concat "…" (substring most compare))))
344 close-bracket))) 344 close-bracket)))
345 ;;"-prospects" - more than one candidate 345 ;;"-prospects" - more than one candidate
346 (prospects-len (+ (length determ) 6 ;; take {,...} into account 346 (prospects-len (+ (length determ)
347 (string-width (buffer-string)))) 347 (string-width icomplete-separator)
348 3 ;; take {…} into account
349 (string-width (buffer-string))))
348 (prospects-max 350 (prospects-max
349 ;; Max total length to use, including the minibuffer content. 351 ;; Max total length to use, including the minibuffer content.
350 (* (+ icomplete-prospects-height 352 (* (+ icomplete-prospects-height
@@ -375,7 +377,9 @@ are exhibited within the square braces.)"
375 (cond ((string-equal comp "") (setq most-is-exact t)) 377 (cond ((string-equal comp "") (setq most-is-exact t))
376 ((member comp prospects)) 378 ((member comp prospects))
377 (t (setq prospects-len 379 (t (setq prospects-len
378 (+ (string-width comp) 1 prospects-len)) 380 (+ (string-width comp)
381 (string-width icomplete-separator)
382 prospects-len))
379 (if (< prospects-len prospects-max) 383 (if (< prospects-len prospects-max)
380 (push comp prospects) 384 (push comp prospects)
381 (setq limit t)))))) 385 (setq limit t))))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 5bbf1708654..79f8d82b02b 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1452,23 +1452,22 @@ of."
1452(defun tramp-set-file-uid-gid (filename &optional uid gid) 1452(defun tramp-set-file-uid-gid (filename &optional uid gid)
1453 "Set the ownership for FILENAME. 1453 "Set the ownership for FILENAME.
1454If UID and GID are provided, these values are used; otherwise uid 1454If UID and GID are provided, these values are used; otherwise uid
1455and gid of the corresponding user is taken. Both parameters must be integers." 1455and gid of the corresponding user is taken. Both parameters must
1456be non-negative integers."
1456 ;; Modern Unices allow chown only for root. So we might need 1457 ;; Modern Unices allow chown only for root. So we might need
1457 ;; another implementation, see `dired-do-chown'. OTOH, it is mostly 1458 ;; another implementation, see `dired-do-chown'. OTOH, it is mostly
1458 ;; working with su(do)? when it is needed, so it shall succeed in 1459 ;; working with su(do)? when it is needed, so it shall succeed in
1459 ;; the majority of cases. 1460 ;; the majority of cases.
1460 ;; Don't modify `last-coding-system-used' by accident. 1461 ;; Don't modify `last-coding-system-used' by accident.
1461 (let ((last-coding-system-used last-coding-system-used) 1462 (let ((last-coding-system-used last-coding-system-used))
1462 (uid (and (numberp uid) (round uid)))
1463 (gid (and (numberp gid) (round gid))))
1464 (if (file-remote-p filename) 1463 (if (file-remote-p filename)
1465 (with-parsed-tramp-file-name filename nil 1464 (with-parsed-tramp-file-name filename nil
1466 (if (and (zerop (user-uid)) (tramp-local-host-p v)) 1465 (if (and (zerop (user-uid)) (tramp-local-host-p v))
1467 ;; If we are root on the local host, we can do it directly. 1466 ;; If we are root on the local host, we can do it directly.
1468 (tramp-set-file-uid-gid localname uid gid) 1467 (tramp-set-file-uid-gid localname uid gid)
1469 (let ((uid (or (and (integerp uid) uid) 1468 (let ((uid (or (and (natnump uid) uid)
1470 (tramp-get-remote-uid v 'integer))) 1469 (tramp-get-remote-uid v 'integer)))
1471 (gid (or (and (integerp gid) gid) 1470 (gid (or (and (natnump gid) gid)
1472 (tramp-get-remote-gid v 'integer)))) 1471 (tramp-get-remote-gid v 'integer))))
1473 (tramp-send-command 1472 (tramp-send-command
1474 v (format 1473 v (format
@@ -1477,8 +1476,8 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1477 1476
1478 ;; We handle also the local part, because there doesn't exist 1477 ;; We handle also the local part, because there doesn't exist
1479 ;; `set-file-uid-gid'. On W32 "chown" might not work. 1478 ;; `set-file-uid-gid'. On W32 "chown" might not work.
1480 (let ((uid (or (and (integerp uid) uid) (tramp-get-local-uid 'integer))) 1479 (let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
1481 (gid (or (and (integerp gid) gid) (tramp-get-local-gid 'integer)))) 1480 (gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
1482 (tramp-compat-call-process 1481 (tramp-compat-call-process
1483 "chown" nil nil nil 1482 "chown" nil nil nil
1484 (format "%d:%d" uid gid) (tramp-shell-quote-argument filename)))))) 1483 (format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))))
@@ -4665,7 +4664,7 @@ raises an error."
4665 command (buffer-string)))))))) 4664 command (buffer-string))))))))
4666 4665
4667(defun tramp-convert-file-attributes (vec attr) 4666(defun tramp-convert-file-attributes (vec attr)
4668 "Convert file-attributes ATTR generated by perl script, stat or ls. 4667 "Convert `file-attributes' ATTR generated by perl script, stat or ls.
4669Convert file mode bits to string and set virtual device number. 4668Convert file mode bits to string and set virtual device number.
4670Return ATTR." 4669Return ATTR."
4671 (when attr 4670 (when attr
@@ -4673,6 +4672,17 @@ Return ATTR."
4673 (when (stringp (car attr)) 4672 (when (stringp (car attr))
4674 (while (string-match tramp-color-escape-sequence-regexp (car attr)) 4673 (while (string-match tramp-color-escape-sequence-regexp (car attr))
4675 (setcar attr (replace-match "" nil nil (car attr))))) 4674 (setcar attr (replace-match "" nil nil (car attr)))))
4675 ;; Convert uid and gid. Use -1 as indication of unusable value.
4676 (when (and (numberp (nth 2 attr)) (< (nth 2 attr) 0))
4677 (setcar (nthcdr 2 attr) -1))
4678 (when (and (floatp (nth 2 attr))
4679 (<= (nth 2 attr) (tramp-compat-most-positive-fixnum)))
4680 (setcar (nthcdr 2 attr) (round (nth 2 attr))))
4681 (when (and (numberp (nth 3 attr)) (< (nth 3 attr) 0))
4682 (setcar (nthcdr 3 attr) -1))
4683 (when (and (floatp (nth 3 attr))
4684 (<= (nth 3 attr) (tramp-compat-most-positive-fixnum)))
4685 (setcar (nthcdr 3 attr) (round (nth 3 attr))))
4676 ;; Convert last access time. 4686 ;; Convert last access time.
4677 (unless (listp (nth 4 attr)) 4687 (unless (listp (nth 4 attr))
4678 (setcar (nthcdr 4 attr) 4688 (setcar (nthcdr 4 attr)
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 0dfc7f27a9c..81dc31792c3 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."
67;;;###autoload 67;;;###autoload
68(defcustom tags-compression-info-list 68(defcustom tags-compression-info-list
69 (purecopy '("" ".Z" ".bz2" ".gz" ".xz" ".tgz")) 69 (purecopy '("" ".Z" ".bz2" ".gz" ".xz" ".tgz"))
70 "List of extensions tried by etags when jka-compr is used. 70 "List of extensions tried by etags when `auto-compression-mode' is on.
71An empty string means search the non-compressed file. 71An empty string means search the non-compressed file."
72These extensions will be tried only if jka-compr was activated
73\(i.e. via customize of `auto-compression-mode' or by calling the function
74`auto-compression-mode')."
75 :version "24.1" ; added xz 72 :version "24.1" ; added xz
76 :type '(repeat string) 73 :type '(repeat string)
77 :group 'etags) 74 :group 'etags)
@@ -1182,7 +1179,7 @@ error message."
1182 "Find the right line in the specified FILE." 1179 "Find the right line in the specified FILE."
1183 ;; If interested in compressed-files, search files with extensions. 1180 ;; If interested in compressed-files, search files with extensions.
1184 ;; Otherwise, search only the real file. 1181 ;; Otherwise, search only the real file.
1185 (let* ((buffer-search-extensions (if (featurep 'jka-compr) 1182 (let* ((buffer-search-extensions (if auto-compression-mode
1186 tags-compression-info-list 1183 tags-compression-info-list
1187 '(""))) 1184 '("")))
1188 the-buffer 1185 the-buffer
@@ -1206,7 +1203,7 @@ error message."
1206 (setq file-search-extensions (cdr file-search-extensions)) 1203 (setq file-search-extensions (cdr file-search-extensions))
1207 (setq the-buffer (find-file-noselect (concat file (car file-search-extensions)))))) 1204 (setq the-buffer (find-file-noselect (concat file (car file-search-extensions))))))
1208 (if (not the-buffer) 1205 (if (not the-buffer)
1209 (if (featurep 'jka-compr) 1206 (if auto-compression-mode
1210 (error "File %s (with or without extensions %s) not found" file tags-compression-info-list) 1207 (error "File %s (with or without extensions %s) not found" file tags-compression-info-list)
1211 (error "File %s not found" file)) 1208 (error "File %s not found" file))
1212 (set-buffer the-buffer)))) 1209 (set-buffer the-buffer))))
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).")
3977 `(progn 3977 `(progn
3978 (defvar ,sym 3978 (defvar ,sym
3979 (let ((i 1)) 3979 (let ((i 1))
3980 (while (not (eq (nth 1 (backtrace-frame i)) 3980 (while (not (eq (indirect-function (nth 1 (backtrace-frame i)) t)
3981 'called-interactively-p)) 3981 (indirect-function 'called-interactively-p)))
3982 (setq i (1+ i))) 3982 (setq i (1+ i)))
3983 i)) 3983 i))
3984 ;; (unless (eq (nth 1 (backtrace-frame ,sym)) 'called-interactively-p) 3984 ;; (unless (eq (nth 1 (backtrace-frame ,sym)) 'called-interactively-p)
diff --git a/lisp/term.el b/lisp/term.el
index fc7ec3ad0f9..b37e71280da 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -778,14 +778,14 @@ Buffer local variable.")
778(defcustom term-default-fg-color nil 778(defcustom term-default-fg-color nil
779 "If non-nil, default color for foreground in Term mode." 779 "If non-nil, default color for foreground in Term mode."
780 :group 'term 780 :group 'term
781 :type 'string) 781 :type '(choice (const nil) (string :tag "color")))
782(make-obsolete-variable 'term-default-fg-color "use the face `term' instead." 782(make-obsolete-variable 'term-default-fg-color "use the face `term' instead."
783 "24.3") 783 "24.3")
784 784
785(defcustom term-default-bg-color nil 785(defcustom term-default-bg-color nil
786 "If non-nil, default color for foreground in Term mode." 786 "If non-nil, default color for foreground in Term mode."
787 :group 'term 787 :group 'term
788 :type 'string) 788 :type '(choice (const nil) (string :tag "color")))
789(make-obsolete-variable 'term-default-bg-color "use the face `term' instead." 789(make-obsolete-variable 'term-default-bg-color "use the face `term' instead."
790 "24.3") 790 "24.3")
791 791
@@ -3222,18 +3222,24 @@ See `term-prompt-regexp'."
3222 (let ((color 3222 (let ((color
3223 (if term-ansi-current-reverse 3223 (if term-ansi-current-reverse
3224 (face-foreground 3224 (face-foreground
3225 (elt ansi-term-color-vector term-ansi-current-color)) 3225 (elt ansi-term-color-vector term-ansi-current-color)
3226 nil 'default)
3226 (face-background 3227 (face-background
3227 (elt ansi-term-color-vector term-ansi-current-bg-color))))) 3228 (elt ansi-term-color-vector term-ansi-current-bg-color)
3229 nil 'default))))
3228 (setq term-current-face 3230 (setq term-current-face
3229 (list :background color 3231 (list :background color
3230 :foreground color)) 3232 :foreground color))
3231 ) ;; No need to bother with anything else if it's invisible. 3233 ) ;; No need to bother with anything else if it's invisible.
3232 (setq term-current-face 3234 (setq term-current-face
3233 (list :foreground 3235 (list :foreground
3234 (face-foreground (elt ansi-term-color-vector term-ansi-current-color)) 3236 (face-foreground
3237 (elt ansi-term-color-vector term-ansi-current-color)
3238 nil 'default)
3235 :background 3239 :background
3236 (face-background (elt ansi-term-color-vector term-ansi-current-bg-color)) 3240 (face-background
3241 (elt ansi-term-color-vector term-ansi-current-bg-color)
3242 nil 'default)
3237 :inverse-video term-ansi-current-reverse)) 3243 :inverse-video term-ansi-current-reverse))
3238 3244
3239 (when term-ansi-current-bold 3245 (when term-ansi-current-bold
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
461 461
462Entry to view-mode runs the normal hook `view-mode-hook'." 462Entry to view-mode runs the normal hook `view-mode-hook'."
463 :lighter " View" :keymap view-mode-map 463 :lighter " View" :keymap view-mode-map
464 (if view-mode (view-mode-enable) (view-mode-disable))) 464 (if view-mode (view--enable) (view--disable)))
465 465
466(defun view-mode-enable (&optional run-view-mode-hook) 466(defun view--enable ()
467 "Turn on View mode.
468Run `view-mode-hook' when RUN-VIEW-MODE-HOOK is non-nil."
469 ;; Always leave view mode before changing major mode. 467 ;; Always leave view mode before changing major mode.
470 ;; This is to guarantee that the buffer-read-only variable is restored. 468 ;; This is to guarantee that the buffer-read-only variable is restored.
471 (add-hook 'change-major-mode-hook 'view-mode-disable nil t) 469 (add-hook 'change-major-mode-hook 'view--disable nil t)
472 (setq view-mode t 470 (setq view-page-size nil
473 view-page-size nil
474 view-half-page-size nil 471 view-half-page-size nil
475 view-old-buffer-read-only buffer-read-only 472 view-old-buffer-read-only buffer-read-only
476 buffer-read-only t) 473 buffer-read-only t)
@@ -481,16 +478,18 @@ Run `view-mode-hook' when RUN-VIEW-MODE-HOOK is non-nil."
481 (format "continue viewing %s" 478 (format "continue viewing %s"
482 (if (buffer-file-name) 479 (if (buffer-file-name)
483 (file-name-nondirectory (buffer-file-name)) 480 (file-name-nondirectory (buffer-file-name))
484 (buffer-name))))) 481 (buffer-name))))))
485 (force-mode-line-update)
486 (when run-view-mode-hook
487 (run-hooks 'view-mode-hook)))
488 482
483
484(define-obsolete-function-alias 'view-mode-enable 'view-mode "24.4")
489(defun view-mode-disable () 485(defun view-mode-disable ()
490 "Turn off View mode." 486 "Turn off View mode."
491 (remove-hook 'change-major-mode-hook 'view-mode-disable t) 487 (declare (obsolete view-mode "24.4"))
488 (view-mode -1))
489
490(defun view--disable ()
491 (remove-hook 'change-major-mode-hook 'view--disable t)
492 (and view-overlay (delete-overlay view-overlay)) 492 (and view-overlay (delete-overlay view-overlay))
493 (force-mode-line-update)
494 ;; Calling toggle-read-only while View mode is enabled 493 ;; Calling toggle-read-only while View mode is enabled
495 ;; sets view-read-only to t as a buffer-local variable 494 ;; sets view-read-only to t as a buffer-local variable
496 ;; after exiting View mode. That arranges that the next toggle-read-only 495 ;; 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."
499 ;; so that View mode stays off if toggle-read-only is called. 498 ;; so that View mode stays off if toggle-read-only is called.
500 (if (local-variable-p 'view-read-only) 499 (if (local-variable-p 'view-read-only)
501 (kill-local-variable 'view-read-only)) 500 (kill-local-variable 'view-read-only))
502 (setq view-mode nil)
503 (if (boundp 'Helper-return-blurb) 501 (if (boundp 'Helper-return-blurb)
504 (setq Helper-return-blurb view-old-Helper-return-blurb)) 502 (setq Helper-return-blurb view-old-Helper-return-blurb))
505 (if buffer-read-only 503 (if buffer-read-only
@@ -562,8 +560,7 @@ This function runs the normal hook `view-mode-hook'."
562 (setq view-exit-action exit-action)) 560 (setq view-exit-action exit-action))
563 561
564 (unless view-mode 562 (unless view-mode
565 (view-mode-enable t) 563 (view-mode 1)
566 (force-mode-line-update)
567 (unless view-inhibit-help-message 564 (unless view-inhibit-help-message
568 (message "%s" 565 (message "%s"
569 (substitute-command-keys "\ 566 (substitute-command-keys "\
@@ -590,7 +587,7 @@ current buffer. "
590 (when view-mode 587 (when view-mode
591 (let ((buffer (window-buffer))) 588 (let ((buffer (window-buffer)))
592 (unless view-no-disable-on-exit 589 (unless view-no-disable-on-exit
593 (view-mode-disable)) 590 (view-mode -1))
594 591
595 (unless exit-only 592 (unless exit-only
596 (cond 593 (cond
@@ -601,8 +598,7 @@ current buffer. "
601 (quit-window))) 598 (quit-window)))
602 599
603 (when exit-action 600 (when exit-action
604 (funcall exit-action buffer)) 601 (funcall exit-action buffer))))))
605 (force-mode-line-update)))))
606 602
607(defun View-exit () 603(defun View-exit ()
608 "Exit View mode but stay in current buffer." 604 "Exit View mode but stay in current buffer."
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], [
712 lib/stdbool.in.h 712 lib/stdbool.in.h
713 lib/stddef.in.h 713 lib/stddef.in.h
714 lib/stdint.in.h 714 lib/stdint.in.h
715 lib/stdio.c
716 lib/stdio.in.h 715 lib/stdio.in.h
717 lib/stdlib.in.h 716 lib/stdlib.in.h
718 lib/strftime.c 717 lib/strftime.c
diff --git a/src/ChangeLog b/src/ChangeLog
index 7342f7c6add..8fc876e248c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,19 @@
12013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * nsterm.m (ns_draw_underwave):
4 * w32term.c (w32_draw_underwave):
5 * xterm.c (x_draw_underwave): Make underwave look more triangular
6 and also degrade gracefully for small fonts. (Bug#13000)
7
8 * nsterm.m (ns_draw_text_decoration):
9 * w32term.c (x_draw_glyph_string):
10 * xterm.c (x_draw_glyph_string): Don't use previous underline
11 thickness and position if previous underline type is underwave.
12
132013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
14
15 * fileio.c (Ffile_acl): Undocument return format.
16
12013-01-02 Glenn Morris <rgm@gnu.org> 172013-01-02 Glenn Morris <rgm@gnu.org>
2 18
3 * keymap.c (Fkey_description): Doc fix. (Bug#13323) 19 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
@@ -257,7 +273,7 @@
257 273
258 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove. 274 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
259 (redisplay_internal): Don't bother selecting the frame to get the 275 (redisplay_internal): Don't bother selecting the frame to get the
260 proper value of frame-local variables. 276 proper value of frame-local variables (bug#13225).
261 277
2622012-12-20 Dmitry Antipov <dmantipov@yandex.ru> 2782012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
263 279
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. */)
3084} 3084}
3085 3085
3086DEFUN ("file-acl", Ffile_acl, Sfile_acl, 1, 1, 0, 3086DEFUN ("file-acl", Ffile_acl, Sfile_acl, 1, 1, 0,
3087 doc: /* Return ACL entries of file named FILENAME, as a string. 3087 doc: /* Return ACL entries of file named FILENAME.
3088The entries are returned in a format suitable for use in `set-file-acl'
3089but is otherwise undocumented and subject to change.
3088Return nil if file does not exist or is not accessible, or if Emacs 3090Return nil if file does not exist or is not accessible, or if Emacs
3089was unable to determine the ACL entries. The latter can happen for 3091was unable to determine the ACL entries. */)
3090local files if Emacs was not compiled with ACL support, or for remote
3091files if the file handler returns nil for the file's ACL entries. */)
3092 (Lisp_Object filename) 3092 (Lisp_Object filename)
3093{ 3093{
3094 Lisp_Object absname; 3094 Lisp_Object absname;
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. */)
86 before it's time to do a QUIT. This must be a power of 2. */ 86 before it's time to do a QUIT. This must be a power of 2. */
87enum { QUIT_COUNT_HEURISTIC = 1 << 16 }; 87enum { QUIT_COUNT_HEURISTIC = 1 << 16 };
88 88
89/* Random data-structure functions */ 89/* Random data-structure functions. */
90 90
91DEFUN ("length", Flength, Slength, 1, 1, 0, 91DEFUN ("length", Flength, Slength, 1, 1, 0,
92 doc: /* Return the length of vector, list or string SEQUENCE. 92 doc: /* Return the length of vector, list or string SEQUENCE.
diff --git a/src/nsterm.m b/src/nsterm.m
index c8ce484a432..0fd062b7f17 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2566,7 +2566,7 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
2566 Draw a wavy line under glyph string s. The wave fills wave_height 2566 Draw a wavy line under glyph string s. The wave fills wave_height
2567 pixels from y. 2567 pixels from y.
2568 2568
2569 x wave_length = 3 2569 x wave_length = 2
2570 -- 2570 --
2571 y * * * * * 2571 y * * * * *
2572 |* * * * * * * * * 2572 |* * * * * * * * *
@@ -2576,14 +2576,14 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
2576static void 2576static void
2577ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x) 2577ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2578{ 2578{
2579 int wave_height = 3, wave_length = 3; 2579 int wave_height = 3, wave_length = 2;
2580 int y, dx, dy, odd, xmax; 2580 int y, dx, dy, odd, xmax;
2581 NSPoint a, b; 2581 NSPoint a, b;
2582 NSRect waveClip; 2582 NSRect waveClip;
2583 2583
2584 dx = wave_length; 2584 dx = wave_length;
2585 dy = wave_height - 1; 2585 dy = wave_height - 1;
2586 y = s->ybase + 1; 2586 y = s->ybase - wave_height + 3;
2587 xmax = x + width; 2587 xmax = x + width;
2588 2588
2589 /* Find and set clipping rectangle */ 2589 /* Find and set clipping rectangle */
@@ -2592,10 +2592,10 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2592 NSRectClip (waveClip); 2592 NSRectClip (waveClip);
2593 2593
2594 /* Draw the waves */ 2594 /* Draw the waves */
2595 a.x = x - ((int)(x) % dx); 2595 a.x = x - ((int)(x) % dx) + 0.5;
2596 b.x = a.x + dx; 2596 b.x = a.x + dx;
2597 odd = (int)(a.x/dx) % 2; 2597 odd = (int)(a.x/dx) % 2;
2598 a.y = b.y = y; 2598 a.y = b.y = y + 0.5;
2599 2599
2600 if (odd) 2600 if (odd)
2601 a.y += dy; 2601 a.y += dy;
@@ -2606,7 +2606,7 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2606 { 2606 {
2607 [NSBezierPath strokeLineFromPoint:a toPoint:b]; 2607 [NSBezierPath strokeLineFromPoint:a toPoint:b];
2608 a.x = b.x, a.y = b.y; 2608 a.x = b.x, a.y = b.y;
2609 b.x += dx, b.y = y + odd*dy; 2609 b.x += dx, b.y = y + 0.5 + odd*dy;
2610 odd = !odd; 2610 odd = !odd;
2611 } 2611 }
2612 2612
@@ -2646,6 +2646,7 @@ ns_draw_text_decoration (struct glyph_string *s, struct face *face,
2646 2646
2647 /* If the prev was underlined, match its appearance. */ 2647 /* If the prev was underlined, match its appearance. */
2648 if (s->prev && s->prev->face->underline_p 2648 if (s->prev && s->prev->face->underline_p
2649 && s->prev->face->underline_type == FACE_UNDER_LINE
2649 && s->prev->underline_thickness > 0) 2650 && s->prev->underline_thickness > 0)
2650 { 2651 {
2651 thickness = s->prev->underline_thickness; 2652 thickness = s->prev->underline_thickness;
diff --git a/src/w32term.c b/src/w32term.c
index c5681438bfe..36ae4d7797f 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -358,7 +358,7 @@ w32_restore_glyph_string_clip (struct glyph_string *s)
358void 358void
359w32_draw_underwave (struct glyph_string *s, COLORREF color) 359w32_draw_underwave (struct glyph_string *s, COLORREF color)
360{ 360{
361 int wave_height = 2, wave_length = 3; 361 int wave_height = 3, wave_length = 2;
362 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax; 362 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
363 XRectangle wave_clip, string_clip, final_clip; 363 XRectangle wave_clip, string_clip, final_clip;
364 RECT w32_final_clip, w32_string_clip; 364 RECT w32_final_clip, w32_string_clip;
@@ -367,7 +367,7 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color)
367 dx = wave_length; 367 dx = wave_length;
368 dy = wave_height - 1; 368 dy = wave_height - 1;
369 x0 = s->x; 369 x0 = s->x;
370 y0 = s->ybase + 1; 370 y0 = s->ybase - wave_height + 3;
371 width = s->width; 371 width = s->width;
372 xmax = x0 + width; 372 xmax = x0 + width;
373 373
@@ -2456,7 +2456,8 @@ x_draw_glyph_string (struct glyph_string *s)
2456 unsigned long thickness, position; 2456 unsigned long thickness, position;
2457 int y; 2457 int y;
2458 2458
2459 if (s->prev && s->prev->face->underline_p) 2459 if (s->prev && s->prev->face->underline_p
2460 && s->prev->face->underline_type == FACE_UNDER_LINE)
2460 { 2461 {
2461 /* We use the same underline style as the previous one. */ 2462 /* We use the same underline style as the previous one. */
2462 thickness = s->prev->underline_thickness; 2463 thickness = s->prev->underline_thickness;
diff --git a/src/xterm.c b/src/xterm.c
index d1934b1986e..e24fbd19f2b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2634,14 +2634,14 @@ x_draw_stretch_glyph_string (struct glyph_string *s)
2634static void 2634static void
2635x_draw_underwave (struct glyph_string *s) 2635x_draw_underwave (struct glyph_string *s)
2636{ 2636{
2637 int wave_height = 2, wave_length = 3; 2637 int wave_height = 3, wave_length = 2;
2638 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax; 2638 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
2639 XRectangle wave_clip, string_clip, final_clip; 2639 XRectangle wave_clip, string_clip, final_clip;
2640 2640
2641 dx = wave_length; 2641 dx = wave_length;
2642 dy = wave_height - 1; 2642 dy = wave_height - 1;
2643 x0 = s->x; 2643 x0 = s->x;
2644 y0 = s->ybase + 1; 2644 y0 = s->ybase - wave_height + 3;
2645 width = s->width; 2645 width = s->width;
2646 xmax = x0 + width; 2646 xmax = x0 + width;
2647 2647
@@ -2809,7 +2809,8 @@ x_draw_glyph_string (struct glyph_string *s)
2809 unsigned long thickness, position; 2809 unsigned long thickness, position;
2810 int y; 2810 int y;
2811 2811
2812 if (s->prev && s->prev->face->underline_p) 2812 if (s->prev && s->prev->face->underline_p
2813 && s->prev->face->underline_type == FACE_UNDER_LINE)
2813 { 2814 {
2814 /* We use the same underline style as the previous one. */ 2815 /* We use the same underline style as the previous one. */
2815 thickness = s->prev->underline_thickness; 2816 thickness = s->prev->underline_thickness;
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
5 5
6# adsgsdg 6# adsgsdg
7 7
8case $X in
9 foo)
10 do_something
11 ;;
12 arg=*) # bug#12953
13 do_something_else_based_on_arg
14 ;;
15 *)
16 default
17 ;;
18esac
19
8echo -n $(( 5 << 2 )) 20echo -n $(( 5 << 2 ))
9# This should not be treated as a heredoc (bug#12770). 21# This should not be treated as a heredoc (bug#12770).
102 222