From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#14049: 24.3; set-frame-width didn't work in daemon mode Date: Fri, 22 Sep 2017 10:10:02 +0200 Message-ID: <59C4C55A.1090104@gmx.at> References: <514EF885.1010009@fudan.edu.cn> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1506068007 773 195.159.176.226 (22 Sep 2017 08:13:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 22 Sep 2017 08:13:27 +0000 (UTC) To: =?UTF-8?Q?=E6=B6=82=E5=9D=9A?= <09300720307@fudan.edu.cn>, 14049-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 22 10:13:21 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvJ5I-00085N-VE for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Sep 2017 10:13:17 +0200 Original-Received: from localhost ([::1]:57247 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvJ5Q-0004hU-7q for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Sep 2017 04:13:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvJ3D-0002z8-15 for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 04:11:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvJ39-0006YK-1A for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 04:11:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43497) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvJ38-0006Y8-TG for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 04:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dvJ38-0007Ky-NO for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 04:11:02 -0400 Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Sep 2017 08:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 14049 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 14049@debbugs.gnu.org, rudalics@gmx.at, 09300720307@fudan.edu.cn Original-Received: via spool by 14049-done@debbugs.gnu.org id=D14049.150606782828160 (code D ref 14049); Fri, 22 Sep 2017 08:11:02 +0000 Original-Received: (at 14049-done) by debbugs.gnu.org; 22 Sep 2017 08:10:28 +0000 Original-Received: from localhost ([127.0.0.1]:52178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvJ2a-0007K8-5Z for submit@debbugs.gnu.org; Fri, 22 Sep 2017 04:10:28 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:54379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvJ2X-0007Jq-OD for 14049-done@debbugs.gnu.org; Fri, 22 Sep 2017 04:10:26 -0400 Original-Received: from [192.168.1.100] ([46.125.249.97]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MDm4o-1eADGz0TJm-00HB1k; Fri, 22 Sep 2017 10:10:07 +0200 In-Reply-To: <514EF885.1010009@fudan.edu.cn> X-Provags-ID: V03:K0:5JIMJW/kFrJ0JmVVk444r2sqsdNxbDD1eVtE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.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137227 Archived-At: > I have the following lines in my .emacs file. > > (defun my:set-frame-size (&optional frame) > (interactive) > (if frame > (select-frame frame)) > (if (display-graphic-p) > (progn > (tool-bar-mode -1) > ;; use 120 char wide window for largeish displays > ;; and smaller 80 column windows for smaller displays > ;; pick whatever numbers make sense for you > (if (> (x-display-pixel-width) 1280) > (set-frame-width (selected-frame) 120) > (set-frame-width (selected-frame) 80)) > ;; for the height, subtract a couple hundred pixels > ;; from the screen height (for panels, menubars and > ;; whatnot), then divide by the height of a char to > ;; get the height we want > (set-frame-height (selected-frame) > (/ (- (x-display-pixel-height) 200) > (frame-char-height))) > ))) > > (add-hook 'after-make-frame-functions 'my:set-frame-size frame) > > However, if i invoke a normal emacs, and create a new frame, both > set-frame-width and set-frame-height work well. > > But if i invoke emacs from 'emacsclient -c -a ""', set-frame-width > didn't work. Width should be 120 instead of staying 80. (I have > "server-start in the end of my .emacs") > > I tried to debug it and use message to print width out. Under both > conditions, x-display-pixel-width is 1366 and (set-frame-width > (selected-frame) 120) is excuted. > > > > > In GNU Emacs 24.3.1 (i686-pc-cygwin) > of 2013-03-11 on fiona > Windowing system distributor `Microsoft Corp.', version 6.1.7601 I have been looking into this (and the related 14056) now. With a more simple scenario using (defun my-set-frame-size (&optional frame) (tool-bar-mode -1) (set-frame-width frame 30) (set-frame-height frame 10)) (add-hook 'after-make-frame-functions 'my-set-frame-size) (server-start) in the server Emacs, I can reproduce the bug for a 24.2.92.1 native Windows build I happen to have around here. For that build, the client frame indeed does not support the requested height but uses the default initial height instead. I cannot reproduce the bug for any later build I have here including one of 24.5.50.1. So I suppose that the bug has been fixed somewhere in between these two builds and mark this bug as done. Very belated thanks for the report, martin