Thanks for your fix~~~
OT question, how is the #'resize-temp-buffer-window get evaluated if we
just define it in the esh-maint.el file? I've tried apply this patch to
the eshell source and re-byte-compiled esh-maint.el, but it seemed that
it didn't get loaded when when invoke eshell. Is there any other things
I have to do to make use of this new defun-when-void?
I've test this function by manually evaluated the defun-when-void, and
it works perfect on my machine.
--- Jerry James <james(a)xemacs.org> wrote:
On Wed, Feb 20, 2008 at 12:34 AM, FKtPp <m_pupil(a)yahoo.com.cn>
> Dear Bug Team!
> While runing grep/fgrep in eshell mode, XEmacs warning me:
> Symbol's function definition is void: resize-temp-buffer-window
Yes, we don't have this function. Here's a patch to address this
problem, but I'm not happy with it for the following reasons:
- The missing function should not be defined in the eshell package,
- This patch duplicates functionality that is already available via
- My version calls resize-minibuffer-count-window-lines, which does
the right thing, but has a misleading name. That function actually
counts the lines in *any* buffer (not window!). It ought to be
buffer-count-lines. It also, in all of my tests so far, returns a
number exactly 1 smaller than it ought to be. Gotta love off-by-one
Has anybody noticed that, although we define temp-buffer-max-height,
we don't actually *use* it anywhere?
packages source patch:
Diff command: cvs -q diff -uN
Files affected: xemacs-packages/eshell/esh-maint.el
retrieving revision 1.20
diff -u -u -r1.20 Makefile
--- xemacs-packages/eshell/Makefile 4 Sep 2007 11:19:06 -0000 1.20
+++ xemacs-packages/eshell/Makefile 6 Mar 2008 18:59:52 -0000
＠＠ -35,7 +35,7 ＠＠
-EXTRA_SOURCES = esh-groups.el
+GENERATED_LISP = esh-groups.el
STANDARD_DOCS = t
retrieving revision 1.1
diff -u -u -r1.1 esh-maint.el
--- xemacs-packages/eshell/esh-maint.el 10 Jan 2001 02:52:55 -0000
+++ xemacs-packages/eshell/esh-maint.el 6 Mar 2008 18:59:52 -0000
＠＠ -46,6 +46,27 ＠＠
(setq cl-optimize-speed 9))
+(defun-when-void resize-temp-buffer-window ()
+ "Resize the selected window to fit its contents.
+Will not make it higher than `temp-buffer-max-height' nor smaller
+`window-min-height'. Do nothing if it is the only window on its
frame, if it
+is not as wide as the frame or if some of the window's contents are
+out of view."
+ (let ((w (selected-window)))
+ ;; First try to make it smaller
+ (shrink-window-if-larger-than-buffer w)
+ ;; Next try to make it bigger
+ (when (and (not (one-window-p 'nomini))
+ (pos-visible-in-window-p (point-min) w)
+ (window-leftmost-p w)
+ (window-rightmost-p w))
+ (let ((max-height (min (round (* (frame-height)
+ (cur-height (window-height w)))
+ (if (< cur-height max-height)
+ (enlarge-window (- max-height cur-height) nil w))))))
(defun eshell-generate-autoloads ()
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.
XEmacs-Beta mailing list