From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to set monospace font with .emacs shared between ubuntu and Cygwin Date: Thu, 26 Sep 2024 09:02:17 +0300 Message-ID: <86jzezar6e.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4840"; mail-complaints-to="usenet@ciao.gmane.io" To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 26 08:02:56 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sthaa-00015y-Bu for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 26 Sep 2024 08:02:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stha3-0002mp-71; Thu, 26 Sep 2024 02:02:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stha0-0002lB-T0 for Help-gnu-emacs@gnu.org; Thu, 26 Sep 2024 02:02:20 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stha0-0002F5-KC for Help-gnu-emacs@gnu.org; Thu, 26 Sep 2024 02:02:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DSc+kSic7HniTyAJ9QFQo39gqbdwJNqdtaawYXQUZJU=; b=JFZrMo1BefUh OvsJqMpy/CflOZzKNGM3J7KHQJUNcCB+ANih/Sn1yLPWOrgBLyIlAm92+nnfThXlsW7vIHATvNOtf 6StgWw8r9Vj0r7Ww1BRFDPenOgFrOw3DZFRCfaMDOTvzqfhIWVfmpFjEDnZMNio0AsI8vILMbhHF8 p2WMqJqAEUCcQCEXQoO5wZtYpPjoCOoaj1sZc0F1UNwUJC9vswF9GbBEvio5gx3FCoRIA+7f0Thnp IBQRXqH0EPkPbbjHfL0oqgIzcewtv+to1Z3hLXgW/sd02SUHeI8hzCPmWRA+4PvIpAaY7yugq7kv7 gXuJdEUgfqAjDBHh7t1UPg==; In-Reply-To: (dk068x@att.com) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148069 Archived-At: > From: "KARR, DAVID" > Date: Wed, 25 Sep 2024 18:32:02 +0000 > > I have Cygwin emacs 29.4 running on my Windows laptop. I have an Ubuntu VM running on that laptop, which is running Emacs 27.1. I am trying to use the same .emacs file through a shared folder. For most things, this works perfectly fine. My Cygwin Emacs is using a proper monospace font, but the VM is using a proportional font. I'd prefer that they both used the same font, but at a minimum, the Ubuntu VM needs to use a monospace font. > > In my Cygwin Emacs, I ran "list-fonts" and got this: > ----------------- > Fontset: -*-*-*-*-*-*-*-*-*-*-*-*-fontset-default > Fontset: -*-courier new-normal-r-*-*-13-*-*-*-c-*-fontset-standard > Fontset: -outline-Courier New-regular-normal-normal-mono-13-*-*-*-c-*-fontset-startup > ----------------- > > In my Ubuntu VM Emacs, I did the same and got this: > ------------- > Fontset: -DAMA-Ubuntu-normal-normal-normal-*-17-*-*-*-*-0-fontset-auto1 > Fontset: -DAMA-Ubuntu-normal-normal-normal-*-13-*-*-*-*-0-fontset-auto2 > Fontset: -*-*-*-*-*-*-*-*-*-*-*-*-fontset-default > Fontset: -*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard > Fontset: -DAMA-Ubuntu Mono-normal-normal-normal-*-17-*-*-*-m-0-fontset-startup > -------------- > > My .emacs currently has no customization related to fonts, except for "(global-font-lock-mode 1)" (I don't even remember what that does, and the associated descriptions are circular). > > What are my options here? My suggestion is to have your .emacs file specify the default font for Ubuntu, using the system-type variable as the dispatch. Find a font on Ubuntu that you like, and then add to .emacs something like (unless (memq system-type '(cygwin windows-nt)) (add-to-list 'default-frame-alist '(font . "YOUR-PREFERRED-FONT-HERE"))) To find out the correct specification of YOUR-PREFERRED-FONT-HERE, start Emacs on Ubuntu, try different fonts (including sizes) until you find one that you like, and then type "M-: (face-font 'default) RET". This should produce the font string you can use in the above. To try different fonts, you can use S-mouse-1, then select "Change Buffer font" from the popup menu, which will display a font selection dialog. Alternatively, Options->"Set Default Font" from the menu bar will show a similar font selection dialog. HTH