These functions are my unexperienced elisp way of doing what I thing the OP
wants:
It is for use with a laptop and an external screen. I use ALT+F1 to cycle
between "totally maximized" and "normal" and ALT+F2 to cycle between "size
for laptop" and "size for external screen".
The downside to my functions is that certain numerical arguments such as
size of window etc. have to be determined on a case by case basis.
Nevertheless I have enjoyed them quite a bit.
Kasper
;; ==== Custom display functions ====
(setq mac-display-list
'((external . ((name . "external")
(font .
"-*-*-medium-r-normal--16-*-*-*-*-*-fontset-hirakaku_w3")
(normalsize . (110 48))
(normalposition . (0 22))
(maxsize . (164 49))))
(laptop . ((name . "laptop")
(font . "-*-*-medium-r-normal--14-*-*-*-*-*-fontset-hirakaku_w3")
(normalsize . (124 38))
(normalposition . (0 22))
(maxsize . (124 39))))
))
(defun mac-switch-display ()
"Switches the display type between laptop and external"
(interactive)
(cond ((equal (cdr (assoc 'name mac-current-display)) "laptop")
(setq mac-current-display (cdr (assoc 'external mac-display-list))))
((equal (cdr (assoc 'name mac-current-display)) "external")
(setq mac-current-display (cdr (assoc 'laptop mac-display-list))))
)
(apply 'set-frame-size (cons (selected-frame) (cdr (assoc 'normalsize
mac-current-display))))
(apply 'set-frame-position (cons (selected-frame) (cdr (assoc
'normalposition mac-current-display))))
(apply 'set-frame-font (list (cdr (assoc 'font mac-current-display))))
)
(defun mac-resize-display ()
"Resizes the display. Toggles between the maxed and normal display size.
If the current displaysize is smaller than the normal display size, switch
to the normal display size. All sizes are frame widths"
(interactive)
(cond ((< (frame-parameter (selected-frame) 'width) (car (cdr (assoc
'normalsize mac-current-display))))
(mac-show-menu-bar)
(apply 'set-frame-position (cons (selected-frame) (cdr (assoc
'normalposition mac-current-display))))
(apply 'set-frame-size (cons (selected-frame) (cdr (assoc 'normalsize
mac-current-display))))
)
((< (frame-parameter (selected-frame) 'width) (car (cdr (assoc 'maxsize
mac-current-display))))
(mac-hide-menu-bar)
(set-frame-position (selected-frame) 0 0)
(apply 'set-frame-size (cons (selected-frame) (cdr (assoc 'maxsize
mac-current-display))))
)
((= (frame-parameter (selected-frame) 'width) (car (cdr (assoc 'maxsize
mac-current-display))))
(mac-show-menu-bar)
(apply 'set-frame-position (cons (selected-frame) (cdr (assoc
'normalposition mac-current-display))))
(apply 'set-frame-size (cons (selected-frame) (cdr (assoc 'normalsize
mac-current-display))))
)
))
(setq mac-current-display (cdr (assoc 'external mac-display-list)))
(mac-switch-display)
(global-set-key (kbd "<M-f1>") 'mac-resize-display)
(global-set-key (kbd "<M-f2>") 'mac-switch-display)
On Jan 28, 2008 7:08 PM, Seiji Zenitani <[EMAIL PROTECTED]> wrote:
>
> Yes, you can use below functions on Carbon Emacs Package.
>
> mac-hide-menu-bar
> mac-show-menu-bar
>
> They may also work on Fink's Emacs and on Aquamacs Emacs.
>
> ==
> Seiji Zenitani
> [EMAIL PROTECTED]
>
>
> On 2008/01/28, at 20:24, David Reitter wrote:
> >
> > On 29 Jan 2008, at 00:10, Dave Peck wrote:
> >>
> >> but I want something that covers up the dock, the menu bar, etc.
> >
> > M-x mac-hide-menu-bar RET
> >
> > Does that do the job?
> >
> > >
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
Carbon Emacs User Group
http://groups.google.com/group/carbon-emacs?hl=en
-~----------~----~----~----~------~----~------~--~---