all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Arthur Tu <arthur.jim.tu@gmail.com>
Cc: 13956@debbugs.gnu.org
Subject: bug#13956: 24.3; An initial frame already exists before reading .emacs on daemon mode
Date: Wed, 14 Jun 2017 20:02:11 -0400	[thread overview]
Message-ID: <87zidarud8.fsf@users.sourceforge.net> (raw)
In-Reply-To: <51419812.9080009@gmail.com> (Arthur Tu's message of "Thu, 14 Mar 2013 17:27:46 +0800")

tags 13956 notabug wontfix
close 13956
quit

Arthur Tu <arthur.jim.tu@gmail.com> writes:

> I want to call emacsclient to edit my file after start emacs
> server once manually.
>
> I have following code in my .emacs:
>
> (defun set-frame ()
>   (interactive)
>   ;;(setq initial-frame-alist '((width . 80) (height . 20)
> (menu-bar-lines . 1)))
>   (progn
>     ;; 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)
>     (add-to-list 'default-frame-alist (cons 'width 120))
>       (add-to-list 'default-frame-alist (cons 'width 120)))
>     ;; 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
>     (add-to-list 'default-frame-alist
>          (cons 'height (/ (- (x-display-pixel-height) 250)
>                   (frame-char-height))))
>     ))
>
> (add-hook 'after-init-hook
>       ;; ask user whether to restore desktop at start-up
>       (lambda ()
>         (if initial-window-system
>         (set-frame)
>           (add-hook 'server-visit-hook 'set-frame))))
>
> However, the first emacsclient frame can't be set to the size i want.
>
> I don't know if this bug is in cygwin branch only or global.
>
> Help please.

In daemon mode, the initial frame stays hidden, so there's no meaningful
size.  You should do something like

    (if (and (not (daemonp)) initial-window-system)
       ...)





      reply	other threads:[~2017-06-15  0:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14  9:27 bug#13956: 24.3; An initial frame already exists before reading .emacs on daemon mode Arthur Tu
2017-06-15  0:02 ` npostavs [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=87zidarud8.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=13956@debbugs.gnu.org \
    --cc=arthur.jim.tu@gmail.com \
    /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.