From: Samuel Thibault <sthibault@debian.org>
Date: Thu, 10 Dec 2015 20:31:04 +0100
Subject: Support KT_DEAD2 diacritics

Forwarded: no
Bug-Debian: http://bugs.debian.org/694169

Add support for KT_DEAD2 diacritics to loadkeys and dumpkeys using the
dead2_ prefix.

[ah@debian.org: update to patch libkeymap and use get_sym{,_size} helpers]
---
 src/libkeymap/dump.c  | 3 +++
 src/libkeymap/ksyms.c | 8 ++++++++
 2 files changed, 11 insertions(+)

--- a/src/libkeymap/dump.c
+++ b/src/libkeymap/dump.c
@@ -395,6 +395,9 @@
 	else if (!numeric && t == KT_META && v < 128 && v < get_sym_size(ctx, KT_LATIN) &&
 	         (p = get_sym(ctx, KT_LATIN, v))[0])
 		fprintf(fd, "Meta_%-11s", p);
+	else if (!numeric && t == KT_DEAD2 && v < 256 && v < get_sym_size(ctx, KT_LATIN) &&
+		 (p = get_sym(ctx, KT_LATIN, v))[0])
+		printf("dead2_%-10s", p);
 	else
 		fprintf(fd, "0x%04x         %s", code, plus ? "" : " ");
 }
--- a/src/libkeymap/ksyms.c
+++ b/src/libkeymap/ksyms.c
@@ -290,6 +290,14 @@
 		/* fall through to error printf */
 	}
 
+	if (!strncmp(s, "dead2_", 6)) {
+		keycode = ksymtocode(ctx, s+6, TO_8BIT);
+		if (KTYP(keycode) == KT_LATIN)
+			return K(KT_DEAD2, KVAL(keycode));
+
+		/* fall through to error printf */
+	}
+
 	if ((n = kt_latin(ctx, s, direction)) >= 0) {
 		return n;
 	}
