From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: `fit-window-to-buffer-as-displayed'? Date: Tue, 11 Jan 2011 00:30:44 -0500 Message-ID: References: <365C578E37C14DC9AA3982C625EFC32E@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1294723861 14348 80.91.229.12 (11 Jan 2011 05:31:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 11 Jan 2011 05:31:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 11 06:30:57 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PcWoo-0003kE-GN for ged-emacs-devel@m.gmane.org; Tue, 11 Jan 2011 06:30:54 +0100 Original-Received: from localhost ([127.0.0.1]:48050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcWon-0006RA-Uf for ged-emacs-devel@m.gmane.org; Tue, 11 Jan 2011 00:30:53 -0500 Original-Received: from [140.186.70.92] (port=36364 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcWoh-0006R5-P4 for emacs-devel@gnu.org; Tue, 11 Jan 2011 00:30:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcWog-0007EK-Nw for emacs-devel@gnu.org; Tue, 11 Jan 2011 00:30:47 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:6260 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcWog-0007ED-Hb for emacs-devel@gnu.org; Tue, 11 Jan 2011 00:30:46 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAON5K01FxIbi/2dsb2JhbACkN3S7N4VMBIRnjiQ X-IronPort-AV: E=Sophos;i="4.60,305,1291611600"; d="scan'208";a="87591024" Original-Received: from 69-196-134-226.dsl.teksavvy.com (HELO ceviche.home) ([69.196.134.226]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 11 Jan 2011 00:30:45 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 825BD660DC; Tue, 11 Jan 2011 00:30:44 -0500 (EST) In-Reply-To: <365C578E37C14DC9AA3982C625EFC32E@us.oracle.com> (Drew Adams's message of "Mon, 10 Jan 2011 16:35:01 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:134431 Archived-At: >> At the time fit-window-to-buffer-as-displayed is called, the >> text might not be completely displayed yet. > Well obviously one would call `fit-window-to-buffer-as-displayed' only after > (one knew that) it was displayed. ;-) And how do you know and/or make sure it's *completely* displayed? > And if it were called when not displayed then, in that situation, we could > either have it be a no-op or have it do what `fit-window-to-buffer' does now. But fit-window-to-buffer doesn't work right in many cases, so that'd not be a complete solution. > That means that you interpret `fit-window-to-buffer' as though it should > _always_ fit the window to the buffer _as displayed_. Yes. > I think there can be use cases for its current behavior. And use > cases for just fitting to the buffer text, ignoring all display > considerations (treating it as plain, fixed-width text, no more). Maybe there can be, but I can't think of any of them, so I think they'd be very far fetched and insignificant. > I probably have nothing to offer wrt the implementation. I do think > though that this is bound to be somewhat complex and success is likely > to be partial and conditional (works for some display artifacts in > some situations, but is not perfect). There are a lot of different > things one can do with display, even just counting the `display' > text/overlay property. (And note that some of them take place beyond > buffer positions, so tests involving (point) won't necessarily cut > the mustard.) There's no point trying to add support for some properties but not all: adding support for all properties is likely to be easier because it'd rely on (re)using the existing display code. Stefan