From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Thomas Voss" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73472: [PATCH] Substitute quotation marks in Eglot messages Date: Wed, 25 Sep 2024 20:03:20 +0200 Message-ID: References: <86setnbu3n.fsf@gnu.org> Reply-To: "Thomas Voss" 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="7691"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73472@debbugs.gnu.org To: "Eli Zaretskii" , =?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 20:04:59 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 1stWNm-0001qu-R2 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Sep 2024 20:04:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stWNS-00086a-Qv; Wed, 25 Sep 2024 14:04:38 -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 1stWNR-00086P-58 for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 14:04:37 -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 1stWNQ-0007Xu-Mz for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 14:04:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:References:From:Date:Mime-Version:To:Subject; bh=lMJBXIYcjWDZG0HFdbvS0uyYjdrGdoLXMEN1Pdw+6eQ=; b=TK+nQU2OPB3p+G7p74V3OutpDcflPWa9u+9PKeNFDVRO9jjZfrEuOjJuOiktX4mW1lJhdJDT2nYTUq2uMMe6QDCZtxoMwVGC09rMZnAXtkV2wYQoPjBC0UPIVs5wpqwh5IEp3VDYCYZvOrXiH2ppJRkqFf6WTdCfwcz0r8LPSbjwU2wy8HQmj/57xrt+s91xLSnrGsoU4ACOKtrD5TTaH30L6DHBiIHA3ASnv17bMhhW0fi0lJiDMtop7qm8nT1EZgYOHizlpuKhSeezs+IoVuevbbVNyYiLune8op4j1rvJ5+fiLV3MNkbwOusFgLz8Bhk5jI2aZtUPITpsJWMV6A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stWNp-0006Sv-Mw for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 14:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Thomas Voss" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Sep 2024 18:05: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.172728747924744 (code B ref 73472); Wed, 25 Sep 2024 18:05:01 +0000 Original-Received: (at 73472) by debbugs.gnu.org; 25 Sep 2024 18:04:39 +0000 Original-Received: from localhost ([127.0.0.1]:48586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stWNQ-0006Qy-H2 for submit@debbugs.gnu.org; Wed, 25 Sep 2024 14:04:38 -0400 Original-Received: from out-180.mta1.migadu.com ([95.215.58.180]:44138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stWNJ-0006Oq-5E for 73472@debbugs.gnu.org; Wed, 25 Sep 2024 14:04:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thomasvoss.com; s=key1; t=1727287405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lMJBXIYcjWDZG0HFdbvS0uyYjdrGdoLXMEN1Pdw+6eQ=; b=4GMcHMtGpU4DdiysVGvxslDU0QNrGRk6ajIaskKdSVGBqSrHq/FEOjzGuSag+LRrxlDKFx HAJjPJM4PxzUWpg0OxkVXZqqbIIVqALKbfR6kNh/pIKiDVB6GgCm2Enavllqoq/XaMuN9E 9mct2ThXcWd6hmHqXN1mXKyVOUUighLxi8DIzGuFCJbKtMuhFFUgfSLgMd//IqafXAny8q 1Ni269TVy5O1kOfsGfs2TGZPbHAMVz7+D5nVbLyNAwJYXirP6ltpC9Cz8Db5fWG19lLado mLHqq3W/pF/z6ODmcO5jFKdr/O3nhv85RFiYm9XqvoxTT8LnCVOyoYI8EpymaA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <86setnbu3n.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT 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:292410 Archived-At: Hi Eli, On Wed Sep 25, 2024 at 6:01 PM CEST, Eli Zaretskii wrote: > > --- 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))= )) > > =20 > > (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= )))) > > =20 > > (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 'sym= bol 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? You=E2=80=99re right that it may be risky; I iterated through the usages of= these functions and nothing stood out to me as a potential location where some unexpected behaviour might occur, although it is true that there is the possibility. Not sure why I didn=E2=80=99t think of this when creating the patch, but it= =E2=80=99s probably a much better idea to change this: (substitute-quotes (apply #'format format args)) to this: (apply #'format (substitute-quotes format) args) This limits the scope of the substitution to just the format strings, where we know no funny business is going on. Unless you have any other reservations I could submit a v2 of the patch to do that. --=20 =E2=80=94 Thomas