From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Edward O'Connor" Newsgroups: gmane.emacs.devel Subject: is there a hook run when display geometry changes? Date: Fri, 12 Aug 2011 10:51:25 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1313171517 23238 80.91.229.12 (12 Aug 2011 17:51:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 12 Aug 2011 17:51:57 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 12 19:51:53 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qrvth-0003BM-4e for ged-emacs-devel@m.gmane.org; Fri, 12 Aug 2011 19:51:53 +0200 Original-Received: from localhost ([::1]:41850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrvtg-0003Mr-Lg for ged-emacs-devel@m.gmane.org; Fri, 12 Aug 2011 13:51:52 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrvtd-0003Mb-M4 for emacs-devel@gnu.org; Fri, 12 Aug 2011 13:51:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qrvtc-0004MJ-SN for emacs-devel@gnu.org; Fri, 12 Aug 2011 13:51:49 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:37457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrvtc-0004MA-NE for emacs-devel@gnu.org; Fri, 12 Aug 2011 13:51:48 -0400 Original-Received: by wwf10 with SMTP id 10so2579075wwf.30 for ; Fri, 12 Aug 2011 10:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=lrjobCYSxQLoLPt1yNL26iM9A86kBZ2EqX5lZcZW03M=; b=JZGFwL51sDI1tEEcn6HJBMQgHMjia7UG3RJexMZlc3wlX93vBJ3KR/pPWrAMphI5RR 6GJFjhQZ0BVfHGIYKkmILLRxCWiIrdGixZFs2fLqu/VjsxlrduxMHE3hCdD7xYXMIpSx UWLBtjSDh+7CJjkYz3uGUqfHVmg+4cu2BzRWQ= Original-Received: by 10.216.237.35 with SMTP id x35mr3228769weq.76.1313171506683; Fri, 12 Aug 2011 10:51:46 -0700 (PDT) Original-Received: by 10.216.18.21 with HTTP; Fri, 12 Aug 2011 10:51:25 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:143165 Archived-At: Hi. Depending on the geometry of the primary display, I like my Emacs to use a different font size and a different window geometry. I have a function in my .emacs which inspects (display-pixel-width) and (display-pixel-height) and then does the right thing, and I run this function from `emacs-startup-hook'. This works well enough, but it'd be even awesomer if I could make Emacs call this function automatically when I plug my laptop into an external display. On GNUStep and Mac OS X, applications can listen for NSApplicationDidChangeScreenParametersNotification for this sort of thing. I assume there is similar functionality under X11 and on Windows. Is there an existing hook for screen geometry changes that should be run when Emacs gets an NSApplicationDidChangeScreenParametersNotification? If not, is this a feature people would be interested in? What are other people already doing for this? Thanks, Ted