changeset 49807:a0aa70bbb62a

(iso-ascii-display-table): New variable. (iso-ascii-standard-display-table): New variable. (iso-ascii-display): Define in iso-ascii-display-table. (iso-ascii-mode): New command.
author Richard M. Stallman <rms@gnu.org>
date Sat, 15 Feb 2003 19:24:11 +0000
parents 2edf03d7c602
children 6a37bab32791
files lisp/international/iso-ascii.el
diffstat 1 files changed, 24 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/iso-ascii.el	Sat Feb 15 19:20:47 2003 +0000
+++ b/lisp/international/iso-ascii.el	Sat Feb 15 19:24:11 2003 +0000
@@ -45,15 +45,26 @@
   :type 'boolean
   :group 'iso-ascii)
 
+(defvar iso-ascii-display-table (make-display-table)
+  "Display table used for ISO-ASCII mode.")
+
+(defvar iso-ascii-standard-display-table nil
+  "Display table used when not in ISO-ASCII mode.")
+;; Don't alter iso-ascii-standard-display-table if this file is loaded again,
+;; or even by using C-M-x on any of the expressions.
+(unless iso-ascii-standard-display-table
+  (setq iso-ascii-standard-display-table
+	standard-display-table))
+
 (defun iso-ascii-display (code string &optional convenient-string)
   (if iso-ascii-convenient
       (setq string (or convenient-string string))
     (setq string (concat "{" string "}")))
   ;; unibyte
-  (standard-display-ascii code string)
+  (aset iso-ascii-display-table code string)
   ;; multibyte
-  (standard-display-ascii (make-char 'latin-iso8859-1 (- code 128))
-			  string))
+  (aset iso-ascii-display-table (make-char 'latin-iso8859-1 (- code 128))
+	string))
 
 (iso-ascii-display 160 "_" " ")   ; NBSP (no-break space)
 (iso-ascii-display 161 "!")   ; inverted exclamation mark
@@ -152,6 +163,16 @@
 (iso-ascii-display 254 "th")  ; small thorn, Icelandic
 (iso-ascii-display 255 "\"y") ; small y with diaeresis or umlaut mark
 
+(defun iso-ascii-mode (arg)
+  "Toggle ISO-ASCII mode."
+  (interactive "P")
+  (unless arg
+    (setq arg (eq standard-display-table iso-ascii-standard-display-table)))
+  (setq standard-display-table
+	(if arg
+	    iso-ascii-display-table
+	  iso-ascii-standard-display-table)))
+
 (provide 'iso-ascii)
 
 ;;; iso-ascii.el ends here