unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Problem in temp-buffer-resize-mode
       [not found] ` <46B1AFC4.2080700@gmx.at>
@ 2007-08-02 23:42   ` Richard Stallman
  2007-08-04  8:45     ` martin rudalics
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Stallman @ 2007-08-02 23:42 UTC (permalink / raw)
  To: martin rudalics; +Cc: eli, emacs-devel

    Thanks for reporting this bug.  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.

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

* Re: Problem in temp-buffer-resize-mode
  2007-08-02 23:42   ` Problem in temp-buffer-resize-mode Richard Stallman
@ 2007-08-04  8:45     ` martin rudalics
  0 siblings, 0 replies; 2+ messages in thread
From: martin rudalics @ 2007-08-04  8:45 UTC (permalink / raw)
  To: rms; +Cc: eli, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

 >     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.

[-- Attachment #2: window.c.patch --]
[-- Type: text/plain, Size: 1035 bytes --]

*** 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);

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

end of thread, other threads:[~2007-08-04  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <18097.25736.3076.918330@kinyarwanda.ccs.neu.edu>
     [not found] ` <46B1AFC4.2080700@gmx.at>
2007-08-02 23:42   ` Problem in temp-buffer-resize-mode Richard Stallman
2007-08-04  8:45     ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).