bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14233: 24.3; Don't constrain frame size to character multiples


From: martin rudalics
Subject: bug#14233: 24.3; Don't constrain frame size to character multiples
Date: Mon, 29 Apr 2013 09:33:50 +0200

> Respecting the order means that it is clear - pretty much equivalent,
> presumably, to modifying one frame parameter at a time, in order.
>
> Whether you do that using (a) separate calls, in sequence, to single-parameter
> setting functions or (b) using one or more calls to a general setting function
> that accepts an alist (which is of course ordered), changes nothing, AFAICT.
>
> Either way, you still have to take into account any interdependence among
> parameters.

As someone who used this for the first time I'd be surely surprised if
interchanging the order of two alist elements would have any such
consequences.  But maybe `modify-frame-parameters' isn't intended for
less experienced users.

> 1. `set-frame-font' apparently has this side effect, which is not appropriate
> here:
>
>   Also, if FRAME is non-nil,
>   alter the user's Customization settings as though the
>   font-related attributes of the `default' face had been "set in
>   this session", so that the font is applied to future frames.
>
> (It should say FRAMES, not FRAME, BTW.)
>
> Why does `set-frame-font' not allow you to change the font for a given frame
> (besides the selected frame), without also changing face `default' for future
> frames?

Maybe because they would tell you to select the frame first and then
call it with FRAME nil.

> Interestingly, in Emacs 20 (and in 21 it was essentially the same),
> `set-frame-font' just used `modify-frame-parameters' - very clear and simple:
>
> (defun set-frame-font (font-name)
>   "Set the font of the selected frame to FONT.
> When called interactively, prompt for the name of the font to use.
> To get the frame's current default font, use `frame-parameters'."
>   (interactive "sFont name: ")
>   (modify-frame-parameters (selected-frame)
>                       (list (cons 'font font-name)))
>   (frame-update-faces (selected-frame)))
>
> ;; And `frame-update-faces' was a no-op (obsolete in Emacs 21):
> (defun frame-update-faces (frame) nil)
>
> Nowadays, `set-frame-font' is an incomprehensible monster.

IMO `modify-frame-parameters' should keep the frame size and everything
else unchanged when changing the font.  Changing the appearance of
scrollbars, fringes and sizes or the appearance of future frames should
be done on top of that, for example, by `set-frame-font' albeit in a
more transparent fashion than currently.

> 2. `modify-frame-parameters' is the basic, general, workhorse function for
> frames.  It lets you set any number of frame parameters in any order.  Yes, I
> would very much like it to continue working in the same, straightforward 
manner,
> including for parameter `font'.

When setting one frame parameter can implicitly change another one, I
wouldn't consider that as "straightforward".  But since I never tried to
customize my emacs in this area I trust you.  Maybe someone who both
uses frame parameters and knows how they should work can eventually fix
the problems in this area then.

martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]