all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>, Dmitry <dgutov@yandex.ru>
Cc: 18493@debbugs.gnu.org
Subject: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account
Date: Thu, 18 Sep 2014 08:52:55 -0700 (PDT)	[thread overview]
Message-ID: <955c9f56-902e-4e21-8cfe-e2b8d2a37ead@default> (raw)
In-Reply-To: <<8338bp2cwf.fsf@gnu.org>>

> That's the intended behavior: posn-col-row is documented to return
> the coordinates of its argument in canonical character units.  And
> that is what it does here.

Yes, but why?

> There's no bug here.

> But once variable-size fonts, stretch glyphs, images, and
> other display atrocities come into play, there's no meaningful way of
> talking about "columns" and "rows" that can be used as indices into
> the text.

If there is no meaningful way to talk about columns and rows then
a function that returns the column and row might as well run around
the block and then take a nap.

I understand your argument, I think.  But there is a difference
between saying (a) that we cannot know just what visual column/row is
involved in the general case, in the presence of the many possible
display considerations and saying (b) that we cannot do that in any
cases.

The case of text scaling seems to me to be a case where we can
meaningfully return the visual column and row.  No?  So that general
give-up argument disappears in this case.

Granted, there is another possible question: Why not have both, as
separate functions - IOW, what we apparently have now, with the 
presence of function `posn-actual-col-row'.  But why?  Is there
really a use case for obtaining what `posn-col-row' currently
returns in a text-scaling context?

And if `posn-actual-col-row' really does return the actual, visual
column and row, then what does that say about your general can't-do
argument above?  And if it does not really do that, then why does
it have that name "actual", and why does its doc give the impression
that it does really do that?

> So the answer to your question depends on what you intend to do with
> the value.
> 
> > > I don't even understand why the value should change with text
> > > scale.
> >
> > It would solve the problem of text-scale-mode being enabled in
> > buffers, where I'm getting inaccurate results from `posn-col-row'
> > because of that. And by "inaccurate", I mean different from the
> > ones I'd like.
> 
> Then perhaps you want posn-col-row-as-dgutov-likes-it, not posn-col-
> row ;-)
> 
> Seriously, though: it all depends on what you do with the results
> returned by this function.  And you didn't explain what that is, so
> it is hard to tell whether there is a problem, and if so, where.
> 
> IOW, please explain what is it that "you'd like".

I agree that the whole question of this design depends on the answer
to your question: what do you intend to do with the return values.

So let me ask you that same question: what is the use case that the
current design supports?  What do you imagine might be a use for
obtaining the frame-char column and row and not wanting the "actual"
column and row?

I am generally in favor of allowing for such differences, as users
are pretty clever at coming up with uses for them.  But here I don't
(yet) see it.  And presumably the designers had something in mind,
when they chose to return the column & row based on frame char size
even in the presence of scaling.

IOW, why have two separate functions, `posn-col-row' and
`posn-actual-col-row'?

It's just a question.  Knowing the design is as it is can help users
put the various functions to best use.





  parent reply	other threads:[~2014-09-18 15:52 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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         ` bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account 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 [this message]
2014-09-18 17:00     ` Eli Zaretskii
2014-09-17 22:03 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
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

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

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

  git send-email \
    --in-reply-to=955c9f56-902e-4e21-8cfe-e2b8d2a37ead@default \
    --to=drew.adams@oracle.com \
    --cc=18493@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.