unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18493@debbugs.gnu.org
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	[thread overview]
Message-ID: <541C710E.2060604@yandex.ru> (raw)
In-Reply-To: <838ulf2192.fsf@gnu.org>

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.





  reply	other threads:[~2014-09-19 18:08 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 22:03 bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account Dmitry
2014-09-17 22:53 ` Drew Adams
2014-09-17 23:17   ` Dmitry Gutov
2014-09-18  1:56     ` Drew Adams
2014-09-18  9:46       ` Dmitry Gutov
2014-09-18 15:37         ` Drew Adams
2014-09-18 16:50           ` Eli Zaretskii
2014-09-18 14:59       ` Eli Zaretskii
2014-09-18  9:32 ` martin rudalics
2014-09-18  9:35   ` Dmitry Gutov
2014-09-18 14:58 ` Eli Zaretskii
2014-09-18 20:55   ` Dmitry Gutov
2014-09-19  1:05     ` Stefan Monnier
2014-09-19  1:07       ` Dmitry Gutov
2014-09-19  6:11     ` Eli Zaretskii
2014-09-19 11:17       ` Dmitry Gutov
2014-09-19 13:22         ` Eli Zaretskii
2014-09-19 18:08           ` Dmitry Gutov [this message]
2014-09-19 19:46             ` Eli Zaretskii
2014-09-22  3:59               ` Dmitry Gutov
2014-09-19 14:54         ` Stefan Monnier
2014-09-19 15:43           ` Eli Zaretskii
2014-09-19 17:38             ` Dmitry Gutov
2014-09-20  1:17               ` Stefan Monnier
2014-09-22  3:59                 ` Dmitry Gutov
     [not found] <<864mw529bx.fsf@yandex.ru>
     [not found] ` <<38e6b538-3e76-472a-b371-2e74f9a14bf7@default>
     [not found]   ` <<541A1693.4090009@yandex.ru>
     [not found]     ` <<30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default>
     [not found]       ` <<831tr92cuq.fsf@gnu.org>
2014-09-18 15:37         ` Drew Adams
2014-09-18 16:39           ` Eli Zaretskii
2014-09-19  1:00           ` Stefan Monnier
     [not found]         ` <<ebad225f-4bc4-426c-a135-8d1d15551fda@default>
     [not found]           ` <<83sijo2893.fsf@gnu.org>
2014-09-18 17:12             ` Drew Adams
2014-09-18 17:22               ` Eli Zaretskii
     [not found] ` <<8338bp2cwf.fsf@gnu.org>
2014-09-18 15:52   ` Drew Adams
2014-09-18 17:00     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=541C710E.2060604@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=18493@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).