unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* giving emacs initial size of 80 x as-much-as-possible
@ 2009-06-26 23:58 Jay Berkenbilt
  2009-06-27 13:56 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Jay Berkenbilt @ 2009-06-26 23:58 UTC (permalink / raw)
  To: emacs-devel


I'm running 23.0.95 with client-side fonts on a GNU/Linux system.  The
distribution is not important as long as client-side fonts are
supported.  I run on Red Hat Enterprise Linux 5 at work and Debian
GNU/Linux at home, and the solution is identical.

For years, I've been calculating in advance the number of rows I need to
set in my emacs geometry based on the size of my font.  In the brave
newish world of scalable, client-side fonts, this is no longer
straightforward since the size of my font is hard to predict.  The size
of, for example, Monospace-12, depends on many factors including the
screen resolution and which font actually matches.  Is there a simple
way to know what the size of a character in a specific monospace font
will be without running emacs to find out?

I have dug through some of the code in xdisp.c and frame.c and have come
across the functions frame-char-width and frame-char-height, so I know
how to get the information about the size of the character once emacs is
running, but not how to calculate it in advance.  I see that the
information comes from the max_ascent and max_descent information from
the font, but I don't really see how to get that information reliably.
I observe that, for some scale factors, emacs and xterm don't even use
the same character size for the same font specification -- emacs
sometimes uses one pixel more vertically than xterm.  Right now, I have
a little script that runs emacs on a lisp file that saves the results of
a file, and this is meeting my needs, but it seems unfortunate to have
to do this.

Why am I doing this?  Well, maybe I'm having a hard time moving into the
modern world of session managers and so forth.  I have code in my login
that I have been using literally since 1989 that calculates the initial
geometries of my xterms and emacs based on the size of the screen and
other information.  This way, I can log in on any screen size and get as
close as possible to my usual screen parameters.  I synchronize my files
to many locations and even have this setup on my USB thumb drive.  I
don't like to have to manually resize windows or to use session managers
to save my previous state.  My method of calculating in advance has
always worked in the past, but I'm having to jump through hoops with
both emacs and xterm to get this information.  Perhaps I could write a C
program that queries the font to get the information.  Maybe I'll go
that route.  Maybe there's some way to get what I need from the output
of fc-match, but I don't see how to get the relevant information,
particularly about ascent and descent information of the font.

Anyway, I'd welcome any suggestions about how to handle this.  It's not
that big a deal though...my current solution of starting a special emacs
just to get the information only adds a few seconds to my login.  It's
still much faster than the amount of time it would take me to set it up
manually.

-- 
Jay Berkenbilt <ejb@ql.org>




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: giving emacs initial size of 80 x as-much-as-possible
  2009-06-26 23:58 giving emacs initial size of 80 x as-much-as-possible Jay Berkenbilt
@ 2009-06-27 13:56 ` Thien-Thi Nguyen
  2009-06-27 14:35   ` Manoj Srivastava
  0 siblings, 1 reply; 3+ messages in thread
From: Thien-Thi Nguyen @ 2009-06-27 13:56 UTC (permalink / raw)
  To: Jay Berkenbilt; +Cc: emacs-devel

Try "emacs --fullheight";
if that doesn't work,
please report the bug.

thi




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: giving emacs initial size of 80 x as-much-as-possible
  2009-06-27 13:56 ` Thien-Thi Nguyen
@ 2009-06-27 14:35   ` Manoj Srivastava
  0 siblings, 0 replies; 3+ messages in thread
From: Manoj Srivastava @ 2009-06-27 14:35 UTC (permalink / raw)
  To: emacs-devel

On Sat, Jun 27 2009, Thien-Thi Nguyen wrote:

> Try "emacs --fullheight";

        If one uses emacs --daemon, is there a corresponding mechanism
 to get an emacsclient window that is full height?

        manoj
-- 
"Luke, I'm yer father, eh.  Come over to the dark side, you hoser." Dave
Thomas, "Strange Brew"
Manoj Srivastava <srivasta@acm.org> <http://www.golden-gryphon.com/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-27 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-26 23:58 giving emacs initial size of 80 x as-much-as-possible Jay Berkenbilt
2009-06-27 13:56 ` Thien-Thi Nguyen
2009-06-27 14:35   ` Manoj Srivastava

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).