diff options
| author | Gerd Moellmann | 2000-12-21 21:22:34 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-12-21 21:22:34 +0000 |
| commit | 6a5275dc6dfdcff56429ccae2942d04cb08945bc (patch) | |
| tree | aa4d3170374e2fb506e7b7e1d7455b51269eab1b | |
| parent | 7ef18b28bcd819346ec9b5f515b8e396648df539 (diff) | |
| download | emacs-6a5275dc6dfdcff56429ccae2942d04cb08945bc.tar.gz emacs-6a5275dc6dfdcff56429ccae2942d04cb08945bc.zip | |
Fix a problem with skip-chars-forward: it doesn't accept
ranges like \177-\237, but accepts the character sequence from \177 to
\237. Doc fix.
(ebnf-version): New version (3.4).
(ebnf-setup): Code fix.
(ebnf-range-regexp): New fun.
(ebnf-8-bit-chars): Const fix.
| -rw-r--r-- | lisp/progmodes/ebnf2ps.el | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index c19dc332b85..a5e481b6b56 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 5 | ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
| 6 | ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 6 | ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
| 7 | ;; Keywords: wp, ebnf, PostScript | 7 | ;; Keywords: wp, ebnf, PostScript |
| 8 | ;; Time-stamp: <2000/08/27 14:24:32 vinicius> | 8 | ;; Time-stamp: <2000/12/19 15:17:15 vinicius> |
| 9 | ;; Version: 3.3 | 9 | ;; Version: 3.4 |
| 10 | ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/Emacs.html | 10 | ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/Emacs.html |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| @@ -26,8 +26,8 @@ | |||
| 26 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 26 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 27 | ;; Boston, MA 02111-1307, USA. | 27 | ;; Boston, MA 02111-1307, USA. |
| 28 | 28 | ||
| 29 | (defconst ebnf-version "3.3" | 29 | (defconst ebnf-version "3.4" |
| 30 | "ebnf2ps.el, v 3.2 <2000/08/27 vinicius> | 30 | "ebnf2ps.el, v 3.4 <2000/12/19 vinicius> |
| 31 | 31 | ||
| 32 | Vinicius's last change version. When reporting bugs, please also | 32 | Vinicius's last change version. When reporting bugs, please also |
| 33 | report the version of Emacs, if any, that ebnf2ps was running with. | 33 | report the version of Emacs, if any, that ebnf2ps was running with. |
| @@ -1881,6 +1881,8 @@ WARNING: It's *NOT* asked any confirmation to override an existing file." | |||
| 1881 | "Return the current ebnf2ps setup." | 1881 | "Return the current ebnf2ps setup." |
| 1882 | (format | 1882 | (format |
| 1883 | " | 1883 | " |
| 1884 | ;;; ebnf2ps.el version %s | ||
| 1885 | |||
| 1884 | \(setq ebnf-special-font %s | 1886 | \(setq ebnf-special-font %s |
| 1885 | ebnf-special-shape %s | 1887 | ebnf-special-shape %s |
| 1886 | ebnf-special-shadow %S | 1888 | ebnf-special-shadow %S |
| @@ -1933,7 +1935,10 @@ WARNING: It's *NOT* asked any confirmation to override an existing file." | |||
| 1933 | ebnf-yac-ignore-error-recovery %S | 1935 | ebnf-yac-ignore-error-recovery %S |
| 1934 | ebnf-ignore-empty-rule %S | 1936 | ebnf-ignore-empty-rule %S |
| 1935 | ebnf-optimize %S) | 1937 | ebnf-optimize %S) |
| 1938 | |||
| 1939 | ;;; ebnf2ps.el - end of settings | ||
| 1936 | " | 1940 | " |
| 1941 | ebnf-version | ||
| 1937 | (ps-print-quote ebnf-special-font) | 1942 | (ps-print-quote ebnf-special-font) |
| 1938 | (ps-print-quote ebnf-special-shape) | 1943 | (ps-print-quote ebnf-special-shape) |
| 1939 | ebnf-special-shadow | 1944 | ebnf-special-shadow |
| @@ -4100,6 +4105,18 @@ end | |||
| 4100 | ;; Internal functions | 4105 | ;; Internal functions |
| 4101 | 4106 | ||
| 4102 | 4107 | ||
| 4108 | ;; function `ebnf-range-regexp' is used to avoid a bug of `skip-chars-forward' | ||
| 4109 | ;; on version 20.4.1, that is, it doesn't accept ranges like "\240-\377" (or | ||
| 4110 | ;; "\177-\237"), but it accepts the character sequence from \240 to \377 (or | ||
| 4111 | ;; from \177 to \237). It seems that version 20.7 has the same problem. | ||
| 4112 | (defun ebnf-range-regexp (prefix from to) | ||
| 4113 | (let (str) | ||
| 4114 | (while (<= from to) | ||
| 4115 | (setq str (concat str (char-to-string from)) | ||
| 4116 | from (1+ from))) | ||
| 4117 | (concat prefix str))) | ||
| 4118 | |||
| 4119 | |||
| 4103 | (defvar ebnf-map-name | 4120 | (defvar ebnf-map-name |
| 4104 | (let ((map (make-vector 256 ?\_))) | 4121 | (let ((map (make-vector 256 ?\_))) |
| 4105 | (mapcar #'(lambda (char) | 4122 | (mapcar #'(lambda (char) |
| @@ -4944,16 +4961,8 @@ end | |||
| 4944 | (point)))) | 4961 | (point)))) |
| 4945 | 4962 | ||
| 4946 | 4963 | ||
| 4947 | ;; to avoid a bug of `skip-chars-forward' on version 20.4.1, that is, it | 4964 | ;; replace the range "\240-\377" (see `ebnf-range-regexp'). |
| 4948 | ;; doesn't accept the range "\240-\377", but it accepts the character sequence | 4965 | (defconst ebnf-8-bit-chars (ebnf-range-regexp "" ?\240 ?\377)) |
| 4949 | ;; from \240 to \377. It seems that version 20.7 has the same problem. | ||
| 4950 | (defconst ebnf-8-bit-chars | ||
| 4951 | (let ((char ?\240) | ||
| 4952 | str) | ||
| 4953 | (while (<= char ?\377) | ||
| 4954 | (setq str (concat str (char-to-string char)) | ||
| 4955 | char (1+ char))) | ||
| 4956 | str)) | ||
| 4957 | 4966 | ||
| 4958 | 4967 | ||
| 4959 | (defun ebnf-string (chars eos-char kind) | 4968 | (defun ebnf-string (chars eos-char kind) |