From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account Date: Fri, 19 Sep 2014 22:08:14 +0400 Message-ID: <541C710E.2060604@yandex.ru> References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> <838ulf2192.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1411151913 24082 80.91.229.3 (19 Sep 2014 18:38:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Sep 2014 18:38:33 +0000 (UTC) Cc: 18493@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 19 20:38:25 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1XV34a-0007Ts-Ce for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Sep 2014 20:38:24 +0200 Original-Received: from localhost ([::1]:59956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XV34a-0000db-2F for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Sep 2014 14:38:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XV34R-0000dJ-MV for bug-gnu-emacs@gnu.org; Fri, 19 Sep 2014 14:38:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XV34L-0001lL-KC for bug-gnu-emacs@gnu.org; Fri, 19 Sep 2014 14:38:15 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XV34L-0001ku-DR for bug-gnu-emacs@gnu.org; Fri, 19 Sep 2014 14:38:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XV2c9-0005fQ-Nc for bug-gnu-emacs@gnu.org; Fri, 19 Sep 2014 14:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Sep 2014 18:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18493 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18493-submit@debbugs.gnu.org id=B18493.141115010321732 (code B ref 18493); Fri, 19 Sep 2014 18:09:01 +0000 Original-Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 18:08:23 +0000 Original-Received: from localhost ([127.0.0.1]:46021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV2bW-0005eS-Iy for submit@debbugs.gnu.org; Fri, 19 Sep 2014 14:08:22 -0400 Original-Received: from mail-lb0-f174.google.com ([209.85.217.174]:43993) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV2bT-0005eI-Oq for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 14:08:20 -0400 Original-Received: by mail-lb0-f174.google.com with SMTP id l4so3605810lbv.5 for <18493@debbugs.gnu.org>; Fri, 19 Sep 2014 11:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=v3XZBf+o1xfgQK0/OHd5fV/q6c5vkYbBh6H6GdOUK1k=; b=whxX42caogMsnzJIwrR1trGbH+eJlyYOk+P+Wbkz/LnDtPePZfE7PWGELlFwafArfK R1CMlaBoN4GuipVxSlmtNZKv4K98OIzuMpVygSLV5q0ELCsPX8B27sr07pBSSCR47MWl z/TMfIh6bsheUzB09D55Im9EHfN0t0CaScbfYI2WeoELCWHTc/wYOTy0NI67ChG5BmrN 8tWENSrTbbAa/7gR6Nx2KgC13GK1JIX0jqblQRYMabt+yRJ4hBQ618BOkIr2IG8tbf6P R9P7C4yPzRDdA2QJHw54vH+gTOoF42tDJGPx7U37qdiXPBSGPfpDVonrcaWzcFkvapXB zUtw== X-Received: by 10.112.56.206 with SMTP id c14mr8032459lbq.27.1411150098800; Fri, 19 Sep 2014 11:08:18 -0700 (PDT) Original-Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id n4sm871221lah.2.2014.09.19.11.08.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 11:08:17 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 In-Reply-To: <838ulf2192.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93533 Archived-At: On 09/19/2014 05:22 PM, Eli Zaretskii wrote: > For you. Then someone else will come and argue that Gnus or Org or > whatever buffers are much more important. They'd be welcome to justify that importance with prolific contributions of code. >> I'd like to reiterate here, that I'd be satisfied just with some >> instructions how to convert the current `posn-col-row' return value >> into value that respects text scale. > > I still don't understand enough what that means to answer, sorry. See > below. What I had in mind, is instead of dividing the pixel coordinates by `frame-char-width', first scale it according to the text scale level. > The distinction is this: do you need the column to access text in the > same display line, or do you need it for other display lines, like for > aligning text in the next or previous lines with the text of the line > where you called posn-col-row? I don't think it would help: before the column number is used, the contents of the next (or previous) lines get converted to "plain" text to the best of our ability: tabs are converted to spaces, for example. >> But from `posn-col-row' I actually take the screen column value > > And do what with it? Please be specific, and please don't spare me > the details. I don't have your knowledge of what company-mode does to > answer these questions myself, and I have only a very vague idea of > how you arrange the display of the completion candidates and how the > "column" reported by posn-col-row enters that picture. I think I've described it already in previous discussions. e.g. in http://debbugs.gnu.org/18195 For better description, you could just read the code, starting with `company-pseudo-tooltip-show'. I think it's pretty easy to follow, and I won't have to translate it line-by-line from Elisp to English. > E.g., given arbitrary pixel coordinates, posn-at-x-y will give you the > object at those coordinates and character position within that object. > Is that what you need? Not really: for example, if there's a tab character there, the value will be too imprecise (I need to know the exact column inside the tab). Or if there's an existing overlay there, I'd try my best to ignore it. "character position" within its display string won't help me in the least.