From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: bug#9782: 24.0.90; move-to-window-line not taking header line into account Date: Tue, 07 May 2013 11:41:00 +0400 Message-ID: <5188B00C.2080600@yandex.ru> References: <83mxcyuw60.fsf@gnu.org> <87haiiqwiz.fsf@yandex.ru> <83vc6yf8hr.fsf@gnu.org> <5185CB24.5060207@yandex.ru> <83sj21fmo5.fsf@gnu.org> <518725C3.10107@yandex.ru> <83bo8of4hp.fsf@gnu.org> <51885853.7020803@yandex.ru> <83txmfebzp.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1367912486 30727 80.91.229.3 (7 May 2013 07:41:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 May 2013 07:41:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 07 09:41:25 2013 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 1UZcWY-000519-U0 for ged-emacs-devel@m.gmane.org; Tue, 07 May 2013 09:41:23 +0200 Original-Received: from localhost ([::1]:47878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZcWY-0001KC-8Y for ged-emacs-devel@m.gmane.org; Tue, 07 May 2013 03:41:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZcWR-0001K1-Rb for emacs-devel@gnu.org; Tue, 07 May 2013 03:41:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZcWN-0006vo-88 for emacs-devel@gnu.org; Tue, 07 May 2013 03:41:15 -0400 Original-Received: from mail-lb0-f174.google.com ([209.85.217.174]:36031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZcWG-0006sv-J5; Tue, 07 May 2013 03:41:04 -0400 Original-Received: by mail-lb0-f174.google.com with SMTP id r10so388535lbi.33 for ; Tue, 07 May 2013 00:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-antivirus:x-antivirus-status; bh=lTv8Kj8/Lv1nLjjd26iuNCdyaWg0FLBzT/1oH1EVG6A=; b=iLEuuhN0paOIIw6ZlgZQBDKeY8mi2ujLjkwkb03XyqIPJiJMe60NbHMGAYBEvGkgNO SctJqgfeC1MKeR7Q53qfE2vWjZh5JE0Skzh57eOvoGEkICaBjOga+bGqoFpIf5n371gs 9jq8RyKS1JWTwRtYqXgEmWu16dMPFpEPL0ekxodPbwr19sNQ8rUyafz3o+buVIJJlRLg 5iPZFQBFO59K658KyzBMAZoNJdYK7lH7jeXfpZVh92DgHZlBWpqeK9PmeGig8Nvu43vK oVEzN06z95KP+Sq065uTJwN0gYaRoaE3YsIZABrYIuweaj7Iw0NZURp6nAjFV9bVrYlQ hECA== X-Received: by 10.152.87.39 with SMTP id u7mr372938laz.48.1367912463146; Tue, 07 May 2013 00:41:03 -0700 (PDT) Original-Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPSA id 4sm3014874lbi.16.2013.05.07.00.41.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 00:41:02 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: <83txmfebzp.fsf@gnu.org> X-Antivirus: avast! (VPS 130506-1, 07.05.2013), Outbound message X-Antivirus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.174 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:159384 Archived-At: On 07.05.2013 6:54, Eli Zaretskii wrote: >> One might think that `move-to-window-line' is also window-relative and >> thus agnostic to the header line (that naturally follows if we consider >> the header line a part of the window). > > "Line" is a line of text, and move-to-window-line was written to go to > a line of text. The question is how they're numbered. One might imagine that the "zeroth" line is covered by the header, so the first one visible is number one. Note I'm not really arguing in favor in that change, since it won't help me get rid of the version check for 24.1-24.3 anyway. >> We still need to compare the column values to see if the click happened >> exactly inside the rectangle, not to the right or left of it. > > Doesn't the overlay cover the entire rectangle? > >> And in `company-select-mouse', we need the row values to find out which >> rectangle line was clicked (which candidate to select) > > Isn't each rectangle a different string? > There's just one overlay, and it covers all of them (plus all text on the sides). Maybe what you're suggesting would be an improvement (I see dropdown-list.el also does that), but the current approach works fast enough, and it would have the advantage in a hypothetical situation when some of the text we need to "draw on" is already rendered via `display' property. >> Taking the above into account, I think having a header-line-aware >> version of `move-to-window-line' instead would be best. > > ??? But you don't want to _move_ anywhere, AFAIU. You want to compute > a window-relative screen line number of a given position (I used point > in the above example, but that can be replaced by any buffer > position). So how does move-to-window-line fit that bill? Its > return value is undocumented, so you cannot really rely on that. I mean fixing the row number <-> line number discrepancy from the other side, by making a wrapper for `move-to-window-line', the only function of the bunch that deals with line numbers. It's used in `company-pseudo-tooltip-show'. >> Like suggested before, it would adjust the argument by 1 if >> emacs-version >= "24", and the header line is present. > > The function move-to-window-line is implemented in C, so it is > pointless to make it sensitive to Emacs version. The wrapper will need to check the version because Emacs 23 and earlier don't need the adjustment.