[macemacsjp-english 916] Re: macemacsjp-english Digest, Vol 24, Issue 15

Back to archive index

Kasper Daniel Hansen khans****@stat*****
Mon Feb 19 12:13:30 JST 2007


What is not *real* about my functions? I thought originally that it  
was doable with some Mac programming, but was directed to the mac- 
hide-menubar function, and while I agree it is not "standard", I  
think it _works_ beautifully.

Kasper

On Feb 18, 2007, at 7:04 PM, Charles Martin wrote:

> Hey, guys, what are the odds of being able to get EMACS to do a *real*
> full screen mode on MAC OS?
>
> On 2/18/07, macem****@lists*****
> <macem****@lists*****> wrote:
>> Send macemacsjp-english mailing list submissions to
>>         macem****@lists*****
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         http://lists.sourceforge.jp/mailman/listinfo/macemacsjp- 
>> english
>> or, via email, send a message with subject or body 'help' to
>>         macem****@lists*****
>>
>> You can reach the person managing the list at
>>         macem****@lists*****
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of macemacsjp-english digest..."
>>
>>
>> Today's Topics:
>>
>>    1. [macemacsjp-english 914] emacs full screen (Kasper Daniel  
>> Hansen)
>>
>>
>> --------------------------------------------------------------------- 
>> -
>>
>> Message: 1
>> Date: Sun, 18 Feb 2007 11:23:39 -0800
>> From: Kasper Daniel Hansen <khans****@stat*****>
>> Subject: [macemacsjp-english 914] emacs full screen
>> To: macem****@lists*****
>> Message-ID: <1B7DC****@stat*****>
>> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>>
>> This is my solution, based on some advice from Seiji-san regarding
>> two things:
>> 1) I want to be able to maximize Emacs so that it covers all of the
>> available screen, including the menu bar and the dock (this is called
>> presentation mode in some applications)
>> 2) I am regularly using an external monitor and want to change my
>> emacs settings (especially font and window size) between my laptop
>> and my external display
>>
>> My solution uses two functions mac-switch-display which switches
>> between window configurations and mac-resize-display which switches
>> between normal and full screen mode. The two functions are bound  
>> to M-
>> f1 and M-f2. I never use more than a  single frame, so I am not sure
>> how it works with several frames.
>>
>> The settings are defined in the variable mac-display-list and should
>> be quite obvious. The positions are in pixels and the sizes are in
>> characters. It seems like Emacs _needs_ a character based frame size.
>> For that reason it may be difficult to _exact;_ cover the entire
>> screen estate (I have a few pixels worth of empty space, when
>> maximizing on my laptop). For obvious reasons, a character based
>> width is very dependent on the font you are using, so I gave up on
>> auto-setting it.
>>
>> In case you need to discover what the position/size of you frame is
>> for configuration purpose, entering these lines into the scratch
>> buffer will help:
>>
>> (frame-parameter (selected-frame) 'font)
>> (frame-parameter (selected-frame) 'height)
>> (frame-parameter (selected-frame) 'left)
>> (frame-parameter (selected-frame) 'top)
>>
>> You use them by placing the cursor at the end of the line _right next
>> to the last )_ and then press C-x C-e.
>>
>> Without further ado, here is the relevant part from my dot-emacs:
>>
>>
>> (setq mac-display-list
>>        '((external . ((name . "external")
>>                      (font . "-*-*-medium-r-normal--16-*-*-*-*-*- 
>> fontset-
>> hiraginokaku")
>>                      (normalsize . (110 48))
>>                      (normalposition . (0 22))
>>                      (maxsize . (164 49))))
>>         (laptop . ((name . "laptop")
>>                    (font . "-*-*-medium-r-normal--14-*-*-*-*-*- 
>> fontset-hiraginokaku")
>>                    (normalsize . (80 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))))
>>          )
>> ))
>>
>> (if (eq window-system 'mac)
>>    (progn (require 'carbon-font)
>>          (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)
>> ))
>>
>>
>> Kasper
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> macemacsjp-english mailing list
>> macem****@lists*****
>> http://lists.sourceforge.jp/mailman/listinfo/macemacsjp-english
>>
>>
>> End of macemacsjp-english Digest, Vol 24, Issue 15
>> **************************************************
>>
>
>
> -- 
> Laissez-nous faire, laissez-nous passer.
> Le monde va de lui-même.
> _______________________________________________
> macemacsjp-english mailing list
> macem****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/macemacsjp-english




More information about the macemacsjp-english mailing list
Back to archive index