List Info

Thread: proposal tiny cleanup for window code




proposal tiny cleanup for window code
country flaguser name
Russian Federation
2007-11-07 04:58:03
I've found that too_small_ok member of struct window isn't
used anywhere except size_window,
so it looks like there are no reasons to have too_small_ok
within struct window...

Dmitry


_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel
  
Re: proposal tiny cleanup for window code
country flaguser name
Austria
2007-11-07 06:57:01
 > I've found that too_small_ok member of struct window
isn't used anywhere
 > except size_window,
 > so it looks like there are no reasons to have
too_small_ok within struct
 > window...

I fail to understand the use of that but the current code
reads as

   if (old_size < min_size && nodelete_p != 2)
     w->too_small_ok = Qt;

   /* Move the following test here since otherwise the
      preceding test doesn't make sense.  martin. */
   if (nodelete_p == 2)
     nodelete_p = 0;

   /* Maybe delete WINDOW if it's too small.  */
   if (nodelete_p != 1 && !NILP (w->parent))
     {
       if (!MINI_WINDOW_P (w) && !NILP
(w->too_small_ok))

hence too_small_ok is never set to t when nodelete_p
initially equals 2.
With your change this becomes

   /* Move the following test here since otherwise the
      preceding test doesn't make sense.  martin. */
   if (nodelete_p == 2)
     nodelete_p = 0;

   /* Maybe delete WINDOW if it's too small.  */
   if (nodelete_p != 1 && !NILP (w->parent))
     {
       if (!MINI_WINDOW_P (w) && old_size <
min_size && nodelete_p != 2)

hence (the "implied") too_small_ok can be set to t
when nodelete_p
initially equals 2 and your version is not semantically
equivalent to
the previous one.  Please verify again.



_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel

Re: proposal tiny cleanup for window code
country flaguser name
Russian Federation
2007-11-07 07:32:22
martin rudalics wrote:

> hence (the "implied") too_small_ok can be set
to t when nodelete_p
> initially equals 2 and your version is not semantically
equivalent to
> the previous one.  Please verify again.

Argh, you're right. But, it still should be enough to make
too_small_ok
local instead of a member of struct window...

Dmitry


_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel
  
Re: proposal tiny cleanup for window code
country flaguser name
Austria
2007-11-07 09:38:18
> Argh, you're right. But, it still should be enough to
make too_small_ok
> local instead of a member of struct window...

OK.  But did you understand what the code does?  Is that
test
needed at all?  IIRC it was dead until I reshuffled it a
couple
of months ago.



_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )