GNU bug report logs - #8379
The width of linum window is not adjusted after face-remapping

Previous Next

Package: emacs;

Reported by: nixie <onixie <at> gmail.com>

Date: Wed, 30 Mar 2011 01:49:02 UTC

Severity: normal

Merged with 1255, 10960

Fixed in version 25.1

Done: Alan J Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8379 in the body.
You can then email your comments to 8379 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Wed, 30 Mar 2011 01:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to nixie <onixie <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 30 Mar 2011 01:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: nixie <onixie <at> gmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: The width of linum window is not adjusted after face-remapping
Date: Wed, 30 Mar 2011 10:43:49 +0900
Hi,

I am green hand in emacs, and starting using GNU Emacs since 23.1.

I found that the width of linum window is not changed with
(text-scale-increase) or (text-scale-decrease) function. 
This is annoying especially when I increase the text size, because the
line number can not be fully viewed.

currently, I use some alleviating code like below to solve this problem.
But I think it does not have generality.

Does someone have any good suggestion on it? Or it can be solved in a
more elegant and general way. I wish that it would be solved in future
version of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun rescale-window-margin-by-faceremapping (win)
  (let ((width (car (window-margins)))
	(scale (cadr (assoc ':height 
			    (assoc 'default 
				   face-remapping-alist)))))
    (if (numberp scale)
	(progn
	  (set-window-margins win (ceiling (* width scale)) (cdr
(window-margins win)))
	  (force-window-update))
      nil)))

(defadvice linum-update-window (after scaling-margin-width last (win)
activate)
  (rescale-window-margin-by-faceremapping win)
  ad-return-value)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Thanks for any help.


-- 
nixie <onixie <at> gmail.com>





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Wed, 30 Mar 2011 02:20:02 GMT) Full text and rfc822 format available.

Message #8 received at 8379 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'nixie'" <onixie <at> gmail.com>, <8379 <at> debbugs.gnu.org>
Subject: RE: bug#8379: The width of linum window is not adjusted
	afterface-remapping
Date: Tue, 29 Mar 2011 19:18:56 -0700
> I found that the width of linum window is not changed with
> (text-scale-increase) or (text-scale-decrease) function. 
> This is annoying especially when I increase the text size, because the
> line number can not be fully viewed.

Yes, indeed.
http://www.emacswiki.org/emacs/face-remap%2b.el





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Wed, 30 Mar 2011 10:41:01 GMT) Full text and rfc822 format available.

Message #11 received at 8379 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: nixie <onixie <at> gmail.com>
Cc: 8379 <at> debbugs.gnu.org
Subject: Re: bug#8379: The width of linum window is not adjusted after
	face-remapping
Date: Wed, 30 Mar 2011 12:39:16 +0200
forcemerge 1255 8379
thanks

> I found that the width of linum window is not changed with
> (text-scale-increase) or (text-scale-decrease) function.

This is bug#1255: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1255

    Juanma




Forcibly Merged 1255 8379. Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 30 Mar 2011 10:41:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Wed, 30 Mar 2011 13:20:03 GMT) Full text and rfc822 format available.

Message #16 received at 8379 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Juanma Barranquero'" <lekktu <at> gmail.com>, "'nixie'" <onixie <at> gmail.com>
Cc: 8379 <at> debbugs.gnu.org
Subject: RE: bug#8379: The width of linum window is not adjusted
	afterface-remapping
Date: Wed, 30 Mar 2011 06:19:39 -0700
> > I found that the width of linum window is not changed with
> > (text-scale-increase) or (text-scale-decrease) function.
> 
> This is bug#1255: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1255

Well if Emacs Dev now recognizes that this is a bug or a missing feature (Stefan
called the _lack_ of window resizing for text scaling "one of its greatest
features"), there's a simple solution.  I proposed it as soon as text scaling
was introduced, but it wasn't adopted.

http://www.emacswiki.org/emacs/face-remap%2b.el

This provides an option that allows for automatic resizing of the window, to go
along with text resizing.  That puts the behavior under user control.  The
window resizing can be: none, horizontal, vertical, or both.

And any function or mode (e.g. linum-mode) that needs a particular type of
window resizing can obviously bind or set the value locally.

This is a trivial fix.  It would be good if Emacs Dev gives users the choice.
Here is the original thread, with a patch:
http://lists.gnu.org/archive/html/emacs-devel/2009-08/msg00414.html





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Wed, 30 Mar 2011 13:55:01 GMT) Full text and rfc822 format available.

Message #19 received at 8379 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: nixie <onixie <at> gmail.com>, 8379 <at> debbugs.gnu.org
Subject: Re: bug#8379: The width of linum window is not adjusted
	afterface-remapping
Date: Wed, 30 Mar 2011 15:53:39 +0200
On Wed, Mar 30, 2011 at 15:19, Drew Adams <drew.adams <at> oracle.com> wrote:

> Well if Emacs Dev now recognizes that this is a bug or a missing feature

It is filed as a bug, that does not mean we all agree about its status.

