changeset 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 02b649742717
children 2a5eca2838d1
files lisp/ChangeLog lisp/progmodes/ebnf2ps.el
diffstat 2 files changed, 30 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Feb 25 22:39:54 2004 +0000
+++ b/lisp/ChangeLog	Thu Feb 26 00:44:29 2004 +0000
@@ -1,3 +1,9 @@
+2004-02-25  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+	* ebnf2ps.el: Doc fix.  For compatibility with Emacs 20, define
+	assq-delete-all if it's not defined.
+	(ebnf-generate-region): Code fix.
+
 2004-02-24  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
 
 	* ebnf-abn.el: New file, implements an ABNF parser.
--- a/lisp/progmodes/ebnf2ps.el	Wed Feb 25 22:39:54 2004 +0000
+++ b/lisp/progmodes/ebnf2ps.el	Thu Feb 26 00:44:29 2004 +0000
@@ -5,7 +5,7 @@
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Time-stamp: <2004/02/24 20:48:53 vinicius>
+;; Time-stamp: <2004/02/25 20:17:43 vinicius>
 ;; Keywords: wp, ebnf, PostScript
 ;; Version: 4.0
 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
@@ -1041,7 +1041,7 @@
 ;; Acknowledgements
 ;; ----------------
 ;;
-;; Thanks to Drew Adams <?@?> for suggestions:
+;; Thanks to Drew Adams <drew.adams@oracle.com> for suggestions:
 ;;    - `ebnf-production-name-p', `ebnf-stop-on-error',
 ;;	`ebnf-file-suffix-regexp'and `ebnf-special-show-delimiter' variables.
 ;;    - `ebnf-delete-style', `ebnf-eps-file' and `ebnf-eps-directory'
@@ -1065,6 +1065,22 @@
 (and (string< ps-print-version "5.2.3")
      (error "`ebnf2ps' requires `ps-print' package version 5.2.3 or later"))
 
+
+;; to avoid gripes with Emacs 20
+(eval-and-compile
+  (or (fboundp 'assq-delete-all)
+      (defun assq-delete-all (key alist)
+	"Delete from ALIST all elements whose car is KEY.
+Return the modified alist.
+Elements of ALIST that are not conses are ignored."
+	(let ((tail alist))
+	  (while tail
+	    (if (and (consp (car tail))
+		     (eq (car (car tail)) key))
+		(setq alist (delq (car tail) alist)))
+	    (setq tail (cdr tail)))
+	  alist))))
+
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; User Variables:
@@ -4471,12 +4487,12 @@
 	     (setq the-point (max (1- (point)) (point-min))
 		   error-msg (concat error-msg ": "
 				     (error-message-string data)
-				     (if (string= error-msg "SYNTAX")
-					 (format ". At %d in buffer \"%s\"."
-						 the-point
-						 (buffer-name))
-				       (format ". In buffer \"%s\"."
-					       (buffer-name))))))))))
+				     ", "
+				     (and (string= error-msg "SYNTAX")
+					  (format "at position %d "
+						  the-point))
+				     (format "in buffer \"%s\"."
+					     (buffer-name)))))))))
     (cond
      ;; error occurred
      (error-msg