emacs-devel
[Top][All Lists]
Advanced

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

Re: Problem in temp-buffer-resize-mode


From: martin rudalics
Subject: Re: Problem in temp-buffer-resize-mode
Date: Sat, 04 Aug 2007 10:45:11 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

>     In fact a test like
>
>        (=  (frame-width) (window-width))
>
>     is used quite frequently in Elisp code and may fail in all these cases
>     just as it did for you.  FWIW these tests should be replaced by calling
>     a function `window-full-width-p' (the function `display-buffer' uses to
>     check whether it should split the largest window).
>
> Would you like to make these fixes, then ack?  They should be fixed in
> Emacs 22, and will then get transferred to the trunk.

`window-full-width-p' is not available in Elisp yet, hence please
confirm whether we want to do this.  I attached the corresponding patch
for window.c, the patches for window.h and help.el are equally trivial.

This probably needs a Lisp Changes entry in NEWS like

*** New function `window-full-width-p'
returns t iff window is as wide as its frame.

and maybe an entry in the Elisp manual.

If you think we should do this, I'd install it simultaneously in Emacs
22 and the trunk.  This way I could merge in the fix to avoid windows
without modelines which at the moment is in the trunk only.
*** window.c    Thu Jul 26 07:28:00 2007
--- window.c    Sat Aug  4 10:32:54 2007
***************
*** 557,562 ****
--- 557,571 ----
    return make_number (window_box_text_cols (decode_any_window (window)));
  }
  
+ DEFUN ("window-full-width-p", Fwindow_full_width_p, Swindow_full_width_p, 0, 
1, 0,
+        doc: /* Return t if WINDOW is as wide as its frame.
+ WINDOW defaults to the selected window.  */)
+      (window)
+      Lisp_Object window;
+ {
+   return WINDOW_FULL_WIDTH_P (decode_any_window (window)) ? Qt : Qnil;
+ }
+ 
  DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
         doc: /* Return the number of columns by which WINDOW is scrolled from 
left margin.
  WINDOW defaults to the selected window.  */)
***************
*** 7515,7520 ****
--- 7524,7530 ----
    defsubr (&Swindow_buffer);
    defsubr (&Swindow_height);
    defsubr (&Swindow_width);
+   defsubr (&Swindow_full_width_p);
    defsubr (&Swindow_hscroll);
    defsubr (&Sset_window_hscroll);
    defsubr (&Swindow_redisplay_end_trigger);

reply via email to

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