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

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

Re: find-file seems to hang


From: Kim F. Storm
Subject: Re: find-file seems to hang
Date: Thu, 07 Oct 2004 11:27:02 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     > Any message should go away after a while, if there is a question to be
>     > answered.  
>
>     Yes, it seems like a bug in imenu.
>
>     A simple fix would be to simply remove the message after 0.5 seconds.
>
> If nobody wants to implement a more general fix, could you
> do that specific fix?


The following patch works ok for me.

However, it seems to me that the "scanning for index" messages 
are not actually shown to the user (also without the patch),
as there is no redisplay while running the relevant hook.

But when I added a sit-for after each message call, but when I opened
a 90000 line c file with the following local vars at the top:

/* -*- mode: C; eval: (setq xxx 2); -*-
 */

it triggered jit font locking in some way which caused a very very
long pause before I could do anything.


*** imenu.el    05 Oct 2004 14:14:49 +0200      1.99
--- imenu.el    07 Oct 2004 11:18:54 +0200      
***************
*** 292,297 ****
--- 292,299 ----
    (and (consp (cdr item)) (listp (cadr item))
         (not (eq (car (cadr item)) 'lambda))))
  
+ (defvar imenu--progress-saved-message nil)
+ 
  ;; Macro to display a progress message.
  ;; RELPOS is the relative position to display.
  ;; If RELPOS is nil, then the relative position in the buffer
***************
*** 300,313 ****
  (defmacro imenu-progress-message (prevpos &optional relpos reverse)
    `(and
      imenu-scanning-message
!     (let ((pos ,(if relpos
                    relpos
                  `(imenu--relative-position ,reverse))))
        (if ,(if relpos t
             `(> pos (+ 5 ,prevpos)))
          (progn
            (message imenu-scanning-message pos)
!           (setq ,prevpos pos))))))
  
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- 302,324 ----
  (defmacro imenu-progress-message (prevpos &optional relpos reverse)
    `(and
      imenu-scanning-message
!     (let ((message-log-max nil)
!         (pos ,(if relpos
                    relpos
                  `(imenu--relative-position ,reverse))))
        (if ,(if relpos t
             `(> pos (+ 5 ,prevpos)))
          (progn
+           (if (= pos 0)
+               (setq imenu--progress-saved-message (current-message)))
            (message imenu-scanning-message pos)
!           (setq ,prevpos pos)
!           (if (and (>= pos 100)
!                    imenu--progress-saved-message)
!               (progn
!                 (message "%s" imenu--progress-saved-message)
!                 (setq imenu--progress-saved-message nil))))))))
  
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  

-- 
Kim F. Storm  http://www.cua.dk





reply via email to

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