* maximizing window for MacOSX
@ 2012-02-03 7:50 ishi soichi
2012-02-03 10:25 ` Peter Dyballa
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: ishi soichi @ 2012-02-03 7:50 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
MacOSX Snow Leopard
Cocoa Emacs 23.2.1
I am trying to develop an Emacs Lisp program that maximizes the window.
I found and modified the following code, which was originally for Carbon
Emacs.
(when (eq window-system 'ns)
(add-hook 'window-setup-hook
(lambda ()
(set-frame-parameter nil 'fullscreen 'fullboth)
)))
(defun mac-toggle-max-window ()
(interactive)
(if (frame-parameter nil 'fullscreen)
(set-frame-parameter nil 'fullscreen nil)
(set-frame-parameter nil 'fullscreen 'fullboth)))
It does not act as I want it to.
window-system for MacOSX is "ns" I believe.
Could anyone see why it does not work?
Thanks in advance.
soichi
[-- Attachment #2: Type: text/html, Size: 1034 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: maximizing window for MacOSX
2012-02-03 7:50 maximizing window for MacOSX ishi soichi
@ 2012-02-03 10:25 ` Peter Dyballa
2012-02-03 14:49 ` Drew Adams
2012-02-28 19:01 ` Oleksandr Gavenko
2 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2012-02-03 10:25 UTC (permalink / raw)
To: ishi soichi; +Cc: help-gnu-emacs
Am 3.2.2012 um 08:50 schrieb ishi soichi:
> It does not act as I want it to.
Your code works with
GNU Emacs 23.3.1 (x86_64-apple-darwin10.8.0, Carbon Version 1.6.0 AppKit 1038.36)
(it's not the NS variant but an "experimental" AppKit variant). Here the frame (or window) title shoots over the screen – and takes the menu-bar with it.
Your code also works with
GNU Emacs 23.4.1 (x86_64-apple-darwin10.8.0, Carbon Version 1.6.0 AppKit 1038.36)
Here the frame (or window) title shoots over the screen and becomes invisible although the menu-bar is still useful.
It does *not* work with
GNU Emacs 23.3.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36)
GNU Emacs 24.0.92.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36)
the NS variants.
I'd recommend to migrate to YAMAMOTO Mitsuharu's AppKit variant of GNU Emacs 23.4. It makes use of the Mac OS X resources like a "native" Mac OS X application. Right now it's a set of patches and extra files in an archive you can find here (in TRAMP syntax): /ftp:anonymous@ftp.math.s.chiba-u.ac.jp:/emacs/. GNU Emacs 23.4 can be found at http://www.gnu.org/software/emacs/emacs.html. You need to patch this code and then compile and install it.
--
Greetings
Pete
Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.
– Bill Watterson, in his comic strip Calvin and Hobbes
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: maximizing window for MacOSX
2012-02-03 7:50 maximizing window for MacOSX ishi soichi
2012-02-03 10:25 ` Peter Dyballa
@ 2012-02-03 14:49 ` Drew Adams
2012-02-05 8:02 ` ishi soichi
2012-02-28 19:01 ` Oleksandr Gavenko
2 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2012-02-03 14:49 UTC (permalink / raw)
To: 'ishi soichi', help-gnu-emacs
> I am trying to develop an Emacs Lisp program that maximizes
> the window. I found and modified the following code, which
> was originally for Carbon Emacs. ...
> It does not act as I want it to.
You might also try the code in frame-cmds.el (e.g. `maximize-frame'):
http://www.emacswiki.org/emacs/download/frame-cmds.el. (It requires a second
library, frame-fns.el: http://www.emacswiki.org/emacs/download/frame-fns.el.)
It does not depend on the frame parameter `fullscreen', which does not exist in
some Emacs builds. It takes into consideration the space available on Mac-OS,
via `mac-display-available-pixel-bounds'.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: maximizing window for MacOSX
2012-02-03 14:49 ` Drew Adams
@ 2012-02-05 8:02 ` ishi soichi
0 siblings, 0 replies; 6+ messages in thread
From: ishi soichi @ 2012-02-05 8:02 UTC (permalink / raw)
To: Drew Adams; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 774 bytes --]
Thanks for the info. I'm going to read the source code!
soichi
2012/2/3 Drew Adams <drew.adams@oracle.com>
> > I am trying to develop an Emacs Lisp program that maximizes
> > the window. I found and modified the following code, which
> > was originally for Carbon Emacs. ...
> > It does not act as I want it to.
>
> You might also try the code in frame-cmds.el (e.g. `maximize-frame'):
> http://www.emacswiki.org/emacs/download/frame-cmds.el. (It requires a
> second
> library, frame-fns.el:
> http://www.emacswiki.org/emacs/download/frame-fns.el.)
>
> It does not depend on the frame parameter `fullscreen', which does not
> exist in
> some Emacs builds. It takes into consideration the space available on
> Mac-OS,
> via `mac-display-available-pixel-bounds'.
>
>
>
[-- Attachment #2: Type: text/html, Size: 1307 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: maximizing window for MacOSX
2012-02-03 7:50 maximizing window for MacOSX ishi soichi
2012-02-03 10:25 ` Peter Dyballa
2012-02-03 14:49 ` Drew Adams
@ 2012-02-28 19:01 ` Oleksandr Gavenko
2012-02-28 19:25 ` Drew Adams
2 siblings, 1 reply; 6+ messages in thread
From: Oleksandr Gavenko @ 2012-02-28 19:01 UTC (permalink / raw)
To: help-gnu-emacs
On 2012-02-03, ishi soichi wrote:
> I am trying to develop an Emacs Lisp program that maximizes the window.
> I found and modified the following code, which was originally for Carbon
> Emacs.
Personally I use such bunch of code:
(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/Linux host
;; with default font (7x13).
(setq tx (- (/ px fx) 7))
(setq ty (- (/ py fy) 4))
(setq initial-frame-alist '((top . 2) (left . 2)))
(add-to-list 'initial-frame-alist (cons 'width tx))
(add-to-list 'initial-frame-alist (cons 'height ty))
) )
It does not fully maximise Emacs but make this close to good solution in
portable way and does not too depended on screen resolution.
--
Best regards!
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: maximizing window for MacOSX
2012-02-28 19:01 ` Oleksandr Gavenko
@ 2012-02-28 19:25 ` Drew Adams
0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2012-02-28 19:25 UTC (permalink / raw)
To: 'Oleksandr Gavenko', help-gnu-emacs
> > I am trying to develop an Emacs Lisp program that maximizes
> > the window. I found and modified the following code, which was
> > originally for Carbon Emacs.
>
> Personally I use such bunch of code:...
You might also try `maximize-frame' (or `maximize-frame-vertically' or
`maximize-frame-horizontally'), here:
http://www.emacswiki.org/emacs/download/frame-cmds.el.
There are also corresponding commands to restore the previous sizes.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-02-28 19:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-03 7:50 maximizing window for MacOSX ishi soichi
2012-02-03 10:25 ` Peter Dyballa
2012-02-03 14:49 ` Drew Adams
2012-02-05 8:02 ` ishi soichi
2012-02-28 19:01 ` Oleksandr Gavenko
2012-02-28 19:25 ` Drew Adams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).