all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13956: 24.3; An initial frame already exists before reading .emacs on daemon mode
@ 2013-03-14  9:27 Arthur Tu
  2017-06-15  0:02 ` npostavs
  0 siblings, 1 reply; 2+ messages in thread
From: Arthur Tu @ 2013-03-14  9:27 UTC (permalink / raw)
  To: 13956

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 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: Emacs-Lisp

Minor modes in effect:
   yas-global-mode: t
   yas-minor-mode: t
   google-this-mode: t
   global-auto-complete-mode: t
   auto-complete-mode: t
   cygwin-terminal-clipboard-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

Recent input:
<lwindow> <lwindow> <lwindow> <lwindow> <lwindow> <lwindow>
<lwindow> <lwindow> <lwindow> <lwindow> <lwindow> <lwindow>
<lwindow> <lwindow> <lwindow> <lwindow> <lwindow> <lwindow>
<lwindow> <lwindow> <lwindow> <lwindow> <lwindow> <lwindow>
<lwindow> <lwindow> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> C-x C-f <backspace>
<backspace> h o <backspace> <backspace> ~ <backspace>
<backspace> <backspace> ~ <backspace> h o <return>
<return> . e <return> C-v C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-p C-p C-n C-l C-l C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n <help-echo>
<help-echo> M-x r e p o r <tab> <return> C-g M-x t
o o l <tab> = b a <tab> <backspace> <backspace> <backspace>
- b a r <tab> <return> M-x r e p o r <tab> <return
 >

Recent messages:
[yas] Loading for `c-mode', just-in-time: (yas--load-directory-1 
/home/Arthur/.emacs.d/elpa/yasnippet-20130218.2229/snippets/c-mode 
(quote c-mode) (quote (cc-mode)))!
[yas] Loading compiled snippets from 
/home/Arthur/.emacs.d/elpa/yasnippet-20130218.2229/snippets/c-mode
[yas] Loading for `cc-mode', just-in-time: (yas--load-directory-1 
/home/Arthur/.emacs.d/elpa/yasnippet-20130218.2229/snippets/cc-mode 
(quote cc-mode) (quote (text-mode)))!
[yas] Loading compiled snippets from 
/home/Arthur/.emacs.d/elpa/yasnippet-20130218.2229/snippets/cc-mode
When done with a buffer, type C-x #
When done with this frame, type C-x 5 0 [3 times]
byte-code: Beginning of buffer [7 times]
Quit
Making completion list...
Tool-Bar mode disabled

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr cus-start cus-load emacsbug message
format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils flymake-cursor byte-opt
warnings bytecomp byte-compile cconv flymake compile comint ansi-color
ring cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs server yasnippet help-mode easymenu
google-this auto-complete-config auto-complete cl-macs gv popup cl
auto-complete-autoloads flymake-css-autoloads flymake-cursor-autoloads
flymake-php-autoloads flymake-python-pyflakes-autoloads
flymake-shell-autoloads flymake-easy-autoloads google-this-autoloads
google-translate-autoloads guess-offset-autoloads haskell-mode-autoloads
mmm-mode-autoloads php-mode-autoloads popup-autoloads
w32-browser-autoloads yasnippet-autoloads package
cygwin-terminal-clipboard easy-mmode flex-mode derived tsdh-dark-theme
edmacro kmacro avoid time-date paren uniquify linum ido advice help-fns
cl-lib advice-preload tooltip ediff-hook vc-hooks lisp-float-type mwheel
w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind w32 multi-tty emacs)





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#13956: 24.3; An initial frame already exists before reading .emacs on daemon mode
  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
  0 siblings, 0 replies; 2+ messages in thread
From: npostavs @ 2017-06-15  0:02 UTC (permalink / raw)
  To: Arthur Tu; +Cc: 13956

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)
       ...)





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-15  0:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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.