- (make-rope (create-glyf (concat "\e[4m" (char-to-string uc) "\e[m")))))
-
-(defun create-glyf (string)
- (let ((i 256))
- (while (and (< i 65536) (aref glyf-table i)
- (not (string= (aref glyf-table i) string)))
- (setq i (1+ i)))
- (if (= i 65536)
- (error "No free glyf codes remain"))
- (aset glyf-table i string)))
+ (make-rope (create-glyph (concat "\e[4m" (char-to-string uc) "\e[m")))))
+
+;; Allocate a glyph code to display by sending STRING to the terminal.
+(defun create-glyph (string)
+ (if (= (length glyph-table) 65536)
+ (error "No free glyph codes remain"))
+ (setq glyph-table (vconcat glyph-table (list string)))
+ (1- (length glyph-table)))