unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Miles Bader <miles@gnu.org>
Subject: Default-face grow/shrink commands
Date: 11 May 2004 08:18:10 +0900	[thread overview]
Message-ID: <877jvj7txp.fsf@tc-1-100.kawasaki.gol.ne.jp> (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

             reply	other threads:[~2004-05-10 23:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-10 23:18 Miles Bader [this message]
2004-05-11 12:23 ` Default-face grow/shrink commands Richard Stallman
2004-05-23 15:46 ` Alex Schroeder
2004-05-24  2:16   ` Miles Bader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877jvj7txp.fsf@tc-1-100.kawasaki.gol.ne.jp \
    --to=miles@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).