all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Monospaced and proportional fonts
@ 2012-06-10 17:26 Eddie
  0 siblings, 0 replies; 2+ messages in thread
From: Eddie @ 2012-06-10 17:26 UTC (permalink / raw
  To: help-gnu-emacs

I have a line in my .emacs that sets the default font:

(add-to-list 'default-frame-alist '(font . "DejaVu Sans Condensed-12"))

I also have two .org files which I open frequently and for which I'd
like to have the default font be a monospace font (Deja Vu Sans
Mono-11 would work just great).

I can pull down the "Options" menu and set the default font from there.
But that's kind of cumbersome and repetitive. Is it possible to
permanently apply a monospaced font to just those two files (not all
my .org files)?

This is Emacs 23.3 on various Linux desktops.

To further complicate things, the full path to these files will change,
depending on what computer I'm working on; they reside on one
computer, but sometimes I access them from another computer via a Samba
share.

Thanks



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

* Re: Monospaced and proportional fonts
       [not found] <mailman.2563.1339352221.855.help-gnu-emacs@gnu.org>
@ 2012-06-25 21:31 ` Michael Heerdegen
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Heerdegen @ 2012-06-25 21:31 UTC (permalink / raw
  To: help-gnu-emacs

Hi,

you can use face remapping for that, a feature that was introduced in
Emacs 23.

It works for me to use something like this in the local variable list
of a file:

eval: (face-remap-add-relative 'default :family "DejaVu Sans Condensed" :height 120)

I.e. to test it for any file, add this to the end of the file:

Local Variables:
eval: (face-remap-add-relative 'default :family "DejaVu Sans Condensed" :height 120)
End:

I hope that's enough for you to experiment.  See the elisp manual,
Display > Faces, and Variables > File Local Variables.


Michael.


Eddie <penguinismo@almostconnecticut.net> writes:

> I have a line in my .emacs that sets the default font:
>
> (add-to-list 'default-frame-alist '(font . "DejaVu Sans Condensed-12"))
>
> I also have two .org files which I open frequently and for which I'd
> like to have the default font be a monospace font (Deja Vu Sans
> Mono-11 would work just great).
>
> I can pull down the "Options" menu and set the default font from there.
> But that's kind of cumbersome and repetitive. Is it possible to
> permanently apply a monospaced font to just those two files (not all
> my .org files)?
>
> This is Emacs 23.3 on various Linux desktops.
>
> To further complicate things, the full path to these files will change,
> depending on what computer I'm working on; they reside on one
> computer, but sometimes I access them from another computer via a Samba
> share.



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

end of thread, other threads:[~2012-06-25 21:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-10 17:26 Monospaced and proportional fonts Eddie
     [not found] <mailman.2563.1339352221.855.help-gnu-emacs@gnu.org>
2012-06-25 21:31 ` Michael Heerdegen

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.