From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#30171: 27.0.50; {add-to,remove-from}-invisibility-spec don't treat t specially Date: Wed, 18 Apr 2018 13:34:42 +0200 Message-ID: <87vacod9yl.fsf@mouse.gnus.org> References: <87d0yxh8ji.fsf@mouse.gnus.org> <831sfd2g9w.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1524051611 724 195.159.176.226 (18 Apr 2018 11:40:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2018 11:40:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: p.stephani2@gmail.com, 30171@debbugs.gnu.org, Stefan Monnier To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 18 13:40:06 2018 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 1f8lRW-0008UI-AH for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Apr 2018 13:40:06 +0200 Original-Received: from localhost ([::1]:51003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8lTb-0006Lc-Ft for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Apr 2018 07:42:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8lNe-0002cn-0i for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 07:36:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8lNa-0005Ud-3I for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 07:36:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50616) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f8lNZ-0005UU-Vs for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 07:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f8lNZ-0007pr-NW for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 07:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 11:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30171 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 30171-submit@debbugs.gnu.org id=B30171.152405131430064 (code B ref 30171); Wed, 18 Apr 2018 11:36:01 +0000 Original-Received: (at 30171) by debbugs.gnu.org; 18 Apr 2018 11:35:14 +0000 Original-Received: from localhost ([127.0.0.1]:58513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8lMk-0007on-IJ for submit@debbugs.gnu.org; Wed, 18 Apr 2018 07:35:14 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:54101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8lMf-0007ob-5K for 30171@debbugs.gnu.org; Wed, 18 Apr 2018 07:35:09 -0400 Original-Received: from 46.67.12.60.tmi.telenormobil.no ([46.67.12.60] helo=corrigan) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1f8lMU-0008Re-Lk; Wed, 18 Apr 2018 13:35:00 +0200 Original-Received: from larsi by corrigan with local (Exim 4.89) (envelope-from ) id 1f8lMJ-0003qK-NV; Wed, 18 Apr 2018 13:34:43 +0200 In-Reply-To: <831sfd2g9w.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 18 Apr 2018 09:13:47 +0300") 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:145566 Archived-At: Eli Zaretskii writes: >> From: Lars Ingebrigtsen >> Date: Tue, 17 Apr 2018 22:39:29 +0200 >> Cc: 30171@debbugs.gnu.org >> >> In any case, perhaps calling `remove-from-invisibility-spec' that's not >> in the spec anyway shouldn't alter it? It's certainly surprising. > > If the only problem is the surprising behavior, I'd prefer to document > it rather than potentially open a can of worms. The change below is the cause of this odd feature set, and I wonder whether Stefan (who made the change) meant for it to do what it does. The relevant bit commit message seems to be "Handle the t case". Stefan, the issue is that t and `(t)' mean wildly differing things: `t' means "hide everything that has an invisibility spec" and `(t)' means "hide the things that has an invisibility spec `eq' to `t'." So if the spec was t, and you remove `foo', you end up with `(t)', which means that if you had invisible text that was `eq' to `bar', that suddenly becomes visible. If you understand what I mean. :-) diff --git a/lisp/subr.el b/lisp/subr.el index 5d40aaae41..535fa2d3d0 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4066,9 +4066,10 @@ add-to-invisibility-spec (defun remove-from-invisibility-spec (element) "Remove ELEMENT from `buffer-invisibility-spec'." - (if (consp buffer-invisibility-spec) - (setq buffer-invisibility-spec - (delete element buffer-invisibility-spec)))) + (setq buffer-invisibility-spec + (if (consp buffer-invisibility-spec) + (delete element buffer-invisibility-spec) + (list t)))) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no