From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#26947: Preserve read-only when debugger with let-bound inhibit-read-only t. Date: Mon, 15 May 2017 17:00:14 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1494892874 12788 195.159.176.226 (16 May 2017 00:01:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 May 2017 00:01:14 +0000 (UTC) To: 26947@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 16 02:01:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAPvJ-00039l-0g for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 May 2017 02:01:09 +0200 Original-Received: from localhost ([::1]:39301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAPvN-0006I2-2C for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 May 2017 20:01:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAPvH-0006HZ-9x for bug-gnu-emacs@gnu.org; Mon, 15 May 2017 20:01:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAPvC-0002DT-Dr for bug-gnu-emacs@gnu.org; Mon, 15 May 2017 20:01:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44485) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dAPvC-0002DJ-AD for bug-gnu-emacs@gnu.org; Mon, 15 May 2017 20:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dAPvC-0004EP-27 for bug-gnu-emacs@gnu.org; Mon, 15 May 2017 20:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 May 2017 00:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26947 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Emacs Bug Reports Original-Received: via spool by submit@debbugs.gnu.org id=B.149489284916238 (code B ref -1); Tue, 16 May 2017 00:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 May 2017 00:00:49 +0000 Original-Received: from localhost ([127.0.0.1]:47162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAPuz-0004Dp-29 for submit@debbugs.gnu.org; Mon, 15 May 2017 20:00:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAPuw-0004Db-VF for submit@debbugs.gnu.org; Mon, 15 May 2017 20:00:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAPuq-00023s-R0 for submit@debbugs.gnu.org; Mon, 15 May 2017 20:00:41 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:36974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dAPuq-00023m-NG for submit@debbugs.gnu.org; Mon, 15 May 2017 20:00:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAPup-0006G5-B6 for bug-gnu-emacs@gnu.org; Mon, 15 May 2017 20:00:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAPuk-00022m-F2 for bug-gnu-emacs@gnu.org; Mon, 15 May 2017 20:00:39 -0400 Original-Received: from gateway34.websitewelcome.com ([192.185.148.196]:32297) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dAPuk-0001yf-6g for bug-gnu-emacs@gnu.org; Mon, 15 May 2017 20:00:34 -0400 Original-Received: from cm4.websitewelcome.com (unknown [108.167.139.16]) by gateway34.websitewelcome.com (Postfix) with ESMTP id ECA7851EAA6 for ; Mon, 15 May 2017 19:00:20 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cm4.websitewelcome.com with id Lo0G1v0191W3Awq01o0H7V; Mon, 15 May 2017 19:00:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WXHDMk8oaJPo6XRvrpdPxDnhv01a3WzPD8e1izGrrxc=; b=GevYjAfbv0BRbAxHhzcD6Ti5X9 2tCLKYxaMvjcGEbNM77VVhcuuxk0+rX5j/gbbBS9x+8DnsGxmIrmERHgFOJhmqqLbMdzEo402tiXz BWNfHIXbJUoiDwTuxZJw5l0hMef8ITayR27xeN88bn/AGFTvRBJmJa9P9jM3p4azkcB8mxuGQSD5l nc7s6WA9tDVwHePojwmNiTnID/9cZQxI8ErWdqe3ueYoaMmAbJOEisdJrp2/xdMbHktr7zmGJged0 UnVn9Va1ZK0HrPa++xN/S9hPPFfHE9p8We48pSL5ZebrSiWoW4GW5QrgDa1gZVnl0MEHxL+VDC0tN 6NwaH06A==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52773 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1dAPuR-000UCq-Ma for bug-gnu-emacs@gnu.org; Mon, 15 May 2017 19:00:15 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dAPuR-000UCq-Ma X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:52773 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 208.118.235.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:132528 Archived-At: Entering the debugger when inhibit-read-only is let-bound to `t` causes all buffers to be read/write even though they may have `buffer-read-only` set to `t`. Step #1: Launch with emacs -q. Step #2: Navigate to the `*scratch*` buffer and set to read-only with C-x C-q. Step #3: Evaluate: (let ((inhibit-read-only t)) (error "stop")) Step #4: Select the window display the `*scratch*` buffer and type something. All open buffers are read/write. Expected Behavior: Protect buffers that have previously been set to `buffer-read-only` with `t`. Workaround: Add the following to the outset of the function `debug`: (when inhibit-read-only (setq inhibit-read-only nil)) The workaround can be perfected to test for whether inhibit-read-only is let-bound to `t` and if it is then ... I say that just in case someone wants `inhibit-read-only` to always be `t` and in that case the debugger shouldn't turn it off. Here is the new thread on emacs.stackexchange.com: https://emacs.stackexchange.com/questions/32829/inhibit-read-only-affects-all-buffers-when-backtrace-buffer-is-open Thanks, Keith