[Top][All Lists]

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

Re: org-mode and mode hooks.

From: Luc Teirlinck
Subject: Re: org-mode and mode hooks.
Date: Sun, 29 May 2005 21:50:05 -0500 (CDT)

>From my previous message:

   Note that even after this patch, there is one potentially troublesome
   case left...

Sorry, I was confused.  That entire long paragraph makes no sense
(sorry about that).  Without MODE-stored-mode, I can not avoid some
inefficiency for non-file buffers (unnecessarily dis- and re-enable
the mode once), unless I somehow can recognize whether we are running
from a timer or process.  (I can not immediately think of way to do
that.  Is there away?)  Getting rid of the one remaining bug I
described _and_ avoiding a similar inefficiency for file buffers can
be accomplished using the following alternate ,buffers function, so it
seems definitely better than the one in my previous patch:

       ;; The function that calls TURN-ON in each buffer.
       (defun ,buffers ()
         (dolist (buf ,buffers)
           (and (buffer-live-p buf)
                (not buffer-file-name)
                (with-current-buffer buf
                  (when mode (,mode -1))

It is actually _here_ (in after-change-major-mode-hook) that disabling
and re-enabling is unlikely to occur, so getting rid of the remaining
bug carries no real price, but getting rid of MODE-stored-hook does
carry some price, for non-file buffers.  I will still think of this further.



reply via email to

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