Next: , Previous: , Up: Miscellaneous  

Q5.3.7: Can I have the end of the buffer delimited in some way?

Say, with: ‘[END]’?

Try this:

(let ((ext (make-extent (point-min) (point-max))))
  (set-extent-property ext 'start-closed t)
  (set-extent-property ext 'end-closed t)
  (set-extent-property ext 'detachable nil)
  (set-extent-end-glyph ext (make-glyph [string :data "[END]"])))

Since this is SXEmacs, you can specify an icon to be shown on window-system devices. To do so, change the make-glyph call to something like this:

(make-glyph '([xpm :file "~/something.xpm"]
              [string :data "[END]"]))

You can inline the XPM definition yourself by specifying :data instead of :file. Here is such a full-featured version that works on both X and TTY devices:

(let ((ext (make-extent (point-min) (point-max))))
  (set-extent-property ext 'start-closed t)
  (set-extent-property ext 'end-closed t)
  (set-extent-property ext 'detachable nil)
  (set-extent-end-glyph ext (make-glyph '([xpm :data "\
/* XPM */
static char* eye = {
\"20 11 7 2\",
\"__ c None\"
\"_` c #7f7f7f\",
\"_a c #fefefe\",
\"_b c #7f0000\",
\"_c c #fefe00\",
\"_d c #fe0000\",
\"_e c #bfbfbf\",
} ;"]
                                          [string :data "[END]"]))))

Note that you might want to make this a function, and put it to a hook. We leave that as an exercise for the reader.