From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: master 0d5036061b5: Skip Eglot test if using very old clangd Date: Wed, 22 Mar 2023 11:14:05 +0000 Message-ID: References: <167942421231.13373.16122455155218245677@vcs2.savannah.gnu.org> <20230321184332.93736C13913@vcs2.savannah.gnu.org> <87lejpnk9t.fsf@gmail.com> <87h6udnip7.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="29181"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 22 12:14:43 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pewQV-0007Rv-7D for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Mar 2023 12:14:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pewQA-0005TF-DH; Wed, 22 Mar 2023 07:14:22 -0400 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 1pewQ9-0005T2-Tc for emacs-devel@gnu.org; Wed, 22 Mar 2023 07:14:21 -0400 Original-Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pewQ8-0001FJ-Cl for emacs-devel@gnu.org; Wed, 22 Mar 2023 07:14:21 -0400 Original-Received: by mail-oi1-x234.google.com with SMTP id q30so6215479oiw.13 for ; Wed, 22 Mar 2023 04:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679483656; 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=blQjyr9ELWrH7gHvB72N7FG6KrMXYVXt/HnJkgbBOC8=; b=SGxoh+Dvka9NghJbNzog4PES3Ft1ZTsEnLlOHyoLfzVwi/joj/oPL3eFk3SvcDDTJL krG6KVJJl9TgPmpXgcK/FRIRt0eOt2PUYiuUIzJxVx0Yzmfcn5NCwoBCpioRZrRNMDwe guDl7XR7vRF30l0BCnAMzy0pINdRNouho5X1WqrGzIPvy+Rry5s2lwZdTFSl8bWnS47K 8a4SlDTZhGXMAftS2sz7Pb3LuXPn7A5IGo3P3VD+pdOjiNtUMJ0Ceu7pSu74XBw8gFXZ xxCO6xL0MoC9QUgqUdjdeez0tGG5kaxeSQWU2YPPplTqypPoWhHFxSBQBHZy9Nb5x4sq VQkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679483656; 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=blQjyr9ELWrH7gHvB72N7FG6KrMXYVXt/HnJkgbBOC8=; b=Nb86qSejK2WjE0nOLbEc9vUQojZhgIYnQhX7yEgG4tsuf/KP9uFbTcSnNUnYMcfWaC dE/tvPETj3En43cjOQXRHq21/7JicXqoUahYE/FbKAvBbylm749l17uSEmfyVYDjP6Rd e7WqLqtSVAxyWki9PtT8SkQOTA3MWnJcX8ddlxiGUh8AZk12kHOXA6H2oHHWFv1Cy7+M O6eQuYIPU9IcTZblR72nFd98LqOsoQHmhzfkf9GFBCj7HuoQX8M3ZoXp1MjCeY7yaLOz gjE3VS+lGdDnF54J8gQX9nW/iLyQbXPPGC2W6LsOsDlZw9sIV/Z+A+fRzp9KJGqfoGsh OJxA== X-Gm-Message-State: AO0yUKVQgoyNDxvlj2/UfAI2mkm/yROVj3WSc7zQO1Mp82YHLZGK0fSF Z+Chqtv2ERWhSOgVPxtXZegI74YV/TBb+y8ESMC6JKgJ X-Google-Smtp-Source: AK7set/HZGD3vhEC3V9GJ4IdPWdFurnjOmK0A+8RbKUxkxKaVN1IuZsEf/SBQ4n9Ecp1MoeXjTnPfi6of6E1KjVRpxk= X-Received: by 2002:aca:910:0:b0:378:30dc:ae5b with SMTP id 16-20020aca0910000000b0037830dcae5bmr913766oij.5.1679483656117; Wed, 22 Mar 2023 04:14:16 -0700 (PDT) In-Reply-To: <87h6udnip7.fsf@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=joaotavora@gmail.com; helo=mail-oi1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304706 Archived-At: On Wed, Mar 22, 2023 at 11:12=E2=80=AFAM Robert Pluim wr= ote: > > >>>>> On Wed, 22 Mar 2023 10:49:41 +0000, Jo=C3=A3o T=C3=A1vora said: > > Jo=C3=A3o> On Wed, Mar 22, 2023 at 10:38=E2=80=AFAM Robert Pluim wrote: > >> Not all clangd have the version string and only the version string= at > >> the end of 'clangd --version'. Here=CA=BCs one I installed from gi= t earlier: > >> > >> clangd version 16.0.0 (https://github.com/llvm/llvm-project.git 08= d094a0e457360ad8b94b017d2dc277e697ca76) > >> Features: linux > >> Platform: x86_64-unknown-linux-gnu > >> > >> So how about the following (or we could just say 'everything > >> non-space', but I=CA=BCm assuming clangd versions are always made = up of > >> numbers and '.') > >> > >> diff --git c/test/lisp/progmodes/eglot-tests.el i/test/lisp/progmo= des/eglot-tests.el > >> index c4b23bfd64e..557bd899ab7 100644 > >> --- c/test/lisp/progmodes/eglot-tests.el > >> +++ i/test/lisp/progmodes/eglot-tests.el > >> @@ -317,7 +317,7 @@ eglot--simulate-key-event > >> (defun eglot--clangd-version () > >> "Report on the clangd version used in various tests." > >> (replace-regexp-in-string > >> - ".*version[[:space:]]+\\(.*\\)" "\\1" > >> + ".*version[[:space:]]+\\([0-9.]*\\).*" "\\1" > >> (car (split-string (shell-command-to-string "clangd --version") "\= n")))) > > > Jo=C3=A3o> Sure, thanks. Bonus points for getting rid of the split-s= tring > Jo=C3=A3o> and using a regexp that looks at the whole string and > Jo=C3=A3o> catches the version. I tried and failed. > > This doesn=CA=BCt care where 'version ' appears: > > (defun eglot--clangd-version () > "Report on the clangd version used in various tests." > (let ((version (shell-command-to-string "clangd --version"))) > (when (string-match "version[[:space:]]+\\([0-9.]*\\)" > version) > (match-string 1 version)))) Looks good, can you push? I wonder why this is so difficult to do with replace-regexp-in-string. Jo=C3=A3o