nterm optimize nterm-vt100-char-insert-table

 

File modified: lisp/ivan/nterm.el

Change288 at Sun May 02 12:36:58 2010 +0200 by Ivan Kanis <ivan@tao>

diff -r 0f3308b55478 -r 292f783f195a lisp/ivan/nterm.el
--- a/lisp/ivan/nterm.el	Sat May 01 22:42:23 2010 +0200
+++ b/lisp/ivan/nterm.el	Sun May 02 12:36:58 2010 +0200
@@ -1055,7 +1055,8 @@
          (insert-mem-attribute
           (cdr (assq 'attr (nth insert-line nterm-memory))))
          (insert-attribute (cdr (assq 'attribute nterm-vt100-state)))
-         (insert-char-table (nterm-vt100-char-insert-table insert-attribute))
+         (insert-char-table (eval (nterm-vt100-char-insert-table
+                                   insert-attribute)))
          (insert-char (if (< char (length insert-char-table))
                           (aref insert-char-table char))))
     (if insert-char
@@ -1080,12 +1081,16 @@
 
 (defun nterm-vt100-char-insert-table (attribute)
   "TBD document"
-  (eval (nth (if (aref attribute nterm-vt100-char-special) 1 0)
-             (nth (cond ((nterm-mem-line-get nterm-vt100-line-decdwl) 1)
-                        ((nterm-mem-line-get nterm-vt100-line-decdwl-top) 2)
-                        ((nterm-mem-line-get nterm-vt100-line-decdwl-bottom) 3)
-                        (t 0))
-                  nterm-vt100-charset-table))))
+  (nth (if (aref attribute nterm-vt100-char-special) 1 0)
+       (nth (if nterm-dwl-exist
+                (cond ((nterm-mem-line-get
+                        nterm-vt100-line-decdwl) 1)
+                      ((nterm-mem-line-get
+                        nterm-vt100-line-decdwl-top) 2)
+                      ((nterm-mem-line-get
+                        nterm-vt100-line-decdwl-bottom) 3)
+                      (t 0)) 0)
+            nterm-vt100-charset-table)))
 
 (defun nterm-vt100-char-insert-blink (attribute line-attr)
   "TBD document"
@@ -1570,7 +1575,7 @@
   "TBD document me."
   (let* ((draw-attribute
           (aref (cdr (assq 'attr (nth line nterm-memory))) draw-index))
-         (draw-char-table (nterm-vt100-char-insert-table draw-attribute))
+         (draw-char-table (eval (nterm-vt100-char-insert-table draw-attribute)))
          (char (aref (cdr (assq 'char (nth line nterm-memory))) draw-index))
          (draw-char (if (< char (length draw-char-table))
                         (aref draw-char-table char)))
@@ -1600,8 +1605,8 @@
 
 (defun nterm-vt100-line-draw-dwl (res)
   "Draw double width LINE from terminal memory."
-  (let* ((dwl-table (nterm-vt100-char-insert-table
-                     (cdr (assq 'attribute res))))
+  (let* ((dwl-table (eval (nterm-vt100-char-insert-table
+                           (cdr (assq 'attribute res)))))
          (dwl-string (aref dwl-table (cdr (assq 'char res)))))
     (nterm-insert-image dwl-string 24 24
                         (cdr (assq 'background res))


back