From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Sergey Organov Newsgroups: gmane.emacs.help Subject: Re: How to enforce unicode font for all charsets? Date: Wed, 11 Mar 2020 15:18:34 +0300 Message-ID: <87tv2vdqzp.fsf@osv.gnss.ru> References: <874kuwphsz.fsf@osv.gnss.ru> <83wo7s9sgt.fsf@gnu.org> <87a74niii8.fsf@osv.gnss.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="120077"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Robert Pluim Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 11 13:19:30 2020 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 1jC0Kf-000V8U-MB for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Mar 2020 13:19:29 +0100 Original-Received: from localhost ([::1]:50716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC0Ke-0001PB-My for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Mar 2020 08:19:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41154) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC0Jw-0001LI-7t for help-gnu-emacs@gnu.org; Wed, 11 Mar 2020 08:18:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jC0Jv-00069J-1M for help-gnu-emacs@gnu.org; Wed, 11 Mar 2020 08:18:44 -0400 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:44799) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jC0Ju-00066o-Q2 for help-gnu-emacs@gnu.org; Wed, 11 Mar 2020 08:18:42 -0400 Original-Received: by mail-lj1-x236.google.com with SMTP id a10so2028932ljp.11 for ; Wed, 11 Mar 2020 05:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=UZAdQvKExjTvycoAkdMv5YvF4R6FbVnqSr7q3oZ05R0=; b=vfG7PRvYTevdiXQgeU4aKpoUmIJXT7KCvS60jDBh4zu8Iv3okg8y9dDMXcq66brIE6 Z9MM9DvUAj7mo4Qb6tWj63e1AOUZEY+LMay6jpgfD7ix+xOpCNp1GcDFIGeUhd4ITxlv FWfN55pXKhdPaE4oGDbiLy5OM3Y3DyjUMO1rnm4N/h9pgCof68dHTDwZKiT6WpmMp6/1 8vFGUzg2LBCt5/isKoXUBjM9n78Bet98cEg7sUdpMj7Gn0/eEGdnP2qObZjhKzliPzDH tEDEnPhbfYzX4PyCGl5QrcNAjbSNg327EWry2Wyapu5wELXuxUhxFgkwBSXln50hUo/B PdNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=UZAdQvKExjTvycoAkdMv5YvF4R6FbVnqSr7q3oZ05R0=; b=LVGKYii1WHG/HRlfa+GLOBZvNGTzCxucV0q/8j+TR9vU/wfE9Ck/98QOyXErVREWgt nn0TEM4OFPPTWWeik6745toTlH1SpUm/GHfyw8zvvKilAN040NQUoV/Bv6v0c2F3J4Xs 0Cfd7VwFQ00bVqungcb9IDzSQPuJzocIQgabIyJZZgdEhzX04WteEOee/deYwoQOYI81 iainDWQtLIFIsByLXDJVabIQ3QldDYKcrQQp1gWsYZaipIiBmX+WkPAm1erkotT9F+vk 9ZXH6bFFY7IaXiBfksgKviJTGdcmgn29uEi170RlZL3qOiHRdPus+DB9m9Y8QyEVlMeA WMng== X-Gm-Message-State: ANhLgQ29QG/gtqzHvKkFIiK/kW0vcvbhbEgS3/ECI7AgKlZIfIbXrLfx /pt89XAJ96aJuzueW1BG+pCdX4Bz X-Google-Smtp-Source: ADFU+vv6UfavHjxBvJN0TSrA2ESY8Jax+eILN1SXbjjDX6pB/J6IlhoTtMEAACtPynvuvac/ZWkvcA== X-Received: by 2002:a2e:b801:: with SMTP id u1mr2004072ljo.188.1583929116896; Wed, 11 Mar 2020 05:18:36 -0700 (PDT) Original-Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id 133sm6525941ljj.91.2020.03.11.05.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 05:18:35 -0700 (PDT) In-Reply-To: (Robert Pluim's message of "Wed, 11 Mar 2020 09:17:12 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::236 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.help:122563 Archived-At: Robert Pluim writes: >>>>>> On Wed, 11 Mar 2020 08:10:39 +0300, Sergey Organov said: > > Sergey> Thanks, I was thinking along these lines indeed. The problem is I can't > Sergey> figure how exactly do I do it, provided the DejaVu Sans Mono is the font > Sergey> currently being set through M-x customize-face RET default, and I don't > Sergey> want to loose the ability to change this way the (only) font I'd like to > Sergey> use. > > Sergey> I mean, it looks like I need to modify fontset-auto1, as M-x > Sergey> describe-fontset RET shows: > > Sergey> Fontset: -PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-fontset-auto1 > Sergey> [...] > > Sergey> and after some more digging, I finally tried: > > Sergey> (set-fontset-font "fontset-auto1" 'windows-1251 > Sergey> (font-xlfd-name (face-attribute 'default :font)) > > Sergey> which evaluates to: > > Sergey> "-PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-iso10646-1" > > You'd want to use nil instead of "fontset-auto1" to affect the current > frame's fontset, or t to affect the default fontset. Thank you for suggestion, but still no luck. I've tried both t and nil to no avail. That said, for permanent customization in init file, I will need to specify particular fontset anyway, right? > > Sergey> but doesn't seem to have any visible effect. And even if that worked, it > Sergey> wouldn't immediately pick subsequent customization of the default face > Sergey> anyway? > > Right, fontsets are static. How often do you customize your default > face? :-) Admittedly not often, but there are still 2 problems: 1. When I do customize the default face, say in 1 year, and it doesn't work, how do I find/recall why? 2. The result of (set-fontset-font) will depend on the moment of its execution relative to application of customization of default face. > Sergey> What do I miss? > > >> Moreover, specifying that font for any charset is probably not > >> a good idea, since no font covers all of Unicode. > > Sergey> Maybe I should be able to express exactly this by specifying, say, > Sergey> "preferred font" for a fontset? I mean: "use this font, unless there is > Sergey> no suitable glyph, in which case turn back to the fancy methods of > Sergey> considering charsets". > > By default, set-fontset-font replaces the existing definition. You can > pass it 'prepend' as the fifth argument to have it add to the front of > the existing one. This is not the same as "preferred font(s)" would be if Emacs had them. > Sergey> Actually, I probably do want to use only this font (and have empty > Sergey> rectangles or some such in case of missed glyphs). I mean some way to > Sergey> force Emacs to behave as if this font is the only available font in the > Sergey> entire system. Still no simple way? > > For all characters or just the windows-1251 charset? If the latter Obviously the former. Just suppose I only install DejaVu Sans Mono font. Nothing else. No other fonts at all. How would Emacs behave by default in such a setup? Now I need to force such behavior in a system where multiple fonts are installed. > > (set-fontset-font t 'windows-1251 > (font-xlfd-name (face-attribute 'default :font)) > > should do that. Somehow it still doesn't work for me even for windows-1251, dunno why. -- Sergey