From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#44629: 28.0.50; Eglot noisy with gfm-view-mode and view-read-only Date: Sat, 14 Nov 2020 13:47:55 +0000 Message-ID: <87wnyokq2c.fsf@gmail.com> References: <875z68p5mr.fsf@tcd.ie> 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="27930"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44629@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 14 14:49:14 2020 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 1kdvvV-00079Y-ES for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Nov 2020 14:49:13 +0100 Original-Received: from localhost ([::1]:44138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdvvT-0006Sk-Qy for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Nov 2020 08:49:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdvvK-0006SW-HC for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 08:49:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdvvK-0000y3-70 for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 08:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdvvK-00057f-3U for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 08:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Nov 2020 13:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44629 X-GNU-PR-Package: emacs Original-Received: via spool by 44629-submit@debbugs.gnu.org id=B44629.160536168519626 (code B ref 44629); Sat, 14 Nov 2020 13:49:02 +0000 Original-Received: (at 44629) by debbugs.gnu.org; 14 Nov 2020 13:48:05 +0000 Original-Received: from localhost ([127.0.0.1]:50118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdvuP-00056U-CG for submit@debbugs.gnu.org; Sat, 14 Nov 2020 08:48:05 -0500 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:36518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdvuN-00055x-LQ for 44629@debbugs.gnu.org; Sat, 14 Nov 2020 08:48:04 -0500 Original-Received: by mail-wr1-f43.google.com with SMTP id j7so13435974wrp.3 for <44629@debbugs.gnu.org>; Sat, 14 Nov 2020 05:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=3tyhiwsGDq7bHE6n1QlWrF7ql0IuhP6opSX+4/r5p6I=; b=R7FS7KlyioXVYDBJPhoULYqRaax8368FNYcCsgN28qPbf4P5XujuWTz2RZ8CzCx6kR nl349WrSukPf5ml1wlr/0lKsrUh28nbk9QPUH2EPVgMNCTf6Se9rcwLgafsU64Iy1oIn BjGi0hGwSqoTjdwfQizpQ46CiUnrcadmL2nmMizvhYa9p6xdpjfn/ssW8aqJtR88MX77 VDZQSFEh7R2ltfS9CPhINroaMUVEmn6CS5LBrVYvlpSNJYnqJJ7d7Q7/Qv3Vvoc/eOvQ peiGWETd0yoRWXCuHv5cEr6gEuY2sT8vlwLeAjz0kbvRkMCmCFRSMcy3FXlXWauK+aPg Hqiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=3tyhiwsGDq7bHE6n1QlWrF7ql0IuhP6opSX+4/r5p6I=; b=kQYKEhU/irGb2PlPcvL8j1u3wcHOcowlSziimy3tEz1woa1vZCYFB8lemBzSPhIycI hModq7acvOKF9rurR8QwVmyeIVPF9vGoQCWtbSuoCIEKPksUpLCxgrwOyPzZRO1WVp43 izCHwSL5+r4nWiqxiO+/rx1mnocuWy/teP+ScujoieFieG33QBp8X26+4ki5C4LdMMBo H/h13DZ4g0Odje6xgLEdHaUXLTIfwn5SjLwH6LjMggUjLALPuPa/pLbEmscR5FMHQKMU aYlnNe6mwRhICuqvcyfjW4MDAz9gwNkT0LUzxkfsVC/uE71oNNPB6syotuVcJf+Y2xnw STwA== X-Gm-Message-State: AOAM530dgjJ7EHUF8r9S9NkiZumgSqJdfJaw3cV1hAPrkxtTmYaY2fjQ 1HrJM5EEPrG/C5VLK+qvsrrNSqFYvPo= X-Google-Smtp-Source: ABdhPJz32G28W08V6gauqs2vqbVu89mR7VUnf9BJMqU1ArjBoSn/3GZxO23SOTi/MPH2BgCPMuLGtg== X-Received: by 2002:adf:f146:: with SMTP id y6mr9693603wro.298.1605361677536; Sat, 14 Nov 2020 05:47:57 -0800 (PST) Original-Received: from krug ([89.180.145.0]) by smtp.gmail.com with ESMTPSA id w15sm15400967wrp.52.2020.11.14.05.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 05:47:56 -0800 (PST) In-Reply-To: <875z68p5mr.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sat, 14 Nov 2020 10:58:04 +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" Xref: news.gmane.io gmane.emacs.bugs:193277 Archived-At: "Basil L. Contovounesios" writes: > X-Debbugs-Cc: "Jo=C3=A3o T=C3=A1vora" > Severity: minor Hi Basil, and thanks for X-Debbugs-CC'ing me in this message. This is indeed the way I hope to handle Eglot bugs in the future: via email and the Emacs bug tracker. > Perhaps Eglot could/should bind view-inhibit-help-message around > gfm-view-mode? Any other ideas? I'd have no problem with that, but as you've noted, it doesn't work when other modes also use `read-only-mode`. I think this is more of an Emacs echo-area congestion problem than an Eglot one. view-read-only seems a bit akward, I'd say, but it's been around such a long time that I won't argue for changing it. I'd say the fix here is for Eglot, jsonrpc.el and all all other code that needs to set a buffer read only for implementation purposes just sets the variable buffer-read-only. In fact, the docstring of read-only-mode hints at this: ... Do not call this from a Lisp program unless you really intend to do the same thing as the C-x C-q command, including possibly enabling or disabling View mode.=20 ... I wasn't aware of caveat until just now. Alternatively, and very cautiously, we could also say that the echo area message issued by view-mode should only be displayed to the user if it's running interactively, i.e. if it's a direct synchronous consequence of an interactive command. That would exclude elisp code running asynchronously like jsonrpc.el's updating of the events buffer, and probably also the use that ElDoc clients make of `read-only-mode`. In fact, the docstring of called-interactively-p seems to indicate its main use is to cover these use cases. ... The only known proper use of `interactive' for KIND is in deciding whether to display a helpful message, or how to display it. ... In that spirit, maybe this could fix it? diff --git a/lisp/view.el b/lisp/view.el index 204e28c2a2..6233f3ba7d 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -559,7 +559,8 @@ view-mode-enter =20=20=20=20=20 (unless view-mode (view-mode 1) - (unless view-inhibit-help-message + (unless (or view-inhibit-help-message + (not (called-interactively-p 'interactive))) (message "%s" (substitute-command-keys "\ View mode: type \\[help-command] for help, \\[describe-mode] for comma= nds, \\[View-quit] to quit."))))) Jo=C3=A3o