From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lute Kamstra Newsgroups: gmane.emacs.devel Subject: Re: org-mode and mode hooks. Date: Wed, 25 May 2005 19:01:09 +0200 Message-ID: <87vf579r56.fsf@xs4all.nl> References: <87y8a3mnz8.fsf@xs4all.nl> <87ll63weye.fsf-monnier+emacs@gnu.org> <87wtpnl38q.fsf@xs4all.nl> <200505251636.j4PGaB024563@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1117040822 6924 80.91.229.2 (25 May 2005 17:07:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 May 2005 17:07:02 +0000 (UTC) Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, dominik@science.uva.nl Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 25 19:06:53 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DazK3-0000mr-Qa for ged-emacs-devel@m.gmane.org; Wed, 25 May 2005 19:05:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DazNx-0007RF-Lz for ged-emacs-devel@m.gmane.org; Wed, 25 May 2005 13:09:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DazNK-0007Fm-1X for emacs-devel@gnu.org; Wed, 25 May 2005 13:08:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DazNF-0007DF-G9 for emacs-devel@gnu.org; Wed, 25 May 2005 13:08:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DazND-00079O-SZ for emacs-devel@gnu.org; Wed, 25 May 2005 13:08:52 -0400 Original-Received: from [194.109.24.32] (helo=smtp-vbr12.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DazGJ-0000Y9-EF for emacs-devel@gnu.org; Wed, 25 May 2005 13:01:43 -0400 Original-Received: from pijl (a80-127-67-124.adsl.xs4all.nl [80.127.67.124]) by smtp-vbr12.xs4all.nl (8.13.3/8.13.3) with ESMTP id j4PH1Ai7017072; Wed, 25 May 2005 19:01:10 +0200 (CEST) (envelope-from Lute.Kamstra@xs4all.nl) Original-Received: from lute by pijl with local (Exim 3.36 #1 (Debian)) id 1DazFl-0001pF-00; Wed, 25 May 2005 19:01:09 +0200 Original-To: Luc Teirlinck In-Reply-To: <200505251636.j4PGaB024563@raven.dms.auburn.edu> (Luc Teirlinck's message of "Wed, 25 May 2005 11:36:11 -0500 (CDT)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Original-Lines: 41 X-Virus-Scanned: by XS4ALL Virus Scanner X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37626 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37626 Luc Teirlinck writes: > Lute Kamstra wrote: > > It is a problem in combination with a global minor mode defined with > define-global-minor-mode since this change: > > 2005-05-22 Luc Teirlinck > > * emacs-lisp/easy-mmode.el (define-global-minor-mode): Use > `after-change-major-mode-hook' instead of `find-file-hook'. > > See another message of mine in this thread. > > I guess `define-global-minor-mode' could use both > `after-change-major-mode-hook' and `find-file-hook', although unless > special care is taken, that could mean that the hook function is run > twice. As I understand it, only the first call of GLOBAL-MODE-buffers will have effect, because it clears the list variable GLOBAL-MODE-buffers. after-change-major-mode-hook is run before find-file-hook. If after-change-major-mode-hook is run too early, that can have negative effects. In the case of global-font-lock-mode, calling global-font-lock-mode-buffers before setting font-lock-defaults is a problem. > But that would not eliminate the need for modes to run > `after-change-major-mode-hook' at their end. The code before I > changed it failed if the mode was run from a timer or by a process. > > The fallback for modes that do not use `after-change-major-mode-hook' > yet is post-command-hook. Even without `after-change-major-mode-hook' > things should work out OK if you do `M-x org-mode' or visit a file > with `C-x C-f'. I believe that the only problems should be modes run > from timers or processes. You seem only to consider the problem that GLOBAL-MODE-buffers is not called. It can also be a problem when it is called too early. Lute.