Subject: 23.1.50; Overlays before-string and after-string does not obey buffer-visibility-spec

From: Lennart Borgman <[email-masked]>
Date: Fri, 17 Jul 2009 22:04:19 +0200

To show this use this code

;;;; Eval this defun, place point at the end of the buffer and call
;;;; it. It inserts text and an overlay in the buffer.
;;;;
;;;; Play with the different buffer invis specs. It looks like the
;;;; overlay is not affected by the specs.

(defun my-test-inv ()
  (interactive)
  (let ((b "some invis parts")
        (ovl (make-overlay (point) (point))))
    (add-text-properties 5 10 '(face secondary-selection
                                     font-lock-face highlight
                                     invisible (my-invis))
                         b)
    (insert ";;;;;;;;;;;; START OF INSERTED TEXT+OVERLAY
;;;;;;;;;;;;;;;;;;;;\n")
    (insert ";; Text: " b "\n")
    (move-overlay ovl (point-max) (point-max))
    (overlay-put ovl 'before-string (propertize "Overlay: " 'face
'secondary-selection))
    (overlay-put ovl 'after-string b)
    ))

;;;;;;; Test these, none affects the overlays `before-string' or `after-string':
;; (setq buffer-invisibility-spec '((my-invis . t) t))
;; (setq buffer-invisibility-spec '((my-invis) t))
;; (setq buffer-invisibility-spec '(t))  ;; This does not work, bug??
;; (setq buffer-invisibility-spec t)
;; (setq buffer-invisibility-spec '(other-invis))

;;;;;;; Delete overlays here:
;; (dolist (ovl (overlays-in (point-min) (point-max))) (delete-overlay ovl))

In GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
 of 2009-06-30
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/g/include -fno-crossjumping'