User: ben
Date: 05/11/13 11:58:01
Modified: xemacs/lisp ChangeLog syntax.el
Log:
create describe-char-table
syntax.el: Convert describe-syntax-table to more general describe-char-table.
(Will also be used by display tables.) Create new describe-syntax-table,
compatible with old function, that uses describe-char-table.
diagnose.el: Conditionalize `sort-numeric-fields' on when-fboundp.
Revision Changes Path
1.696 +9 -0 XEmacs/xemacs/lisp/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.695
retrieving revision 1.696
diff -u -p -r1.695 -r1.696
--- ChangeLog 2005/11/13 10:56:09 1.695
+++ ChangeLog 2005/11/13 10:57:59 1.696
@@ -1,5 +1,14 @@
2005-11-13 Ben Wing <ben(a)xemacs.org>
+ * syntax.el:
+ * syntax.el (describe-syntax-table): Removed.
+ * syntax.el (describe-char-table): New.
+ Convert describe-syntax-table to more general describe-char-table.
+ (Will also be used by display tables.) Create new describe-syntax-table,
+ compatible with old function, that uses describe-char-table.
+
+2005-11-13 Ben Wing <ben(a)xemacs.org>
+
* diagnose.el (show-memory-usage):
Conditionalize `sort-numeric-fields' on when-fboundp.
1.5 +13 -4 XEmacs/xemacs/lisp/syntax.el
Index: syntax.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/syntax.el,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- syntax.el 2001/05/04 22:42:15 1.4
+++ syntax.el 2005/11/13 10:58:00 1.5
@@ -2,6 +2,7 @@
;; Copyright (C) 1993, 1997 Free Software Foundation, Inc.
;; Copyright (C) 1995 Sun Microsystems.
+;; Copyright (C) 2005 Ben Wing.
;; This file is part of XEmacs.
@@ -238,7 +239,11 @@ This is similar to `map-char-table', but
; spec (aref o ?a) (aref n ?a))))))))
-(defun describe-syntax-table (table stream)
+(defun describe-char-table (table mapper describe-value stream)
+"Describe char-table TABLE, outputting to STREAM.
+MAPPER maps over the table and should be `map-char-table' or
+`map-syntax-table'. DESCRIBE-VALUE is a function of two arguments,
+VALUE and STREAM, and should output a description of VALUE."
(let (first-char
last-char
prev-val
@@ -272,7 +277,7 @@ This is similar to `map-char-table', but
(text-char-description first)
(text-char-description last))
stream))))
- (describe-syntax-code value stream))
+ (funcall describe-value value stream))
#'(lambda (first last value stream)
(let* ((tem (text-char-description first))
(pos (length tem))
@@ -290,8 +295,8 @@ This is similar to `map-char-table', but
(while (progn (write-char ?\ stream)
(setq pos (1+ pos))
(< pos 16))))
- (describe-syntax-code value stream)))))
- (map-syntax-table
+ (funcall describe-value value stream)))))
+ (funcall mapper
#'(lambda (range value)
(cond
((not first-char)
@@ -320,6 +325,10 @@ This is similar to `map-char-table', but
table)
(if first-char
(funcall describe-one first-char last-char prev-val stream))))
+
+(defun describe-syntax-table (table stream)
+ "Output a description of TABLE (a syntax table) to STREAM."
+ (describe-char-table table 'map-syntax-table 'describe-syntax-code stream))
(defun describe-syntax-code (code stream)
(let ((match (and (consp code) (cdr code)))