unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* setting the font in .emacs
@ 2002-09-22 18:37 Dan Hitt
  2002-09-22 20:24 ` Oliver Scholz
  0 siblings, 1 reply; 14+ messages in thread
From: Dan Hitt @ 2002-09-22 18:37 UTC (permalink / raw)


Hi,

I'd like emacs (21.2.1) to come up with a larger font than it
does by default, and i'd like to do this by adding some command
to my .emacs file.

In other words, i don't want to go through shift-down-mouse-1 to
change things each time i start emacs.

How can i do this?

This is all on x windows, so i suppose i should be willing to
solve this problem with some x resouce method, although my
preference would be to do something more window-system independent.

I've done C-h a, and nothing seems appropriate.  I've also
looked at the faq (and, btw, is there some way to toggle
the faq between its current info format at a flat file?).
I've also looked at mouse.el, but don't want to start reverse
engineering if there's a simpler way.

Thanks in advance for any tips on how to do this, including
rtfm advice, and thanks also for any suggestions on further
sources to consult for help.

dan

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

* Re: setting the font in .emacs
  2002-09-22 20:24 ` Oliver Scholz
@ 2002-09-22 19:44   ` Keith
  2002-09-22 20:52     ` David Forrest
                       ` (3 more replies)
  2002-09-23 11:05   ` Fredrik Staxeng
  1 sibling, 4 replies; 14+ messages in thread
From: Keith @ 2002-09-22 19:44 UTC (permalink / raw)


>>>>> "os" == Oliver Scholz <alkibiades@gmx.de> writes:

    os> (set-face-font 'default
    os> "-b&h-lucidatypewriter-medium-r-*-*-*-140-*-*-*-*-iso8859-1")


That was something I had not yet found out, but actually solved one of
my small problems. Tried it and it worked perfectly.

Unfortunately I use emacs at the cli as well and this generates an
error if emacs is started outside of X. How should it be modified to
only apply ix X is running, there by not generating the error?

-- 
Keith.

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

* Re: setting the font in .emacs
  2002-09-22 18:37 setting the font in .emacs Dan Hitt
@ 2002-09-22 20:24 ` Oliver Scholz
  2002-09-22 19:44   ` Keith
  2002-09-23 11:05   ` Fredrik Staxeng
  0 siblings, 2 replies; 14+ messages in thread
From: Oliver Scholz @ 2002-09-22 20:24 UTC (permalink / raw)


hitt@eskimo.com (Dan Hitt) writes:

> Hi,
>
> I'd like emacs (21.2.1) to come up with a larger font than it
> does by default, and i'd like to do this by adding some command
> to my .emacs file.

(set-face-font 'default
	       "-b&h-lucidatypewriter-medium-r-*-*-*-140-*-*-*-*-iso8859-1")

Or set it via customize: 

`M-x customize-face RET default RET'

    -- Oliver

-- 
1 Vendémiaire an 211 de la Révolution
Liberté, Egalité, Fraternité!

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

* Re: setting the font in .emacs
  2002-09-22 19:44   ` Keith
@ 2002-09-22 20:52     ` David Forrest
  2002-09-23  0:31     ` Oliver Scholz
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: David Forrest @ 2002-09-22 20:52 UTC (permalink / raw)


On Sun, 22 Sep 2002, Keith wrote:

> >>>>> "os" == Oliver Scholz <alkibiades@gmx.de> writes:
>
>     os> (set-face-font 'default
>     os> "-b&h-lucidatypewriter-medium-r-*-*-*-140-*-*-*-*-iso8859-1")
>
>
> That was something I had not yet found out, but actually solved one of
> my small problems. Tried it and it worked perfectly.
>
> Unfortunately I use emacs at the cli as well and this generates an
> error if emacs is started outside of X. How should it be modified to
> only apply ix X is running, there by not generating the error?

Use the variable window-system:

(when window-system (...))

Dave
-- 
 Dave Forrest                                   drf5n@virginia.edu
 (804)642-0662h (434)924-3954w  http://mug.sys.virginia.edu/~drf5n/

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

* Re: setting the font in .emacs
  2002-09-22 19:44   ` Keith
  2002-09-22 20:52     ` David Forrest
@ 2002-09-23  0:31     ` Oliver Scholz
  2002-09-23 11:12       ` Keith
  2002-09-23 18:38     ` Stefan Monnier <foo@acm.com>
  2002-09-23 19:40     ` Benjamin Lewis
  3 siblings, 1 reply; 14+ messages in thread
From: Oliver Scholz @ 2002-09-23  0:31 UTC (permalink / raw)


Keith <kroc@blueyonder.co.uk> writes:

>>>>>> "os" == Oliver Scholz <alkibiades@gmx.de> writes:
>
>     os> (set-face-font 'default
>     os> "-b&h-lucidatypewriter-medium-r-*-*-*-140-*-*-*-*-iso8859-1")
>
>
> That was something I had not yet found out, but actually solved one of
> my small problems. Tried it and it worked perfectly.
>
> Unfortunately I use emacs at the cli as well and this generates an
> error if emacs is started outside of X. How should it be modified to
> only apply ix X is running, there by not generating the error?
[...]

Yes, you can check for various display capabilities with the
`display-.*-p'-functions. In this case `display-multi-font-p' would be
the appropriate one:

