From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Greg Minshall Newsgroups: gmane.emacs.devel Subject: Re: unsolicited patch to image-mode.el -- "fit to window" Date: Fri, 24 Jul 2015 06:46:28 +0300 Message-ID: <38598.1437709588@greg-minshalls-mbp.local> References: <55B131CB.6060905@gmx.at> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1437709637 14092 80.91.229.3 (24 Jul 2015 03:47:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jul 2015 03:47:17 +0000 (UTC) Cc: emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 24 05:47:08 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZITwy-0000Q8-04 for ged-emacs-devel@m.gmane.org; Fri, 24 Jul 2015 05:47:08 +0200 Original-Received: from localhost ([::1]:43484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZITwx-0005xa-3s for ged-emacs-devel@m.gmane.org; Thu, 23 Jul 2015 23:47:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZITwN-0005R6-U7 for emacs-devel@gnu.org; Thu, 23 Jul 2015 23:46:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZITwI-0000pN-LN for emacs-devel@gnu.org; Thu, 23 Jul 2015 23:46:31 -0400 Original-Received: from relay01.pair.com ([209.68.5.15]:1370) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZITwI-0000oC-FZ for emacs-devel@gnu.org; Thu, 23 Jul 2015 23:46:26 -0400 Original-Received: (qmail 99078 invoked by uid 0); 24 Jul 2015 03:46:25 -0000 Original-Received: from 85.103.9.210 (HELO gregair.cliq.com) (85.103.9.210) by relay01.pair.com with SMTP; 24 Jul 2015 03:46:25 -0000 X-pair-Authenticated: 85.103.9.210 Original-Received: from greg-minshalls-mbp.local (localhost [127.0.0.1]) by gregair.cliq.com (Postfix) with ESMTP id 1042E9090559; Fri, 24 Jul 2015 06:46:29 +0300 (EEST) In-reply-to: Your message of "Thu, 23 Jul 2015 20:26:19 +0200." <55B131CB.6060905@gmx.at> X-Mailer: MH-E 8.5; nmh 1.5; GNU Emacs 24.5.50 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.68.5.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188042 Archived-At: Martin, > + (wpixels (window-inside-pixel-edges)) > + (wsize (cons (- (nth 2 wpixels) (nth 0 wpixels)) > + (- (nth 3 wpixels) (nth 1 wpixels)))) ; ditto > > Hopefully you should be able to replace this with > > + (wsize (cons (window-body-width nil t) (window-body-height nil t)) thanks, that's much clearer. a "coding philosophy" question, though. there are a dozen or so other references to (window-size-pixel-edges) (and its associated (nth)'s) in the code. my tendency would be to change none (in a patch) or all (in a more substantive re-write). changing all -- while "trivial" -- is, of course, more likely to introduce bug, and i don't know of any test suite for image mode? thoughts? cheers, Greg Minshall