Mercurial > hg > xemacs-beta
view tests/gtk/statusbar-test.el @ 5632:bd80d9103fc8
Integrate CL code better into core, remove obsolete compatibility code.
lisp/ChangeLog addition:
2011-12-30 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el:
Call #'cl-compile-time-init explicitly here, don't rely on
bytecomp-load-hook for what is core functionality.
* cl-extra.el:
* cl-extra.el (require):
* cl-extra.el (make-random-state):
* cl-extra.el (random-state-p):
* cl-extra.el (make-hashtable): Removed.
* cl-extra.el (make-weak-hashtable): Removed.
* cl-extra.el (make-key-weak-hashtable): Removed.
* cl-extra.el (make-value-weak-hashtable): Removed.
* cl-extra.el ('hashtablep): Removed.
* cl-extra.el ('hashtable-fullness): Removed.
* cl-extra.el ('hashtable-test-function): Removed.
* cl-extra.el ('hashtable-type): Removed.
* cl-extra.el ('hashtable-size): Removed.
* cl-extra.el ('copy-hashtable): Removed.
* cl-extra.el (cl-builtin-gethash): Removed.
* cl-extra.el (cl-builtin-remhash): Removed.
* cl-extra.el (cl-builtin-clrhash): Removed.
* cl-extra.el (cl-builtin-maphash): Removed.
* cl-extra.el ('cl-gethash): Removed.
* cl-extra.el ('cl-puthash): Removed.
* cl-extra.el ('cl-remhash): Removed.
* cl-extra.el ('cl-clrhash): Removed.
* cl-extra.el ('cl-maphash): Removed.
* cl-extra.el ('cl-make-hash-table): Removed.
* cl-extra.el ('cl-hash-table-p): Removed.
* cl-extra.el ('cl-hash-table-count): Removed.
* cl-extra.el (cl-prettyexpand):
* cl-extra.el (names):
Remove compatibility aliases from this file.
In #'cl-prettyexpand, if FULL is nil, don't expand return-from
either, for symmetry with not expanding block.
Drop cl-extra-load-hook, it's useless when cl-extra is dumped
(since third-party code can't use it, and dumped code shouldn't
use it.)
* cl-macs.el:
* cl-macs.el (cl-pop2):
* cl-macs.el (defun*):
* cl-macs.el (cl-parse-loop-clause):
Remove some no-longer-needed compatibility kludges.
* cl.el:
* cl.el ('cl-map-extents): Removed.
* cl.el (cl-random-time):
* cl.el (list*): New, moved back from subr.el, given a shorter
implementation.
* cl.el ('cl-member): Removed.
* cl.el ('cl-floor): Removed.
* cl.el ('cl-ceiling): Removed.
* cl.el ('cl-truncate): Removed.
* cl.el ('cl-round): Removed.
* cl.el ('cl-mod): Removed.
Remove some compatibility aliases; these may conflict with
package usage, in which case the packages need to be updated, the
new names are available in 21.4, and that's the most recent
version we support.
* cl.el (cl-hacked-flag): Removed.
* cl.el (cl-hack-byte-compiler): Removed.
* subr.el:
* subr.el (list*): Moved back to cl.el.
* update-elc-2.el (batch-update-elc-2):
* update-elc.el (do-autoload-commands):
Add an autoload for cl-compile-time-init in these two files, they
run on bare temacs, auto-autoload isn't available to them, and now
bytecomp calls cl-compile-time-init explicitly.
* cl-compat.el: Removed. This file was long obsolete.
man/ChangeLog addition:
2011-12-30 Aidan Kehoe <kehoea@parhasard.net>
* cl.texi (Top):
* cl.texi (Usage):
* cl.texi (Organization):
* cl.texi (Efficiency Concerns):
* cl.texi (Common Lisp Compatibility):
Remove documentation of cl-compat, now it's deleted.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Fri, 30 Dec 2011 16:05:31 +0000 |
parents | b9167d522a9a |
children |
line wrap: on
line source
;; statusbar-test.el --- test the GTK status bar ;; ;; Copyright 2000, 2001 William Perry ;; ;; This file is part of XEmacs. ;; XEmacs is free software: you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by the ;; Free Software Foundation, either version 3 of the License, or (at your ;; option) any later version. ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;; for more details. ;; You should have received a copy of the GNU General Public License ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. (defvar statusbar-hashtable (make-hashtable 29)) (defvar statusbar-gnome-p nil) (defmacro get-frame-statusbar (frame) `(gethash (or ,frame (selected-frame)) statusbar-hashtable)) (defun add-frame-statusbar (frame) "Stick a GTK (or GNOME) statusbar at the bottom of the frame." (if (windowp (frame-property frame 'minibuffer)) (puthash frame (get-frame-statusbar (window-frame (frame-property frame 'minibuffer))) statusbar-hashtable) (let ((sbar nil) (shell (frame-property frame 'shell-widget))) (if (string-match "Gnome" (gtk-type-name (gtk-object-type shell))) (progn (require 'gnome-widgets) (setq sbar (gnome-appbar-new t t 0) statusbar-gnome-p t) (gtk-progress-set-format-string sbar "%p%%") (gnome-app-set-statusbar shell sbar)) (setq sbar (gtk-statusbar-new)) (gtk-box-pack-end (frame-property frame 'container-widget) sbar nil nil 0)) (puthash frame sbar statusbar-hashtable)))) (add-hook 'create-frame-hook 'add-frame-statusbar) (add-hook 'delete-frame-hook (lambda (f) (remhash f statusbar-hashtable))) (defun clear-message (&optional label frame stdout-p no-restore) (let ((sbar (get-frame-statusbar frame))) (if sbar (if statusbar-gnome-p (gnome-appbar-pop sbar) (gtk-statusbar-pop sbar 1))))) (defun append-message (label message &optional frame stdout-p) (let ((sbar (get-frame-statusbar frame))) (if sbar (if statusbar-gnome-p (gnome-appbar-push sbar message) (gtk-statusbar-push sbar 1 message))))) (defun progress-display (fmt &optional value &rest args) "Print a progress gauge and message in the bottom gutter area of the frame. The arguments are the same as to `format'. If the only argument is nil, clear any existing progress gauge." (let ((sbar (get-frame-statusbar nil))) (apply 'message fmt args) (if statusbar-gnome-p (progn (gtk-progress-set-show-text (gnome-appbar-get-progress sbar) t) (gnome-appbar-set-progress sbar (/ value 100.0)) (gdk-flush))))) (defun lprogress-display (label fmt &optional value &rest args) "Print a progress gauge and message in the bottom gutter area of the frame. First argument LABEL is an identifier for this progress gauge. The rest of the arguments are the same as to `format'." (if (and (null fmt) (null args)) (prog1 nil (clear-progress-display label nil)) (let ((str (apply 'format fmt args))) (progress-display str value) str))) (defun clear-progress-display (&rest ignored) (if statusbar-gnome-p (let* ((sbar (get-frame-statusbar nil)) (progress (gnome-appbar-get-progress sbar))) (gnome-appbar-set-progress sbar 0) (gtk-progress-set-show-text progress nil))))