> (Stefan
> called the _lack_ of window resizing for text scaling "one of its greatest
> features"),

Yes, but, if I'm reading correctly the old thread, he didn't say that
there wasn't a bug, only that the bug is not in text scaling, but in
applications (like linum) that can be affected for it and do not plan
accordingly.

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Thu, 31 Mar 2011 09:36:01 GMT) Full text and rfc822 format available.

Message #22 received at 8379 <at> debbugs.gnu.org (full text, mbox):

From: nixie <onixie <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 8379 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#8379: The width of linum window is not adjusted
	afterface-remapping
Date: Thu, 31 Mar 2011 18:31:59 +0900
> forcemerge 1255 8379
> thanks

>> I found that the width of linum window is not changed with
>> (text-scale-increase) or (text-scale-decrease) function.

> This is bug#1255: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1255

Sorry for not kindly reading the threads archives.

> Yes, but, if I'm reading correctly the old thread, he didn't say that
> there wasn't a bug, only that the bug is not in text scaling, but in
> applications (like linum) that can be affected for it and do not plan
> accordingly.
> 
>     Juanma

yes, i think it is not a bug in text scaling. But i don't think fix it
in applications (maybe not only the linum) is a good idea. 

I wonder if there is a pure and smart window adjusting function.


-- 
nixie <onixie <at> gmail.com>





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Thu, 31 Mar 2011 13:23:02 GMT) Full text and rfc822 format available.

Message #25 received at 8379 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'nixie'" <onixie <at> gmail.com>, "'Juanma Barranquero'" <lekktu <at> gmail.com>
Cc: 8379 <at> debbugs.gnu.org
Subject: RE: bug#8379: The width of linum window is not adjusted
	afterface-remapping
Date: Thu, 31 Mar 2011 06:22:35 -0700
> I wonder if there is a pure and smart window adjusting function.

Did you look at face-remap+.el?  In what way does it not adjust the window as
needed?





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Thu, 31 Mar 2011 14:41:02 GMT) Full text and rfc822 format available.

Message #28 received at 8379 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: nixie <onixie <at> gmail.com>
Cc: 8379 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#8379: The width of linum window is not adjusted
	afterface-remapping
Date: Thu, 31 Mar 2011 16:40:01 +0200
On Thu, Mar 31, 2011 at 11:31, nixie <onixie <at> gmail.com> wrote:

> Sorry for not kindly reading the threads archives.

No problem. It is often hard to find the relevant bug. In this case, I
remembered the old one because I was involved.

> yes, i think it is not a bug in text scaling. But i don't think fix it
> in applications (maybe not only the linum) is a good idea.

I'm not really sure. On one hand, it seems like text scaling should
affect all the window (margins, etc.). On the other hand, I understand
Stefan's comment that that's not what text-scaling is supposed to do.

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Thu, 31 Mar 2011 14:49:01 GMT) Full text and rfc822 format available.

Message #31 received at 8379 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Juanma Barranquero'" <lekktu <at> gmail.com>, "'nixie'" <onixie <at> gmail.com>
Cc: 8379 <at> debbugs.gnu.org
Subject: RE: bug#8379: The width of linum window is not adjusted
	afterface-remapping
Date: Thu, 31 Mar 2011 07:48:04 -0700
> > yes, i think it is not a bug in text scaling. But i don't 
> > think fix it in applications (maybe not only the linum)
> > is a good idea.
> 
> I'm not really sure. On one hand, it seems like text scaling should
> affect all the window (margins, etc.). On the other hand, I understand
> Stefan's comment that that's not what text-scaling is supposed to do.

There is no right or wrong answer wrt affecting the window that applies to all
contexts.  The behavior wrt the window should be under user and program control.
Sometimes you want the window to be resized to adapt to the apparent text size
change; sometimes you do not.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8379; Package emacs. (Thu, 31 Mar 2011 15:03:01 GMT) Full text and rfc822 format available.

Message #34 received at 8379 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: nixie <onixie <at> gmail.com>, 8379 <at> debbugs.gnu.org
Subject: Re: bug#8379: The width of linum window is not adjusted
	afterface-remapping
Date: Thu, 31 Mar 2011 16:54:30 +0200
On Thu, Mar 31, 2011 at 16:48, Drew Adams <drew.adams <at> oracle.com> wrote:

> There is no right or wrong answer wrt affecting the window that applies to all
> contexts.  The behavior wrt the window should be under user and program control.
> Sometimes you want the window to be resized to adapt to the apparent text size
> change; sometimes you do not.

You're right that there's no right or wrong answer. What I meant is
that I don't know if what you call "program control" should be the
responsibility of the text-scaling code (with suitable hooks to allow
customization), or it's better to leave it as it is and let the
applications (like linum.el) adapt to a possible rescaling.

As it is now, an application has no way to know that the text in the
buffer is shown rescaled/remaped, unless it periodically checks
`face-remapping-alist', because remapping does not *have* to go
through face-remap-* functions, so there's no hook or callback.

    Juanma




Merged 1255 8379 10960. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 06 Mar 2012 17:11:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.1, send any further explanations to 1255 <at> debbugs.gnu.org and Stephen Berman <stephen.berman <at> gmx.net> Request was from Alan J Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Sun, 10 Jan 2016 20:17:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Feb 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 130 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.