From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rahguzar Newsgroups: gmane.emacs.help Subject: Re: `window-absolute-pixel-position' with vscroll Date: Wed, 21 Jun 2023 22:42:22 +0200 Message-ID: <87zg4secdn.fsf@zohomail.eu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35474"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.3; emacs 29.0.91 Cc: help-gnu-emacs@gnu.org To: eliz@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 22 07:46:31 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qCD9L-00093Z-5Z for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Jun 2023 07:46:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCD8s-0003SG-5i; Thu, 22 Jun 2023 01:46:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qC5Ks-000690-KV for help-gnu-emacs@gnu.org; Wed, 21 Jun 2023 17:25:54 -0400 Original-Received: from sender11-pp-o91.zoho.eu ([31.186.226.249]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qC5Kq-0007nv-9Z; Wed, 21 Jun 2023 17:25:54 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1687382744; cv=none; d=zohomail.eu; s=zohoarc; b=kJ/6yYwzIYhqk8Vuv2HIi1Lv05yAICGrhI7MH0oo5NstCDlkINIC/AWQ6lh6mToHQWFkaIxK10gnjF4qUQX3+bg0APPBkOHuvhbgnhb3hfWdg2rswk5nbtzPFCkKsdr6tduEYYHBKYTfnc3dJi8RUSzGI1kOHeMiv5UJAVwJrtI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1687382744; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:Subject:To; bh=Ai7UnF9M9uwF3qmXLFFE6F6GeThcrMsXnhTiSATm9P8=; b=Dwhjs5KPp59Zmg9Tnfwibnk//mD82EKPGk8OLRiKrJ6pGqDcj0iCkqI9CPaoxC3TiHZUqYsYNYI8FiU3+OYEr738vVac0o3LQ6lgn2VpmD/keJrLbxiNk3w8EMnPL8BRxy+RvoSHh6wCoI3t7Gl1YOAx/iA+tYqTXQATe0vmLPQ= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=zohomail.eu; spf=pass smtp.mailfrom=rahguzar@zohomail.eu; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1687382744; s=zoho; d=zohomail.eu; i=rahguzar@zohomail.eu; h=From:From:To:To:Subject:Subject:In-Reply-To:Date:Date:CC:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To:Cc; bh=Ai7UnF9M9uwF3qmXLFFE6F6GeThcrMsXnhTiSATm9P8=; b=UJgTslHIXvT5ReHK04unNZsIysL09gnYJCih9+X4Icg6bTpzQfnRlA3gdsLuh/8W FOXqNL9Pyxi2eiq0k8pluSN02mQgICUKKi8PSOIzFYO8SYbzjiCvsnVBhInX2N73P+s YaR5A5Frl7WloPyFJCI+S9muPp/v13RkpLbP1KFg= Original-Received: from localhost (81-231-79-170-no600.tbcn.telia.com [81.231.79.170]) by mx.zoho.eu with SMTPS id 1687382742703619.7061638294249; Wed, 21 Jun 2023 23:25:42 +0200 (CEST) In-Reply-To: 831qi5569c.fsf@gnu.org X-ZohoMailClient: External Received-SPF: pass client-ip=31.186.226.249; envelope-from=rahguzar@zohomail.eu; helo=sender11-pp-o91.zoho.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 22 Jun 2023 01:45:52 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144018 Archived-At: Hi Eli, Due to some reason I didn't receive your message and only saw it because I checked archives just now. Consider the following code, (progn (goto-char (point-max)) (insert "\n") (insert-image (create-image "path/to/image")) (insert "\n") (insert-image (create-image "path/to/image"))) I pasted it in scratch buffer starting from `emacs -Q` and then evaluated it. Now go to the first image and use `i +` till the image height is larger than the window height (more about needing this below). Then do `M-: (set-window-vscroll nil 100 t t)` Where 100 is just a place holder but the number should be smaller than the window height and large enough that the second image comes into view. Next do `M-: (window-absolute-pixel-position (point))` I got `(1896 . 0)` which I don't know how to interpret since that is supposed to represent the top-left corner of the image but that corner is not visible in window and I don't know how that 1896 came to be there. Next do `M-: (window-absolute-pixel-position (+ 2 (point)))` I got `(8 . 862)`, which matches what I expect from evaluating `(pos-visible-in-window-p (point) nil t)`. Although I remember this result being confusing too but I think it was just me being confused. While doing this I noticed that I can't set vscroll until image is taller than the window i.e. in this case the top of first the image remains glued to the top of the window. This is not the case with text i.e. `M-: (progn (goto-char (point-min)) (set-window-vscroll nil 10 t t))` in the scratch buffer partially hides the top line for me as expected but if the window starts at an image less tall than the window and I do `M-: (set-window-vscroll nil 100 t t)` the top of the image remains visible even if the image is more than 100 pixels tall. Thanks, Rahguzar