all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#67449: Manual: add how to change default global font size in .emacs
@ 2023-11-26  2:18 Dan Jacobson
  2023-11-26  5:50 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Jacobson @ 2023-11-26  2:18 UTC (permalink / raw)
  To: 67449

In (info "(emacs) Fonts") we learn

> By default, Emacs displays text on graphical displays using a 10-point
> monospace font, and the font size can be changed interactively (*note
> Text Scale::).

That is great. But what is 10-point is not the right default size for 
you.

Well, to make a new defaut, just put
(global-text-scale-adjust INCREMENT)
in your .emacs. As simple as that.

But the manual never gets around to mentioning that.

So how shall we fix that problem?

Well first there on In (info "(emacs) Fonts") please add:

> besides interactively, the default can also be incremented in your
> .emacs file: via (global-text-scale-adjust INCREMENT).

OK, also in  (info "(emacs) Text Scale") we see

>  to change the sizes of the fonts globally, type ‘C-x
> C-M-+’, ‘C-x C-M-=’, ‘C-x C-M--’ or ‘C-x C-M-0’, or scroll the mouse
> wheel with both the ‘Ctrl’ and ‘Meta’ modifiers pressed.

That is also great, but you also need to mention how to change it
permanently in .emacs: via (global-text-scale-adjust INCREMENT).

In fact, that would make this index entry
* global-text-scale-adjust: Text Scale. (line  35)
make sense. As currently all it leads to are the keystrokes.

