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#18385: 24.3.93; posn-at-point doesn't account for tab-width Date: Wed, 03 Sep 2014 03:30:10 +0400 Message-ID: <86ha0plhx9.fsf@yandex.ru> References: <86ppffuhx3.fsf@yandex.ru> <83k35mf3kz.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1409700686 32596 80.91.229.3 (2 Sep 2014 23:31:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Sep 2014 23:31:26 +0000 (UTC) To: 18385@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 03 01:31:20 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 1XOxXi-00082V-TB for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Sep 2014 01:31:19 +0200 Original-Received: from localhost ([::1]:40674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOxXi-0008T2-Gz for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Sep 2014 19:31:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOxXY-0008S6-Pt for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:31:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOxXS-0006cR-J3 for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:31:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOxXS-0006cN-Ga for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XOxXS-0005rh-0u for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Sep 2014 23:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18385 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18385-submit@debbugs.gnu.org id=B18385.140970062622494 (code B ref 18385); Tue, 02 Sep 2014 23:31:01 +0000 Original-Received: (at 18385) by debbugs.gnu.org; 2 Sep 2014 23:30:26 +0000 Original-Received: from localhost ([127.0.0.1]:57188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOxWr-0005qj-TK for submit@debbugs.gnu.org; Tue, 02 Sep 2014 19:30:26 -0400 Original-Received: from mail-lb0-f181.google.com ([209.85.217.181]:44629) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOxWo-0005qS-6p for 18385@debbugs.gnu.org; Tue, 02 Sep 2014 19:30:23 -0400 Original-Received: by mail-lb0-f181.google.com with SMTP id s7so199253lbd.40 for <18385@debbugs.gnu.org>; Tue, 02 Sep 2014 16:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=SHI7f81piVwgfBKpJdZ5joDNvOWzaON9Esk7iAo1ACA=; b=AEFg5q1teJ4dvBSqtbnvQ1cFdvEiN0E/M2ByTBxgv0aCcq7AdPJZmJRqAxC/c6ScT0 m/7UYWe+odavPj6HLT2nyIoAL3JJ3HwkoI3JcPiFCj9rM8cFPlfb79Fnr5mdgsAQIm+r zvwW7kNMCa91omciV0Z5lGTDF5zlRig4WoZhCP+s0mOUPLMpS2scCm8TePy6hbZqYSNB bFlj7GalMBSYhkK7HAxetqqQzKWnzPywF0BkszauuQRG1qYTu3IDH3ZBhpS0L44wBxps kMrlh5QeTpfe7M1ZZ6ADAkQ1Whj13OzPcNYxda1eaoje0moL+AuvzRn/+w53uSL56OTd tSXw== X-Received: by 10.152.3.35 with SMTP id 3mr28892969laz.5.1409700615937; Tue, 02 Sep 2014 16:30:15 -0700 (PDT) Original-Received: from axl ([178.252.98.87]) by mx.google.com with ESMTPSA id sr4sm273561lac.39.2014.09.02.16.30.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Sep 2014 16:30:14 -0700 (PDT) In-Reply-To: <83k35mf3kz.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 02 Sep 2014 18:24:12 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux) 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:92980 Archived-At: Hi Eli, Thanks for the detailed explanation. Eli Zaretskii writes: > "Character number in that row". IOW, it counts characters, not visual > columns. This function, and the data in its POSITION argument which > it accesses, are designed to make it easy to find the glyph (or > "display element") in a screen line, so it simply provides the ordinal > number of the "thing at point" on its screen line, disregarding the > screen dimensions of that thing. Okay, if character widths are "applied" after the glyphs to be displayed are collected, I guess this makes a certain amount of sense. Is this value useful, though? Since the visual buffer contents are inaccessible from Lisp, I believe this value wouldn't be properly correct in most contexts, even in tty, where the major pitfalls you described can't happen. AFAICS, this function is only called in two places in Emacs code: - From `line-move-partial', where I don't understand what it does. - From `proced-sort-header', where the caller apparently just assumes there are no multiple-width characters on that line. So, was the decision not to return current-column-like value made due to performance considerations? > And you were right to resolve that by using posn-col-row instead. > That function translates pixel coordinates into row/column units, > which is much closer to what you want. Thanks, that's good to know.