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: :family and :height in set-face-attribute Date: Mon, 24 Jun 2024 18:34:11 +0300 Message-ID: <86bk3qbbik.fsf@gnu.org> References: <86h6dibixi.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8756"; 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 Mon Jun 24 17:34:54 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 1sLliX-0001yC-JW for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 24 Jun 2024 17:34:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLlhu-0007Jf-J0; Mon, 24 Jun 2024 11:34:14 -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 1sLlht-0007JM-3Q for help-gnu-emacs@gnu.org; Mon, 24 Jun 2024 11:34:13 -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 1sLlhs-00016F-Rx for help-gnu-emacs@gnu.org; Mon, 24 Jun 2024 11:34:12 -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=kqnNR0B8Y/XCHi/9lHVdkzYApdrsh8NMm5MPG9HdI/s=; b=LaljL/CJwUMn JacoWyDP971tJNC0LQC0lnoujykfRKmzN1TbkeFkmV0KJ1nkHqTqxE/HnVldjwxClUdy0rNBT2z6O u4EUVnpsf2+maPShG3nZpTi3eQc9zDmI1GpJBvVpC4jLmHQ9++pCFds1FrxuOisTWbos0gX41ZonZ QzNReAmOExC4T1G4z6e87CfKPAlGxvTHyKx/c3h6M7ZBs8GVVG+Zr3u6tRcEQ5T/XdR9gcjuwwVYB 90QlNkQXaR5CoXlngQGkuzX/Fc6ZBGvhHMf2qKV3vK2ZgH6AQgD95BS/DTEmuY10rsj+LLs/9BuOM 47/FK6O7vTjVAEFIKlfRTA==; In-Reply-To: (message from Heime on Mon, 24 Jun 2024 14:57:09 +0000) 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:146982 Archived-At: > Date: Mon, 24 Jun 2024 14:57:09 +0000 > From: Heime > Cc: help-gnu-emacs@gnu.org > > On Monday, June 24th, 2024 at 12:54 PM, Eli Zaretskii wrote: > > > > Date: Mon, 24 Jun 2024 10:32:25 +0000 > > > From: Heime heimeborgia@protonmail.com > > > > > > I have the following command working > > > > > > (buffer-face-mode-invoke > > > `(:family ,face-family :height ,(string-to-number face-height)) t) > > > > > > But this one does not > > > > > > (set-face-attribute 'default nil > > > :family face-family :height (string-to-number face-height)) > > > > > > Works for me. But since you haven't shown the values of face-family > > and face-height, it's hard to tell whether I reproduced what you do. > > This is it > > (defvar monatt nil > "A boolean variable that is true by default.") > > (defun monfont (face-family face-height) > > (interactive > > (list > > (let ( (cseq '("Wargames" "URW Chancery L" "Century Schoolbook L" "Bold Oblique")) ) > > (completing-read " Family Name: " cseq nil t "Bold Oblique")) > > > (let ( (hseq '("340" "300" "260" "220" "180")) ) > > (completing-read " Face Height: " hseq nil t "180")) )) > > (if monatt > > (buffer-face-mode-invoke > > `(:family ,face-family :height ,(string-to-number face-height)) t) > > (set-face-attribute 'default nil > > :family face-family :height (string-to-number face-height)) )) Come on, can't you just show the values you use in the set-face-attribute call? Also, is the value of face-family with which you call set-face-attribute one of the families returned by font-family-list?