From 5268b4422dbd9f66fb432e4225174f8c09f97bf4 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Thu, 3 Aug 2000 20:11:01 +0000 Subject: [PATCH] Get around a bug on skip-chars-forward. (ebnf-8-bit-chars): New var for bug fix. (ebnf-string): Bug fix. --- lisp/progmodes/ebnf2ps.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index 509be6cc015..493ceb9cecd 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -4996,12 +4996,25 @@ Otherwise, it is treated as an empty string." (point)))) +;; to avoid a bug of `skip-chars-forward' on version 20.4.1, that is, it +;; doesn't accept the range "\240-\377", but it accepts the character sequence +;; from \240 to \377. It seems that version 20.7 has the same problem. +(defconst ebnf-8-bit-chars + (let ((char ?\240) + str) + (while (<= char ?\377) + (setq str (concat str (char-to-string char)) + char (1+ char))) + str)) + + (defun ebnf-string (chars eos-char kind) (forward-char) (buffer-substring-no-properties (point) (progn - (skip-chars-forward (concat chars "\240-\377") ebnf-limit) + ;;(skip-chars-forward (concat chars "\240-\377") ebnf-limit) + (skip-chars-forward (concat chars ebnf-8-bit-chars) ebnf-limit) (if (or (eobp) (/= (following-char) eos-char)) (error "Illegal %s: missing `%c'." kind eos-char) (forward-char) -- 2.39.2