all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* hideshow.el: permanent local variables
@ 2007-03-01 22:07 Glenn Morris
  2007-03-02  8:26 ` Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2007-03-01 22:07 UTC (permalink / raw)
  To: emacs-devel


Re-raising a small issue I reported ~ 3 years ago (no responses),
since it just annoyed me again. If no-one has a reason why these
should be permanent-local, I would like to change this.


<http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-04/msg00135.html>

hideshow.el gives several variables the permanent-local property:

hs-minor-mode, hs-c-start-regexp, hs-block-start-regexp
hs-block-start-mdata-select, hs-block-end-regexp, hs-forward-sexp-func
hs-adjust-block-beginning

I don't understand why this is desirable; indeed it leads to at least
one problem.

I activate hideshow mode in lisp-based modes with a mode-hook (as per
the suggested usage in the file commentary). When I decide to save my
scratch buffer as a text file, hideshow mode is not killed.

For example, this leads to problems with restoring a desktop:

emacs -q --no-site-file
M-x hs-minor-mode
C-x C-w foo.txt
M-x desktop-save-mode
M-x desktop-save .
M-x desktop-read
   -> "Text Mode doesn't support Hideshow Minor Mode"

This aborts the load of the rest of a desktop.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hideshow.el: permanent local variables
  2007-03-01 22:07 hideshow.el: permanent local variables Glenn Morris
@ 2007-03-02  8:26 ` Richard Stallman
  2007-03-02  8:37   ` David Kastrup
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2007-03-02  8:26 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

    hideshow.el gives several variables the permanent-local property:

    hs-minor-mode, hs-c-start-regexp, hs-block-start-regexp
    hs-block-start-mdata-select, hs-block-end-regexp, hs-forward-sexp-func
    hs-adjust-block-beginning

    I don't understand why this is desirable; indeed it leads to at least
    one problem.

The reason for giving something a `permanent-local' property is so it
will survive a change in major modes.

I don't know what's going on hideshow, but is there some reason one
might want these settings to survive a change in major mode?
(It does seem unlikely.)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hideshow.el: permanent local variables
  2007-03-02  8:26 ` Richard Stallman
@ 2007-03-02  8:37   ` David Kastrup
  2007-03-02 14:37     ` Lennart Borgman (gmail)
  2007-03-02 15:49     ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: David Kastrup @ 2007-03-02  8:37 UTC (permalink / raw)
  To: rms; +Cc: Glenn Morris, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     hideshow.el gives several variables the permanent-local property:
>
>     hs-minor-mode, hs-c-start-regexp, hs-block-start-regexp
>     hs-block-start-mdata-select, hs-block-end-regexp, hs-forward-sexp-func
>     hs-adjust-block-beginning
>
>     I don't understand why this is desirable; indeed it leads to at least
>     one problem.
>
> The reason for giving something a `permanent-local' property is so it
> will survive a change in major modes.
>
> I don't know what's going on hideshow, but is there some reason one
> might want these settings to survive a change in major mode?
> (It does seem unlikely.)

Maybe something to do with mmm-mode?  I don't know how this works in
detail.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hideshow.el: permanent local variables
  2007-03-02  8:37   ` David Kastrup
@ 2007-03-02 14:37     ` Lennart Borgman (gmail)
  2007-03-02 15:15       ` David Kastrup
  2007-03-02 15:49     ` Stefan Monnier
  1 sibling, 1 reply; 7+ messages in thread
From: Lennart Borgman (gmail) @ 2007-03-02 14:37 UTC (permalink / raw)
  To: David Kastrup; +Cc: Glenn Morris, rms, emacs-devel

David Kastrup wrote:

>> The reason for giving something a `permanent-local' property is so it
>> will survive a change in major modes.
>>
>> I don't know what's going on hideshow, but is there some reason one
>> might want these settings to survive a change in major mode?
>> (It does seem unlikely.)
> 
> Maybe something to do with mmm-mode?  I don't know how this works in
> detail.

In that case can't that be handled by mmm-mode, or?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hideshow.el: permanent local variables
  2007-03-02 14:37     ` Lennart Borgman (gmail)
@ 2007-03-02 15:15       ` David Kastrup
  0 siblings, 0 replies; 7+ messages in thread
From: David Kastrup @ 2007-03-02 15:15 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Glenn Morris, rms, emacs-devel

"Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:

> David Kastrup wrote:
>
>>> The reason for giving something a `permanent-local' property is so it
>>> will survive a change in major modes.
>>>
>>> I don't know what's going on hideshow, but is there some reason one
>>> might want these settings to survive a change in major mode?
>>> (It does seem unlikely.)
>>
>> Maybe something to do with mmm-mode?  I don't know how this works in
>> detail.
>
> In that case can't that be handled by mmm-mode, or?

No idea, this was really just a blind guess in the dark.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hideshow.el: permanent local variables
  2007-03-02  8:37   ` David Kastrup
  2007-03-02 14:37     ` Lennart Borgman (gmail)
@ 2007-03-02 15:49     ` Stefan Monnier
  2007-03-04 20:51       ` Glenn Morris
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2007-03-02 15:49 UTC (permalink / raw)
  To: David Kastrup; +Cc: Glenn Morris, rms, emacs-devel

>> I don't know what's going on hideshow, but is there some reason one
>> might want these settings to survive a change in major mode?
>> (It does seem unlikely.)

> Maybe something to do with mmm-mode?  I don't know how this works in
> detail.

I don't think it's got to do with mmm-mode (it might even predate it).
More likely it was just an arbitrary decision.

I believe hs-minor-mode should not be permanent.  Just like
outline-minor-mode.


        Stefan


PS: Note, that if you remove the permanent-local property from these
variables, then you have to add a change-major-mode-hook to turn off the
minor-mode explicitly (so that it erases the overlays).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: hideshow.el: permanent local variables
  2007-03-02 15:49     ` Stefan Monnier
@ 2007-03-04 20:51       ` Glenn Morris
  0 siblings, 0 replies; 7+ messages in thread
From: Glenn Morris @ 2007-03-04 20:51 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: rms, emacs-devel

Stefan Monnier wrote:

> I believe hs-minor-mode should not be permanent.  Just like
> outline-minor-mode.

I made this change.

> PS: Note, that if you remove the permanent-local property from these
> variables, then you have to add a change-major-mode-hook to turn off
> the minor-mode explicitly (so that it erases the overlays).

Thanks, I might not have thought of that.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-03-04 20:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-01 22:07 hideshow.el: permanent local variables Glenn Morris
2007-03-02  8:26 ` Richard Stallman
2007-03-02  8:37   ` David Kastrup
2007-03-02 14:37     ` Lennart Borgman (gmail)
2007-03-02 15:15       ` David Kastrup
2007-03-02 15:49     ` Stefan Monnier
2007-03-04 20:51       ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.