emacs-devel
[Top][All Lists]
Advanced

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

RE: question about "Making change-major-mode-hook buffer-local while loc


From: Drew Adams
Subject: RE: question about "Making change-major-mode-hook buffer-local while locally let-bound!"
Date: Mon, 21 Jun 2010 21:10:50 -0700

>  (make-local-variable 'emacs-lisp-mode-hook)
>  (make-local-variable 'change-major-mode-hook)
>  (let ((emacs-lisp-mode-hook    nil)
>        (change-major-mode-hook  nil))
>    (emacs-lisp-mode))
> 
> Those hooks are not permanent-local, so they'll be emptied and
> repopulated as needed by the call to emacs-lisp-mode.
> So you could probably just do:
> 
>  (set (make-local-variable 'emacs-lisp-mode-hook) nil)
>  (set (make-local-variable 'change-major-mode-hook) nil)
>  (emacs-lisp-mode)

Very clear; thank you.

> > What is gained by having such a runtime message?
> 
> This messages is linked to a problematic circumstance where 
> Emacs tries to do its best, but where the code should ideally
> be changed to avoid such a circumstance.  So it's important
> to detect and warn about those cases, and sadly, I don't know
> how to do it at a better time.

This, however, is not so clear. ;-)  What I take away from it is that there is
some unspecified problem somewhere that has no easy solution, so to encourage
programmers not to write code that might manifest the problem you think it best
to issue a runtime message about the problematic code.

That doesn't sound like a good approach, to me, but you know the details, not I.
I suppose it is a serious problem, in order to make it warrant such a strange
remedy.

Anyway, thanks very much for the explanation above.




reply via email to

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