This patch has been committed.
Jeff Miller writes:
Vin Shelton writes:
> Since Jeff's recent changes, without this patch, I cannot build
> hyperbole. It appears the package smoketest is broken as well (from
>
http://labb.contactor.se/~matsl/smoketest/logs/2006-07-31-18:02_buildAll_...
:
How about instead, I remove the dependency for ibuffer? I only
included it because I wanted something that acted like Emacs'
fit-window-to-buffer. Since I've since added a bunch of
compatibility code, might as well add this one. Hyperbole builds ok
for me after I make this change.
I'll commit this shortly.
Jeff
ChangeLog addition:
2006-08-01 Jeff Miller <jeff.miller(a)xemacs.org>
* Makefile (REQUIRES): remove ibuffer for REQUIRES
* calendar.el: add cal-fit-window-to-buffer
* calendar.el (generate-calendar-window): use it
calendar source patch:
Diff command: cvs -q diff -uN
Files affected: calendar.el Makefile
Index: Makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/Makefile,v
retrieving revision 1.31
diff -u -b -w -u -r1.31 Makefile
--- Makefile 2006/08/01 01:52:15 1.31
+++ Makefile 2006/08/02 01:42:32
@@ -22,7 +22,7 @@
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
Index: calendar.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/calendar.el,v
retrieving revision 1.8
diff -u -b -w -u -r1.8 calendar.el
--- calendar.el 2006/07/31 02:15:23 1.8
+++ calendar.el 2006/08/02 01:42:33
@@ -130,6 +130,29 @@
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 @@
(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 @@
(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)
--
Jeff Miller
jmiller(a)cablespeed.com