From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#61726: [PATCH] Eglot: Support positionEncoding capability Date: Fri, 24 Feb 2023 18:55:18 +0000 Message-ID: References: <87a614g628.fsf@gmail.com> <83v8jspgnr.fsf@gnu.org> <87lekodxja.fsf@gmail.com> <83a614p4sh.fsf@gnu.org> <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> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29907"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61726@debbugs.gnu.org, Eli Zaretskii To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 24 19:56:32 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 1pVdFA-0007fQ-Aq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Feb 2023 19:56:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVdEn-0000fV-KJ; Fri, 24 Feb 2023 13:56:09 -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 1pVdEi-0000cG-H0 for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 13:56:05 -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 1pVdEi-0008VZ-2N for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 13:56:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVdEh-0006wQ-VF for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 13:56:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Feb 2023 18:56:03 +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.167726493826605 (code B ref 61726); Fri, 24 Feb 2023 18:56:03 +0000 Original-Received: (at 61726) by debbugs.gnu.org; 24 Feb 2023 18:55:38 +0000 Original-Received: from localhost ([127.0.0.1]:38240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVdEI-0006v2-9X for submit@debbugs.gnu.org; Fri, 24 Feb 2023 13:55:38 -0500 Original-Received: from mail-oa1-f46.google.com ([209.85.160.46]:45728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVdEG-0006uo-W4 for 61726@debbugs.gnu.org; Fri, 24 Feb 2023 13:55:37 -0500 Original-Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-1729bdcca99so488850fac.12 for <61726@debbugs.gnu.org>; Fri, 24 Feb 2023 10:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677264931; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+iwxm5wq6ZMOKJN/TNETB6dqaWGlcTpUDuJyVM0Ce2w=; b=iIA0ST6XTIWopY3Mb82QObLPwHQdvccIHc1Efv9BKOYPRfjgMGwsUwvsyCt1gPu5fW Jj4HSi/2/ZSEa+KO36UTNXA8RhkpozOBH/3uOGisujFYqC2rixoIk2YLnlgcs39CuEbv PJEoyETlpGs2Jur31kSSZ3iRDBekFAN5ceaNGiqW/VEvf1GopVsfhQejb+6WUJnubGE1 bfLyaOPQj1m0Abwf5oAIK3mFGO1Dz92t6yr8vFaqZ/b/MwM0W9RREKfRdHCCO+f6d79V +Kz6QKLaZIWnsyZwmf+x4t3ZH05mv9U3OIc882RwVBpLsWLxyPj/8oIrsPH4yr/y9kaX YJqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677264931; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+iwxm5wq6ZMOKJN/TNETB6dqaWGlcTpUDuJyVM0Ce2w=; b=3mC6yP0/SsOM3XQjdU0Wi9jOw5bt5BYPBqGUYUhoo7l47OdDIOWmmPhF08aNYH/XPA oZlJe4TKpBSVazQHAQH0Xr2XmlaEcnE9ZCbokkDq3wChtz/A/sRC9zknByyqHpzFLo/4 f/vVIEAVabFsiKiemMOG/bVFRQg8+AjkgpDhCqPgjBy9LcwbHlb/QgV5DoJ+p+MYAsLu ZUnF6zaQ0gzkrY9JYPcqb7zpLPs4KgggdrQFy1LuT9pS7rIWkoWHyb69zB6XVlcKrbxr AlBEi2gysyCDfaSxYK80Wum+ntDAqM7/D1UEr07me23T/Km/WjZjCZqeHeZ11f9IobXg Lo2Q== X-Gm-Message-State: AO0yUKWXgTcfEH+8FAXO+dBXEZkkDYd90TUr94kGzHAavEE/RZpe1lmg xxuJydk2GMqzN/9pxqYX4eUdUXzyw6TONV6TECc= X-Google-Smtp-Source: AK7set9zmMW/3ExyWTX/RlhER1BCqdme4vHrZuigujlnYAQJQJpGqySC/pnwW4xk8PXRGH6nGHaNaDZZepYHrhhgBIQ= X-Received: by 2002:a05:6870:5302:b0:16e:8b45:1e0d with SMTP id j2-20020a056870530200b0016e8b451e0dmr1326157oan.8.1677264929613; Fri, 24 Feb 2023 10:55:29 -0800 (PST) In-Reply-To: <87fsav7x81.fsf@gmail.com> 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:256650 Archived-At: On Fri, Feb 24, 2023 at 6:08 PM Augusto Stoffel wrote= : > > I've attached a minimal functioning version of the patch. I would > prefer to merge this and do all possible refinements discussed here at a > later stage. This is OK with me. I think the current patch is OK, modulo some very minor whitespace and formatting options that I can fix myself. > For the 2 new functions I've followed current naming scheme, replacing > "lsp-abiding" by "bytewise". We can then get rid of all the suboptimal > nomenclature (lsp-abiding, column, bytewise) in one go at a later stage. OK, but not too late though, as these are user-visible-functions, and I'd like to tag an Eglot version soon. > I also didn't attempt to make 'eglot-move-to-bytewise-column' and > 'eglot-bytewise-column' "correct" in the cases where 'json-serialize' > throws an error. I think it's clear that Eli and I have different > definitions "correctness" in this context, but Eli's proposal requires > substantial further work, including recovering from possible errors > raising from 'json-serialize'. If Eli is OK with this provisional UTF-8 impl, then so am I. How complicated do you estimate Eli proposal to be in comparison? > Lastly, I used 'line-beginning-position' naively in the 2 new function > because there are at least 4 other pre-existing naive uses in eglot.el. > This refinement deserves a patch of its own, probably using something on > the lines of > > (defalias eglot--pos-bol (if (fboundp 'pos-bol) 'pos-bol ...)) This is also a good idea. Jo=C3=A3o