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

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

Re: shell-command-on-region fooled by long lines


From: Kevin Rodgers
Subject: Re: shell-command-on-region fooled by long lines
Date: Thu, 02 Feb 2006 09:49:36 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Kevin Rodgers wrote:
> Here's an experimental version of display-message-or-buffer that counts
> display lines by comparing each line length to the frame width.  It
> tries to do so efficiently for both empty messages and large messages,
> like the original:

Thanks to the clue posted by Sam Owre in a subsequent thread, this is
all that's needed:

2006-02-02  Kevin Rodgers  <address@hidden>

        * simple.el (display-message-or-buffer): Count screen lines
        instead of buffer lines when determining whether the message
        will fit in the echo area/minibuffer window.

*** simple.el~  Thu Feb  2 09:31:34 2006
--- simple.el   Thu Feb  2 09:35:18 2006
***************
*** 1922,1928 ****
           (let ((lines
                  (if (= (buffer-size) 0)
                      0
!                   (count-lines (point-min) (point-max)))))
             (cond ((= lines 0))
                   ((and (or (<= lines 1)
                             (<= lines
--- 1922,1928 ----
           (let ((lines
                  (if (= (buffer-size) 0)
                      0
!                   (count-screen-lines nil nil t (minibuffer-window)))))
             (cond ((= lines 0))
                   ((and (or (<= lines 1)
                             (<= lines

--
Kevin Rodgers





reply via email to

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