From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61726: [PATCH] Eglot: Support positionEncoding capability Date: Sat, 25 Feb 2023 18:26:01 +0200 Message-ID: <83wn45k8yu.fsf@gnu.org> References: <87a614g628.fsf@gmail.com> <87cz60dus9.fsf@gmail.com> <835ybrpnqj.fsf@gnu.org> <87y1oncz09.fsf@gmail.com> <83r0ufo3uc.fsf@gnu.org> <87356vbf0b.fsf@gmail.com> <83pm9znw0i.fsf@gnu.org> <87lekn9ss3.fsf@gmail.com> <83h6vbntqd.fsf@gnu.org> <878rgn9r6u.fsf@gmail.com> <83edqfnq5u.fsf@gnu.org> <83bkljnpck.fsf@gnu.org> <874jrb9l6d.fsf@gmail.com> <834jrbnlaf.fsf@gnu.org> <87v8jr83ic.fsf@gmail.com> <83v8jrm4r0.fsf@gnu.org> <87fsav7x81.fsf@gmail.com> <83a612ko73.fsf@gnu.org> <87ttza3rwh.fsf@gmail.com> <83356tluvq.fsf@gnu.org> <87a61125ox.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10204"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61726@debbugs.gnu.org, joaotavora@gmail.com To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 25 17:27:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVxOH-0002Ro-3T for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Feb 2023 17:27:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVxO5-0006NY-5Y; Sat, 25 Feb 2023 11:27:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVxO3-0006MN-2P for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2023 11:27:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVxO2-0006v0-E6 for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2023 11:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVxO2-0003na-2g for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2023 11:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Feb 2023 16:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61726 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61726-submit@debbugs.gnu.org id=B61726.167734236914539 (code B ref 61726); Sat, 25 Feb 2023 16:27:02 +0000 Original-Received: (at 61726) by debbugs.gnu.org; 25 Feb 2023 16:26:09 +0000 Original-Received: from localhost ([127.0.0.1]:41349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVxNA-0003mR-N9 for submit@debbugs.gnu.org; Sat, 25 Feb 2023 11:26:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVxN7-0003lv-RW for 61726@debbugs.gnu.org; Sat, 25 Feb 2023 11:26:06 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVxN2-0006df-DI; Sat, 25 Feb 2023 11:26:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PXfIfGM2GaYo1wAQdp6H8VZyaLyfR/aOA9fpCy7PrL8=; b=kud5qK8utW9c 4S/e+h4l17uNSUOSgikyUrvgUTS15AJ7HhbOEN1caNYm8azIlAf0y6FA4x2nGSiq05jcvMteD2AI0 d/eXRXrwjF1byi63Y+Oo74L68FJgpTd45ThADTphupA6brcfObONpfPX0S8PqObXYk7bj5BbhXgVe DfpehT2Rv+KULz/8WIUZ+K9ztowFguonLfq6E284m7pfgx19y96u27+JXqH3ZhrB0Lun7qOsBzf/G HHXik8IPLN/pFkPG7U+Ni2pnOlmDhJbxKwaHyiytQfFAnYRBhAq+aK5qqT323Gi2BVAq7g+4PLAO9 Q/pQIdtbykGVCXADfp6Efg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVxN1-0000WJ-S6; Sat, 25 Feb 2023 11:26:00 -0500 In-Reply-To: <87a61125ox.fsf@gmail.com> (message from Augusto Stoffel on Sat, 25 Feb 2023 15:14:06 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256731 Archived-At: > From: Augusto Stoffel > Cc: joaotavora@gmail.com, 61726@debbugs.gnu.org > Date: Sat, 25 Feb 2023 15:14:06 +0100 > > On Sat, 25 Feb 2023 at 15:47, Eli Zaretskii wrote: > > >> > Can you please humor me and implement eglot-bytewise-column like that? > >> > >> I would be glad to do that, but unfortunately I'd have to ask your > >> advice as to how to make the corresponding adaptation of > >> eglot-move-to-bytewise-column. > ^^^^^^^ Sorry. Here: (defun eglot-move-to-bytewise-column (column) "Move to COLUMN as computed using the LSP `utf-8' criterion." (let* ((bol (line-beginning-position)) (goal-byte (+ (position-bytes bol) column)) (eol (line-end-position))) (goto-char bol) (while (and (< (position-bytes (point)) goal-byte) (< (point) eol)) (if (>= (char-after) #x3fff80) ; raw bytes take 2 bytes in the buffer (setq goal-byte (1+ goal-byte))) (forward-char 1))))