From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#20971: 24.4; occur-1 makes my buffer read-only Date: Fri, 25 Sep 2020 16:04:37 +0200 Message-ID: <87pn6anea2.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15554"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Alex =?UTF-8?Q?Schr=C3=B6der?= , 20971@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 25 16:05:40 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 1kLoLz-0003vR-Nl for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Sep 2020 16:05:39 +0200 Original-Received: from localhost ([::1]:55310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLoLy-00061l-Oq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Sep 2020 10:05:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLoLO-0005ZD-GG for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2020 10:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLoLO-0002eV-5v for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2020 10:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kLoLO-0003xI-05 for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2020 10:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Sep 2020 14:05:01 +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.160104269415171 (code B ref 20971); Fri, 25 Sep 2020 14:05:01 +0000 Original-Received: (at 20971) by debbugs.gnu.org; 25 Sep 2020 14:04:54 +0000 Original-Received: from localhost ([127.0.0.1]:44997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLoLG-0003wd-2d for submit@debbugs.gnu.org; Fri, 25 Sep 2020 10:04:54 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:40602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLoLC-0003wG-L1 for 20971@debbugs.gnu.org; Fri, 25 Sep 2020 10:04:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=XyFw8ji/P2ehfW1Ka5+X2mNUUDOq3SjpQBI9rnbjUI0=; b=d718WEGvPCUYqulNkOEqKgrEgZ fk6NNKej++oFSwxP20+xYb7UCUMgF0Mu5B1/7MeAFSW5Suj5ofArDN0uZTfKIlqLDU8biHFAZz/qG UarsKntmfTTHbCIHzqy2TaY4HCGXzjYuqTOvYBAhZksQmqOb3O2M6QNqmQn4nvXg/5LU=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLoL0-00032P-Lh; Fri, 25 Sep 2020 16:04:43 +0200 X-Now-Playing: Stephan Mathieu's _FrequencyLib_: "Happy Glow" In-Reply-To: (Stefan Kangas's message of "Mon, 30 Sep 2019 01:16:55 +0200") 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:188973 Archived-At: Stefan Kangas writes: > 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? I am guessing the reporter had some misbehaving code running off of `display-buffer' that changed the current buffer: (display-buffer occur-buf) (when occur--final-pos (set-window-point (get-buffer-window occur-buf 'all-frames) occur--final-pos)) (setq next-error-last-buffer occur-buf) (setq buffer-read-only t) (set-buffer-modified-p nil) (run-hooks 'occur-hook))))))) So everything after displaying the buffer runs somewhere else. We could defensively re-wrap the rest in a with-current-buffer, but... I think the bug is in the code that changed the current buffer, really. So I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no