(when (display-multi-font-p)
  (set-face-font ...))

    -- Oliver

-- 
2 Vendémiaire an 211 de la Révolution
Happy new year 211!
Liberté, Egalité, Fraternité!

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

* Re: setting the font in .emacs
  2002-09-22 20:24 ` Oliver Scholz
  2002-09-22 19:44   ` Keith
@ 2002-09-23 11:05   ` Fredrik Staxeng
  1 sibling, 0 replies; 14+ messages in thread
From: Fredrik Staxeng @ 2002-09-23 11:05 UTC (permalink / raw)


Oliver Scholz <alkibiades@gmx.de> writes:

> hitt@eskimo.com (Dan Hitt) writes:
> 
> > Hi,
> >
> > I'd like emacs (21.2.1) to come up with a larger font than it
> > does by default, and i'd like to do this by adding some command
> > to my .emacs file.
> 
> (set-face-font 'default
> 	       "-b&h-lucidatypewriter-medium-r-*-*-*-140-*-*-*-*-iso8859-1")
> 
> Or set it via customize: 
> 
> `M-x customize-face RET default RET'
> 
 
If you use the X resource instead the font will be correct from the start,
so you don't have to see Emacs resize the window. E g

emacs.font:     -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1 

-- 
Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr

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

* Re: setting the font in .emacs
  2002-09-23  0:31     ` Oliver Scholz
@ 2002-09-23 11:12       ` Keith
  2002-09-24 14:59         ` Keith O'Connell
  0 siblings, 1 reply; 14+ messages in thread
From: Keith @ 2002-09-23 11:12 UTC (permalink / raw)


>>>>> "os" == Oliver Scholz <alkibiades@gmx.de> writes:

    os> Yes, you can check for various display capabilities with the
    os> `display-.*-p'-functions. In this case `display-multi-font-p'
    os> would be the appropriate one:

    os> (when (display-multi-font-p) (set-face-font ...))

Perfect! Thank you for that     :-)

-- 
Keith.

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

* Re: setting the font in .emacs
  2002-09-22 19:44   ` Keith
  2002-09-22 20:52     ` David Forrest
  2002-09-23  0:31     ` Oliver Scholz
@ 2002-09-23 18:38     ` Stefan Monnier <foo@acm.com>
  2002-09-23 19:40     ` Benjamin Lewis
  3 siblings, 0 replies; 14+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-09-23 18:38 UTC (permalink / raw)


os> (set-face-font 'default
os> "-b&h-lucidatypewriter-medium-r-*-*-*-140-*-*-*-*-iso8859-1")
[...]
> Unfortunately I use emacs at the cli as well and this generates an
> error if emacs is started outside of X.

You might consider it as a bug and send it to gnu.emacs.bug (aka
gnu-emacs-bug@gnu.org).


        Stefan

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

* Re: setting the font in .emacs
  2002-09-22 19:44   ` Keith
                       ` (2 preceding siblings ...)
  2002-09-23 18:38     ` Stefan Monnier <foo@acm.com>
@ 2002-09-23 19:40     ` Benjamin Lewis
  3 siblings, 0 replies; 14+ messages in thread
From: Benjamin Lewis @ 2002-09-23 19:40 UTC (permalink / raw)


On Sun, 22 Sep 2002, kroc@blueyonder.co.uk wrote:

>>>>>> "os" == Oliver Scholz <alkibiades@gmx.de> writes:
> 
> os> (set-face-font 'default
> os> "-b&h-lucidatypewriter-medium-r-*-*-*-140-*-*-*-*-iso8859-1")
> 
> 
> That was something I had not yet found out, but actually solved one of
> my small problems. Tried it and it worked perfectly.
> 
> Unfortunately I use emacs at the cli as well and this generates an
> error if emacs is started outside of X. How should it be modified to
> only apply ix X is running, there by not generating the error?

How about 
(if window-system
   (set-face...))

-- 
Benjamin Lewis

On a paper submitted by a physicist colleague: 
"This isn't right.  This isn't even wrong."    -- Wolfgang Pauli

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

* Re: setting the font in .emacs
  2002-09-23 11:12       ` Keith
@ 2002-09-24 14:59         ` Keith O'Connell
  2002-09-24 15:28           ` Kai Großjohann
  0 siblings, 1 reply; 14+ messages in thread
From: Keith O'Connell @ 2002-09-24 14:59 UTC (permalink / raw)


