[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Default-face grow/shrink commands
From: |
Miles Bader |
Subject: |
Default-face grow/shrink commands |
Date: |
11 May 2004 08:18:10 +0900 |
One very handy feature of many modern GUI programs (at least, gnome apps
and mozilla :-) is that they have commands to grow and shrink the base
font-size, usually bound to the nicely mnemonic C-+ and C-- (mozilla and
some other programs also bind C-= to the same thing as C-+, so you don't
have to use the shift key; gnome unfortunately assigns a _different_
meaning to C-=).
I think emacs should also have this feature (and others have said the same
thing), and it seems simple enough in theory. I've appended a possible
implementation of `increase-default-face-height' and
`decrease-default-face-height' and associated bindings.
However there are a few little wrinkles I'd like to ask the list about:
(1) In most programs, such commands only affect the current X window, so
in my implementation I've used (selected-frame) when manipulating the
default face. With `emacs -q', this works great.
However with my .emacs in effect, this doesn't work: the font-size
increases (causing the X window to grow) -- and then immediately
reverts to the old font-size (and the X window shrinks again)!
It seems that there's some state somewhere in the convoluted
machinery that gets invoked when the default face changes, which is
overriding the change; I think this is probably a bug (you _ought_ to
be able to make local changes to the default face!), but I don't know
where. If I change my commands to use a frame of `nil' -- meaning
`every frame' -- it works properly, albeit affecting every frame
rather than just the current one.
I'd appreciate any insight people have into this.
(2) My commands just grow/shrink the :height of the default face by a
factor of 1.2, which generally works `pretty well', but occasionally
there isn't an appropriate font available, so growing/shrinking can
happen without any visible effect. It would perhaps be nice if there
was a way to find the next `nice size' for the default face; however
maybe this idea is hard given today's scalable fonts etc. Any ideas?
Thanks,
-Miles
default-grow.el
Description: default-face grow/shrink commands
--
`Cars give people wonderful freedom and increase their opportunities.
But they also destroy the environment, to an extent so drastic that
they kill all social life' (from _A Pattern Language_)
- Default-face grow/shrink commands,
Miles Bader <=