Mercurial > hg > xemacs-beta
annotate tests/gutter-test.el @ 4506:bd28481bb0e1
Port #'window-buffer-height, #'fit-window-to-buffer, & window, buf, functions.
lisp/ChangeLog addition:
2008-08-31 Aidan Kehoe <kehoea@parhasard.net>
* window.el (only-window-p): New.
Check if WINDOW is the only window in some context, normally its
frame.
(one-window-p):
Implemented this in terms of #'only-window-p, calling it on the
selected window.
(window-buffer-height): Uncomment this, make it work.
(count-screen-lines): Support a BUFFER argument.
(fit-window-to-buffer): Uncomment this, correct its implementation
to work with XEmacs.
* help.el (temp-buffer-resize-mode): New. Name taken from GNU,
implementation our own.
* (resize-temp-buffer-window): New. GNU-compatible alias for
#'shrink-window-if-larger-than-buffer.
* dumped-lisp.el (preloaded-file-list): Move easy-mmode before
help, now that the latter uses #'define-minor-mode.
* frame.el: Point to #'temp-buffer-resize-mode in a comment.
Some of this code is from GNU; help.el CVS version 1.327 of
2007-03-21, window.el CVS version 1.122, of 2007-06-24. Both these
are GPLV2 or later.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 31 Aug 2008 12:26:46 +0200 |
parents | 42375619fa45 |
children | 8a653fbe5c27 |
rev | line source |
---|---|
442 | 1 (setq str "Hello\nAgain") |
2 (setq str-ext (make-extent 0 5 str)) | |
398 | 3 (set-extent-begin-glyph |
442 | 4 str-ext |
398 | 5 (make-glyph [xpm :file "../etc/xemacs-icon.xpm"])) |
442 | 6 (set-extent-property str-ext 'mouse-face 'highlight) |
398 | 7 |
442 | 8 (setq str2 "Hello\n") |
9 (setq str2-ext (make-extent 0 1 str2)) | |
398 | 10 (set-extent-begin-glyph |
442 | 11 str2-ext |
398 | 12 (make-glyph |
13 [button :width 5 :height 1 | |
14 :face modeline-mousable | |
442 | 15 :callback (set-specifier bottom-gutter-visible-p '(str2)) |
398 | 16 :descriptor "ok" :selected t])) |
17 | |
442 | 18 (set-specifier bottom-gutter-height 'autodetect) |
19 (set-specifier bottom-gutter-border-width 2) | |
20 | |
21 (set-gutter-element | |
22 bottom-gutter 'str | |
23 (make-glyph | |
863 | 24 [layout :orientation vertical :margin-width 4 |
25 :vertically-justify center :horizontally-justify left | |
442 | 26 :items ([string :data "Fontifying glyphs.c..."] |
863 | 27 [layout :orientation horizontal |
442 | 28 :items |
29 ([progress-gauge :value 0 :pixel-height 24 | |
30 :pixel-width 250 :descriptor | |
31 "Progress"] | |
32 [button :pixel-height 24 | |
33 :descriptor " Stop " | |
34 :callback (quote quit)])])])) | |
35 | |
36 (set-gutter-element-visible-p bottom-gutter-visible-p 'str t) | |
863 | 37 (set-gutter-element left-gutter 'str2 str2) |
38 (set-gutter-element-visible-p left-gutter-visible-p 'str2 t) | |
442 | 39 |