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: Sun, 15 Nov 2020 09:55:39 +0000 Message-ID: <87blfzkkpw.fsf@gmail.com> References: <875z68p5mr.fsf@tcd.ie> <87wnyokq2c.fsf@gmail.com> <871rgvj1ym.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="2204"; 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 Sun Nov 15 10:56:11 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 1keElX-0000Sj-JE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Nov 2020 10:56:11 +0100 Original-Received: from localhost ([::1]:60734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1keElW-0004tu-Jw for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Nov 2020 04:56:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keElO-0004rf-Qa for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 04:56:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40946) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1keElO-0006PX-GU for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 04:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1keElO-0003iQ-En for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 04:56: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: Sun, 15 Nov 2020 09:56: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.160543415014259 (code B ref 44629); Sun, 15 Nov 2020 09:56:02 +0000 Original-Received: (at 44629) by debbugs.gnu.org; 15 Nov 2020 09:55:50 +0000 Original-Received: from localhost ([127.0.0.1]:52492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keElB-0003hv-Qf for submit@debbugs.gnu.org; Sun, 15 Nov 2020 04:55:50 -0500 Original-Received: from mail-wr1-f51.google.com ([209.85.221.51]:41543) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keElA-0003hi-Mi for 44629@debbugs.gnu.org; Sun, 15 Nov 2020 04:55:49 -0500 Original-Received: by mail-wr1-f51.google.com with SMTP id 23so15373670wrc.8 for <44629@debbugs.gnu.org>; Sun, 15 Nov 2020 01:55:48 -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=cupPibu+xkvyKse2dzBbFA7nSR5317c0/t8WrmVRmo4=; b=tRSbZVZ4Rrjh+WaiuGWnep3vubCLr1Q3OD2XpruQUM9JnsfkMB9AocCWSOmWh2TdVc 0rHcwGi8s7ULQ33aQUf93GiY0Pr8TNuEXSe2+aeZDGRNujovA/RcyUV7Vqaq6nTCEHie NqHTycotLFfRijRcOhDtbL9ysBeRuV4d68UCg+TzMCn8jVC7QLnS0kTxKWXE90ydWMxo WVr0KIY4qf90M2DNQkIFTj+hQhiDBUDP5NTMYFFhD7zutlLGg2ZnyM38PlyYrjobkDJM Cf95/EhQjqy8bxoeqU2mM1WDWDyXss6fj2OaS4JFvikl4Pl/LWJfKZvXIUtrryj535HX +H1w== 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=cupPibu+xkvyKse2dzBbFA7nSR5317c0/t8WrmVRmo4=; b=oN41pM6ccnNUMVbETVdVniOpCffvLrqx+SazGymYfLZdyzdf2js0zKoZinHLSq4BHb 9reEgCsvK4kRtzTDOUt7jF8Xzip8QeQu21MLH8SuZVid7EBZ7zdHnKG1tuWhFNWQR+mD QAMF495sBa5/Cy8nA1P6y/xSgw8sgstnlHt7DexEo/u1AF5ZSAS5Jp/2pB6kUaagyZi7 seWJ9VmR/4x04AyipKjhh02eRxJRekZgSHbxuO0B0PlBAboRdas1Rfr4YzvBEW8LF8Hq qD7R+Ry88HGiw0+UOtPQSOjdW74IgQVQDxGo34focd4+eVLaPOUz4VcA8FWi/tv7Obq8 KnPQ== X-Gm-Message-State: AOAM532vH0bLVcofflaB7xMbmvy3G/TT0f2x2By5G5aAPojtXIQ426hY oHP02Wc5Bea4K/Fy2PuXY69CBXK3e/c= X-Google-Smtp-Source: ABdhPJyAoHDMKqFnA/ZIO3KfEHG+3w6pbTXy5sNGZ9odGQcsHXZ6BvCiVxeHTsDj3LnLUPykd3dg0A== X-Received: by 2002:a05:6000:1:: with SMTP id h1mr13245272wrx.127.1605434142403; Sun, 15 Nov 2020 01:55:42 -0800 (PST) Original-Received: from krug ([89.180.145.127]) by smtp.gmail.com with ESMTPSA id 36sm1499045wrf.94.2020.11.15.01.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2020 01:55:41 -0800 (PST) In-Reply-To: <871rgvj1ym.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sat, 14 Nov 2020 17:13:53 +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:193352 Archived-At: "Basil L. Contovounesios" writes: > Jo=C3=A3o T=C3=A1vora writes: > > [...] > >> 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: > > [...] > >> 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 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=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 co= mmands, \\[View-quit] to quit."))))) > > I don't think so, at least not in that exact manifestation, because > view-mode-enter is seldom, if ever, called interactively. I.e. this > will suppress the help message even when you visit a read-only file. You're of course right. This is for the immediately "containing function", not for the "current stack". But 'this-command' could do the trick; diff --git a/lisp/view.el b/lisp/view.el index 204e28c2a2..2a0fc85cb8 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -559,7 +559,8 @@ view-mode-enter =20=20=20=20=20=20 (unless view-mode (view-mode 1) - (unless view-inhibit-help-message + (unless (or view-inhibit-help-message + (not this-command)) (message "%s" (substitute-command-keys "\ View mode: type \\[help-command] for help, \\[describe-mode] for comm= ands, \\[View-quit] to quit."))))) When I have this, and view-read-only set to t, C-x C-f'ing to /etc/fstab gets me the message but this: (run-with-timer 1 nil (lambda () (find-file "/etc/fstab"))) does not. Anyway, feel free to beat me to the patches to jsonrpc.el and Eglot (the former you can do directly on the tree, the latter can be done via GitHub, or just send me the patch here). Jo=C3=A3o