comparison lisp/glyphs.el @ 4226:9b4442ac18c7

[xemacs-hg @ 2007-10-15 09:55:43 by didierv] Fix image specifiers related bugs
author didierv
date Mon, 15 Oct 2007 09:55:50 +0000
parents fd1acd2f457a
children 6a17ac5da3c4
comparison
equal deleted inserted replaced
4225:e358b6c40407 4226:9b4442ac18c7
1 ;;; glyphs.el --- Lisp interface to C glyphs 1 ;;; glyphs.el --- Lisp interface to C glyphs
2 2
3 ;; Copyright (C) 1994, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1994, 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995, 1996, 2000, 2005 Ben Wing. 4 ;; Copyright (C) 1995, 1996, 2000, 2005 Ben Wing.
5 ;; Copyright (C) 2007 Didier Verna
5 6
6 ;; Author: Chuck Thompson <cthomp@cs.uiuc.edu>, Ben Wing <ben@xemacs.org> 7 ;; Author: Chuck Thompson <cthomp@cs.uiuc.edu>, Ben Wing <ben@xemacs.org>
7 ;; Maintainer: XEmacs Development Team 8 ;; Maintainer: XEmacs Development Team
8 ;; Keywords: extensions, internal, dumped 9 ;; Keywords: extensions, internal, dumped
9 10
1182 ;; the following. I have no idea if this is standard. 1183 ;; the following. I have no idea if this is standard.
1183 ,@(if (featurep 'jpeg) '(("\\`\377\330\377\340\000\020JFIF" 1184 ,@(if (featurep 'jpeg) '(("\\`\377\330\377\340\000\020JFIF"
1184 [jpeg :data nil] 2))) 1185 [jpeg :data nil] 2)))
1185 ,@(if (featurep 'png) '(("\\.png\\'" [png :file nil] 2))) 1186 ,@(if (featurep 'png) '(("\\.png\\'" [png :file nil] 2)))
1186 ,@(if (featurep 'png) '(("\\`\211PNG" [png :data nil] 2))) 1187 ,@(if (featurep 'png) '(("\\`\211PNG" [png :data nil] 2)))
1187 ("" [string :data nil] 2) 1188 ;; No, I don't think we want to inline images... -- dvl
1189 ;; ("" [string :data nil] 2)
1188 ("" [nothing])))) 1190 ("" [nothing]))))
1189 ;; #### this should really be formatted-string, not string but we 1191 ;; #### this should really be formatted-string, not string but we
1190 ;; don't have it implemented yet 1192 ;; don't have it implemented yet
1191 ;;
1192 ;; #define could also mean a bitmap as well as a version 1 XPM. Who
1193 ;; cares. We don't want the file contents getting converted to a
1194 ;; string in either case which is why the entry is there.
1195 (if (featurep 'tty) 1193 (if (featurep 'tty)
1196 (progn 1194 (progn
1197 (set-console-type-image-conversion-list 1195 (set-console-type-image-conversion-list
1198 'tty 1196 'tty
1199 '(("^#define" [string :data "[xpm]"]) 1197 '(("\\.xpm\\'" [string :data nil] 2)
1200 ("\\`X-Face:" [string :data "[xface]"]) 1198 ("\\.xbm\\'" [string :data nil] 2)
1199 ;; #define could also mean a bitmap as well as a version 1 XPM. Who
1200 ;; cares.
1201 ("^#define" [string :data "[xpm]"])
1201 ("\\`/\\* XPM \\*/" [string :data "[xpm]"]) 1202 ("\\`/\\* XPM \\*/" [string :data "[xpm]"])
1202 ("\\`GIF87" [string :data "[gif]"]) 1203 ("\\`X-Face:" [string :data "[xface]"])
1204 ("\\.gif\\'" [string :data nil] 2)
1205 ("\\`GIF8[79]" [string :data "[gif]"])
1206 ("\\.jpe?g\\'" [string :data nil] 2)
1203 ("\\`\377\330\340\000\020JFIF" [string :data "[jpeg]"]) 1207 ("\\`\377\330\340\000\020JFIF" [string :data "[jpeg]"])
1204 ("" [string :data nil] 2) 1208 ;; all of the JFIF-format JPEG's that I've seen begin with
1209 ;; the following. I have no idea if this is standard.
1210 ("\\`\377\330\377\340\000\020JFIF" [string :data "[jpeg]"])
1211 ("\\.png\\'" [string :data nil] 2)
1212 ("\\`\211PNG" [string :data "[png]"])
1213 ;; No, I don't think we want to inline images... -- dvl
1214 ;;("" [string :data nil] 2)
1205 ;; this last one is here for pointers and icons and such -- 1215 ;; this last one is here for pointers and icons and such --
1206 ;; strings are not allowed so they will be ignored. 1216 ;; strings are not allowed so they will be ignored.
1207 ("" [nothing]))) 1217 ("" [nothing])))
1208 1218
1209 ;; finish initializing truncation glyph -- created internally 1219 ;; finish initializing truncation glyph -- created internally
1215 (set-glyph-image continuation-glyph "\\" 'global 'tty) 1225 (set-glyph-image continuation-glyph "\\" 'global 'tty)
1216 1226
1217 ;; finish initializing hscroll glyph -- created internally 1227 ;; finish initializing hscroll glyph -- created internally
1218 ;; because it has a built-in bitmap 1228 ;; because it has a built-in bitmap
1219 (set-glyph-image hscroll-glyph "$" 'global 'tty))) 1229 (set-glyph-image hscroll-glyph "$" 'global 'tty)))
1230
1231 ;; For streams, we don't want images at all -- dvl
1232 (set-console-type-image-conversion-list 'stream '(("" [nothing])))
1233
1220 1234
1221 (set-glyph-image octal-escape-glyph "\\") 1235 (set-glyph-image octal-escape-glyph "\\")
1222 (set-glyph-image control-arrow-glyph "^") 1236 (set-glyph-image control-arrow-glyph "^")
1223 (set-glyph-image invisible-text-glyph " ...") 1237 (set-glyph-image invisible-text-glyph " ...")
1224 ;; (set-glyph-image hscroll-glyph "$") 1238 ;; (set-glyph-image hscroll-glyph "$")