From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#48798: 26.3; `define-minor-mode': Message should name the current buffer where enabled/disabled Date: Tue, 4 Jul 2023 15:25:26 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5283"; mail-complaints-to="usenet@ciao.gmane.io" To: "48798@debbugs.gnu.org" <48798@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 04 17:26:17 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 1qGhuy-0001Bd-M4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Jul 2023 17:26:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGhum-0004Kd-Vt; Tue, 04 Jul 2023 11:26:05 -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 1qGhul-0004K4-Ap for bug-gnu-emacs@gnu.org; Tue, 04 Jul 2023 11:26:03 -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 1qGhul-0002o4-1V for bug-gnu-emacs@gnu.org; Tue, 04 Jul 2023 11:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qGhuk-00042i-HQ for bug-gnu-emacs@gnu.org; Tue, 04 Jul 2023 11:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Jul 2023 15:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48798 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 48798-submit@debbugs.gnu.org id=B48798.168848433515506 (code B ref 48798); Tue, 04 Jul 2023 15:26:02 +0000 Original-Received: (at 48798) by debbugs.gnu.org; 4 Jul 2023 15:25:35 +0000 Original-Received: from localhost ([127.0.0.1]:36455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGhuJ-000421-BS for submit@debbugs.gnu.org; Tue, 04 Jul 2023 11:25:35 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:53216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGhuE-00041p-0A for 48798@debbugs.gnu.org; Tue, 04 Jul 2023 11:25:33 -0400 Original-Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 364EiW8a001023 for <48798@debbugs.gnu.org>; Tue, 4 Jul 2023 15:25:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=fr+Tqq2ARHS/MgKJW22hh1uvGTqVrkDwnoXAu64ZVq8=; b=FvXoB8PJEp0EaNdJwARjFbWEt+mRz7S99H4uaWkDC1ItoZ55gZPquBwKp5ToOLHkh229 8bO1XYyzzrmOSzKQ+EmAGjmLz3noOg7LmAGxXdiujuNEhVIl+GFn5ASR/r+yHc4GUWEz V7Dl9mah8VjzjOVG7Y5F1n1q8T+ANIr5CQPV7MnDiEPyStgvJFeIPSJZ5dLYfwrVH1+9 eI43v6VEvRDOczJRxFl5DA28cvxLpcsS8UbKgWmbLUvGz9jOkvvWu9DW9WSVk2KDUYE+ TkdR82tgLiPj71q//s1RPlvKKfHAHo2KEmodKEPGELVOoNY40aqEi+okI7ZCytHB+dft gQ== Original-Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjax3cvkf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <48798@debbugs.gnu.org>; Tue, 04 Jul 2023 15:25:29 +0000 Original-Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 364EW6Z4040331 for <48798@debbugs.gnu.org>; Tue, 4 Jul 2023 15:25:28 GMT Original-Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rjakahnn6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <48798@debbugs.gnu.org>; Tue, 04 Jul 2023 15:25:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nsh9G+7jh9FuukBV0EIJ6WZ8k9XOSMKP8OOhfl8OfJCclidKBrIiYw2mivkpCcWQl1CNN+J6hfATK8EcGLP+ZgkKrllSZzmrNtWZa5da+Acbp0sLcb5NdAJQsZXyUYZK1yC7S7VTf00s46QKrVz6jzV2r3sVa7llwsjyrba2k1t4esIdQ2z3ugV+EI7wojoFOYlrS1b+/6ShYiDV3AUPSvVg2ygD8mNkS3m2WEaOKmNckJVuEnfRpv/1Q/2epSV1bo4YyH5osQwbDarqAS6eYd5BZCHofD2zXjs7XglzWn5bH4p0onOZiCJgHnk9GXS3y81G+pd+eejCmJobdOiIFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fr+Tqq2ARHS/MgKJW22hh1uvGTqVrkDwnoXAu64ZVq8=; b=J6+it0Y7NzJJu+b3pfI2GxdZxeTIcNXHT9jcVGXUVxsU0Qs2Om4wUABQZ7j6hkp2YH8vaGZ6DVppGOPywu/ozDl9IZ5yDnLkErRPUXP7KYNBvw5/ZDUWdB1/Uoy0Js75Lq/cQpyVs6b0oagSYfmL551MpRoKhWAYEHyofduz++hlcjPWnjF2y9OfZKqvd705D97cNImxfGCFrwLhcoHGTJDfdf7UWBjJUd3Mdnj/DhuFVSv+9DDijJgIU1dRlH4ELjJsprQ8N5w7O/+XKlU71Jg5nfvDXFkwRbfucQ1fqjFHiqZ6WbP1HPGVjZRusWTD9fh9JtFELvg+NFTOfO9HYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fr+Tqq2ARHS/MgKJW22hh1uvGTqVrkDwnoXAu64ZVq8=; b=fKdjcXZ29lIfxpOghHwrXNmyikmx3Gn1z/VM30lvWSghI+IZuiUkNPQqcRQGLUjmsi918IxGeZKjOFwp4A3T7ZRhVcos8d7CATuOf3ndsixp+5F4t3kHNuIBeak3ijxgW1RZ8nlaLYUgzAfcbL5NsOs2v9pr8CrpDLJORFkK8So= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by SA3PR10MB7021.namprd10.prod.outlook.com (2603:10b6:806:314::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Tue, 4 Jul 2023 15:25:26 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::22c4:9389:291e:aeae]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::22c4:9389:291e:aeae%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023 15:25:26 +0000 Thread-Topic: bug#48798: 26.3; `define-minor-mode': Message should name the current buffer where enabled/disabled Thread-Index: AdfC2M5h1NY5z8H+Q9WarldRvHEiJFwiPd2QHsjVhIAAAZgsEA== In-Reply-To: Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|SA3PR10MB7021:EE_ x-ms-office365-filtering-correlation-id: 2d306573-2e97-4811-5dfb-08db7ca2e4c7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nnebg3cYFTfzY5BVQDuwWacRj4MsDXT7GcNsaVKGpZJV2lhkRZdCi5f3F5nceq/PsFPUOYNdgcpvkiotWSTdW79E7xPEogExkHv3enR7q2zbO8HK7ced8ZRvMmxXUVpUXOODlQROKct3E7+8gTnN+k3o0wL7OpVZNpjAE2fWo3+rKtSyNmETfKvsyCfDQKGLbnYQugknxUNk9pfCcfIyPMxmvHRxaJShn+zTJbRGcYPlxC7yRG7qfnaml0mtdyGm0pUnNwBJ21FhHzfn/HHe5KZY3xYJXC55B2blPrJQk8dJom+Gixt0cwVzwTiUvbSgw/j5OU73w8QSE1GyWYJlG4QrDqj5DNywzcvKroElTKHm0B3nSejK1RpnfeNzjYimxuhmvl8xR04FNjztXL1kvi14FN78bl3ugFGEmaHdphOF3otAlAiBTUo575dO8Cvxngz4l0Bc/E5TNcqAIQ4ZAfOrczh8bXrZDXv5y0z81DMf4Nz37n8XVQpmIbdmMt8epMFuIyGwpc7tB3uQxyxe75h+FRvtEQkt3yjNhjOf2ea+dieQH6Kq39AwkrENVSkqVjjnkvnjyMuU3PfmRSnKqlUirSSw1/WJ6yXBTOE+Ir1NJ9tsE0jUeexH93Hn6Ok95ADgVR9hAFS2DDsfXj+nXg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(366004)(346002)(39860400002)(396003)(136003)(451199021)(5660300002)(7696005)(33656002)(52536014)(2906002)(186003)(6506007)(38100700002)(122000001)(9686003)(26005)(38070700005)(2940100002)(44832011)(15650500001)(55016003)(478600001)(83380400001)(316002)(76116006)(64756008)(66556008)(66446008)(6916009)(66476007)(66946007)(86362001)(71200400001)(8676002)(8936002)(41300700001)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: FEnM6aODY/25Mxrrt2oZx1fx6gZxADEY1cCcJeCd9wMqMJ/bHdazsiASDAysbpOXHrtXM3gppwDqli9o1DSMfWCsnR+UR9VFqGsty6NSkZoxmWmiyjBJcMFsuD/utv4ltN+gYVmvrfseAAPw6g/vtfUtWBNtQNrPnrmuCHvwjsTswC1tUALdYoKlgfz/QdqWMwE3FxjwXuKql+3mzXTD54BGA6j2Da7bjq5yEk1ObP6yxWxu6cxamfG8MlelWcsrwR/pnuXz/8N6oWAZi0fBXunIQp61TNbaNveuIsaRE/4hDYsCBppkBuns/3mnCDsXvDcDEISa/iiQciO4jA8G8aBCZ1jL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bBHNlcOKp0nj4JvnBfUIha0dcGjL8ijkqLQJPRoqGAE+gUCtlaoY79yiQXdUh9YyDhA282JT5U3/Yl2AlVhOXBLeLfUllbLEsbkXbEP88imQxasY7gxgCy10nhvaHa+HhLI61Y3rrF9rxbBwXRJDDXwenCAHQsAZPRltmzYhUDq5ftog6EEEa7W0cDheBWxbpoiL0i6xsxgiNYceOv67jJ2cscDwGTThMs4s0AwqdQc4hBkmrtN0tfM2Wblo/Uw5FWqOv sbx47Rm3lIS5pLrDUo X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d306573-2e97-4811-5dfb-08db7ca2e4c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2023 15:25:26.7752 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JaL7sk27DwzYdOIyFrcPRbuDDaMEJLd7NcbXWPknq7TU0oPZFYl0o6kjn/MSOM8hYIPu+Vd3ahtbUdvcR3ec2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR10MB7021 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-04_10,2023-07-04_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 bulkscore=0 suspectscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307040133 X-Proofpoint-GUID: V_4t79hyklAwW_8jBa8LUuNf9WUcMyoU X-Proofpoint-ORIG-GUID: V_4t79hyklAwW_8jBa8LUuNf9WUcMyoU 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:264590 Archived-At: Guess I have to send this again, after unarchiving this bug (as well as 330= 76)? Is it the case that if N bugs were merged then it's not enough to una= rchive one of them - you need to unarchive all of them? > > The same problem persists - bugs #33076 and #48798. > > > > It's quite possible to not notice - or even not be > > able to easily see - which buffer is current when > > it's changed to/from read-only. It just makes > > sense to tell users which buffer is involved. > > > > Really hard to believe this isn't obvious and the > > trivial fix wasn't applied. This just makes life > > that much harder for users, with no benefit to Emacs. >=20 > Perhaps the problem is more noticeable if buffers > are in separate frames. Especially since Emacs > has messed with frame focus so much (since Emacs > 26, at least). If the buffer you thought was > current with its window selected is not, for some > reason (e.g. gratuitous Emacs frame-focus switch), > then the message doesn't help at all if you have > multiple buffers in separate frames etc. >=20 > I'm guessing that this might be why Lars didn't > think this was a real problem. It might be less > noticeable if you're not a victim of Emacs's > gratuitous frame focus-switching. >=20 > But even if that's not the case, I see no reason > why this shouldn't be fixed. _Whatever_ the > reason might be why someone doesn't know or isn't > sure which buffer had the focus, why not have a > message that tells you what Emacs actually did? >=20 > Please reopen this bug and apply the trivial fix. > Thx. I'd really not like to have to redefine > `define-minor-mode' for my own use, just to fix > this annoyance. To me, this message improvement > for users should be a no-brainer. I'm asking again that this be fixed. I'm not asking that such a message be changed for all modes, i.e., a change in `define-minor-mode'. Whether that would be appropriate is TBD - a different question. It could be asked, but I'm not asking it here. =20 For this enhancement request I'm asking only that this be fixed for `read-only-mode'. In various situations it can be nonobvious which buffer's read-only state was changed. And there's really no good reason why the buffer name shouldn't be included in the msg. And no objective reason was given - the only reason given was that Lars subjectively found the fix to be "more annoying than informative". Whether or not the code below is the right fix is for you to decide. It gets the job done and shows what the behavior should be. I don't care how the fix gets implemented. (defun ro-echo-buffer () "Echo `buffer-read-only' value, showing buffer name." (message "Read-only mode is %s in buffer `%s'" (if buffer-read-only 'ON 'OFF) (current-buffer))) (add-hook 'read-only-mode-hook 'ro-echo-buffer) Please reconsider Emacs not letting users see this little bit of important info in the msg. ___ As for whether ON/OFF is kosher, vs the more verbose and less noticeable enabled/disabled: I think it should be. In fact, I think it's preferable, at least in a message. And Emacs itself sometimes says that a mode is "active" instead of "enabled". (e.g. allout.el, autorevert.el) I think uppercase ON and OFF stand out clearly in such a message, and that helps.