From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex =?UTF-8?Q?Schr=C3=B6der?= Newsgroups: gmane.emacs.bugs Subject: bug#20971: 24.4; occur-1 makes my buffer read-only Date: Fri, 03 Jul 2015 13:09:24 +0000 Message-ID: References: <83twtlzbs3.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d043893bd6f52720519f84466 X-Trace: ger.gmane.org 1435929028 7116 80.91.229.3 (3 Jul 2015 13:10:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jul 2015 13:10:28 +0000 (UTC) Cc: 20971@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 03 15:10:20 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZB0jT-0000bv-Db for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Jul 2015 15:10:19 +0200 Original-Received: from localhost ([::1]:41146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB0jS-00034t-S3 for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Jul 2015 09:10:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB0jP-00034f-Cj for bug-gnu-emacs@gnu.org; Fri, 03 Jul 2015 09:10:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZB0jE-0003WY-EN for bug-gnu-emacs@gnu.org; Fri, 03 Jul 2015 09:10:15 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB0jE-0003Vt-C6 for bug-gnu-emacs@gnu.org; Fri, 03 Jul 2015 09:10:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZB0jD-0002zi-SU for bug-gnu-emacs@gnu.org; Fri, 03 Jul 2015 09:10:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex =?UTF-8?Q?Schr=C3=B6der?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Jul 2015 13:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20971 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20971-submit@debbugs.gnu.org id=B20971.143592898211479 (code B ref 20971); Fri, 03 Jul 2015 13:10:03 +0000 Original-Received: (at 20971) by debbugs.gnu.org; 3 Jul 2015 13:09:42 +0000 Original-Received: from localhost ([127.0.0.1]:38327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZB0is-0002z4-2l for submit@debbugs.gnu.org; Fri, 03 Jul 2015 09:09:42 -0400 Original-Received: from mail-wi0-f178.google.com ([209.85.212.178]:36010) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZB0ip-0002yp-Rc for 20971@debbugs.gnu.org; Fri, 03 Jul 2015 09:09:40 -0400 Original-Received: by widjy10 with SMTP id jy10so109720934wid.1 for <20971@debbugs.gnu.org>; Fri, 03 Jul 2015 06:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=3BH9w80WQySOhpNDXz2ceD8DPRzK4+SWhEtN7oeMdUE=; b=gTpW4zaXWzZgDb2z2mbNEdBji2zQtruju2XnCX4ZI5PLmGYMRFWo1nNWX0c3U+HpLA fHrTr9EE0TDxGGrYWtFyX6zSRGUl3m0ZFiXD2DJxGEias2FK6/POB4mDB9knk9eOJU3k OxcSsynAPJ9vuRqGAa/zbeaYPuU4fmzW5uHy+J5DRfQGZbBt6wK+SCFmHbdANvtC7uhV aUuEjEnDUXsRTlbA4gmGlFydGUOImed8mTgwJIdzvbPpwleNWkgSO0EKiY4Sv2Hy9bwQ nvL9nRUtxvrIsAqPBdIk2Q94vCWwDNz+VASHV72BWIEsWxUEBG+8d9nk2U70hVUaIj2B wuAw== X-Received: by 10.180.77.68 with SMTP id q4mr25543763wiw.22.1435928974281; Fri, 03 Jul 2015 06:09:34 -0700 (PDT) In-Reply-To: <83twtlzbs3.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104653 Archived-At: --f46d043893bd6f52720519f84466 Content-Type: text/plain; charset=UTF-8 Indeed, the problem goes away with emacs -Q. I investigated further and found that the culprit is display-buffer-function being set to popwin:display-buffer. Thus, I can load my current config and evaluate (setq display-buffer-function nil). The problem will disappear. I still think that my patch is the right solution. The current code expects display-buffer to behave in a certain way and Emacs gives us a ton of ways to change that. Thus, we either need to explicitly set the current buffer, or we can do away with trying to make *Occur* read-only. And really, who needs that? Even if 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 still 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 longer depending on display-buffer to work in a particular way) and it has practically no drawbacks. --f46d043893bd6f52720519f84466 Content-Type: text/html; charset=UTF-8
Indeed, the problem goes away with emacs -Q. I investigated further and found that the culprit is display-buffer-function being set to popwin:display-buffer. Thus, I can load my current config and evaluate (setq display-buffer-function nil). The problem will disappear.

I still think that my patch is the right solution. The current code expects display-buffer to behave in a certain way and Emacs gives us a ton of ways to change that. Thus, we either need to explicitly set the current buffer, or we can do away with trying to make *Occur* read-only. And really, who needs that? Even if 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 still say "Text is read-only: #<buffer *Occur*>" 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 longer depending on display-buffer to work in a particular way) and it has practically no drawbacks.
--f46d043893bd6f52720519f84466--