From 01b9ba0983602e3085a67a5e076d6d033b368a0b Mon Sep 17 00:00:00 2001
From: Jonas Fonseca <fonseca@diku.dk>
Date: Sat, 14 Jan 2006 19:24:46 +0100
Subject: [PATCH 1/6] Fix keymap-%.txt building; move FIXME about prefixes to
 elinkskeys.5.txt

---
 doc/Makefile         |  2 +-
 doc/elinkskeys.5.txt | 10 ++++++++++
 doc/tools/keys2doc   |  8 --------
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/doc/Makefile b/doc/Makefile
index 3a6335605..85138f216 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -93,7 +93,7 @@ install-local:
 CODE2DOC = $(srcdir)tools/code2doc
 HELP2DOC = $(srcdir)tools/help2doc
 CONF2DOC = $(srcdir)tools/conf2doc
-KEYS2DOC = $(srcdir)tools/make-elinkskeys-manpage
+KEYS2DOC = $(srcdir)tools/keys2doc
 ELINKS	 = $(top_builddir)/src/elinks
 FEATURES = $(top_srcdir)/features.conf
 KBDBIND	 = $(top_srcdir)/src/config/kbdbind.c
diff --git a/doc/elinkskeys.5.txt b/doc/elinkskeys.5.txt
index 3fde5b018..d53230756 100644
--- a/doc/elinkskeys.5.txt
+++ b/doc/elinkskeys.5.txt
@@ -80,6 +80,16 @@ Some keys will need to be quoted or escaped. For example, space can be written
 as  `" "` (quote space quote), and the quote itself as `\"` (backslash quote).
 Backslash can be written as `\\` (double backslash).
 
+/////////////////////////////////////////////////////////////////////////////
+FIXME:
+
+ - You may prefix each of these keys with a number, telling its repeat count
+  (how many times to do it). You can also re-bind keys, see elinkskeys(5) for
+  documentation and a more complete list of keys  bound by default. 
+
+ - The following keys can be used while editing a line/jumping to a URL
+/////////////////////////////////////////////////////////////////////////////
+
 KEYMAP ACTIONS
 --------------
 
diff --git a/doc/tools/keys2doc b/doc/tools/keys2doc
index e4b537e83..aa031075b 100755
--- a/doc/tools/keys2doc
+++ b/doc/tools/keys2doc
@@ -6,14 +6,6 @@
 # Copyright (c) Jonas Fonseca <fonseca@diku.dk>, 2005-2006
 #
 
-# FIXME:
-#
-# - You may prefix each of these keys with a number, telling its repeat count
-# (how many times to do it). You can also re-bind keys, see elinkskeys(5) for
-# documentation and a more complete list of keys  bound by default. 
-#
-# - The following keys can be used while editing a line/jumping to a URL
-
 KBDBIND=$1
 CONFIGDIR=$(dirname "$KBDBIND")
 OUTPUT=$2

From c992a0860c479bf006108014eddfa23865081511 Mon Sep 17 00:00:00 2001
From: Jonas Fonseca <fonseca@diku.dk>
Date: Sat, 14 Jan 2006 19:40:29 +0100
Subject: [PATCH 2/6] Sound of silence

---
 doc/Makefile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/Makefile b/doc/Makefile
index 85138f216..a421fb481 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -61,7 +61,7 @@ man:  txt $(MAN_DOCS)
 all-docs: man html pdf
 
 install-doc: all-docs update-man install
