From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm Kirschbaum Newsgroups: gmane.emacs.bugs Subject: bug#64275: 30.0.50; [PATCH] Improve sigil font-lock match for elixir-ts-mode Date: Sat, 24 Jun 2023 22:14:17 +0200 Message-ID: <87zg4od38w.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9661"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.3; emacs 30.0.50 To: 64275@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 24 22:18:23 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 1qD9iA-0002Pg-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Jun 2023 22:18:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qD9hv-0000jn-3s; Sat, 24 Jun 2023 16:18:07 -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 1qD9hr-0000jU-Nv for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 16:18:05 -0400 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 1qD9hq-0000pw-EO for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 16:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qD9hq-0004L9-9u for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 16:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wilhelm Kirschbaum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Jun 2023 20:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64275 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168763784816604 (code B ref -1); Sat, 24 Jun 2023 20:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Jun 2023 20:17:28 +0000 Original-Received: from localhost ([127.0.0.1]:41574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qD9hI-0004Ji-0L for submit@debbugs.gnu.org; Sat, 24 Jun 2023 16:17:28 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:38290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qD9hF-0004JY-MV for submit@debbugs.gnu.org; Sat, 24 Jun 2023 16:17:26 -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 1qD9hF-0000g1-A4 for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 16:17:25 -0400 Original-Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qD9hD-0000fC-P7 for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 16:17:25 -0400 Original-Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-31272fcedf6so1688674f8f.2 for ; Sat, 24 Jun 2023 13:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687637842; x=1690229842; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=wpStVPHDWRE0K5q6L7gTsvEeegn0umXwEOnXBowKP0o=; b=hd6KRfTeKJJwQrmxMH8mE6tBCZg/QiqtumqDtkjXiDmuFIb6ZNF5GoWJXbMidpZjpM MkDTuBOhBQ4HVZdRiXCeg61lqJJePEHH9+fTomCCjBbkffXLL2D45qIJX4kf+E0VrUYM y8O4s6rICrVdARk61zl/TSsyTZlP6pLtcDFrtd6QKaUYd2xoPskrv7xq8yMxVmn4733B i+nVJ8Kj7JLcgKZF+li3viNabzNlx4aDwILUUK1G1JB7IaT+a6ij4ZN1pIP+2i02QhSO IQuMCoNu/lpPoxbpMB1AS9dvkkLsgx7TUQB2Z1QpQVQiP8tSBOk7oFmFgBWx6ddxY91d A/UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687637842; x=1690229842; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wpStVPHDWRE0K5q6L7gTsvEeegn0umXwEOnXBowKP0o=; b=NLQMiySGruhIroyPHGKfWSMtV7bvcRt86TM0yiG5c+nZ+qIoNUzsxFAQ7PucI9Plua 0Z0I9ZCYWF8qQScwec8wbNIwrMQwR0qONuLNw2qxo8RHS0z2TVkREzkEcA+uS/V2tsel ZzM3zUKX5QozLjwPogKptwe+mUTuUx7uaMN79hDu4Seie+8CHHPVSJhSOQmCAkgP8VmG zl5GQgZMVamnXzOIqe7EfuiBkVde6+84Cpd7ZjhHOi/87llw9erui8c2tSwDm3htkIsY mHqk6wmnXUqYrj8E+nOfeSYYnaEqbOWFe2DyAH7O7V1DsnOZfyMJCqOT/fUS98KWzjsc kLag== X-Gm-Message-State: AC+VfDwDL2w5RF9QD8etlqXtmGtw54BjdJLSo8KG8P8mOhzM/tEthanu unJH7z/z8TGwItoDpsAyjreE8FMzWTo= X-Google-Smtp-Source: ACHHUZ6Wz6X2UQ6E5vaVROmVaWox4moUcgSPm5NVrt/RRVV9y9FBzjoeVPoYLpa/GY11RRh+GqG6UQ== X-Received: by 2002:a5d:6a4b:0:b0:313:e971:53a8 with SMTP id t11-20020a5d6a4b000000b00313e97153a8mr434118wrw.18.1687637842056; Sat, 24 Jun 2023 13:17:22 -0700 (PDT) Original-Received: from melissa.local (ec2-13-245-180-173.af-south-1.compute.amazonaws.com. [13.245.180.173]) by smtp.gmail.com with ESMTPSA id l13-20020a5d674d000000b003113513f491sm2836869wrw.114.2023.06.24.13.17.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jun 2023 13:17:21 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=wkirschbaum@gmail.com; helo=mail-wr1-x434.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:264015 Archived-At: --=-=-= Content-Type: text/plain; format=flowed This patch updates the sigil matching for Elixir. We don't need to know what the sigil is to be able to set the font. The one exception is regex via a sigil. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-eglot-imenu-when-the-server-does-not-support-it.patch >From 9a1389305d92f0e08d39d2ff5540cb494c012f12 Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Sat, 24 Jun 2023 21:54:30 +0200 Subject: [PATCH 1/1] Fix eglot-imenu when the server does not support it A language server might not support textDocument/documentSymbol, so we need to check first. * lisp/progmodes/eglot.el (eglot-imenu): Check for the textDocument/documentSymbol capability before requesting. --- lisp/progmodes/eglot.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index e2478f2dde3..265cfc88579 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3351,16 +3351,17 @@ eglot--imenu-DocumentSymbol (defun eglot-imenu () "Eglot's `imenu-create-index-function'. Returns a list as described in docstring of `imenu--index-alist'." - (let* ((res (eglot--request (eglot--current-server-or-lose) - :textDocument/documentSymbol - `(:textDocument - ,(eglot--TextDocumentIdentifier)) - :cancel-on-input non-essential)) - (head (and (cl-plusp (length res)) (elt res 0)))) - (when head - (eglot--dcase head - (((SymbolInformation)) (eglot--imenu-SymbolInformation res)) - (((DocumentSymbol)) (eglot--imenu-DocumentSymbol res)))))) + (when (eglot--server-capable :textDocument/documentSymbol) + (let* ((res (eglot--request (eglot--current-server-or-lose) + :textDocument/documentSymbol + `(:textDocument + ,(eglot--TextDocumentIdentifier)) + :cancel-on-input non-essential)) + (head (and (cl-plusp (length res)) (elt res 0)))) + (when head + (eglot--dcase head + (((SymbolInformation)) (eglot--imenu-SymbolInformation res)) + (((DocumentSymbol)) (eglot--imenu-DocumentSymbol res))))))) (cl-defun eglot--apply-text-edits (edits &optional version) "Apply EDITS for current buffer if at VERSION, or if it's nil." -- 2.41.0 --=-=-= Content-Type: text/plain; format=flowed Wilhelm --=-=-=--