Mercurial > emacs
comparison lisp/progmodes/ebnf2ps.el @ 54145:e3765a3df826
For compatibility with Emacs 20, define assq-delete-all if it's not defined.
author | Vinicius Jose Latorre <viniciusjl@ig.com.br> |
---|---|
date | Thu, 26 Feb 2004 00:44:29 +0000 |
parents | 766aaa5bded5 |
children | 5774986c6ebb |
comparison
equal
deleted
inserted
replaced
54144:02b649742717 | 54145:e3765a3df826 |
---|---|
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 | 3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 |
4 ;; Free Software Foundation, Inc. | 4 ;; Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> | 6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
7 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> | 7 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
8 ;; Time-stamp: <2004/02/24 20:48:53 vinicius> | 8 ;; Time-stamp: <2004/02/25 20:17:43 vinicius> |
9 ;; Keywords: wp, ebnf, PostScript | 9 ;; Keywords: wp, ebnf, PostScript |
10 ;; Version: 4.0 | 10 ;; Version: 4.0 |
11 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ | 11 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ |
12 | 12 |
13 ;; This file is part of GNU Emacs. | 13 ;; This file is part of GNU Emacs. |
1039 ;; | 1039 ;; |
1040 ;; | 1040 ;; |
1041 ;; Acknowledgements | 1041 ;; Acknowledgements |
1042 ;; ---------------- | 1042 ;; ---------------- |
1043 ;; | 1043 ;; |
1044 ;; Thanks to Drew Adams <?@?> for suggestions: | 1044 ;; Thanks to Drew Adams <drew.adams@oracle.com> for suggestions: |
1045 ;; - `ebnf-production-name-p', `ebnf-stop-on-error', | 1045 ;; - `ebnf-production-name-p', `ebnf-stop-on-error', |
1046 ;; `ebnf-file-suffix-regexp'and `ebnf-special-show-delimiter' variables. | 1046 ;; `ebnf-file-suffix-regexp'and `ebnf-special-show-delimiter' variables. |
1047 ;; - `ebnf-delete-style', `ebnf-eps-file' and `ebnf-eps-directory' | 1047 ;; - `ebnf-delete-style', `ebnf-eps-file' and `ebnf-eps-directory' |
1048 ;; commands. | 1048 ;; commands. |
1049 ;; - some docs fix. | 1049 ;; - some docs fix. |
1062 | 1062 |
1063 (require 'ps-print) | 1063 (require 'ps-print) |
1064 | 1064 |
1065 (and (string< ps-print-version "5.2.3") | 1065 (and (string< ps-print-version "5.2.3") |
1066 (error "`ebnf2ps' requires `ps-print' package version 5.2.3 or later")) | 1066 (error "`ebnf2ps' requires `ps-print' package version 5.2.3 or later")) |
1067 | |
1068 | |
1069 ;; to avoid gripes with Emacs 20 | |
1070 (eval-and-compile | |
1071 (or (fboundp 'assq-delete-all) | |
1072 (defun assq-delete-all (key alist) | |
1073 "Delete from ALIST all elements whose car is KEY. | |
1074 Return the modified alist. | |
1075 Elements of ALIST that are not conses are ignored." | |
1076 (let ((tail alist)) | |
1077 (while tail | |
1078 (if (and (consp (car tail)) | |
1079 (eq (car (car tail)) key)) | |
1080 (setq alist (delq (car tail) alist))) | |
1081 (setq tail (cdr tail))) | |
1082 alist)))) | |
1067 | 1083 |
1068 | 1084 |
1069 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1085 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1070 ;; User Variables: | 1086 ;; User Variables: |
1071 | 1087 |
4469 ((quit error) | 4485 ((quit error) |
4470 (ding) | 4486 (ding) |
4471 (setq the-point (max (1- (point)) (point-min)) | 4487 (setq the-point (max (1- (point)) (point-min)) |
4472 error-msg (concat error-msg ": " | 4488 error-msg (concat error-msg ": " |
4473 (error-message-string data) | 4489 (error-message-string data) |
4474 (if (string= error-msg "SYNTAX") | 4490 ", " |
4475 (format ". At %d in buffer \"%s\"." | 4491 (and (string= error-msg "SYNTAX") |
4476 the-point | 4492 (format "at position %d " |
4477 (buffer-name)) | 4493 the-point)) |
4478 (format ". In buffer \"%s\"." | 4494 (format "in buffer \"%s\"." |
4479 (buffer-name)))))))))) | 4495 (buffer-name))))))))) |
4480 (cond | 4496 (cond |
4481 ;; error occurred | 4497 ;; error occurred |
4482 (error-msg | 4498 (error-msg |
4483 (goto-char the-point) | 4499 (goto-char the-point) |
4484 (if ebnf-stop-on-error | 4500 (if ebnf-stop-on-error |