# HG changeset patch # User Richard M. Stallman # Date 1045337051 0 # Node ID a0aa70bbb62a111922b11189c38adb58234acb37 # Parent 2edf03d7c602558cf107bcbe0c9e46a10cb92b2c (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. diff -r 2edf03d7c602 -r a0aa70bbb62a lisp/international/iso-ascii.el --- 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