all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Default-face grow/shrink commands
@ 2004-05-10 23:18 Miles Bader
  2004-05-11 12:23 ` Richard Stallman
  2004-05-23 15:46 ` Alex Schroeder
  0 siblings, 2 replies; 4+ messages in thread
From: Miles Bader @ 2004-05-10 23:18 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2131 bytes --]

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



[-- Attachment #2: default-face grow/shrink commands --]
[-- Type: application/emacs-lisp, Size: 1171 bytes --]

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]



-- 
`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_)

[-- Attachment #4: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Default-face grow/shrink commands
  2004-05-10 23:18 Default-face grow/shrink commands Miles Bader
@ 2004-05-11 12:23 ` Richard Stallman
  2004-05-23 15:46 ` Alex Schroeder
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2004-05-11 12:23 UTC (permalink / raw)
  Cc: emacs-devel

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

Adding these is a good thing, and it is self-contained so there's no
harm adding it now--assuming the problems you've mentioned can be
solved.

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

* Re: Default-face grow/shrink commands
  2004-05-10 23:18 Default-face grow/shrink commands Miles Bader
  2004-05-11 12:23 ` Richard Stallman
@ 2004-05-23 15:46 ` Alex Schroeder
  2004-05-24  2:16   ` Miles Bader
  1 sibling, 1 reply; 4+ messages in thread
From: Alex Schroeder @ 2004-05-23 15:46 UTC (permalink / raw)
  Cc: emacs-devel

Miles Bader <miles@gnu.org> writes:

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

I faintly remember that at one time, setting fonts via X resources
made it impossible to change them later using Lisp.  Something like
that?  There's also a link between the face and the frame parameters,
so if you change the face, but somehow it no longer updates the frame
parameters, you might have conflicting states.

Alex.
-- 
.O.  http://www.emacswiki.org/alex/
..O  Schroeder's fourth law:
OOO  None of your friends and coworkers share your taste in music.

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

* Re: Default-face grow/shrink commands
  2004-05-23 15:46 ` Alex Schroeder
@ 2004-05-24  2:16   ` Miles Bader
  0 siblings, 0 replies; 4+ messages in thread
From: Miles Bader @ 2004-05-24  2:16 UTC (permalink / raw)
  Cc: emacs-devel

Alex Schroeder <alex@emacswiki.org> writes:
> There's also a link between the face and the frame parameters,
> so if you change the face, but somehow it no longer updates the frame
> parameters, you might have conflicting states.

To state it more bluntly, there's a confusing and ugly incestuous
relationship between the default face and frame parameters.  I'd _love_
to just tear the whole damn thing out and keep only faces, but I can't
because it wouldn't be backward compatible.

-Miles
-- 
97% of everything is grunge

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

end of thread, other threads:[~2004-05-24  2:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-10 23:18 Default-face grow/shrink commands Miles Bader
2004-05-11 12:23 ` Richard Stallman
2004-05-23 15:46 ` Alex Schroeder
2004-05-24  2:16   ` Miles Bader

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.