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

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

bug#35062: [PATCH 0/4] Trivial code cleanups


From: Robert Pluim
Subject: bug#35062: [PATCH 0/4] Trivial code cleanups
Date: Mon, 01 Apr 2019 17:04:52 +0200

>>>>> On Mon, 01 Apr 2019 17:34:46 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Robert Pluim <rpluim@gmail.com> Cc: Konstantin Kharlamov
    >> <Hi-Angel@yandex.ru>, 35062@debbugs.gnu.org Date: Mon, 01 Apr
    >> 2019 15:27:59 +0200
    >> 
    >> Iʼd prefer it if the effort went to determining if eg the alert
    >> for 'type = 2' below was correct or not

    Eli> Isn't it clear?

No, because you had to do your analysis below first to see if using '=='
changed the meaning of the code.

    Eli> Btw, AFAICT, that function is _always_ called with type == 2
    Eli> in xterm.c, never with any other value.  Only its other
    Eli> implementations can be called with a different value of TYPE.

BTW, the w32term.c implementation has the same typo :-)

Perhaps we can just delete most of that condition (I canʼt test at the
moment, my X11 machine is down).

diff --git a/src/xterm.c b/src/xterm.c
index f90d6713b0..a52f2c0862 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5342,10 +5342,7 @@ x_window_to_scroll_bar (Display *display, Window 
window_id, int type)
                               ! NILP (bar));
           bar = XSCROLL_BAR (bar)->next)
        if (XSCROLL_BAR (bar)->x_window == window_id
-            && FRAME_X_DISPLAY (XFRAME (frame)) == display
-           && (type = 2
-               || (type == 1 && XSCROLL_BAR (bar)->horizontal)
-               || (type == 0 && !XSCROLL_BAR (bar)->horizontal)))
+            && FRAME_X_DISPLAY (XFRAME (frame)) == display)
          return XSCROLL_BAR (bar);
     }
 





reply via email to

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