emacs-pretest-bug
[Top][All Lists]
Advanced

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

Problem with post-command-idle-hook (which-func.el)


From: Tim Van Holder
Subject: Problem with post-command-idle-hook (which-func.el)
Date: 20 May 2003 09:48:04 +0200

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the address@hidden mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

Ever since yesterday morning's build, I got an error upon emacs startup:

Error in post-command-idle-hook: (invalid-function (macro . #[(window &rest 
body) ÂÃÄBB        BB‡ [window body save-selected-window select-window ((quote 
norecord))] 4 1636684]))

I ran a grep on the lisp files, and the only one I use that also used
post-command-idle-hook was which-func.el.

The following patchlet switches which-func to the use of run-with-idle-timer
(using half-second updates, which is probably responsive enough); with this
patch the error no longer appears.

--- lisp/which-func.el.~1.32.~  2003-05-19 09:24:22.000000000 +0200
+++ lisp/which-func.el  2003-05-20 09:40:50.000000000 +0200
@@ -175,6 +175,8 @@ It creates the Imenu index for the buffe
 ;;;###autoload
 (defalias 'which-func-mode 'which-function-mode)
 
+(defvar which-func-update-timer nil)
+
 ;; This is the name people would normally expect.
 ;;;###autoload
 (define-minor-mode which-function-mode
@@ -188,14 +190,16 @@ and off otherwise."
   (if which-function-mode
       ;;Turn it on
       (progn
-        (add-hook 'post-command-idle-hook 'which-func-update)
+        (setq which-func-update-timer
+              (run-with-idle-timer 0.5 t 'which-func-update))
         (dolist (buf (buffer-list))
           (with-current-buffer buf
             (setq which-func-mode
                   (or (eq which-func-modes t)
                       (member major-mode which-func-modes))))))
     ;; Turn it off
-    (remove-hook 'post-command-idle-hook 'which-func-update)
+    (cancel-timer which-func-update-timer)
+    (setq which-func-update-timer nil)
     (dolist (buf (buffer-list))
       (with-current-buffer buf (setq which-func-mode nil)))))
 


In GNU Emacs 21.3.50.1 (i686-pc-linux-gnu)
 of 2003-05-20 on leeloo
configured using `configure '--with-png' '--with-tiff' '--with-jpeg' 
'--with-gif' '--prefix=/opt/gcc3' '--with-x-toolkit=gtk''

-- 
Tim Van Holder <mailto:address@hidden>
Anubex         <http://www.anubex.com>




reply via email to

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