* Changing string from completing-read to height for buffer-face-mode-invoke
@ 2024-06-23 10:36 Heime
2024-06-23 11:30 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Heime @ 2024-06-23 10:36 UTC (permalink / raw)
To: Heime via Users list for the GNU Emacs text editor
I am using the function falfont to change the font of a buffer or frame.
Do I need to change face-height to an integer rather than keeping it as a string ?
(require 'face-remap)
(defvar faljura t
"A boolean variable that is true by default.")
(defun falfont (face-family face-height)
(interactive
(list
(let ( (cseq '("Wargames" "URW Chancery L")) )
(completing-read " Family Name: " cseq nil t "URW Chancery L"))
(let ( (hseq '("220" "120")) )
(completing-read " Face Height: " hseq nil t "80")) ))
(pcase face-family
("Wargames"
(if faljura
(buffer-face-mode-invoke '(:family face-family :height face-height) t)
(set-face-attribute 'default nil :family face-family :height face-height)))
("URW Chancery L"
(if faljura
(buffer-face-mode-invoke '(:family face-family :height face-height) t)
(set-face-attribute 'default nil :family face-family :height face-height)))))
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Changing string from completing-read to height for buffer-face-mode-invoke
2024-06-23 10:36 Changing string from completing-read to height for buffer-face-mode-invoke Heime
@ 2024-06-23 11:30 ` Eli Zaretskii
2024-06-23 12:25 ` Heime
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-06-23 11:30 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Sun, 23 Jun 2024 10:36:30 +0000
> From: Heime <heimeborgia@protonmail.com>
>
> I am using the function falfont to change the font of a buffer or frame.
>
> Do I need to change face-height to an integer rather than keeping it as a string ?
Yes.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Changing string from completing-read to height for buffer-face-mode-invoke
2024-06-23 11:30 ` Eli Zaretskii
@ 2024-06-23 12:25 ` Heime
2024-06-23 12:35 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Heime @ 2024-06-23 12:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On Sunday, June 23rd, 2024 at 11:30 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sun, 23 Jun 2024 10:36:30 +0000
> > From: Heime heimeborgia@protonmail.com
> >
> > I am using the function falfont to change the font of a buffer or frame.
> >
> > Do I need to change face-height to an integer rather than keeping it as a string ?
>
> Yes.
What function would help me do the conversion ?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Changing string from completing-read to height for buffer-face-mode-invoke
2024-06-23 12:25 ` Heime
@ 2024-06-23 12:35 ` Eli Zaretskii
2024-06-23 13:14 ` Heime
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-06-23 12:35 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Sun, 23 Jun 2024 12:25:42 +0000
> From: Heime <heimeborgia@protonmail.com>
> Cc: help-gnu-emacs@gnu.org
>
>
> On Sunday, June 23rd, 2024 at 11:30 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > > Date: Sun, 23 Jun 2024 10:36:30 +0000
> > > From: Heime heimeborgia@protonmail.com
> > >
> > > I am using the function falfont to change the font of a buffer or frame.
> > >
> > > Do I need to change face-height to an integer rather than keeping it as a string ?
> >
> > Yes.
>
> What function would help me do the conversion ?
string-to-number
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Changing string from completing-read to height for buffer-face-mode-invoke
2024-06-23 12:35 ` Eli Zaretskii
@ 2024-06-23 13:14 ` Heime
0 siblings, 0 replies; 5+ messages in thread
From: Heime @ 2024-06-23 13:14 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
Sent with Proton Mail secure email.
On Sunday, June 23rd, 2024 at 12:35 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sun, 23 Jun 2024 12:25:42 +0000
> > From: Heime heimeborgia@protonmail.com
> > Cc: help-gnu-emacs@gnu.org
> >
> > On Sunday, June 23rd, 2024 at 11:30 AM, Eli Zaretskii eliz@gnu.org wrote:
> >
> > > > Date: Sun, 23 Jun 2024 10:36:30 +0000
> > > > From: Heime heimeborgia@protonmail.com
> > > >
> > > > I am using the function falfont to change the font of a buffer or frame.
> > > >
> > > > Do I need to change face-height to an integer rather than keeping it as a string ?
> > >
> > > Yes.
> >
> > What function would help me do the conversion ?
>
> string-to-number
I do not see the new font being activated with this version
(pcase face-family
("Wargames"
(if montejura
(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))))
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-06-23 13:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-23 10:36 Changing string from completing-read to height for buffer-face-mode-invoke Heime
2024-06-23 11:30 ` Eli Zaretskii
2024-06-23 12:25 ` Heime
2024-06-23 12:35 ` Eli Zaretskii
2024-06-23 13:14 ` Heime
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).