1 ;;;; Study dframe by Eric.
2 ;; How to manage frames to display buffers.
3 (setq display-buffer-reuse-frames t
)
4 ;; (setq pop-up-frames nil) <<--- this setted at true, is deleterio.
5 ;(setq special-display-buffer-names '("RMAIL" "*IBuffer*" "*Proced*"))
6 (setq same-window-regexps nil
)
7 (setq special-display-regexps
8 '(("\\*info.*\\*" (name .
"*Info*")(width .
80)(height .
36)(unsplittable . t
))
9 ("\\*WoMan .*\\*" (name .
"*WoMan*")(width .
80)(height .
36)(unsplittable . t
))
10 ; ("\\*-jabber-\\*" (name "Jabber")(width . 30)(hight .30)(unspliitable . t))
11 "\\*Group\\*" "\\*Customize "
17 ;; (make-frame '((name . "TEST")(minibuffer . nil))))
22 ;(string-match "\\*info\\*" (buffer-name (get-buffer "*info*")))
24 ;; Which frame is visible by name
25 (defun frame-is-visible (regex-for-name)
27 (let ((s regex-for-name
) (ret nil
))
30 (if (string-match s
(get-frame-name f
)) (setq ret f
)))
32 (and ret
(frame-visible-p ret
))))
36 (eval-after-load 'my-elisp
38 (if (not (featurep 'frame-fns
))
39 (load-file (expand-file-name (concat user-elisp-directory
"frame-fns.el"))))
40 (if (not (featurep 'frame-cmds
))
41 (load-file (expand-file-name (concat user-elisp-directory
"frame-cmds.el"))))
44 ;; for resizing ... locked at top-left corner.
45 (defvar frame-resizing-mode-map
46 (let ((m (make-sparse-keymap)))
47 (define-key m
(kbd "<up>") 'shrink-frame
)
48 (define-key m
(kbd "<down>") 'enlarge-frame
)
49 (define-key m
(kbd "<left>") 'shrink-frame-horizontally
)
50 (define-key m
(kbd "<right>") 'enlarge-frame-horizontally
)
51 (define-key m
(kbd "C-c C-c") 'frame-resizing-mode
)
52 ; (define-key m (kbd "RET") 'frame-resizing-mode)
56 (define-minor-mode frame-resizing-mode
58 :ligther
" F-Resizing "
59 :keymap
'frame-resizing-mode-map
)
61 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
63 ;; for positioning ... locked at top-left corner.
64 (defvar frame-positioning-mode-map
65 (let ((m (make-sparse-keymap)))
66 (define-key m
(kbd "<up>") 'move-frame-up
)
67 (define-key m
(kbd "<down>") 'move-frame-down
)
68 (define-key m
(kbd "<left>") 'move-frame-left
)
69 (define-key m
(kbd "<right>") 'move-frame-right
)
70 (define-key m
(kbd "C-c C-c") 'frame-positioning-mode
)
71 ; (define-key m (kbd "RET") 'frame-positioning-mode)
75 (define-minor-mode frame-positioning-mode
77 :ligther
" F-Positioning "
78 :keymap
'frame-positioning-mode-map
)
80 (defun maximum-frame-height () ""
81 (- (/ (x-display-pixel-height)(frame-char-height)) 1))
82 (defun maximum-frame-width () ""
83 (- (/ (- (x-display-pixel-width)
84 (frame-parameter (selected-frame) 'left-fringe
)
85 (frame-parameter (selected-frame) 'right-fringe
)) (frame-char-width)) 2))
87 (defun set-unmaximized-frame-sizes () "" (interactive)
88 (set-frame-parameter (selected-frame) 'unmaximized-width
89 (frame-parameter (selected-frame) 'width
))
90 (set-frame-parameter (selected-frame) 'unmaximized-height
91 (frame-parameter (selected-frame) 'height
)))
93 (defun un/maximize-frame
(&optional frame
)""(interactive)
94 (unless (framep frame
) (setq frame
(selected-frame)))
95 (if (frame-parameter frame
'maximized
)
98 (or (frame-parameter frame
'unmaximized-width
) 80)
99 (or (frame-parameter frame
'unmaximized-height
) 32))
100 (set-frame-parameter frame
'maximized nil
))
101 (set-frame-size frame
(maximum-frame-width) (maximum-frame-height))
102 (set-frame-parameter frame
'maximized t
)))
105 ;;; (defun maximize-frame (&optional frame)""(interactive)
106 ;;; (if (not (framep frame)) (setq frame (selected-frame))))
108 ;;; (defun unmaximize-frame (&optional frame)""(interactive)
109 ;;; (if (not (framep frame)) (setq frame (selected-frame)))
110 ;;; (set-frame-size frame unmaximized-frame-width unmaximized-frame-height)
111 ;;; (set-frame-parameter frame 'maximized nil))
114 "My Frames Managment loaded."))