(Note: in all of the above I intentionally do not mention "Easy
customization". That is not what I am trying to document.)

P.S.,
emacs -Q --eval '(global-text-scale-adjust 0)' cause the initial text
to disappear.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-26  2:18 bug#67449: Manual: add how to change default global font size in .emacs Dan Jacobson
@ 2023-11-26  5:50 ` Eli Zaretskii
  2023-11-26 13:28   ` Dan Jacobson
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2023-11-26  5:50 UTC (permalink / raw)
  To: Dan Jacobson; +Cc: 67449

tags 67449 notabug wontfix
close 67449
thanks

> Date: Sun, 26 Nov 2023 10:18:16 +0800
> From: Dan Jacobson <jidanni@jidanni.org>
> 
> In (info "(emacs) Fonts") we learn
> 
> > By default, Emacs displays text on graphical displays using a 10-point
> > monospace font, and the font size can be changed interactively (*note
> > Text Scale::).
> 
> That is great. But what is 10-point is not the right default size for 
> you.

The text just below that explains how to do that in half a dozen
different ways.

> Well, to make a new defaut, just put
> (global-text-scale-adjust INCREMENT)
> in your .emacs. As simple as that.

No, that's not the right way, since it doesn't affect all the faces
used by Emacs.  You've misunderstood the intent and purpose of
global-text-scale-adjust and friends.

> OK, also in  (info "(emacs) Text Scale") we see
> 
> >  to change the sizes of the fonts globally, type ‘C-x
> > C-M-+’, ‘C-x C-M-=’, ‘C-x C-M--’ or ‘C-x C-M-0’, or scroll the mouse
> > wheel with both the ‘Ctrl’ and ‘Meta’ modifiers pressed.
> 
> That is also great, but you also need to mention how to change it
> permanently in .emacs: via (global-text-scale-adjust INCREMENT).

Because doing that permanently makes no sense, and that's not what
global-text-scale-adjust is for.

This is not a bug, and there's nothing we should do here.

Closing.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-26  5:50 ` Eli Zaretskii
@ 2023-11-26 13:28   ` Dan Jacobson
  2023-11-26 13:50     ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Jacobson @ 2023-11-26 13:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67449

OK, so if "emacs' default font size is 10",
there is no way to make it e.g., 15.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-26 13:28   ` Dan Jacobson
@ 2023-11-26 13:50     ` Eli Zaretskii
  2023-11-26 20:55       ` Dan Jacobson
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2023-11-26 13:50 UTC (permalink / raw)
  To: Dan Jacobson; +Cc: 67449

> Date: Sun, 26 Nov 2023 21:28:31 +0800
> From: Dan Jacobson <jidanni@jidanni.org>
> Cc: 67449@debbugs.gnu.org
> 
> OK, so if "emacs' default font size is 10",
> there is no way to make it e.g., 15.

Yes, there is: see the manual, in the same node where you found the
description of the default.  There are 5 different ways of doing this
described there, two of them are suitable for customizing the font
Emacs will use as the default one, and recording that customization
once and for all.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-26 13:50     ` Eli Zaretskii
@ 2023-11-26 20:55       ` Dan Jacobson
  2023-11-27  3:27         ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Jacobson @ 2023-11-26 20:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67449

Fine. If there is a simple way, to change the default font size, one 
line that one can put in one's .emacs file, without needing to deal with 
the customization system, then please mention it, right there, below the 
line that says emacs's default font size is 10. Thank you.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-26 20:55       ` Dan Jacobson
@ 2023-11-27  3:27         ` Eli Zaretskii
  2023-11-29  3:10           ` Dan Jacobson
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2023-11-27  3:27 UTC (permalink / raw)
  To: Dan Jacobson; +Cc: 67449

> Date: Mon, 27 Nov 2023 04:55:29 +0800
> From: Dan Jacobson <jidanni@jidanni.org>
> Cc: 67449@debbugs.gnu.org
> 
> Fine. If there is a simple way, to change the default font size, one 
> line that one can put in one's .emacs file, without needing to deal with 
> the customization system, then please mention it, right there, below the 
> line that says emacs's default font size is 10. Thank you.

It's already mentioned there.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-27  3:27         ` Eli Zaretskii
@ 2023-11-29  3:10           ` Dan Jacobson
  2023-11-29 12:47             ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Jacobson @ 2023-11-29  3:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67449

In (info "(emacs) Fonts")

> File: emacs.info,  Node: Fonts,  Next: Speedbar,  Prev: Frame Commands,  Up: Frames
> 
> 22.8 Fonts
> ==========
> 
> By default, Emacs displays text on graphical displays using a 10-point

10 point. Let's say we want it to use 14 point default.

> monospace font,

We don't care about monospace or not. We just want to make 10 into 14.


> and the font size can be changed interactively (*note
> Text Scale::).

We don't want to change it interactively. We just want to put a line in
our .emacs file to change it.

>    There are several different ways to specify a different font:

We don't want to specify a different font. We don't care about the font.
We just want to make it use a different size as default.

>    • Click on ‘Set Default Font’ in the ‘Options’ menu.  This makes the
>      selected font the default on all existing graphical frames.  To
>      save this for future sessions, click on ‘Save Options’ in the
>      ‘Options’ menu.

We don't want to click on anything. Nor do we want to choose a font. We
just want to change the default size for emacs of fonts.

> 
>    • Add a line to your init file, modifying the variable
>      ‘default-frame-alist’ to specify the ‘font’ parameter (*note Frame
>      Parameters::), like this:
> 
>           (add-to-list 'default-frame-alist
>                        '(font . "DejaVu Sans Mono-10"))

Yes we want to add a line to our .emacs file. But we don't want to have
to say some font name. We just want to tell emacs to use "default size
14, not 10".


> 
>      This makes the font the default on all graphical frames created
>      after restarting Emacs with that init file.
> 
>    • Add an ‘emacs.font’ X resource setting to your X resource file,
>      like this:
> 
>           emacs.font: DejaVu Sans Mono-12

Again we are forced to name a font. We don't want to name a font. We
just want to tell emacs to do what it does, but at scale 14 not 10.

Anyway maybe there is a glimmer of hope with some line like
-*-*-*-14-*-*-*- or something, but it so frustrating. Whereas in other
apps one can just choose a default font size, in emacs ... well you have
to go down to the car dealership and learn about muffler types. You
can't just tell the rental agency to deliver an economy sized car.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-29  3:10           ` Dan Jacobson
@ 2023-11-29 12:47             ` Eli Zaretskii
  2023-11-30  7:23               ` Kévin Le Gouguec
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2023-11-29 12:47 UTC (permalink / raw)
  To: Dan Jacobson; +Cc: 67449

> From: Dan Jacobson <jidanni@jidanni.org>
> Cc: 67449@debbugs.gnu.org
> Date: Wed, 29 Nov 2023 11:10:09 +0800
> 
> In (info "(emacs) Fonts")
> 
> > File: emacs.info,  Node: Fonts,  Next: Speedbar,  Prev: Frame Commands,  Up: Frames
> > 
> > 22.8 Fonts
> > ==========
> > 
> > By default, Emacs displays text on graphical displays using a 10-point
> 
> 10 point. Let's say we want it to use 14 point default.
> 
> > monospace font,
> 
> We don't care about monospace or not. We just want to make 10 into 14.

Monospace is the default, so it doesn't matter whether "we" care or
not.

> > and the font size can be changed interactively (*note
> > Text Scale::).
> 
> We don't want to change it interactively. We just want to put a line in
> our .emacs file to change it.
> 
> >    There are several different ways to specify a different font:
> 
> We don't want to specify a different font. We don't care about the font.
> We just want to make it use a different size as default.

So just specify the same font with the different size.  Case closed.

> >    • Add a line to your init file, modifying the variable
> >      ‘default-frame-alist’ to specify the ‘font’ parameter (*note Frame
> >      Parameters::), like this:
> > 
> >           (add-to-list 'default-frame-alist
> >                        '(font . "DejaVu Sans Mono-10"))
> 
> Yes we want to add a line to our .emacs file. But we don't want to have
> to say some font name. We just want to tell emacs to use "default size
> 14, not 10".

So just specify the same font with the different size.  Case closed.

> >      This makes the font the default on all graphical frames created
> >      after restarting Emacs with that init file.
> > 
> >    • Add an ‘emacs.font’ X resource setting to your X resource file,
> >      like this:
> > 
> >           emacs.font: DejaVu Sans Mono-12
> 
> Again we are forced to name a font. We don't want to name a font. We
> just want to tell emacs to do what it does, but at scale 14 not 10.

So just specify the same font with the different size.  Case closed.

> Anyway maybe there is a glimmer of hope with some line like
> -*-*-*-14-*-*-*- or something, but it so frustrating.

A two-liner in the init file or a X resource setting cannot be
anywhere near frustrating.

> Whereas in other apps one can just choose a default font size, in
> emacs ... well you have to go down to the car dealership and learn
> about muffler types. You can't just tell the rental agency to
> deliver an economy sized car.

Or you can do the above, which is easy and a no-brainer, really.  Case
closed.  And this bug is also closed.  Please accept the decision and
stop pushing.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-29 12:47             ` Eli Zaretskii
@ 2023-11-30  7:23               ` Kévin Le Gouguec
  2023-11-30  8:39                 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Kévin Le Gouguec @ 2023-11-30  7:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67449, Dan Jacobson

Eli Zaretskii <eliz@gnu.org> writes:

>> > and the font size can be changed interactively (*note
>> > Text Scale::).
>> 
>> We don't want to change it interactively. We just want to put a line in
>> our .emacs file to change it.
>> 
>> >    There are several different ways to specify a different font:
>> 
>> We don't want to specify a different font. We don't care about the font.
>> We just want to make it use a different size as default.
>
> So just specify the same font with the different size.  Case closed.
>
>> >    • Add a line to your init file, modifying the variable
>> >      ‘default-frame-alist’ to specify the ‘font’ parameter (*note Frame
>> >      Parameters::), like this:
>> > 
>> >           (add-to-list 'default-frame-alist
>> >                        '(font . "DejaVu Sans Mono-10"))
>> 
>> Yes we want to add a line to our .emacs file. But we don't want to have
>> to say some font name. We just want to tell emacs to use "default size
>> 14, not 10".
>
> So just specify the same font with the different size.  Case closed.
>
>> >      This makes the font the default on all graphical frames created
>> >      after restarting Emacs with that init file.
>> > 
>> >    • Add an ‘emacs.font’ X resource setting to your X resource file,
>> >      like this:
>> > 
>> >           emacs.font: DejaVu Sans Mono-12
>> 
>> Again we are forced to name a font. We don't want to name a font. We
>> just want to tell emacs to do what it does, but at scale 14 not 10.
>
> So just specify the same font with the different size.  Case closed.
>
>> Anyway maybe there is a glimmer of hope with some line like
>> -*-*-*-14-*-*-*- or something, but it so frustrating.
>
> A two-liner in the init file or a X resource setting cannot be
> anywhere near frustrating.
>
>> Whereas in other apps one can just choose a default font size, in
>> emacs ... well you have to go down to the car dealership and learn
>> about muffler types. You can't just tell the rental agency to
>> deliver an economy sized car.
>
> Or you can do the above, which is easy and a no-brainer, really.  Case
> closed.  And this bug is also closed.  Please accept the decision and
> stop pushing.

FWIW, I've been following this thread because I empathize with Dan in
this report: depending on the system I use, emacs -Q gets me either
Ubuntu Mono (GNOME/Ubuntu 22.04), Noto Sans Mono (Plasma/Debian 12) or
Source Code Pro (Plasma/openSUSE Tumbleweed).

In practice I customize Emacs to pick DejaVu Sans Mono in every setup,
but that's a decision I take for incidental reasons (character coverage,
bold/italic variants); so indeed I happen to

> just specify the same font

but I can imagine wanting to keep the system's default _family_, yet
have a consistent font _size_ across all my setups, in which case having
to spell out the font in my dotfiles is a bother.

(Granted, the X resource solution cited above might work?  Would it work
--with-pgtk on Wayland?)

(Granted², as soon as each "setup" differs in screen size, resolution,
or density, "a consistent font _size_ across all my setups" probably
requires bespoke face heights for each setup; still, that does not mean
I'd want to mess with the _family_)

FWIW², if I were to attempt to "just set the size, ignoring the font" in
my dotfiles, I'd probably go with either

  ;; (1)
  (set-face-attribute 'default nil :height my/height)

or

  ;; (2)
  (let* ((family (face-attribute 'default :family))
         (font-desc (format "%s-%s" family my/size)))
    (add-to-list 'default-frame-alist
                 (cons 'font font-desc)))

?  Not saying that's worth documenting, just hoping that'll help Dan
sort out his config.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-30  7:23               ` Kévin Le Gouguec
@ 2023-11-30  8:39                 ` Eli Zaretskii
  2023-12-02  3:16                   ` Dan Jacobson
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2023-11-30  8:39 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: 67449, jidanni

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: Dan Jacobson <jidanni@jidanni.org>,  67449@debbugs.gnu.org
> Date: Thu, 30 Nov 2023 08:23:00 +0100
> 
> > just specify the same font
> 
> but I can imagine wanting to keep the system's default _family_, yet
> have a consistent font _size_ across all my setups, in which case having
> to spell out the font in my dotfiles is a bother.

I don't see why it should be a bother.  That same node of the manual
says a bit later:

     To check what font you're currently using, the ‘C-u C-x =’ command
  can be helpful.  It describes the character at point, and names the font
  that it's rendered in.





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-11-30  8:39                 ` Eli Zaretskii
@ 2023-12-02  3:16                   ` Dan Jacobson
  2023-12-02  7:42                     ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Jacobson @ 2023-12-02  3:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67449, Kévin Le Gouguec

So the default size "10" must be buried in the C source code, and if
the user wants to change *it* they must recompile emacs.
Too bad.

P.S.,
$ emacs -Q -eval "(set-face-attribute 'default nil :height (* 18 6))"
tests great! (Except I found I needed to multiply any value I wanted by
six, in order to get that value. At least on a Chromebook.)





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

* bug#67449: Manual: add how to change default global font size in .emacs
  2023-12-02  3:16                   ` Dan Jacobson
@ 2023-12-02  7:42                     ` Eli Zaretskii
  0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2023-12-02  7:42 UTC (permalink / raw)
  To: Dan Jacobson; +Cc: 67449, kevin.legouguec

> Date: Sat, 02 Dec 2023 11:16:14 +0800
> From: Dan Jacobson <jidanni@jidanni.org>
> Cc: Kévin Le Gouguec <kevin.legouguec@gmail.com>,
>  67449@debbugs.gnu.org
> 
> So the default size "10" must be buried in the C source code, and if
> the user wants to change *it* they must recompile emacs.
> Too bad.

It isn't too bad, since the default size can be customized, as
explained by that section of the manual.

> $ emacs -Q -eval "(set-face-attribute 'default nil :height (* 18 6))"
> tests great! (Except I found I needed to multiply any value I wanted by
> six, in order to get that value. At least on a Chromebook.)

The section "Frame Parameters" explains how to do this for the init
file.  (The section "Fonts", which started this discussion, has a
hyper-link to "Frame Parameters".)





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

end of thread, other threads:[~2023-12-02  7:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-26  2:18 bug#67449: Manual: add how to change default global font size in .emacs Dan Jacobson
2023-11-26  5:50 ` Eli Zaretskii
2023-11-26 13:28   ` Dan Jacobson
2023-11-26 13:50     ` Eli Zaretskii
2023-11-26 20:55       ` Dan Jacobson
2023-11-27  3:27         ` Eli Zaretskii
2023-11-29  3:10           ` Dan Jacobson
2023-11-29 12:47             ` Eli Zaretskii
2023-11-30  7:23               ` Kévin Le Gouguec
2023-11-30  8:39                 ` Eli Zaretskii
2023-12-02  3:16                   ` Dan Jacobson
2023-12-02  7:42                     ` Eli Zaretskii

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.