xemacs-base / case-table.el

Diff from to

case-table.el

   "Describe the case table of the current buffer."
   (interactive)
   (let ((buffer (current-buffer))
-	(ch 0))
+	(i 0)
+	ch)
     (with-displaying-help-buffer
      (lambda ()
        (set-buffer standard-output)
-       (while (< ch 256)
-	 (cond ((/= ch (downcase ch buffer))
+       (while (< i 256)
+	 (setq ch (int-to-char i))
+	 (cond ((eq (upcase ch) (downcase ch))
+		nil)
+	       ((eq ch (downcase ch buffer))
 		(insert (text-char-description ch))
 		(indent-to 16)
 		(insert "uppercase, matches "
 			(text-char-description (downcase ch))
 			"\n"))
-	       ((/= ch (upcase ch buffer))
+	       ((eq ch (upcase ch buffer))
 		(insert (text-char-description ch))
 		(indent-to 16)
 		(insert "lowercase, matches "
 	       ;;	       (indent-to 16)
 	       ;;	       (insert "case-invariant\n"))
 	       )
-	 (setq ch (1+ ch)))))))
+	 (setq i (1+ i)))))))
 
 (defun invert-case (count)
   "Change the case of the character just after point and move over it.
 
 (defun set-case-syntax-delims (l r table)
   "Make characters L and R a matching pair of non-case-converting delimiters.
-Sets the entries for L and R in standard-case-table,
+TABLE is a case-table object.
+Sets the entries for L and R in TABLE,
 standard-syntax-table, and text-mode-syntax-table to indicate
 left and right delimiters."
-  (aset (car table) l l)
-  (aset (car table) r r)
+  (if (functionp 'put-case-table-pair)
+      (progn
+	(put-case-table-pair l l table)
+	(put-case-table-pair r r table))
+    (aset (car table) l l)
+    (aset (car table) r r))
   (modify-syntax-entry l (concat "(" (char-to-string r) "  ")
 		       (standard-syntax-table))
   (modify-syntax-entry l (concat "(" (char-to-string r) "  ")
 
 (defun set-case-syntax-pair (uc lc table)
   "Make characters UC and LC a pair of inter-case-converting letters.
+TABLE is a case-table object.
 Sets the entries for characters UC and LC in
-standard-case-table, standard-syntax-table, and
+TABLE, standard-syntax-table, and
 text-mode-syntax-table to indicate an (uppercase, lowercase)
 pair of letters."
-  (aset (car table) uc lc)
+  (if (functionp 'put-case-table-pair)
+      (put-case-table-pair uc lc table)
+    (aset (car table) uc lc))
   (modify-syntax-entry lc "w   " (standard-syntax-table))
   (modify-syntax-entry lc "w   " text-mode-syntax-table)
   (modify-syntax-entry uc "w   " (standard-syntax-table))
 
 (defun set-case-syntax (c syntax table)
   "Make characters C case-invariant with syntax SYNTAX.
-Sets the entries for character C in standard-case-table,
+TABLE is a case-table object.
+Sets the entries for character C in TABLE,
 standard-syntax-table, and text-mode-syntax-table to indicate this.
 SYNTAX should be \" \", \"w\", \".\" or \"_\"."
-  (aset (car table) c c)
+  (if (functionp 'put-case-table-pair)
+      (put-case-table-pair c c table)
+    (aset (car table) c c))
   (modify-syntax-entry c syntax (standard-syntax-table))
   (modify-syntax-entry c syntax text-mode-syntax-table))
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.