.emacs-my
changeset 370 378a4dc8ea1c
parent 369 1dbc90e50b2d
child 371 c2aac4122192
--- a/.emacs-my	Wed Mar 24 21:00:27 2010 +0200
+++ b/.emacs-my	Wed Mar 24 23:51:43 2010 +0200
@@ -44,6 +44,27 @@
 
 (setq default-directory "~/")
 
+;; To maximize frame on full screen, not work with Windows Emacs 21.4.
+;; And maked different height with Emacs 22.3 and 23.1.
+;; (setq initial-frame-alist '((fullscreen . fullboth)))
+
+;; Next code work with Emacs 21.4, 22.3, 23.1.
+(when window-system
+  (let (
+        (px (display-pixel-width))
+        (py (display-pixel-height))
+        (fx (frame-char-width))
+        (fy (frame-char-height))
+        tx ty
+        )
+    ;; Next formulas discovered empiric on Windows host with default font.
+    (setq tx (- (/ px fx) 6))
+    (setq ty (- (/ py fy) 4))
+    (setq initial-frame-alist '((top . 0) (left . 0)))
+    (add-to-list 'initial-frame-alist (cons 'width tx))
+    (add-to-list 'initial-frame-alist (cons 'height ty))
+    ) )
+
 (menu-bar-mode -1)
 (tool-bar-mode -1)
 (tooltip-mode -1)
@@ -1137,13 +1158,4 @@
                                "Nice day for Emacsing!")) )
               (message (nth (random (length mgs-list)) mgs-list)))))
 
-;; Size of emacs area and its position.
-(when window-system
-  (run-at-time (format "%d sec" 1) nil '(lambda () (set-frame-position (selected-frame) 1 1)))
-  (when (boundp 'my-frame-width)
-    (run-at-time (format "%d sec" 2) nil '(lambda () (set-frame-width (selected-frame) my-frame-width t))) )
-  (when (boundp 'my-frame-height)
-    (run-at-time (format "%d sec" 3) nil '(lambda () (set-frame-height (selected-frame) my-frame-height t))) )
-  )
-
 ;; End loading...