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: Sun, 26 Feb 2023 16:50:13 +0200 Message-ID: <83r0uciiqi.fsf@gnu.org> References: <87a614g628.fsf@gmail.com> <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> <83wn45k8yu.fsf@gnu.org> <874jr9z94m.fsf@gmail.com> <87y1olv0h1.fsf@gmail.com> <87sfetgux5.fsf@gmail.com> <83pm9xj74q.fsf@gnu.org> <83v8joimo9.fsf@gnu.org> <87r0ucpl30.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8973"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61726@debbugs.gnu.org, arstoffel@gmail.com To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 26 15:51:25 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 1pWIN1-000244-So for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Feb 2023 15:51:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWIMi-0004rF-0r; Sun, 26 Feb 2023 09:51:04 -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 1pWIMg-0004qx-I1 for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 09:51:02 -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 1pWIMg-0002es-7c for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 09:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWIMf-0001ju-UM for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 09:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Feb 2023 14:51:01 +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.16774230526663 (code B ref 61726); Sun, 26 Feb 2023 14:51:01 +0000 Original-Received: (at 61726) by debbugs.gnu.org; 26 Feb 2023 14:50:52 +0000 Original-Received: from localhost ([127.0.0.1]:42902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWIMW-0001jP-0d for submit@debbugs.gnu.org; Sun, 26 Feb 2023 09:50:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWIMU-0001jD-7J for 61726@debbugs.gnu.org; Sun, 26 Feb 2023 09:50:50 -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 1pWIMO-0002Yf-W7; Sun, 26 Feb 2023 09:50:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=nEa68+yRbG/gKfvKLXg8SWt2x7H6zIId7UHpEAcAujQ=; b=DjCY8b4LbILInxCR4n/F nmtLYGaLhXWEWfKaYTUAwQxVc33kjVjdR2KFG2oOXlBBb9/h8k5li79K7BQcrY+mu10PjYEjrJHBb wT2CT4TjGbv6wFvvoku5H1XEMrc2MHcgKlKUzZ978HObUdx6yMZYW4weqGvuxaTno2Mp3suRfolFQ sswTwUpVh5QjJwzB6HkbCZV93q9ylnuiy479seVjF0oc7lTponnjXjOh9NUWbsdooHWtJUzggQPPc fSe9Ikp1fM/k5Kb+ncm7YLGaCm5YqI92hXe5K3+Uo+dtgjWrRaHqbK/3+Lxj9NeeFJFwpjBla0raS p7Cf5B7bpGh5cA==; 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 1pWILu-0003Ei-Oq; Sun, 26 Feb 2023 09:50:29 -0500 In-Reply-To: <87r0ucpl30.fsf@gmail.com> (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Sun, 26 Feb 2023 14:17:39 +0000) 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:256808 Archived-At: > From: João Távora > Cc: arstoffel@gmail.com, 61726@debbugs.gnu.org > Date: Sun, 26 Feb 2023 14:17:39 +0000 > > Eli Zaretskii writes: > > > I've corrected a few doc strings to use a more widely-familiar > > terminology. > > Thanks, but at one of the corrections is mistaken, so I've fixed it like > this. > > (defvar eglot-current-linepos-function #'eglot-utf-16-linepos > - "Function calculating number of UTF-16 code units from line beginning. > + "Function calculating number of code units from line beginning. > > This is the inverse operation of > `eglot-move-to-linepos-function' (which see). It is a function of > > This variable is set by default to a function that indeed does UTF-16 > calculations. But it can and will be set to one that does UTF-32 or > UTF-8 codepoint calculations, depending on the server. > > I also have a few nits. In your patch: > > (defun eglot-utf-32-linepos () > - "Calculate number of code units to line beginning using UTF-32." > + "Calculate number of Unicode codepoints from line beginning." > (- (point) (line-beginning-position))) > > This is strictly true, because in UTF-32 it's one code point per code > unit. But the protocol of the variable > 'eglot-current-linepos-function', where this function is to be plugged, > a code-unit counting function is demanded. I would predict that > encoding-challenged programmers (like this package's maintainer in about > 2 week's time) might not know about that equivalence and will find it > slightly confusing to plug this function into that variable. > > But as I said this is just a nit. I made one more fix.