User: jmiller
Date: 06/08/02 04:59:43
Modified: packages/xemacs-packages/calendar ChangeLog Makefile
calendar.el
Log:
remove ibuffer dependency.
Revision Changes Path
1.33 +6 -0 XEmacs/packages/xemacs-packages/calendar/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/ChangeLog,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -p -r1.32 -r1.33
--- ChangeLog 2006/08/01 01:52:15 1.32
+++ ChangeLog 2006/08/02 02:59:42 1.33
@@ -1,3 +1,9 @@
+2006-08-01 Jeff Miller <jeff.miller(a)xemacs.org>
+
+ * Makefile (REQUIRES): remove ibuffer from REQUIRES
+ * calendar.el: add cal-fit-window-to-buffer
+ * calendar.el (generate-calendar-window): use it
+
2006-07-31 Steve Youngs <steve(a)sxemacs.org>
* Makefile (REQUIRES): Remove fsf-compat.
1.32 +1 -1 XEmacs/packages/xemacs-packages/calendar/Makefile
Index: Makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/Makefile,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -p -r1.31 -r1.32
--- Makefile 2006/08/01 01:52:15 1.31
+++ Makefile 2006/08/02 02:59:43 1.32
@@ -22,7 +22,7 @@ AUTHOR_VERSION =
MAINTAINER = Jeff Miller <jeff.miller(a)xemacs.org>
PACKAGE = calendar
PKG_TYPE = regular
-REQUIRES = xemacs-base ibuffer
+REQUIRES = xemacs-base
CATEGORY = standard
include ../../Local.rules.inc
1.9 +24 -3 XEmacs/packages/xemacs-packages/calendar/calendar.el
Index: calendar.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/calendar.el,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- calendar.el 2006/07/31 02:15:23 1.8
+++ calendar.el 2006/08/02 02:59:43 1.9
@@ -130,6 +130,29 @@ properties to add to the result."
str))
)
+;; XEmacs change
+;; fit-window-to-buffer is only available in Emacs.
+;; shamelessly taken from ibuffer
+(unless (fboundp 'fit-window-to-buffer)
+ (defun cal-fit-window-to-buffer (&optional owin)
+ "Make window the right size to display its contents exactly."
+ (interactive)
+ (if owin
+ (delete-other-windows))
+ (when (> (length (window-list nil 'nomini)) 1)
+ (let* ((window (selected-window))
+ (buf (window-buffer window))
+ (height (window-displayed-height (selected-window)))
+ (new-height (with-current-buffer buf
+ (count-lines (point-min) (point-max))))
+ (diff (- new-height height)))
+ (unless (zerop diff)
+ (enlarge-window diff))
+ (let ((end (with-current-buffer buf (point-max))))
+ (while (and (> (length (window-list nil 'nomini)) 1)
+ (not (pos-visible-in-window-p end)))
+ (enlarge-window 1)))))))
+
;;; Code:
(eval-when-compile
@@ -138,8 +161,6 @@ properties to add to the result."
(defvar calendar-month-name-array)
(defvar calendar-starred-day))
-(require 'ibuffer)
-
(defun calendar-version ()
(interactive)
(message "Version 6, October 12, 1995"))
@@ -1856,7 +1877,7 @@ Or, for optional MON, YR."
(if (fboundp 'set-window-vscroll)
(set-window-vscroll nil 0))
;; Adjust the window to exactly fit the displayed calendar
- (ibuffer-shrink-to-fit ))
+ (cal-fit-window-to-buffer))
(sit-for 0)
(and mark-holidays-in-calendar
(mark-calendar-holidays)
Show replies by date