From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: move_it_vertically_backward question Date: Thu, 16 Dec 2021 15:27:10 +0200 Message-ID: <83ee6che8h.fsf@gnu.org> References: <87lf0pw78r.fsf.ref@yahoo.com> <87lf0pw78r.fsf@yahoo.com> <837dc8mue3.fsf@gnu.org> <874k7cuhv4.fsf@yahoo.com> <83lf0nl56t.fsf@gnu.org> <875yrrtiwj.fsf@yahoo.com> <837dc7l2pa.fsf@gnu.org> <87ilvqty24.fsf@yahoo.com> <8335muj8zk.fsf@gnu.org> <87h7bang3d.fsf@yahoo.com> <83mtl1j527.fsf@gnu.org> <87zgp1mldh.fsf@yahoo.com> <83tuf9gdg5.fsf@gnu.org> <87pmpwkikp.fsf@yahoo.com> <83mtl0hnm5.fsf@gnu.org> <87czlwkfpk.fsf@yahoo.com> <8735mskal2.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28744"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 16 14:42:01 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mxr1E-0007Fj-VQ for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Dec 2021 14:42:01 +0100 Original-Received: from localhost ([::1]:38786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxr1D-000467-Qa for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Dec 2021 08:41:59 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxqnC-00058f-VG for emacs-devel@gnu.org; Thu, 16 Dec 2021 08:27:31 -0500 Original-Received: from [2001:470:142:3::e] (port=35042 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxqnA-00012T-Vu; Thu, 16 Dec 2021 08:27:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=EiCAn3EM8J7yPAS2TmHer3kyoLwiBAxgDXErNSFMPGI=; b=Qh09YRocmjol P+T9ZveWUoSVEb1ubz4Pto7vDaLnYcwn7BfzvbJyD8x7xsvmCkg+xMwR0w/WXFn6SmkaNxA8mgVLT VlPFp+Iz1gltB2tx6eh4K16e19uOyPt+UHmeYTjAIIdfr/Ts3SQ30jJHdoQhRNO8km9thxwnOc6id Ke7xkVm3xeUb6OwOA+psQwabj/mYo2blVctivZtMeIYn6oy0aEETNBglNaqzzvnEOqnZWc2XKP3bE Lej3s6MBcInin/f3qxCIebEY5kpxfMiSnkbMev8OZS04Fg/hFc/hs9TV5iyQNoa9LG5+tbBczT12W aRgXMKc5huMYArsSi/5iow==; Original-Received: from [87.69.77.57] (port=2881 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxqn9-0004zI-RJ; Thu, 16 Dec 2021 08:27:29 -0500 In-Reply-To: <8735mskal2.fsf@yahoo.com> (message from Po Lu on Thu, 16 Dec 2021 20:17:45 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:282154 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Thu, 16 Dec 2021 20:17:45 +0800 > > Po Lu writes: > > > I can't think of anything better. > > Now that I think of it, how about this: we introduce a primitive > `line-above-point-by', which returns the line N pixels above a given > point in the current window What would such a primitive be used for, except for your specific use case? And even in that use case, it's better to have a single primitive that does both this job and the text-dimension measuring job than having 2 separate primitives that you'd need to call from Lisp. If nothing else, you lose the information collected by the iterator in the first call, and cannot use it in the second. Moreover, position found by the iterator cannot be always easily communicated to another primitive, because that position could be inside a display or overlay string, not at a buffer position. > and a new `no-ascent-descent' argument to window-text-pixel-size, > that avoids adding the ascent and descent of the iterator to the > height before returning it? Since ascent+descent are the line height, I don't understand why this would be useful.