* Screen size (pixels or whatever)
@ 2015-06-22 20:49 Vasily Korytov
2015-06-22 20:52 ` Vasily Korytov
[not found] ` <mailman.5472.1435016699.904.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 8+ messages in thread
From: Vasily Korytov @ 2015-06-22 20:49 UTC (permalink / raw)
To: help-gnu-emacs
Hey,
How do I get screen size in Emacs?
I don’t mean frame-width, but I mean eventually the number of lines that are possible to fit on the screen.
That is: on one machine I have 1400х1050 and I use:
(setq default-frame-alist
'((height . 53)
(width . 120)
(top . 50)
(left . 380)))
On second one I have 1280x768 and I use:
(setq default-frame-alist
'((height . 45)
(width . 120)
(top . 3)
(left . 220)))
I want to glue this in one configuration file that works on both machines.
I would like to know, if there is a function, that would give me the number of pixels on the current display or some other mean to detect, is it a large screen or not.
--
Vasily Korytov
http://chillum.github.io
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Screen size (pixels or whatever)
2015-06-22 20:49 Screen size (pixels or whatever) Vasily Korytov
@ 2015-06-22 20:52 ` Vasily Korytov
2015-06-23 14:23 ` Alan Schmitt
[not found] ` <mailman.5472.1435016699.904.help-gnu-emacs@gnu.org>
1 sibling, 1 reply; 8+ messages in thread
From: Vasily Korytov @ 2015-06-22 20:52 UTC (permalink / raw)
To: help-gnu-emacs
22 черв. 2015 о 23:49 Vasily Korytov <vasily.korytov@yandex.com> написав(ла):
> How do I get screen size in Emacs?
The answer is (display-pixel-width) and (display-pixel-height).
Found the answer just after posting.
Thanks for reading this.
--
Vasily Korytov
http://chillum.github.io
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Screen size (pixels or whatever)
[not found] ` <mailman.5472.1435016699.904.help-gnu-emacs@gnu.org>
@ 2015-06-23 0:00 ` Emanuel Berg
2015-06-23 1:19 ` JohnF
1 sibling, 0 replies; 8+ messages in thread
From: Emanuel Berg @ 2015-06-23 0:00 UTC (permalink / raw)
To: help-gnu-emacs
Vasily Korytov <vasily.korytov@yandex.com> writes:
> The answer is (display-pixel-width) and
> (display-pixel-height).
I have those 85 and 32 so that ain't that many
pixels :) But I suspect that is chars an lines
(COLUMNS and LINES in da' shell).
But: What are you trying to do?
You know of course of --fullscreen in X? Which is the
only way one could use Emacs in X without going
nuts...
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Screen size (pixels or whatever)
[not found] ` <mailman.5472.1435016699.904.help-gnu-emacs@gnu.org>
2015-06-23 0:00 ` Emanuel Berg
@ 2015-06-23 1:19 ` JohnF
2015-06-23 3:35 ` Marko Vojinovic
[not found] ` <mailman.5480.1435030538.904.help-gnu-emacs@gnu.org>
1 sibling, 2 replies; 8+ messages in thread
From: JohnF @ 2015-06-23 1:19 UTC (permalink / raw)
To: help-gnu-emacs
Vasily Korytov <vasily.korytov@yandex.com> wrote:
> 22 ????. 2015 ? 23:49 Vasily Korytov <vasily.korytov@yandex.com> ???????(??):
>> How do I get screen size in Emacs?
> The answer is (display-pixel-width) and (display-pixel-height).
> Found the answer just after posting.
> Thanks for reading this.
I've been using
;;; initial frame width,height,position
(set-frame-width (selected-frame) 80) ; #chars wide
(set-frame-height (selected-frame) 52) ; #lines ling
(set-frame-position (selected-frame) 10 10 ) ; x y from upper-left
What's the diff???
--
John Forkosh ( mailto: j@f.com where j=john and f=forkosh )
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Screen size (pixels or whatever)
2015-06-23 1:19 ` JohnF
@ 2015-06-23 3:35 ` Marko Vojinovic
[not found] ` <mailman.5480.1435030538.904.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 8+ messages in thread
From: Marko Vojinovic @ 2015-06-23 3:35 UTC (permalink / raw)
To: help-gnu-emacs
On Tue, 23 Jun 2015 01:19:41 +0000 (UTC)
JohnF <john@please.see.sig.for.email.com> wrote:
> Vasily Korytov <vasily.korytov@yandex.com> wrote:
> > 22 ????. 2015 ? 23:49 Vasily Korytov
> > <vasily.korytov@yandex.com> ???????(??):
> >> How do I get screen size in Emacs?
> > The answer is (display-pixel-width) and (display-pixel-height).
> > Found the answer just after posting.
> > Thanks for reading this.
>
> I've been using
> ;;; initial frame width,height,position
> (set-frame-width (selected-frame) 80) ; #chars wide
> (set-frame-height (selected-frame) 52) ; #lines ling
> (set-frame-position (selected-frame) 10 10 ) ; x y from upper-left
> What's the diff???
As the OP explained in the original post, he wants those rules to work
conditionally, if certain screen resolution is detected.
I don't know how to do that internally in Emacs, but if one is running
under Linux, the command "xrandr | grep \*" will tell you the
resolution and frequency of the monitor. Maybe one can have Emacs
execute this and parse the info...
HTH, :-)
Marko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Screen size (pixels or whatever)
2015-06-22 20:52 ` Vasily Korytov
@ 2015-06-23 14:23 ` Alan Schmitt
2015-06-23 14:59 ` Drew Adams
0 siblings, 1 reply; 8+ messages in thread
From: Alan Schmitt @ 2015-06-23 14:23 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
On 2015-06-22 22:52, Vasily Korytov <vasily.korytov@yandex.com> writes:
> 22 черв. 2015 о 23:49 Vasily Korytov <vasily.korytov@yandex.com> написав(ла):
>> How do I get screen size in Emacs?
>
> The answer is (display-pixel-width) and (display-pixel-height).
This gives you the full width and height, including menu bars. I think
Drew Adams has code that takes this into account in his 1on1 library
(http://www.emacswiki.org/emacs/OneOnOneEmacs), but I don't recall which
file this is in exactly.
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Weekly CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Screen size (pixels or whatever)
2015-06-23 14:23 ` Alan Schmitt
@ 2015-06-23 14:59 ` Drew Adams
0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2015-06-23 14:59 UTC (permalink / raw)
To: Alan Schmitt, help-gnu-emacs
> >> How do I get screen size in Emacs?
> > The answer is (display-pixel-width) and (display-pixel-height).
>
> This gives you the full width and height, including menu bars. I
> think Drew Adams has code that takes this into account in his 1on1 library
> (http://www.emacswiki.org/emacs/OneOnOneEmacs), but I don't recall
> which file this is in exactly.
`frame-cmds.el' might help; dunno. (It in turn requires `frame-fns.el'.)
http://www.emacswiki.org/emacs/download/frame-cmds.el
http://www.emacswiki.org/emacs/download/frame-fns.el
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Screen size (pixels or whatever)
[not found] ` <mailman.5480.1435030538.904.help-gnu-emacs@gnu.org>
@ 2015-06-24 4:57 ` JohnF
0 siblings, 0 replies; 8+ messages in thread
From: JohnF @ 2015-06-24 4:57 UTC (permalink / raw)
To: help-gnu-emacs
Marko Vojinovic <vvmarko@gmail.com> wrote:
> JohnF <john@please.see.sig.for.email.com> wrote:
>> Vasily Korytov <vasily.korytov@yandex.com> wrote:
>> > Vasily Korytov <vasily.korytov@yandex.com> ???????(??):
>> >> How do I get screen size in Emacs?
>> > The answer is (display-pixel-width) and (display-pixel-height).
>> > Found the answer just after posting.
>> > Thanks for reading this.
>>
>> I've been using
>> ;;; initial frame width,height,position
>> (set-frame-width (selected-frame) 80) ; #chars wide
>> (set-frame-height (selected-frame) 52) ; #lines ling
>> (set-frame-position (selected-frame) 10 10 ) ; x y from upper-left
>> What's the diff???
>
> As the OP explained in the original post,
Right, my bad. Sorry, I overlooked that. Thanks.
> he wants those rules to work conditionally,
> if certain screen resolution is detected.
>
> I don't know how to do that internally in Emacs, but if one is running
> under Linux, the command "xrandr | grep \*" will tell you the
> resolution and frequency of the monitor. Maybe one can have Emacs
> execute this and parse the info...
> HTH, :-)
> Marko
--
John Forkosh ( mailto: j@f.com where j=john and f=forkosh )
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-06-24 4:57 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-22 20:49 Screen size (pixels or whatever) Vasily Korytov
2015-06-22 20:52 ` Vasily Korytov
2015-06-23 14:23 ` Alan Schmitt
2015-06-23 14:59 ` Drew Adams
[not found] ` <mailman.5472.1435016699.904.help-gnu-emacs@gnu.org>
2015-06-23 0:00 ` Emanuel Berg
2015-06-23 1:19 ` JohnF
2015-06-23 3:35 ` Marko Vojinovic
[not found] ` <mailman.5480.1435030538.904.help-gnu-emacs@gnu.org>
2015-06-24 4:57 ` JohnF
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.