>>>>> "kroc" == Keith  <kroc@blueyonder.co.uk>:
>>>>> "os"   == Oliver Scholz <alkibiades@gmx.de>:

    os> Yes, you can check for various display capabilities with the
    os> `display-.*-p'-functions. In this case `display-multi-font-p'
    os> would be the appropriate one:

    os> (when (display-multi-font-p) (set-face-font ...))

    kroc> Perfect! Thank you for that :-)

I know I said perfect, but that was a little premature. When the emacs
window is opened it comes up with the face font specified in the
command above, however if you spawn another window with C-x 5 2, it
comes up with the original font.

Having specified a font in .emacs, how can I make the spawned windows
follow this instruction as well?

-- 
Keith.

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

* Re: setting the font in .emacs
  2002-09-24 14:59         ` Keith O'Connell
@ 2002-09-24 15:28           ` Kai Großjohann
  2002-09-24 18:13             ` Keith O'Connell
  2002-09-24 18:58             ` Oliver Scholz
  0 siblings, 2 replies; 14+ messages in thread
From: Kai Großjohann @ 2002-09-24 15:28 UTC (permalink / raw)


Keith O'Connell <kroc@blueyonder.co.uk> writes:

> I know I said perfect, but that was a little premature. When the emacs
> window is opened it comes up with the face font specified in the
> command above, however if you spawn another window with C-x 5 2, it
> comes up with the original font.

(add-to-list 'default-frame-alist '(font . "your-font-name-here"))

I think this works without conditionals.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

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

* Re: setting the font in .emacs
  2002-09-24 15:28           ` Kai Großjohann
@ 2002-09-24 18:13             ` Keith O'Connell
  2002-09-24 18:58             ` Oliver Scholz
  1 sibling, 0 replies; 14+ messages in thread
From: Keith O'Connell @ 2002-09-24 18:13 UTC (permalink / raw)


>>>>> "Kai" == Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

    Kai> (add-to-list 'default-frame-alist '(font
    Kai> . "your-font-name-here"))

    Kai> I think this works without conditionals.

You are right as usual - Thanks very much!

-- 
Keith.

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

* Re: setting the font in .emacs
  2002-09-24 15:28           ` Kai Großjohann
  2002-09-24 18:13             ` Keith O'Connell
@ 2002-09-24 18:58             ` Oliver Scholz
  2002-09-24 20:08               ` Kai Großjohann
  1 sibling, 1 reply; 14+ messages in thread
From: Oliver Scholz @ 2002-09-24 18:58 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Keith O'Connell <kroc@blueyonder.co.uk> writes:
>
>> I know I said perfect, but that was a little premature. When the emacs
>> window is opened it comes up with the face font specified in the
>> command above, however if you spawn another window with C-x 5 2, it
>> comes up with the original font.
>
> (add-to-list 'default-frame-alist '(font . "your-font-name-here"))
>
> I think this works without conditionals.

My bad, I don't use `set-face-font' myself, I should have checked
that it works correctly.

But I am puzzled. Both `set-face-font' and `set-face-foreground' work
by calling `set-face-attribute'. But the former, when applied to the
default face, changes the attribute in question _not_ for future
frames, while the latter does. Why the difference?

    -- Oliver

-- 
3 Vendémiaire an 211 de la Révolution
Liberté, Egalité, Fraternité!

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

* Re: setting the font in .emacs
  2002-09-24 18:58             ` Oliver Scholz
@ 2002-09-24 20:08               ` Kai Großjohann
  0 siblings, 0 replies; 14+ messages in thread
From: Kai Großjohann @ 2002-09-24 20:08 UTC (permalink / raw)


Oliver Scholz <alkibiades@gmx.de> writes:

> But I am puzzled. Both `set-face-font' and `set-face-foreground' work
> by calling `set-face-attribute'. But the former, when applied to the
> default face, changes the attribute in question _not_ for future
> frames, while the latter does. Why the difference?

Maybe a bug.  Can you reproduce it by doing set-face-attribute
manually?  From "emacs -q -no-site-file"?  If so, please submit a bug
report.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

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

end of thread, other threads:[~2002-09-24 20:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-22 18:37 setting the font in .emacs Dan Hitt
2002-09-22 20:24 ` Oliver Scholz
2002-09-22 19:44   ` Keith
2002-09-22 20:52     ` David Forrest
2002-09-23  0:31     ` Oliver Scholz
2002-09-23 11:12       ` Keith
2002-09-24 14:59         ` Keith O'Connell
2002-09-24 15:28           ` Kai Großjohann
2002-09-24 18:13             ` Keith O'Connell
2002-09-24 18:58             ` Oliver Scholz
2002-09-24 20:08               ` Kai Großjohann
2002-09-23 18:38     ` Stefan Monnier <foo@acm.com>
2002-09-23 19:40     ` Benjamin Lewis
2002-09-23 11:05   ` Fredrik Staxeng

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