From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: shell-command-on-region fooled by long lines Date: Thu, 02 Feb 2006 09:49:36 -0700 Message-ID: References: <87mzhchqqf.fsf@jidanni.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1138908587 20114 80.91.229.2 (2 Feb 2006 19:29:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Feb 2006 19:29:47 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 02 20:29:43 2006 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F4k8v-0001hS-TU for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Feb 2006 20:29:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F4kC2-0007Hn-NQ for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Feb 2006 14:32:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F4iF8-0006n2-2l for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2006 12:27:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F4iF5-0006lh-35 for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2006 12:27:37 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F4hlz-0003QE-3h for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2006 11:57:31 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F4hkq-0002qN-I7 for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2006 11:56:20 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1F4hgv-00048J-3I for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2006 17:52:17 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Feb 2006 17:52:17 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Feb 2006 17:52:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: bug-gnu-emacs@gnu.org Original-Lines: 37 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:14770 Archived-At: 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 * 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