changeset 6418:43dea22be493

(standard-display-ascii): Error if using a windowing system. (standard-display-g1, standard-display-graphic): Ditto. (standard-display-underline): If window system, use underline font.
author Karl Heuer <kwzh@gnu.org>
date Sat, 19 Mar 1994 03:48:55 +0000
parents 81e96cd91613
children e5ce725b661d
files lisp/disp-table.el
diffstat 1 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/disp-table.el	Sat Mar 19 03:00:25 1994 +0000
+++ b/lisp/disp-table.el	Sat Mar 19 03:48:55 1994 +0000
@@ -89,14 +89,22 @@
 
 ;;;###autoload
 (defun standard-display-ascii (c s)
-  "Display character C using string S."
+  "Display character C using string S.
+S is usually a terminal-dependent escape sequence.
+This function is meaningless for an X frame."
+  (if window-system
+      (error "Cannot use string glyphs in a windowing system"))
   (or standard-display-table
       (setq standard-display-table (make-vector 261 nil)))
   (aset standard-display-table c (apply 'vector (append s nil))))
 
 ;;;###autoload
 (defun standard-display-g1 (c sc)
-  "Display character C as character SC in the g1 character set."
+  "Display character C as character SC in the g1 character set.
+This function assumes that your terminal uses the SO/SI characters;
+it is meaningless for an X frame."
+  (if window-system
+      (error "Cannot use string glyphs in a windowing system"))
   (or standard-display-table
       (setq standard-display-table (make-vector 261 nil)))
   (aset standard-display-table c
@@ -104,7 +112,11 @@
 
 ;;;###autoload
 (defun standard-display-graphic (c gc)
-  "Display character C as character GC in graphics character set."
+  "Display character C as character GC in graphics character set.
+This function assumes VT100-compatible escapes; it is meaningless for an
+X frame."
+  (if window-system
+      (error "Cannot use string glyphs in a windowing system"))
   (or standard-display-table
       (setq standard-display-table (make-vector 261 nil)))
   (aset standard-display-table c
@@ -113,10 +125,14 @@
 ;;;###autoload
 (defun standard-display-underline (c uc)
   "Display character C as character UC plus underlining."
+  (if window-system (require 'faces))
   (or standard-display-table
       (setq standard-display-table (make-vector 261 nil)))
   (aset standard-display-table c
-	(vector (create-glyph (concat "\e[4m" (char-to-string uc) "\e[m")))))
+	(vector 
+	 (if window-system
+	     (logior uc (lsh (face-id (internal-find-face 'underline)) 8))
+	   (create-glyph (concat "\e[4m" (char-to-string uc) "\e[m"))))))
 
 ;; Allocate a glyph code to display by sending STRING to the terminal.
 ;;;###autoload