bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30204: 27.0.50; Changing major mode resets non-default invisibility


From: Lars Ingebrigtsen
Subject: bug#30204: 27.0.50; Changing major mode resets non-default invisibility spec
Date: Fri, 13 Aug 2021 14:50:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Philipp Stephani <p.stephani2@gmail.com> writes:

> C-x b *foo* RET
> M-: (progn (add-to-invisibility-spec 'bar) (insert (propertize "foo" 
> 'invisible 'foo)))
>
> Now "foo" is visible, as it should be.
>
> M-x fundamental-mode => "foo" becomes invisible, because
> `kill-all-local-variables' has reset `buffer-invisibility-spec' to t.
> This can be confusing for modes that use conditional invisibility
> properties such as markdown-mode.

I'm not quite sure I understand the problem here -- if you have a buffer
in markdown-mode (that's set these properties), why would you change to
fundamental-mode?

And I think this is correct behaviour -- if you've switched to
fundamental-mode, then you don't want these remnants from markdown-mode
to survive, I think?

>  Why can't you make buffer-invisibility-spec be a permanent-local
>  variable in the cases where that is TRT?
> 
>  Hmm, yes, that sounds like a good idea. Let me try that. 
> 
> I don't think this works: The permanent-local property is a global symbol
> property, but I'd need it to be per-buffer. 

Yes, I don't think we have any mechanism that says "this buffer-local
value should survive if you change major mode, but only this one".  And
I think that's probably a good idea, because it sounds like a confusing
interface.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]