From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: Calculate window size in pixels Date: Fri, 06 May 2005 12:40:12 +0200 Organization: [posted via Easynet Spain] Message-ID: <87wtqczlgz.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115381833 1863 80.91.229.2 (6 May 2005 12:17:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 6 May 2005 12:17:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 06 14:17:08 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DU1lE-0004aK-9A for geh-help-gnu-emacs@m.gmane.org; Fri, 06 May 2005 14:16:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DU1qu-0000qH-NR for geh-help-gnu-emacs@m.gmane.org; Fri, 06 May 2005 08:22:44 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!freenix!usenet-fr.net!teaser.fr!easynet-quince!easynet.net!easynet-post2!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:SjQCnCOysrEd0sujLNalKaPp7S0= Original-Lines: 28 Original-NNTP-Posting-Host: 62.93.174.79 Original-X-Trace: DXC=hMVQY`aSCD9:aP:3TbT]9;EY<>`XO4V7=>Uh List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26369 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26369 Mathias Dahl writes: > Is it possible to calculate an Emacs window's size in pixels? > `window-height' and `window-width' returns lines and columns. > > I guess this have to do with the frame's default font or > something. Having two functions, `window-height-pixels' and > `window-width-pixels' would be nice :) > > Can it be done? > > The reason that I want this is to be able to figure out to what size I > have to resize an image to before inserting it into a window, so that > it fits snugly. It depends on the window manager. With X, (when (eq window-system 'x) you'd use: x-display-pixel-width x-display-pixel-height ) -- __Pascal Bourguignon__ http://www.informatimago.com/ Until real software engineering is developed, the next best practice is to develop with a dynamic system that has extreme late binding in all aspects. The first system to really do this in an important way is Lisp. -- Alan Kay