如果在fringe上显示是可行的,例子:
(define-fringe-bitmap 'test-bitmap
(vector #b00000000
#b00000000
#b00000000
#b00000000
#b00111100
#b01000010
#b01000010
#b00000010
#b00001100
#b00010000
#b00100000
#b01000000
#b01000000
#b01111110
#b00000000
#b00000000))
(let ((ov (make-overlay 1 1 (current-buffer))))
(overlay-put ov 'before-string
(propertize " " 'display '(left-fringe test-bitmap error))))
还有一种办法是用xpm,比如:
(create-image "/* XPM */
static char * percent[] = {
\"8 16 2 1\",
\"0 c #ffffff\",
\"1 c #000000\",
\"00000000\",
\"00000000\",
\"00000000\",
\"00000000\",
\"00111100\",
\"01000010\",
\"01000010\",
\"00000010\",
\"00001100\",
\"00010000\",
\"00100000\",
\"01000000\",
\"01000000\",
\"01111110\",
\"00000000\",
\"00000000\"};"
'xpm t :ascent 'center)
你把这段直接存到一个xpm文件,直接打开就能看到效果。
/* XPM */
static char * percent[] = {
"8 16 2 1",
"0 c #ffffff",
"1 c #000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00111100",
"01000010",
"01000010",
"00000010",
"00001100",
"00010000",
"00100000",
"01000000",
"01000000",
"01111110",
"00000000",
"00000000"};