From: martin rudalics <rudalics@gmx.at>
To: 涂坚 <09300720307@fudan.edu.cn>, 14049-done@debbugs.gnu.org
Subject: bug#14049: 24.3; set-frame-width didn't work in daemon mode
Date: Fri, 22 Sep 2017 10:10:02 +0200 [thread overview]
Message-ID: <59C4C55A.1090104@gmx.at> (raw)
In-Reply-To: <514EF885.1010009@fudan.edu.cn>
> 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
prev parent reply other threads:[~2017-09-22 8:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-24 12:58 bug#14049: 24.3; set-frame-width didn't work in daemon mode 涂坚
2017-09-22 8:10 ` martin rudalics [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59C4C55A.1090104@gmx.at \
--to=rudalics@gmx.at \
--cc=09300720307@fudan.edu.cn \
--cc=14049-done@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.