.emacs-my
changeset 1183 6fdc4a4f4155
parent 1182 616154dadd38
child 1184 43925b28ed73
equal deleted inserted replaced
1182:616154dadd38 1183:6fdc4a4f4155
   232 ;; And maked different height with Emacs 22.3 and 23.1.
   232 ;; And maked different height with Emacs 22.3 and 23.1.
   233 ;; (setq initial-frame-alist '((fullscreen . fullboth)))
   233 ;; (setq initial-frame-alist '((fullscreen . fullboth)))
   234 
   234 
   235 (setq display-buffer-reuse-frames t)
   235 (setq display-buffer-reuse-frames t)
   236 
   236 
   237 ;; Next code work with Emacs 21.4, 22.3, 23.1.
   237 (defun my-maximize ()
   238 (when window-system
   238   ;; Next code work with Emacs 21.4, 22.3, 23.1.
   239   (let (
   239   (let (
   240         (px (display-pixel-width))
   240         (px (display-pixel-width))
   241         (py (display-pixel-height))
   241         (py (display-pixel-height))
   242         (fx (frame-char-width))
   242         (fx (frame-char-width))
   243         (fy (frame-char-height))
   243         (fy (frame-char-height))
   246     ;; Next formulas discovered empiric on Windows host with default font.
   246     ;; Next formulas discovered empiric on Windows host with default font.
   247     (setq tx (- (/ px fx) 7))
   247     (setq tx (- (/ px fx) 7))
   248     (setq ty (- (/ py fy) 4))
   248     (setq ty (- (/ py fy) 4))
   249     (setq initial-frame-alist '((top . 2) (left . 2)))
   249     (setq initial-frame-alist '((top . 2) (left . 2)))
   250     (add-to-list 'initial-frame-alist (cons 'width tx))
   250     (add-to-list 'initial-frame-alist (cons 'width tx))
   251     (add-to-list 'initial-frame-alist (cons 'height ty))
   251     (add-to-list 'initial-frame-alist (cons 'height ty)) ))
   252     ) )
   252 
       
   253 (when window-system
       
   254   (if (fboundp 'toggle-frame-maximized)
       
   255       (toggle-frame-maximized)
       
   256     (my-maximize) ))
   253 
   257 
   254 (menu-bar-mode -1)
   258 (menu-bar-mode -1)
   255 (when window-system
   259 (when window-system
   256   (mouse-avoidance-mode 'animate)
   260   (mouse-avoidance-mode 'animate)
   257   (scroll-bar-mode 1)
   261   (scroll-bar-mode 1)