[OS X Emacs] window-height trouble

David Reitter david.reitter at gmail.com
Sun Dec 12 08:43:13 EST 2010

On Dec 12, 2010, at 7:28 AM, Chris Beard wrote:
> In Aquamacs it acts screwy, and it looks like window-height doesn't
> work in it. I'm not too experienced at elisp, but I evaluated
> (window-height), and the integer 36 came up in *Messages* buffer. The
> line numbering shows the buffer where I evaluated it is 48 lines long
> (though the scratch buffer numbering appears to actually be 36 lines
> long).

This seems to be a bug in chop.el.

`window-height' returns the height of the window, expressed in frame lines.  The line height refers to the font used for the frame.  Modern GNU Emacs, and also Aquamacs, may use a different font for the buffer (see `face-remapping-alist').  Thus, you cannot use `window-height' to determine the extent of a window for the purposes of scrolling.  Chop.el would similarly fail when lines of different heights are used, e.g., through syntax highlighting (AUCTeX uses it a lot).

A better way may be to use `scroll-up' (with `save-excursion') to figure out what the height is (let-binding a few scroll parameters).  This, however, will interact with wrapped lines and the like.

Aquamacs makes use of a number of Emacs 23 features.  External packages that are written with Emacs-on-a-text-terminal assumptions will trip over this.

Turn off aquamacs-autoface-mode for a quick workaround.

http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
http://aquamacs.org/donate -- Could we help you? Return the favor and support the Aquamacs Project!

More information about the MacOSX-Emacs mailing list