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#73472: [PATCH] Substitute quotation marks in Eglot messages Date: Wed, 25 Sep 2024 19:01:32 +0300 Message-ID: <86setnbu3n.fsf@gnu.org> References: 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="35828"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73472@debbugs.gnu.org To: "Thomas Voss" , =?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 Wed Sep 25 18:03:26 2024 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 1stUU9-00099t-VG for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Sep 2024 18:03:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stUTr-0003Y1-6f; Wed, 25 Sep 2024 12:03: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 1stUTM-0002dc-C2 for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 12:02:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1stUTL-0007tI-S8 for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 12:02:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=Ch21CkHcw4qoY3lFyfnJRU5OpRldB4HHNPL1BPdpUHI=; b=Y5xvm0YbZO0ACKPNRnFKh6vffjaj9UaqfmvR0y5865xdv3kCARkE/s4q1g/HbJgeQlIo5msJiq8GKUDtA1n8Yqdd9yE7uZWfuewob3nNJtLCUU81qVBk3RiAJYajLV142CCVj0aUa5TyKaH3Sthpb+VCeKk7kQ0kpFrRD3es4WZYkPJIMJwGrjBQEvL09zwkg8vC49gbdR35EBvjCr98FFj0hhgh4H7aK5yj3c3+QgY75JKYGaocEL0jsjnVx021fdqjh7qVU+HYDYHeodkBBwgfsq3V0flp1qSN0c11OMaP28/OWYTRe29A0Z2bD8Lhif0hICI+FUKKg2Gp1Um2Fw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stUTl-0004fQ-OQ for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 12:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Sep 2024 16:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73472 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73472-submit@debbugs.gnu.org id=B73472.172728013717791 (code B ref 73472); Wed, 25 Sep 2024 16:03:01 +0000 Original-Received: (at 73472) by debbugs.gnu.org; 25 Sep 2024 16:02:17 +0000 Original-Received: from localhost ([127.0.0.1]:43519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stUT2-0004cr-Up for submit@debbugs.gnu.org; Wed, 25 Sep 2024 12:02:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stUT0-0004cY-OQ for 73472@debbugs.gnu.org; Wed, 25 Sep 2024 12:02:15 -0400 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 1stUSV-0007fi-Do; Wed, 25 Sep 2024 12:01:43 -0400 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=Ch21CkHcw4qoY3lFyfnJRU5OpRldB4HHNPL1BPdpUHI=; b=QxZ3DGW3O04pJHyPL4Hc P55HVtVOzoz+fbsC3B+VtT4z5xSG+MFiz64RXhpORJklJ8DAmwJc2zN1oJpEK41nMnrDQ5+o/3KWV +srObjHlDx2z/gmyWNTZOf/0XF/MyyVHF9o8uzZs+XmWO+75+R4aKoHPbku1MOfllTSwgLBzPCIby rJ9BnVKVAKIjfGa/loQRI04+pcqCjVz0d7P39Yx7bTJHuvO4RNVKI6giJpymSxaT1j7Hr4xGd+rvk wtzNBrdw1wqxSZu1AuRjIAWlOWymtOWP2SXKovFph2eS6Pd9LGz8XZoiGH0t7N4w5Xt/KZxnp5pDr zitQwOy2GFl15A==; In-Reply-To: (bug-gnu-emacs@gnu.org) 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:292404 Archived-At: > Date: Wed, 25 Sep 2024 16:03:32 +0200 > From: "Thomas Voss" via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Another quick patch from myself. This patch makes it so that the > diagnostics and interactive prompts from Eglot (such as the prompt you > iteract with when renaming a symbol) properly respect > ‘text-quoting-style’. Thanks. > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -1698,11 +1698,11 @@ eglot--connect > ;;; > (defun eglot--error (format &rest args) > "Error out with FORMAT with ARGS." > - (error "[eglot] %s" (apply #'format format args))) > + (error "[eglot] %s" (substitute-quotes (apply #'format format args)))) > > (defun eglot--message (format &rest args) > "Message out with FORMAT with ARGS." > - (message "[eglot] %s" (apply #'format format args))) > + (message "[eglot] %s" (substitute-quotes (apply #'format format args)))) > > (defun eglot--warn (format &rest args) > "Warning message with FORMAT and ARGS." > @@ -3704,8 +3704,8 @@ eglot-rename > "Rename the current symbol to NEWNAME." > (interactive > (list (read-from-minibuffer > - (format "Rename `%s' to: " (or (thing-at-point 'symbol t) > - "unknown symbol")) > + (format-prompt "Rename `%s' to" nil (or (thing-at-point 'symbol t) > + "unknown symbol")) > nil nil nil nil > (symbol-name (symbol-at-point))))) > (eglot-server-capable-or-lose :renameProvider) Hmm... in the first two changes, how do we know that the quote characters are indeed quoting stuff in the context where we substitute quotes according to quoting-style? Those functions get strings they know nothing about, so it looks a bit risky to blindly convert any quoting characters there. Or what am I missing?