all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: RE: question about "Making change-major-mode-hook buffer-local while locally let-bound!"
Date: Mon, 21 Jun 2010 21:10:50 -0700	[thread overview]
Message-ID: <80A8EA57888645DB9610A635D8BC0706@us.oracle.com> (raw)
In-Reply-To: <jwvzkync3w8.fsf-monnier+emacs@gnu.org>

>  (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	other threads:[~2010-06-22  4:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-20 16:51 question about "Making change-major-mode-hook buffer-local while locally let-bound!" Drew Adams
2010-06-20 18:31 ` question about "Making change-major-mode-hook buffer-local whilelocally let-bound!" Drew Adams
2010-06-20 20:56   ` Davis Herring
2010-06-20 21:24     ` Drew Adams
2010-06-20 23:15 ` question about "Making change-major-mode-hook buffer-local while locally let-bound!" Johan Bockgård
2010-06-20 23:29   ` question about "Making change-major-mode-hook buffer-localwhile " Drew Adams
2010-06-22  0:28 ` question about "Making change-major-mode-hook buffer-local while " Stefan Monnier
2010-06-22  4:10   ` Drew Adams [this message]
2010-06-22  5:01     ` Davis Herring
2010-06-22  5:44       ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2010-06-20 20:38 MON KEY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80A8EA57888645DB9610A635D8BC0706@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.