From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: Obtain X / HPOS with move_it_to at eol when buffer-display-table line-feed Date: Wed, 30 Aug 2017 11:35:21 -0700 Message-ID: <4lsorjiu.wl%esq@lawlist.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1504118166 23975 195.159.176.226 (30 Aug 2017 18:36:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 Aug 2017 18:36:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 30 20:35:57 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dn7q3-0005Bb-4n for ged-emacs-devel@m.gmane.org; Wed, 30 Aug 2017 20:35:43 +0200 Original-Received: from localhost ([::1]:52183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn7qA-0002P1-2V for ged-emacs-devel@m.gmane.org; Wed, 30 Aug 2017 14:35:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn7q2-0002Ou-NP for emacs-devel@gnu.org; Wed, 30 Aug 2017 14:35:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dn7py-00030l-IG for emacs-devel@gnu.org; Wed, 30 Aug 2017 14:35:42 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.52.45]:35896) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dn7py-0002w2-BW for emacs-devel@gnu.org; Wed, 30 Aug 2017 14:35:38 -0400 Original-Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 198C2400C7336 for ; Wed, 30 Aug 2017 13:35:23 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id n7p2dhdu3c72gn7p2dWZ8S; Wed, 30 Aug 2017 13:34:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Cc :To:From:Message-ID:Date:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=y2EmH9V8xj3Bc5S8C55ms7lhLUaeQrf106i9MX8kUBM=; b=TSYTI9xDmQrc2QVDm0Br3/AJyd mekrA+tvdvY6zM8bH1acOmUf9BCMEYbe18cBkogYf5Ji3DUD2lI8FXHxwalMmg2kPWJE++OYCbipD 7EFeYYC+R7MhwNb15HyLK1EnCpu4jJNBhU/VnZY1YCloFH+lGkeNZhMdfXl0Lxinv7eWJFhFuc/SQ zIz4Ort7o0/MfqgZF0wf4g241rp8cmGfRcjWWoIyqpRfYMcbfzRsPXQX/kjObzVknKHv5yL0p1Q94 /LxHy+oiO76upzxDctwSYoSXzib7eA/fSmjukN3fc/mDt/1LUegIIzMRIoFHXn+zGxIuwsvUiB2T5 3dapVSnQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51907 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1dn7pi-0011MZ-AH; Wed, 30 Aug 2017 13:35:22 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dn7pi-0011MZ-AH X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:51907 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.52.45 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:217890 Archived-At: Fake cursors are created/erased by hijacking w->phys_cursor.x/y/hpos/vpos= and calling either erase_phys_cursor or draw_window_cursor. The creatio= n of a glyph/character on top of the cursor is optional so that a floatin= g cursor anywhere is possible if so desired. With respect to eol pilcrows, move_it_to gives X and HPOS coordinates for= an invisible \n to the right of the pilcrow. We essentially have =C2=B6= \n, and IT cannot see the pilcrow. The X and HPOS returned by move_it_to= gives us =C2=B6|\n instead of |=C2=B6\n. Stated another way, X and HPOS= are reported as being on the end of the pilcrow, instead of the beginnin= g of the pilcrow. My preference would be to continue using the built-in method for drawing/= erasing cursors -- i.e., let erase_phys_cursor and draw_window_cursor do = all the work for us, and we only need to give them precise coordinates (x= /y/hpos/vpos). Perhaps there is some way to help move_it_to see the pilcrow, or at least= pretend that it exists? /* EXAMPLES of (aref buffer-display-table ?\n): [(182 . 127) 10]; [182= 10]; [10] */ Lisp_Object buffer_display_table =3D BVAR (b, display_table); bool buffer_display_table_p =3D !NILP (buffer_display_table); Lisp_Object line_feed_vector; if (buffer_display_table_p) line_feed_vector =3D Faref (buffer_display_table, make_number (10)); /* Reset it.current_x and it.hpos to the desired locations. */ if (FETCH_BYTE (IT_BYTEPOS (it)) =3D=3D '\n' && buffer_display_table_p && VECTORP (line_feed_vector) && ASIZE (line_feed_vector) > 1) { it.current_x =3D ABRACADABRA_X; it.hpos =3D ABRACADABRA_HPOS; } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [08-30-2017 09:51:56] <30 Aug 2017 19:51:56 +0300> FROM: Eli Zaretskii >=20 > * * * >=20 > When you say "X POS for any particular eol pilcrow", do you mean the x > coordinate of the beginning of the pilcrow or of its end? >=20 > And what do you get instead when you use move_it_to like you show? >=20 > Also, why do you care about the exact coordinate of the pilcrow? You > could simply reach it and then do there whatever you want, no matter > what is the coordinate. >=20 > * * *