From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juan Pedro Bolivar Puente Newsgroups: gmane.emacs.help Subject: Re: Frame resize hook? Date: Wed, 22 Apr 2009 19:04:00 +0200 Message-ID: References: <7ceivkeofq.fsf@pbourguignon.anevia.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1240420021 7466 80.91.229.12 (22 Apr 2009 17:07:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Apr 2009 17:07:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 22 19:08:18 2009 Return-path: Envelope-to: geh-help-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 1LwfvP-0003yH-50 for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Apr 2009 19:07:55 +0200 Original-Received: from localhost ([127.0.0.1]:55410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lwfu0-0002dT-3t for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Apr 2009 13:06:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lwftb-0002dE-SD for help-gnu-emacs@gnu.org; Wed, 22 Apr 2009 13:06:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwftW-0002d2-FU for help-gnu-emacs@gnu.org; Wed, 22 Apr 2009 13:06:02 -0400 Original-Received: from [199.232.76.173] (port=41244 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwftW-0002cz-9c for help-gnu-emacs@gnu.org; Wed, 22 Apr 2009 13:05:58 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:42940 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LwftV-0008MF-Lx for help-gnu-emacs@gnu.org; Wed, 22 Apr 2009 13:05:58 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LwftU-0001X7-4n for help-gnu-emacs@gnu.org; Wed, 22 Apr 2009 17:05:56 +0000 Original-Received: from 1.red-81-39-224.dynamicip.rima-tde.net ([81.39.224.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Apr 2009 17:05:56 +0000 Original-Received: from magnicida by 1.red-81-39-224.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Apr 2009 17:05:56 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 1.red-81-39-224.dynamicip.rima-tde.net User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) In-Reply-To: <7ceivkeofq.fsf@pbourguignon.anevia.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor 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:63948 Archived-At: > > Perhaps with an advice, but ISTR that advices are not called when the > function is called from within the C layer of emacs (the calls are > "open coded" there). So it would work only if the frame resizing is > done from lisp code. > > The functions to advice would be set-frame-size, set-frame-width and set-frame-height. > (perhaps also set-frame-position). > > Cf. defadvice > > Otherwise, you would have to patch the C code of these primitive functions. > I tried adding: (defadvice set-frame-size (after jpb-advice-resize-1) (ecb-redraw-layout)) (defadvice set-frame-width (after jpb-advice-resize-2) (ecb-redraw-layout)) (defadvice set-frame-height (after jpb-advice-resize-2) (ecb-redraw-layout)) (ad-activate 'set-frame-size) (ad-activate 'set-frame-width) (ad-activate 'set-frame-height) But, as you said, it only works when calling set-frame-xxx from Elisp code, not on window manager events. Thanks for the tip anyways, I didn't know about "advices". JP