all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Emre Yolcu <mail@emreyolcu.com>
Cc: 71085@debbugs.gnu.org
Subject: bug#71085: text-scale-adjust does not adjust margin width
Date: Tue, 21 May 2024 21:17:37 +0300	[thread overview]
Message-ID: <86ed9v81xa.fsf@gnu.org> (raw)
In-Reply-To: <c9163847-ba87-4fe8-8297-5d2b986466e8@emreyolcu.com> (message from Emre Yolcu on Tue, 21 May 2024 12:14:41 -0400)

> Date: Tue, 21 May 2024 12:14:41 -0400
> Cc: 71085@debbugs.gnu.org
> From: Emre Yolcu <mail@emreyolcu.com>
> 
> Eli Zaretskii wrote:
> > I don't understand the expectations: the window and frame geometry are
> > not changed by text-scale-adjust, so why did you expect the window
> > margins to change?  The margins are part of the window geometry.
> I was not thinking of the margins as part of the window geometry but as 
> a special part of the buffer that we set aside and do not interact with. 

Well, but the fact is the margins _are_ part of the window geometry.
And window geometry doesn't change when text size is scaled.  So this
is a de-facto behavior Emacs had for several releases now, and we must
preserve it.

> This is partly because the margins display text, the height of which is 
> affected by text-scale-adjust, and partly because there is no visual 
> separation between the margin and the buffer (assuming fringes are 
> disabled). For comparison, the mode line also displays text, but it has 
> its own face and its text size is not affected by text-scale-adjust (as 
> one would expect). The fringe also has its own face, as do all of the 
> other things that I would consider to be part of the window geometry, 
> but there is no "margin" face. (I am aware that we can affect its 
> display to some degree by propertizing the text in it.)

I see no reason to introduce yet another face.  Most stuff displayed
in the margin doesn't need to be resized, so modes who write some
large enough text there can use a special face as I demonstrated.

> > The above is inaccurate: the text shown in the margin can have its own
> > distinct face.  For example, try this in "emacs -Q":
> >
> >    M-x font-lock-mode RET
> >    M-<
> >    M-: (set-window-margins nil 4 4) RET
> >    M-: (add-text-properties (point) (1+ (point)) (list 'display (list '(margin left-margin) (propertize "FOO" 'face 'warning)))) RET
> >
> > You will see the string "FOO" displayed in the margin with a distinct
> > face.  You could define this face to have an absolute :height
> > attribute, in which case the text in the margin will not scale, and
> > thus will not be clipped when you use text-size-adjust.  So there _is_
> > in fact a way to work around, even if you don't want to use
> > global-text-scale-adjust-resizes-frames and the globalized
> > text-scaling.
> I didn't mean to imply that we cannot affect the appearance of the text 
> displayed in the margins in any way, but simply that there is no 
> "margin" face that a user can modify via, for instance, 
> custom-set-faces. The workaround that you suggested requires the user to 
> patch every single package that displays text in the margins, which is 
> less than ideal.

Not "every package", because not every package has these problems.
But yes, packages that want the text in the margins to remain visible
even when the text is significantly resized need to define a special
face for the margin.  I see no problem here, since this is on a
per-package basis.

> A much nicer workaround would be possible if there 
> existed a "margin" face: text-scale-mode could simply remap it as it 
> does the default face.

Actually, you want a face that will _not_ be remapped, since you want
to make sure the text in the margins will not get clipped.  The
current behavior is that by default the text in the margin is already
remapped, which is why it can get clipped if it becomes too wide.

> > I see no bug here.
> Fair enough. Please consider it a feature request for a "margin" face 

I don't see a need for it, sorry.





  reply	other threads:[~2024-05-21 18:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20 22:50 bug#71085: text-scale-adjust does not adjust margin width Emre Yolcu
2024-05-21 11:38 ` Eli Zaretskii
2024-05-21 16:14   ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-21 16:14   ` Emre Yolcu
2024-05-21 18:17     ` Eli Zaretskii [this message]
2024-05-21 20:10       ` Emre Yolcu
2024-05-22 12:03         ` Eli Zaretskii
2024-05-22 17:05           ` Emre Yolcu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ed9v81xa.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71085@debbugs.gnu.org \
    --cc=mail@emreyolcu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.