comparison lisp/w3/w3-display.el @ 118:7d55a9ba150c r20-1b11

Import from CVS: tag r20-1b11
author cvs
date Mon, 13 Aug 2007 09:24:17 +0200
parents 9f59509498e1
children d2f30a177268
comparison
equal deleted inserted replaced
117:578fd4947a72 118:7d55a9ba150c
1 ;;; w3-display.el --- display engine v99999 1 ;;; w3-display.el --- display engine v99999
2 ;; Author: wmperry 2 ;; Author: wmperry
3 ;; Created: 1997/03/26 15:24:53 3 ;; Created: 1997/04/03 16:32:31
4 ;; Version: 1.157 4 ;; Version: 1.171
5 ;; Keywords: faces, help, hypermedia 5 ;; Keywords: faces, help, hypermedia
6 6
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu) 8 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc. 9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
68 (w3-d-s-var-def w3-face-text-decoration) 68 (w3-d-s-var-def w3-face-text-decoration)
69 (w3-d-s-var-def w3-face-face) 69 (w3-d-s-var-def w3-face-face)
70 (w3-d-s-var-def w3-face-descr) 70 (w3-d-s-var-def w3-face-descr)
71 (w3-d-s-var-def w3-face-pixmap) 71 (w3-d-s-var-def w3-face-pixmap)
72 (w3-d-s-var-def w3-display-css-properties) 72 (w3-d-s-var-def w3-display-css-properties)
73 (w3-d-s-var-def w3-display-background-properties)
73 74
74 (eval-when-compile 75 (eval-when-compile
75 (defmacro w3-get-attribute (attr) 76 (defmacro w3-get-attribute (attr)
76 (` (cdr-safe (assq (, attr) args)))) 77 (` (cdr-safe (assq (, attr) args))))
77 78
89 90
90 (defmacro w3-get-all-face-info () 91 (defmacro w3-get-all-face-info ()
91 (` 92 (`
92 (progn 93 (progn
93 (w3-get-face-info font-family) 94 (w3-get-face-info font-family)
95 ;; This is to handle the 'face' attribute on arbitrary elements
96 (if (cdr-safe (assq 'face (nth 1 node)))
97 (setf (car w3-face-font-family)
98 (append (car w3-face-font-family)
99 (split-string (cdr-safe
100 (assq 'face (nth 1 node)))
101 " *, *"))))
94 (w3-get-face-info font-style) 102 (w3-get-face-info font-style)
95 (w3-get-face-info font-weight) 103 (w3-get-face-info font-weight)
96 (w3-get-face-info font-variant) 104 (w3-get-face-info font-variant)
97 (w3-get-face-info font-size) 105 (w3-get-face-info font-size)
98 (w3-get-face-info text-decoration) 106 (w3-get-face-info text-decoration)
309 (catch 'fill-exit 317 (catch 'fill-exit
310 (while (re-search-forward ".$" nil t) 318 (while (re-search-forward ".$" nil t)
311 (if (>= (setq width (current-column)) fill-column) 319 (if (>= (setq width (current-column)) fill-column)
312 nil ; already justified, or error 320 nil ; already justified, or error
313 (beginning-of-line) 321 (beginning-of-line)
314 (insert-char ? (- fill-column width)) 322 (insert-char ? (- fill-column width) t)
315 (end-of-line) 323 (end-of-line)
316 (if (eobp) 324 (if (eobp)
317 (throw 'fill-exit t)) 325 (throw 'fill-exit t))
318 (condition-case () 326 (condition-case ()
319 (forward-char 1) 327 (forward-char 1)
361 (point))))) 369 (point)))))
362 (goto-char (point-max)) 370 (goto-char (point-max))
363 (add-text-properties w3-scratch-start-point 371 (add-text-properties w3-scratch-start-point
364 (point) (list 'face w3-active-faces 372 (point) (list 'face w3-active-faces
365 'html-stack w3-display-open-element-stack 373 'html-stack w3-display-open-element-stack
366 'start-open t 374 'start-open nil
367 'end-open t 375 'end-open nil
368 'rear-nonsticky t 376 'front-sticky t
377 'rear-nonsticky nil
369 'duplicable t)) 378 'duplicable t))
370 (if (car w3-active-voices) 379 (if (car w3-active-voices)
371 (add-text-properties w3-scratch-start-point (point) 380 (add-text-properties w3-scratch-start-point (point)
372 (list 'personality (car w3-active-voices)))) 381 (list 'personality (car w3-active-voices))))
373 ) 382 )
448 (push content content-stack) 457 (push content content-stack)
449 (setq content (nth 2 (, node)))))) 458 (setq content (nth 2 (, node))))))
450 459
451 (defmacro w3-display-handle-list-type () 460 (defmacro w3-display-handle-list-type ()
452 (` 461 (`
453 (case (car break-style) 462 (add-text-properties
454 (list-item 463 (point)
455 (let ((list-style (w3-get-style-info 'list-style-type node)) 464 (progn
456 (list-num (if (car w3-display-list-stack) 465 (case (car break-style)
457 (incf (car w3-display-list-stack)) 466 (list-item
458 1)) 467 (let ((list-style (w3-get-style-info 'list-style-type node))
459 (margin (1- (car left-margin-stack))) 468 (list-num (if (car w3-display-list-stack)
460 (indent (w3-get-style-info 'text-indent node 0))) 469 (incf (car w3-display-list-stack))
461 (if (> indent 0) 470 1))
462 (setq margin (+ margin indent)) 471 (margin (1- (car left-margin-stack)))
463 (setq margin (max 0 (- margin indent)))) 472 (indent (w3-get-style-info 'text-indent node 0)))
464 (beginning-of-line) 473 (if (> indent 0)
465 (case list-style 474 (setq margin (+ margin indent))
466 ((disc circle square) 475 (setq margin (max 0 (- margin indent))))
467 (insert (format (format "%%%dc" margin) 476 (beginning-of-line)
468 (or (cdr-safe (assq list-style w3-bullets)) 477 (case list-style
469 ?o)))) 478 ((disc circle square)
470 ((decimal lower-roman upper-roman lower-alpha upper-alpha) 479 (insert (format (format "%%%dc" margin)
471 (let ((x (case list-style 480 (or (cdr-safe (assq list-style w3-bullets))
472 (lower-roman 481 ?o))))
473 (w3-decimal-to-roman list-num)) 482 ((decimal lower-roman upper-roman lower-alpha upper-alpha)
474 (upper-roman 483 (let ((x (case list-style
475 (upcase 484 (lower-roman
476 (w3-decimal-to-roman list-num))) 485 (w3-decimal-to-roman list-num))
477 (lower-alpha 486 (upper-roman
478 (w3-decimal-to-alpha list-num)) 487 (upcase
479 (upper-alpha 488 (w3-decimal-to-roman list-num)))
480 (upcase 489 (lower-alpha
481 (w3-decimal-to-alpha list-num))) 490 (w3-decimal-to-alpha list-num))
482 (otherwise 491 (upper-alpha
483 (int-to-string list-num))))) 492 (upcase
484 (insert (format (format "%%%ds." margin) x)) 493 (w3-decimal-to-alpha list-num)))
494 (otherwise
495 (int-to-string list-num)))))
496 (insert (format (format "%%%ds." margin) x))
497 )
498 )
499 (otherwise
500 (insert (w3-get-pad-string margin)))
485 ) 501 )
486 ) 502 )
487 (otherwise 503 )
488 (insert (w3-get-pad-string margin))) 504 (otherwise
489 ) 505 (insert (w3-get-pad-string (+ (car left-margin-stack)
506 (w3-get-style-info 'text-indent node 0)))))
490 ) 507 )
491 ) 508 (point))
492 (otherwise 509 (list 'start-open t
493 (insert (w3-get-pad-string (+ (car left-margin-stack) 510 'end-open t
494 (w3-get-style-info 'text-indent node 0))))) 511 'rear-nonsticky nil
495 ) 512 'face 'nil))))
496 )
497 )
498 513
499 (defmacro w3-display-set-margins () 514 (defmacro w3-display-set-margins ()
500 (` 515 (`
501 (progn 516 (progn
502 (push (+ (w3-get-style-info 'margin-left node 0) 517 (push (+ (w3-get-style-info 'margin-left node 0)
808 (setq w3-table-border-chars w3-table-ascii-border-chars 823 (setq w3-table-border-chars w3-table-ascii-border-chars
809 w3-terminal-properties nil) 824 w3-terminal-properties nil)
810 (cond 825 (cond
811 ((and w3-use-terminal-characters 826 ((and w3-use-terminal-characters
812 (eq (device-type) 'x)) 827 (eq (device-type) 'x))
813 (if (find-face 'w3-table-hack-x-face) nil 828 (if (and (find-face 'w3-table-hack-x-face)
829 (face-differs-from-default-p 'w3-table-hack-x-face))
830 nil
814 (make-face 'w3-table-hack-x-face) 831 (make-face 'w3-table-hack-x-face)
815 (font-set-face-font 'w3-table-hack-x-face 832 (if (not (face-differs-from-default-p 'w3-table-hack-x-face))
816 (make-font :family "terminal"))) 833 (font-set-face-font 'w3-table-hack-x-face
834 (make-font :family "terminal"
835 :registry "*"
836 :encoding "*"
837 ))))
817 (cond 838 (cond
818 ((not (face-differs-from-default-p 'w3-table-hack-x-face)) 839 ((not (face-differs-from-default-p 'w3-table-hack-x-face))
819 nil) 840 nil)
820 ((and w3-use-terminal-glyphs (fboundp 'face-id)) 841 ((and w3-use-terminal-glyphs (fboundp 'face-id))
821 (let ((id (face-id 'w3-table-hack-x-face)) 842 (let ((id (face-id 'w3-table-hack-x-face))
1208 (cur-height nil) 1229 (cur-height nil)
1209 (cols nil) 1230 (cols nil)
1210 (rows nil) 1231 (rows nil)
1211 (row 0) 1232 (row 0)
1212 (this-rectangle nil) 1233 (this-rectangle nil)
1234 (inhibit-read-only t)
1213 (i 0) 1235 (i 0)
1214 ) 1236 )
1215 1237
1216 (push (cons tag args) w3-display-open-element-stack) 1238 (push (cons tag args) w3-display-open-element-stack)
1217 1239
1247 ;;(if align (push (intern (downcase align)) w3-display-alignment-stack)) 1269 ;;(if align (push (intern (downcase align)) w3-display-alignment-stack))
1248 (save-excursion 1270 (save-excursion
1249 (save-restriction 1271 (save-restriction
1250 (narrow-to-region (point) (point)) 1272 (narrow-to-region (point) (point))
1251 (setq fill-column avgwidth 1273 (setq fill-column avgwidth
1252 inhibit-read-only t
1253 w3-last-fill-pos (point-min) 1274 w3-last-fill-pos (point-min)
1254 i 0) 1275 i 0)
1255 ;; skip over columns that have leftover content 1276 ;; skip over columns that have leftover content
1256 (while (and (< i num-cols) 1277 (while (and (< i num-cols)
1257 (/= 0 (aref table-rowspans i))) 1278 (/= 0 (aref table-rowspans i)))
1258 (setq i (+ i (max 1 (aref table-colspans i))))) 1279 (setq i (+ i (max 1 (aref table-colspans i)))))
1280 ;; Need to push the properties for the table onto the stack
1281 (setq w3-display-css-properties (css-get
1282 tag
1283 args
1284 w3-current-stylesheet
1285 w3-display-open-element-stack))
1286 (push (w3-face-for-element (list tag args nil)) w3-active-faces)
1287 (push (w3-voice-for-element (list tag args nil)) w3-active-voices)
1288 (push (cons tag args) w3-display-open-element-stack)
1259 (while cols 1289 (while cols
1290 ;; And need to push these bogus placeholders on there
1291 ;; so that w3-display-node doesn't pop off the real face
1292 ;; or voice we just put in above.
1293 (push nil w3-active-faces)
1294 (push nil w3-active-voices)
1260 (let* ((node (car cols)) 1295 (let* ((node (car cols))
1261 (attributes (nth 1 node)) 1296 (attributes (nth 1 node))
1262 (colspan (string-to-int 1297 (colspan (string-to-int
1263 (or (cdr-safe (assq 'colspan attributes)) 1298 (or (cdr-safe (assq 'colspan attributes))
1264 "1"))) 1299 "1")))
1300 (delete-region (point-min) (point)) 1335 (delete-region (point-min) (point))
1301 (goto-char (point-max)) 1336 (goto-char (point-max))
1302 (skip-chars-backward " \t\n\r") 1337 (skip-chars-backward " \t\n\r")
1303 (delete-region (point) (point-max)) 1338 (delete-region (point) (point-max))
1304 (if (>= fill-column (current-column)) 1339 (if (>= fill-column (current-column))
1305 (insert-char ? (- fill-column (current-column)))) 1340 (insert-char ? (- fill-column (current-column)) t))
1341 (goto-char (point-min))
1342 ;; This gets our text properties out to the
1343 ;; end of lines for table rows/cells with backgrounds
1344 (while (not (eobp))
1345 (re-search-forward "$" nil t)
1346 (if (>= fill-column (current-column))
1347 (insert-char ? (- fill-column (current-column)) t))
1348 (or (eobp) (forward-char 1)))
1306 (aset formatted-cols i (extract-rectangle (point-min) (point-max))) 1349 (aset formatted-cols i (extract-rectangle (point-min) (point-max)))
1307 (delete-region (point-min) (point-max)) 1350 (delete-region (point-min) (point-max))
1308 (let ((j (1- colspan))) 1351 (let ((j (1- colspan)))
1309 (while (> j 0) 1352 (while (> j 0)
1310 (aset table-colspans (+ i j) 0) 1353 (aset table-colspans (+ i j) 0)
1313 ;; skip over columns that have leftover content 1356 ;; skip over columns that have leftover content
1314 (while (and (< i num-cols) 1357 (while (and (< i num-cols)
1315 (/= 0 (aref table-rowspans i))) 1358 (/= 0 (aref table-rowspans i)))
1316 (setq i (+ i (max 1 (aref table-colspans i))))) 1359 (setq i (+ i (max 1 (aref table-colspans i)))))
1317 )) 1360 ))
1318 1361 (pop w3-display-open-element-stack)
1362 (pop w3-active-faces)
1363 (pop w3-active-voices)
1364 (w3-pop-all-face-info)
1319 ;; finish off the columns 1365 ;; finish off the columns
1320 (while (< i num-cols) 1366 (while (< i num-cols)
1321 (aset table-colwidth i (aref column-dimensions i)) 1367 (aset table-colwidth i (aref column-dimensions i))
1322 (aset table-colspans i 1) 1368 (aset table-colspans i 1)
1323 (setq i (1+ i)) 1369 (setq i (1+ i))
1386 (insert (pop (aref formatted-cols i))) 1432 (insert (pop (aref formatted-cols i)))
1387 (setq lflag nil) 1433 (setq lflag nil)
1388 (setq i (+ i (max (aref table-colspans i) 1434 (setq i (+ i (max (aref table-colspans i)
1389 (aref prev-colspans i) 1)))) 1435 (aref prev-colspans i) 1))))
1390 (t 1436 (t
1391 (insert-char ? (aref table-colwidth i)) 1437 (insert-char ? (aref table-colwidth i) t)
1392 (setq lflag nil) 1438 (setq lflag nil)
1393 (setq i (+ i (max (aref table-colspans i) 1439 (setq i (+ i (max (aref table-colspans i)
1394 (aref prev-colspans i) 1)))))) 1440 (aref prev-colspans i) 1))))))
1395 (w3-insert-terminal-char (w3-table-lookup-char lflag (/= row 1) nil t)) 1441 (w3-insert-terminal-char (w3-table-lookup-char lflag (/= row 1) nil t))
1396 (insert "\n")) 1442 (insert "\n"))
1409 (w3-insert-terminal-char (w3-table-lookup-char nil t nil t)) 1455 (w3-insert-terminal-char (w3-table-lookup-char nil t nil t))
1410 (setq i 0) 1456 (setq i 0)
1411 (while (< i num-cols) 1457 (while (< i num-cols)
1412 (if (car (aref formatted-cols i)) 1458 (if (car (aref formatted-cols i))
1413 (insert (pop (aref formatted-cols i))) 1459 (insert (pop (aref formatted-cols i)))
1414 (insert-char ? (aref table-colwidth i))) 1460 (insert-char ? (aref table-colwidth i) t))
1415 (w3-insert-terminal-char (w3-table-lookup-char nil t nil t)) 1461 (w3-insert-terminal-char (w3-table-lookup-char nil t nil t))
1416 (setq i (+ i (max (aref table-colspans i) 1)))) 1462 (setq i (+ i (max (aref table-colspans i) 1))))
1417 (insert "\n") 1463 (insert "\n")
1418 ;;(and w3-do-incremental-display (w3-pause)) 1464 ;;(and w3-do-incremental-display (w3-pause))
1419 (setq height (1- height))) 1465 (setq height (1- height)))
1426 1472
1427 (setq prev-rowspans (copy-seq table-rowspans)) 1473 (setq prev-rowspans (copy-seq table-rowspans))
1428 (setq prev-colspans (copy-seq table-colspans)) 1474 (setq prev-colspans (copy-seq table-colspans))
1429 1475
1430 (and w3-do-incremental-display (w3-pause)) 1476 (and w3-do-incremental-display (w3-pause))
1431
1432 ) 1477 )
1433 (caption 1478 (caption
1434 (let ((left (length fill-prefix)) 1479 (let ((left (length fill-prefix))
1435 (fill-prefix "") 1480 (fill-prefix "")
1436 (fill-column table-width) 1481 (fill-column table-width)
1491 (setq rows (cons (nreverse items) rows) 1536 (setq rows (cons (nreverse items) rows)
1492 items nil)) 1537 items nil))
1493 (while rows 1538 (while rows
1494 (push (list 'tr nil (pop rows)) items)) 1539 (push (list 'tr nil (pop rows)) items))
1495 items)) 1540 items))
1541
1542 (defun w3-fix-color (color)
1543 (if (and color
1544 (string-match "^[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$" color))
1545 (concat "#" color)
1546 color))
1496 1547
1497 (defun w3-display-normalize-form-info (args) 1548 (defun w3-display-normalize-form-info (args)
1498 (let* ((plist (alist-to-plist args)) 1549 (let* ((plist (alist-to-plist args))
1499 (type (intern (downcase 1550 (type (intern (downcase
1500 (or (plist-get plist 'type) "text")))) 1551 (or (plist-get plist 'type) "text"))))
1615 (setcdr class (cons unique-id (cdr class))) 1666 (setcdr class (cons unique-id (cdr class)))
1616 (setf (nth 1 node) (cons (cons 'class (list unique-id)) 1667 (setf (nth 1 node) (cons (cons 'class (list unique-id))
1617 (nth 1 node)))) 1668 (nth 1 node))))
1618 (setf (nth 1 node) (cons (cons 'id unique-id) (nth 1 node))) 1669 (setf (nth 1 node) (cons (cons 'id unique-id) (nth 1 node)))
1619 (w3-handle-style (list 'data sheet 1670 (w3-handle-style (list 'data sheet
1620 'notation "css")))) 1671 'notation "text/css"))))
1621 (setq w3-display-css-properties (css-get 1672 (setq w3-display-css-properties (css-get
1622 (nth 0 node) 1673 (nth 0 node)
1623 (nth 1 node) 1674 (nth 1 node)
1624 w3-current-stylesheet 1675 w3-current-stylesheet
1625 w3-display-open-element-stack)) 1676 w3-display-open-element-stack))
1825 (setq w3-current-isindex (cons action prompt))) 1876 (setq w3-current-isindex (cons action prompt)))
1826 ) 1877 )
1827 ((html body) 1878 ((html body)
1828 (let ((fore (car (delq nil (copy-list w3-face-color)))) 1879 (let ((fore (car (delq nil (copy-list w3-face-color))))
1829 (back (car (delq nil (copy-list w3-face-background-color)))) 1880 (back (car (delq nil (copy-list w3-face-background-color))))
1881 (alink (w3-get-attribute 'alink))
1882 (vlink (w3-get-attribute 'vlink))
1883 (link (w3-get-attribute 'link))
1884 (sheet "")
1830 ) 1885 )
1831 (if (and fore font-running-xemacs) 1886 (if link
1832 (font-set-face-foreground 'default fore (current-buffer))) 1887 (setq sheet (format "%sa:link { color: %s }\n" sheet
1833 (if (and back font-running-xemacs) 1888 (w3-fix-color link))))
1834 (font-set-face-background 'default back (current-buffer))) 1889 (if vlink
1890 (setq sheet (format "%sa:visited { color: %s }\n" sheet
1891 (w3-fix-color vlink))))
1892 (if alink
1893 (setq sheet (format "%sa:active { color: %s }\n" sheet
1894 (w3-fix-color alink))))
1895 (if (/= (length sheet) 0)
1896 (w3-handle-style (list 'data sheet
1897 'notation "text/css")))
1898 (if (and (w3-get-attribute 'text) (not fore))
1899 (setf (car w3-face-color) (w3-fix-color
1900 (w3-get-attribute 'text))))
1901 (if (not font-running-xemacs)
1902 (setq w3-display-background-properties (cons fore back))
1903 (if fore
1904 (font-set-face-foreground 'default fore (current-buffer)))
1905 (if back
1906 (font-set-face-background 'default back (current-buffer))))
1835 (w3-handle-content node))) 1907 (w3-handle-content node)))
1836 (*document 1908 (*document
1837 (let ((info (mapcar (lambda (x) (cons x (symbol-value x))) 1909 (let ((info (mapcar (lambda (x) (cons x (symbol-value x)))
1838 w3-persistent-variables))) 1910 w3-persistent-variables)))
1839 (if (not w3-display-same-buffer) 1911 (if (not w3-display-same-buffer)
1858 (set (make-local-variable 'voice-lock-mode) t) 1930 (set (make-local-variable 'voice-lock-mode) t)
1859 (setq w3-current-stylesheet (css-copy-stylesheet 1931 (setq w3-current-stylesheet (css-copy-stylesheet
1860 w3-user-stylesheet) 1932 w3-user-stylesheet)
1861 w3-last-fill-pos (point) 1933 w3-last-fill-pos (point)
1862 fill-prefix "") 1934 fill-prefix "")
1863 (set (make-local-variable 'inhibit-read-only) t)) 1935 )
1864 (w3-handle-content node) 1936 (w3-handle-content node)
1865 ) 1937 )
1866 (*invisible 1938 (*invisible
1867 (w3-handle-empty-tag)) 1939 (w3-handle-empty-tag))
1868 (meta 1940 (meta
2074 ;; Remove 'face property at end of lines - underlining screws up stuff 2146 ;; Remove 'face property at end of lines - underlining screws up stuff
2075 ;; also remove 'mouse-face property at the beginning and end of lines 2147 ;; also remove 'mouse-face property at the beginning and end of lines
2076 (let ((inhibit-read-only t)) 2148 (let ((inhibit-read-only t))
2077 (save-excursion 2149 (save-excursion
2078 (goto-char (point-min)) 2150 (goto-char (point-min))
2079 (while (search-forward "[ \t]*\n[ \t]*" nil t) 2151 (while (re-search-forward "[ \t]*\n[ \t]*" nil t)
2080 (remove-text-properties (match-beginning 0) (match-end 0) 2152 (remove-text-properties (match-beginning 0) (match-end 0)
2081 '(face nil mouse-face nil) nil))))) 2153 '(face nil mouse-face nil) nil)))))
2082 2154
2083 (defsubst w3-finish-drawing () 2155 (defsubst w3-finish-drawing ()
2084 (let (url glyph widget) 2156 (let (url glyph widget)
2096 (w3-find-specific-link (url-target url-current-object))) 2168 (w3-find-specific-link (url-target url-current-object)))
2097 (goto-char (point-min))) 2169 (goto-char (point-min)))
2098 (and (not w3-running-xemacs) 2170 (and (not w3-running-xemacs)
2099 (not (eq (device-type) 'tty)) 2171 (not (eq (device-type) 'tty))
2100 (w3-fixup-eol-faces)) 2172 (w3-fixup-eol-faces))
2101 (let ((inhibit-read-only t))
2102 (remove-text-properties (point-min) (point-max) '(read-only) nil))
2103 (message "Drawing... done")) 2173 (message "Drawing... done"))
2104 2174
2105 (defun w3-region (st nd) 2175 (defun w3-region (st nd)
2106 (if (not w3-setup-done) (w3-do-setup)) 2176 (if (not w3-setup-done) (w3-do-setup))
2107 (let* ((source (buffer-substring st nd)) 2177 (let* ((source (buffer-substring st nd))
2171 (let ((w3-display-frames t)) 2241 (let ((w3-display-frames t))
2172 (w3-refresh-buffer))) 2242 (w3-refresh-buffer)))
2173 (let* ((old-asynch url-be-asynchronous) 2243 (let* ((old-asynch url-be-asynchronous)
2174 (structure (reverse w3-frameset-structure))) 2244 (structure (reverse w3-frameset-structure)))
2175 (if new-frame 2245 (if new-frame
2176 (select-frame (make-frame-command))) 2246 (select-frame (make-frame)))
2177 (setq-default url-be-asynchronous nil) 2247 (setq-default url-be-asynchronous nil)
2178 ;; set up frames 2248 ;; set up frames
2179 (while structure 2249 (while structure
2180 (if (eq (car (car structure)) 'frameset) 2250 (if (eq (car (car structure)) 'frameset)
2181 (let* ((current-dims (cdr (car structure))) 2251 (let* ((current-dims (cdr (car structure)))
2298 dimensions) 2368 dimensions)
2299 (pop star-dimensions)) 2369 (pop star-dimensions))
2300 ;; push + push => in order 2370 ;; push + push => in order
2301 dimensions)))))) 2371 dimensions))))))
2302 2372
2303
2304 (provide 'w3-display) 2373 (provide 'w3-display)