-	$(foreach doc,$(HTML_DOCS), \
+	@$(foreach doc,$(HTML_DOCS), \
 		if test -d $(doc); then \
 			$(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(PACKAGE)/html/$(doc); \
 			$(call ncmd,installdata,$(doc)/*,$(HTML_DIR)/$(doc)); \
@@ -69,12 +69,12 @@ install-doc: all-docs update-man install
 			$(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(PACKAGE)/html; \
 			$(call ncmd,installdata,$(doc),$(HTML_DIR)); \
 		fi;)
-	$(foreach doc,$(PDF_DOCS), \
+	@$(foreach doc,$(PDF_DOCS), \
 		$(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(PACKAGE)/pdf; \
 		$(call ncmd,installdata,$(doc),$(PDF_DIR);))
 
 update-man: man
-	$(if $(MAN_DOCS), \
+	@$(if $(MAN_DOCS), \
 		$(call ncmd,installdata,elinks.1,man/man1/elinks.1.in); \
 		$(call ncmd,installdata,elinkskeys.5,man/man5/); \
 		$(call ncmd,installdata,elinks.conf.5,man/man5/))
@@ -177,19 +177,19 @@ man_hack = sed "s/^\(\.TH \"ELINKS[^\"]*\" [0-9] \).*/\1\"$(1)\" \"$(MAN_DATE)\"
 
 %.html: %.txt asciidoc.conf
 	$(call cmd,asciidoc,xhtml11)
-	$(call asciidoc_dep)
+	@-$(call asciidoc_dep)
 
 %.xml: %.txt asciidoc.conf
 	$(call cmd,asciidoc,docbook)
-	$(call asciidoc_dep)
+	@-$(call asciidoc_dep)
 
 %.1: %.1.xml
 	$(call cmd,xmlto,man)
-	$(call man_hack,$(call man_desc))
+	@$(call man_hack,$(call man_desc))
 
 %.5: %.5.xml
 	$(call cmd,xmlto,man)
-	$(call man_hack,$(call man_desc))
+	@$(call man_hack,$(call man_desc))
 
 %.html-chunked: %.xml
 	$(call cmd,xmlto,html,-o $@)

From 66e9ae4957449d0e03d16ff3c892aa3c34e6d3d2 Mon Sep 17 00:00:00 2001
From: Jonas Fonseca <fonseca@diku.dk>
Date: Sat, 14 Jan 2006 19:25:47 +0100
Subject: [PATCH 3/6] Escape {}'s so that AsciiDoc does the right thing; fixes
 elinks.conf(5)

---
 doc/man/man5/elinks.conf.5 | 4 ++--
 doc/tools/help2doc         | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/man/man5/elinks.conf.5 b/doc/man/man5/elinks.conf.5
index db9ffa86c..fcd422df1 100644
--- a/doc/man/man5/elinks.conf.5
+++ b/doc/man/man5/elinks.conf.5
@@ -17,7 +17,7 @@
 .el .ne 3
 .IP "\\$1" \\$2
 ..
-.TH "ELINKS.CONF" 5 "ELinks configuration file" "2006-01-12" "ELinks configuration file"
+.TH "ELINKS.CONF" 5 "ELinks configuration file" "2006-01-14" "ELinks configuration file"
 .SH NAME
 elinks.conf \- ELinks configuration file
 .SH "SYNOPSIS"
@@ -742,7 +742,7 @@ Prevent overwriting the local files:
 0: is files will silently be overwritten
 .TP
 \(bu
-
+1: is add a suffix \&.{number} (for example '\&.1') to the name
 .TP
 \(bu
 2: is ask the user
diff --git a/doc/tools/help2doc b/doc/tools/help2doc
index 62255ecc4..2b48da28f 100755
--- a/doc/tools/help2doc
+++ b/doc/tools/help2doc
@@ -105,6 +105,7 @@ do
 		fi
 
 		line=`echo "$line" | sed -e "s/[ ]*(DISABLED)//"`
+		line=`echo "$line" | sed 's/\([{}]\)/\\\\\1/g'`
 		number=
 		if test -n "$parse_int_option";
 		then

From 6e79a24679f3fbe11085b7d95e3c9161f456c621 Mon Sep 17 00:00:00 2001
From: Jonas Fonseca <fonseca@diku.dk>
Date: Sat, 14 Jan 2006 19:45:40 +0100
Subject: [PATCH 4/6] Add an empty line before titles in keymap-*.txt; fixes
 elinkskeys.5.html

---
 doc/tools/keys2doc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/tools/keys2doc b/doc/tools/keys2doc
index aa031075b..5e95eebc5 100755
--- a/doc/tools/keys2doc
+++ b/doc/tools/keys2doc
@@ -14,6 +14,7 @@ test -d "$CONFIGDIR" || exit
 
 print_title()
 {
+	echo
 	echo "$1" | tr 'a-z' 'A-Z'
 	echo "$1" | sed 's/[^~]/~/g'
 	echo

From 8aa32ea1536d80cb3ada830faf637289a1eb0b04 Mon Sep 17 00:00:00 2001
From: Jonas Fonseca <fonseca@diku.dk>
Date: Sat, 14 Jan 2006 19:47:47 +0100
Subject: [PATCH 5/6] Replace --'s so they do not get translated to &#8212;

---
 doc/asciidoc.conf | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf
index 9d8eb0ef8..ac0afaeb5 100644
--- a/doc/asciidoc.conf
+++ b/doc/asciidoc.conf
@@ -15,6 +15,9 @@
 # - typedef:[]
 # - ref:[]
 
+[replacements]
+(^|[^-])--($|[^-])=\1--\2
+
 # Some macros can have optional {0} value, that is what
 # the {0%...} and {0#...} handles.
 

From 46669bd2e60a28b0698183935d6ade80d8fee367 Mon Sep 17 00:00:00 2001
From: Jonas Fonseca <fonseca@diku.dk>
Date: Sat, 14 Jan 2006 19:48:44 +0100
Subject: [PATCH 6/6] Be more careful when copying .deps/*.pp files

Some systems won't have them and then there will be lots of error messages.
---
 Makefile.lib | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.lib b/Makefile.lib
index 8519a5856..b6c124af6 100644
--- a/Makefile.lib
+++ b/Makefile.lib
@@ -111,11 +111,13 @@ endif
 
 %.o: $(srcdir)%.c
 	$(call mcmd,compile)
-	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	@-if test -e .deps/$(*F).pp; then \
+		cp .deps/$(*F).pp .deps/$(*F).P; \
 		tr ' ' '\012' < .deps/$(*F).pp \
 			| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
 			>> .deps/$(*F).P; \
-		rm .deps/$(*F).pp
+		rm .deps/$(*F).pp; \
+	fi
 
 CLEAN += $(PROG) $(OBJS)