From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#20971: 24.4; occur-1 makes my buffer read-only Date: Mon, 30 Sep 2019 01:16:55 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="174750"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 20971@debbugs.gnu.org To: Alex =?UTF-8?Q?Schr=C3=B6der?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 30 01:18:25 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEiSK-000jFb-Gv for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 01:18:20 +0200 Original-Received: from localhost ([::1]:42650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEiSJ-0007cb-F3 for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Sep 2019 19:18:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42061) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEiS4-0007cD-DR for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2019 19:18:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEiS3-0005f0-0o for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2019 19:18:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47269) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iEiS2-0005ek-G2 for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2019 19:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iEiS2-0006YH-9t for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2019 19:18:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Sep 2019 23:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20971 X-GNU-PR-Package: emacs Original-Received: via spool by 20971-submit@debbugs.gnu.org id=B20971.156979903425074 (code B ref 20971); Sun, 29 Sep 2019 23:18:02 +0000 Original-Received: (at 20971) by debbugs.gnu.org; 29 Sep 2019 23:17:14 +0000 Original-Received: from localhost ([127.0.0.1]:56087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEiRG-0006WM-3A for submit@debbugs.gnu.org; Sun, 29 Sep 2019 19:17:14 -0400 Original-Received: from mail-pf1-f178.google.com ([209.85.210.178]:40867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEiRE-0006W6-Rz for 20971@debbugs.gnu.org; Sun, 29 Sep 2019 19:17:13 -0400 Original-Received: by mail-pf1-f178.google.com with SMTP id x127so4467075pfb.7 for <20971@debbugs.gnu.org>; Sun, 29 Sep 2019 16:17:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=eA7f5voKH0GuOj5+iWyrYhW7RJNSVnxgImQ2dn4Z0FQ=; b=gNd/d8JcFQj5VH88N6CK1oltgYIMbBkiBUctqd/JK15chB/Bwn8UehHlQsLk4i3JmX jWRqr51ehy4QoChYWsi85hInzhPDWH38fnE8SdL8BgSj1vvlNi9UZYsLD+NezsvA/FzC jz39NsIAhOWLnOY2sLo62i7lGepJkyS+OR98QX37cLc86ukfT01pz7M3/5/UoFe2e38e w5kEuMvV5JT64QszKYSyvKfmd7GYSgB3EpeddplyFSZVIGR5XzO8qGObdG74s9DVA2V/ WVuyOY7prGSxRhgnvqc1ws1sseK2AW2AQ9ufpc3Vl9vxxYtKE59dMZZ7zN9sZdEMF3iZ 5ZMQ== X-Gm-Message-State: APjAAAXPHAzbHASwQQaYe72Rh2gwlxBD7r6mygiW6a+lnhyPkUxI39XZ 1ZpXVdph5xDdsFyZeQrRZaP1YJODxdcKhYTIzbE= X-Google-Smtp-Source: APXvYqwXprq6RMiPHFV1XZSSygNuWsP6eQQmwNaEi00RMOR1kpQ3WXNRyhOeAWimATA2KotFWLylIE+vGw82pT5uukU= X-Received: by 2002:a63:1310:: with SMTP id i16mr19724763pgl.200.1569799026990; Sun, 29 Sep 2019 16:17:06 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167766 Archived-At: Alex Schr=C3=B6der writes: > Indeed, the problem goes away with emacs -Q. I investigated further and f= ound that the culprit is display-buffer-function > being set to popwin:display-buffer. Thus, I can load my current config an= d evaluate (setq display-buffer-function nil). The > problem will disappear. > > I still think that my patch is the right solution. The current code expec= ts display-buffer to behave in a certain way and > Emacs gives us a ton of ways to change that. Thus, we either need to expl= icitly set the current buffer, or we can do away > with trying to make *Occur* read-only. And really, who needs that? Even i= f we don't set buffer-read-only, the buffer has no > self-insert-command bindings, and if you try to C-k the header, it will s= till say "Text is read-only: #" > because there is a read-only text-property. And why shouldn't you delete = matches? > > Thus, as far as I can tell, my change makes the code more robust (no long= er depending on display-buffer to work in a > particular way) and it has practically no drawbacks. I think *Occur* should definitely be read-only, so your first patch is the wrong solution in my opinion. On the other hand, I see no drawbacks with wrapping the relevant calls in: (with-current-buffer occur-buf ...) At the very least, that would make the intention of that code a bit more clear. But that entire part of the code is already wrapped in (with-current-buffer occur-buf ...). So why are we not in occur-buf already? Best regards, Stefan Kangas