all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arthur Tu <arthur.jim.tu@gmail.com>
To: 14056@debbugs.gnu.org
Subject: bug#14056: 24.3; set-frame-height/width don't work when called first time on daemon mode
Date: Tue, 26 Mar 2013 20:05:26 +0800	[thread overview]
Message-ID: <51518F05.4010202@gmail.com> (raw)

Sorry I come up with this bug again.
I found that i can't reply to my previous bug report.

I have the following function added to after-frame-created-functions.
(defun my:set-frame-size (&optional frame)
   (interactive)
   (unless frame
     (setq (selected-frame) frame))
   (if (display-graphic-p)
       (progn
     (tool-bar-mode -1)
     (message "set frame size")

     ;; This should be an emacs bug.
     ;; i have to add a fake operation on frame here.
     ;; (set-frame-height frame 29)

     ;; 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 frame
               (/ (- (x-display-pixel-height) 200)
                  (frame-char-height)))
     ;; 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 frame 120)
       (set-frame-width frame 80))
     )))
(add-hook after-frame-created-functions my:set-frame-size)

I have serveral experiments.

1. If i use the code shown before, after 'emacsclient -c -a ""', every
emacsclient frame can set width corrently and its height stay unchanged.

2. If i move the part of set width code before set height code, height can
be changed correctly while width can't.

3. If i add a fake (set-frame-height(or width) whatever), like that
commented by me, I can set both height and width.









In GNU Emacs 24.3.1 (i686-pc-cygwin)
  of 2013-03-11 on fiona
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
  `configure
  '--srcdir=/home/kbrown/src/cygemacs/emacs-24.3-1/src/emacs-24.3'
  '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin'
  '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--datadir=/usr/share'
  '--localstatedir=/var' '--sysconfdir=/etc' '--datarootdir=/usr/share'
  '--docdir=/usr/share/doc/emacs' '-C' '--with-w32' 'CC=gcc'
  'CFLAGS=-ggdb -O2 -pipe
  -fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-24.3-1/build=/usr/src/debug/emacs-24.3-1
  -fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-24.3-1/src/emacs-24.3=/usr/src/debug/emacs-24.3-1'
  'LDFLAGS=-L/usr/lib/ncursesw' 'LIBS='
  'CPPFLAGS=-I/usr/include/ncursesw''

Important settings:
   value of $LANG: en_US.UTF-8
   locale-coding-system: utf-8-unix
   default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
   shell-dirtrack-mode: t
   cygwin-terminal-clipboard-mode: t
   yas-global-mode: t
   yas-minor-mode: t
   global-auto-complete-mode: t
   auto-complete-mode: t
   global-semanticdb-minor-mode: t
   global-semantic-idle-scheduler-mode: t
   semantic-mode: t
   global-ede-mode: t
   show-paren-mode: t
   global-linum-mode: t
   linum-mode: t
   tooltip-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t






                 reply	other threads:[~2013-03-26 12:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=51518F05.4010202@gmail.com \
    --to=arthur.jim.tu@gmail.com \
    --cc=14056@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.