From a2c32b0cfc9f6d3410e2832d8ea0d4f1df576d1e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 31 Jan 2015 20:48:53 +0200 Subject: Avoid aborts when keyboard-coding-system is raw-text (Bug#19532) src/coding.c (raw_text_coding_system_p): New function. src/keyboard.c (read_decoded_event_from_main_queue): Use it when the keyboard coding-system is 'raw-text'. src/coding.h (raw_text_coding_system_p): Add prototype. --- src/coding.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/coding.c') diff --git a/src/coding.c b/src/coding.c index a7128ee3e73..1a0e1279648 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5979,6 +5979,15 @@ raw_text_coding_system (Lisp_Object coding_system) : AREF (raw_text_eol_type, 2)); } +/* Return true if CODING corresponds to raw-text coding-system. */ + +bool +raw_text_coding_system_p (struct coding_system *coding) +{ + return (coding->decoder == decode_coding_raw_text + && coding->encoder == encode_coding_raw_text) ? true : false; +} + /* If CODING_SYSTEM doesn't specify end-of-line format, return one of the subsidiary that has the same eol-spec as PARENT (if it is not -- cgit v1.2.1