all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Problem with modeline and window margins
@ 2005-01-20 10:41 Chong Yidong
  2005-01-20 13:06 ` Kim F. Storm
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2005-01-20 10:41 UTC (permalink / raw)


Regarding the following item from FOR_RELEASE:

> ** Problem with modeline and window margins:
>
> The mode line's right "box" line is misplaced under the right margin,
> rather than at the right window edge.
>
> emacs -Q
> (set-window-margins nil 25 25)
> C-x 2

The problem seems to be that x_draw_glyph_string_box finds the right-hand
edge of the box by calling window_box_right. However, the value returned
by window_box_right stops at the right margin (see the definition of
window_box_width.)

The following patch for xterm.c seems to fix the bug, but someone ought to
check it. The corresponding patches for w32term.c and macterm.c are
straightforward.


--- xterm.c     Thu Jan 20 18:37:15 2005
+++ xterm.c~    Thu Jan 20 18:26:16 2005
@@ -2131,18 +2131,14 @@
   if (s->row->full_width_p
       && !s->w->pseudo_window_p)
     {
       last_x += WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w);
       if (s->area != RIGHT_MARGIN_AREA
          || WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w))
        last_x += WINDOW_RIGHT_FRINGE_WIDTH (s->w);
-      /* window_box_right excludes the right margin, so we add it. */
-      if (INTEGERP (s->w->right_margin_cols))
-        last_x += XFASTINT (s->w->left_margin_cols)
-          * WINDOW_FRAME_COLUMN_WIDTH (s->w);
     }

   /* The glyph that may have a right box line.  */
   last_glyph = (s->cmp || s->img
                ? s->first_glyph
                : s->first_glyph + s->nchars - 1);

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

* Re: Problem with modeline and window margins
  2005-01-20 10:41 Problem with modeline and window margins Chong Yidong
@ 2005-01-20 13:06 ` Kim F. Storm
  2005-01-20 14:42   ` Chong Yidong
  0 siblings, 1 reply; 4+ messages in thread
From: Kim F. Storm @ 2005-01-20 13:06 UTC (permalink / raw)
  Cc: emacs-devel

"Chong Yidong" <cyd@stupidchicken.com> writes:

> Regarding the following item from FOR_RELEASE:
>
>> ** Problem with modeline and window margins:
>>
>> The mode line's right "box" line is misplaced under the right margin,
>> rather than at the right window edge.
>>
>> emacs -Q
>> (set-window-margins nil 25 25)
>> C-x 2
>
> The problem seems to be that x_draw_glyph_string_box finds the right-hand
> edge of the box by calling window_box_right. However, the value returned
> by window_box_right stops at the right margin (see the definition of
> window_box_width.)

Thank you very much for tracking this down -- it has been bugging me for a while.

Your patch looks ok, but I think it can be done simpler.  Can you try this
patch instead:

*** xterm.c	01 Jan 2005 13:35:03 +0100	1.855
--- xterm.c	20 Jan 2005 13:56:13 +0100	
***************
*** 2127,2141 ****
    struct glyph *last_glyph;
    XRectangle clip_rect;
  
-   last_x = window_box_right (s->w, s->area);
    if (s->row->full_width_p
        && !s->w->pseudo_window_p)
!     {
!       last_x += WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w);
!       if (s->area != RIGHT_MARGIN_AREA
! 	  || WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w))
! 	last_x += WINDOW_RIGHT_FRINGE_WIDTH (s->w);
!     }
  
    /* The glyph that may have a right box line.  */
    last_glyph = (s->cmp || s->img
--- 2127,2137 ----
    struct glyph *last_glyph;
    XRectangle clip_rect;
  
    if (s->row->full_width_p
        && !s->w->pseudo_window_p)
!     last_x = WINDOW_RIGHT_EDGE_X (s->w);
!   else
!     last_x = window_box_right (s->w, s->area);
  
    /* The glyph that may have a right box line.  */
    last_glyph = (s->cmp || s->img


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Problem with modeline and window margins
  2005-01-20 13:06 ` Kim F. Storm
@ 2005-01-20 14:42   ` Chong Yidong
  2005-01-21 20:09     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2005-01-20 14:42 UTC (permalink / raw)
  Cc: Kim F. Storm

"Kim F. Storm" <storm@cua.dk> writes:

>> The problem seems to be that x_draw_glyph_string_box finds the
>> right-hand edge of the box by calling window_box_right. However, the
>> value returned by window_box_right stops at the right margin (see the
>> definition of window_box_width.)
>
> Thank you very much for tracking this down -- it has been bugging me for a
> while.
>
> Your patch looks ok, but I think it can be done simpler.  Can you try this
> patch instead:

Your patch indeed fixes the bug, and it is much more correct. Glad to have
helped. I just hope it's contributed to the 21.4 release, which seems to
be dragging somewhat.

Incidentally, are there any other bugs that should be in FOR-RELEASE? All
the remaining items I see in there are either GTK related, not
reproducible, or strangely inconsequential ("Make Rmail find the best
version of movemail"??)

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

* Re: Problem with modeline and window margins
  2005-01-20 14:42   ` Chong Yidong
@ 2005-01-21 20:09     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2005-01-21 20:09 UTC (permalink / raw)
  Cc: storm, emacs-devel

    reproducible, or strangely inconsequential ("Make Rmail find the best
    version of movemail"??)

That is an important change, but it was installed on Jan 15,
so I will delete it from FOR-RELEASE.

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

end of thread, other threads:[~2005-01-21 20:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-20 10:41 Problem with modeline and window margins Chong Yidong
2005-01-20 13:06 ` Kim F. Storm
2005-01-20 14:42   ` Chong Yidong
2005-01-21 20:09     ` Richard Stallman

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.