emacs-devel
[Top][All Lists]
Advanced

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

bug in overlays-at/overlays-in


From: Michael Kifer
Subject: bug in overlays-at/overlays-in
Date: Sat, 05 Jan 2002 19:38:41 -0500

It seems that overlays-at/overlays-in fail to catch some live overlays
sometimes, or the problem is somewhere deeper than that.
This bug showed up in the 21.* series. The 20.* series was ok.

Here is a sniplet that runs into this problem:

(progn
  (add-hook 'minibuffer-setup-hook 'my-mini-hook)
  (defvar my-mini-overlay)
  (make-variable-buffer-local 'my-mini-overlay)
  (put 'my-mini-overlay 'permanent-local t)
  
  (defun my-mini-hook ()
    (message "Overlay already exists: %S "  (overlayp my-mini-overlay))
    (or (overlayp my-mini-overlay)
    (setq my-mini-overlay (make-overlay 1 5 (current-buffer))))
    
    (message "Minibuffer overlay: %S "  my-mini-overlay)
    (message "Overlays at pos 2: %S "  (overlays-at 2))
    
    (overlay-put my-mini-overlay 'evaporate nil)
    (overlay-put my-mini-overlay 'face 'modeline))
  )

It adds a minibuffer setup hook, my-mini-hook.
When called, the hook creates an overlay in the
minibuffer, if this overlay doesn't already exist.
The overlay is saved in the buffer-local, permanent variable
my-mini-overlay.

If you first visit a file, you will see that part of the prompt is shaded
due to that minibuffer overlay. However, on the second visit, nothing is
shaded. 
If you look in *Messages* you will see that the overlay created by the
first visit still exists in *Minibuf-1*, but it is not picked up by
overlays-at (the same happens with overlays-in). 

Furthermore, since the overlay exists, but the minibuffer isn't 
highlighted, it means that there is a bug somewhere else in the code.


Michael Kifer
address@hidden  



reply via email to

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