From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Eure Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#5098: [NS] 23.1.50; display-pixel-height / display-pixel-width don't work in .emacs Date: Sat, 28 Nov 2009 15:30:29 -0800 Message-ID: Reply-To: Ian Eure , 5098@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1259742645 16836 80.91.229.12 (2 Dec 2009 08:30:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Dec 2009 08:30:45 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 02 09:30:36 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NFkbX-0001MA-Aj for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Dec 2009 09:30:32 +0100 Original-Received: from localhost ([127.0.0.1]:34329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFkbW-0006JW-KJ for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Dec 2009 03:30:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFkYn-00058W-JL for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2009 03:27:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFkYi-00056x-Fo for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2009 03:27:40 -0500 Original-Received: from [199.232.76.173] (port=47236 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFkYh-00056t-UU for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2009 03:27:36 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]:37375) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NFkYh-00019V-37 for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2009 03:27:35 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFkYe-0005jx-55 for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2009 03:27:32 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB28RNdJ004921; Wed, 2 Dec 2009 00:27:24 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB28A66O003518; Wed, 2 Dec 2009 00:10:06 -0800 Resent-Date: Wed, 2 Dec 2009 00:10:06 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Ian Eure Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 02 Dec 2009 08:10:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 5098 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12597408122100 (code B ref -1); Wed, 02 Dec 2009 08:10:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 2 Dec 2009 08:00:12 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB280AH3002096 for ; Wed, 2 Dec 2009 00:00:11 -0800 Original-Received: from mx10.gnu.org ([199.232.76.166]:44036) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1NFk89-0001x1-Aj for emacs-pretest-bug@gnu.org; Wed, 02 Dec 2009 03:00:09 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NFk87-0007kk-DC for emacs-pretest-bug@gnu.org; Wed, 02 Dec 2009 03:00:09 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]:35335) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NFk86-0007ka-P9 for emacs-pretest-bug@gnu.org; Wed, 02 Dec 2009 03:00:07 -0500 Original-Received: from 64-71-7-198.static.wiline.com ([64.71.7.198] helo=proton.local) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFk85-00046E-8N for emacs-pretest-bug@gnu.org; Wed, 02 Dec 2009 03:00:05 -0500 Original-Received: by proton.local (Postfix, from userid 502) id C1C1436F4AC; Sat, 28 Nov 2009 15:30:30 -0800 (PST) X-detected-operating-system: by mx20.gnu.org: Genre and OS details not recognized. X-Greylist: delayed 86402 seconds by postgrey-1.27 at nadesico; Wed, 02 Dec 2009 03:00:04 EST X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Wed, 02 Dec 2009 03:27:40 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33137 gmane.emacs.pretest.bugs:25268 Archived-At: I have a function which sets up the Emacs frame how I like it. This involves centering the frame within the screen; since I run Emacs on multiple systems, I calculate it based on the current screen dimensions. However, calling both display-pixel-height and display-pixel-width return zero when called from my .emacs file. I added some debug messages to emacs-startup-hook and window-setup-hook, and they return zero there as well. After Emacs has started, they return the correct values. This is irritating, since I must manually call my function after Emacs starts up. Here=E2=80=99s a simple testcase: (defun report-display-size () (message "Screen dimensions are %dx%d" (display-pixel-width) (display-pixel-height))) (add-hook 'window-setup-hook 'report-display-size) -> "Screen dimensions are 0x0" M-: (report-display-size) RET -> "Screen dimensions are 1440x900" In GNU Emacs 23.1.50.1 (x86_64-apple-darwin10.2.0, NS apple-appkit-1038.25) of 2009-11-27 on proton.local Windowing system distributor `Apple', version 10.3.1038 configured using `configure '--without-dbus' '--with-ns' 'CFLAGS=3D-pipe -= O2 -march=3Dnocona'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default enable-multibyte-characters: t Major mode: Magit Minor modes in effect: erc-spelling-mode: t erc-ring-mode: t erc-pcomplete-mode: t erc-netsplit-mode: t erc-button-mode: t erc-fill-mode: t erc-autojoin-mode: t erc-match-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-readonly-mode: t erc-scrolltobottom-mode: t which-function-mode: t yas/minor-mode: t shell-dirtrack-mode: t ime-bindings: t show-paren-mode: t recentf-mode: t iswitchb-mode: t cua-mode: t auto-insert-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t size-indication-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent input: f r o m SPC . e m a c s SPC o r SPC =20 , SPC C-x o C-x b C-x o C-n C-p C-n C-p C-x=20 b H C-x o C-x b e m a c s - s t a=20 r t u p h - h o o k , M-q C-o C-o C-n C-n=20 C-a C-c C-c C-p C-p C-e =20 C-c C-b C-c C-b C-SPC C-M-f M-w C-x o SPC=20 C-y C-x o C-p C-n C-p C-e C-b C-b C-b C-b C-b =20 C-x 1 M-< C-s - h o o k C-s C-s C-s C-s C-s C-s C-s=20 C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s=20 C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s=20 C-s C-s C-s C-s C-x k RET C-n C-p C-n C-p C-x b C-g=20 C-x b C-n C-p M-b M-b M-b o r SPC C-e . M-q=20 C-SPC C-p C-a M-w C-n C-n C-d C-x C-s C-c C-g n n n=20 n n n n p p C-n C-p C-p=20 C-p C-p C-p C-p C-p C-p C-p C-n C-p C-n C-x C-t C-x=20 C-s C-x b g s c C o m m e n t SPC u p =20 o u t SPC f r a m e - c e n t e r SPC c=20 a l l , SPC i t SPC d o e n s ' t SPC w o r k SPC a=20 t SPC a t s t s t a r t u p SPC t i m=20 e . C-c C-c M-x r e p o r t - e m Recent messages: Mark set Saving file /Users/ieure/Projects/dotfiles/emacs.d/ime-lisp/ime-top.el... Mark set Wrote /Users/ieure/Projects/dotfiles/emacs.d/ime-lisp/ime-top.el (No files need saving) Saving file /Users/ieure/Projects/dotfiles/emacs.d/ime-lisp/ime-top.el... Mark set Wrote /Users/ieure/Projects/dotfiles/emacs.d/ime-lisp/ime-top.el Type C-c C-c to commit (C-c C-k to cancel). Git finished. Load-path shadows: None found. Features: (shadow mail-extr emacsbug magit diff-mode log-edit pcvs-util add-log parse-time ielm jka-compr find-func cua-rect rect dired-aux dired cus-edit grep executable newcomment apropos dabbrev erc-spelling flyspell ispell erc-ring erc-pcomplete pcomplete erc-netsplit erc-button erc-fill erc-stamp erc-join help-mode view erc-track erc-match erc-goodies erc erc-backend erc-compat pp multi-isearch vc-git test-case-mode compile goto-addr light-symbol hi-lock thingatpt hl-line eldoc which-func imenu ime-top ime-ns dpkg-dev-el dpkg-dev-el-loaddefs ime-smarty ime-help ime-thrift ime-diff ime-org ime-m4 ime-markdown ime-clojure swank-clojure-autoload ime-slime slime-autoloads ime-w3m w3m-load ime-snippets dropdown-list yasnippet cl cl-19 ime-dired ime-ibuffer edmacro kmacro ime-abbrev ime-inferior ime-erc ime-ssh ime-sql ime-javascript ime-xml ime-html ime-sh ime-tcl ime-elisp ime-python ime-php skeleton ime-vc ime-programming tramp-imap epa derived epg epg-config imap-hash imap message sendmail ecomplete rfc822 mml mml-sec mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader mm-util mail-prsvr gmm-utils mailheader canlock sha1 hex-util hashcash mail-utils assoc tramp-gw tramp-fish tramp-smb tramp-cache tramp-ftp tramp-cmds tramp regexp-opt auth-source gnus-util netrc time-date shell comint ring password-cache format-spec tramp-compat trampver ime-inserts ime-editing ime-bindings easy-mmode ime-vars ime-fonts ime-autoloads ime-frame ibuf-ext ibuffer uniquify advice help-fns advice-preload paren server recentf tree-widget wid-edit iswitchb cua-base autoinsert cus-start cus-load tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process ns multi-tty emacs)