Subject: bug#8914: 23.3; Overlay overlapping buffer-invisibility-spec behaves oddly

From: David Aspinall <[email-masked]>
Date: Tue, 21 Jun 2011 16:57:32 +0100

Insert the text below into a buffer,

   M-x eval-buffer RET
   M-x toggle-invis

The smaller area remains visible, although there is a surrounding
overlay which has an invisibility spec which should cover the revealed
characters.  

I suppose this is debatable, but intuitively I would expect the whole
larger region to be made invisible.

It seems similar to the case where faces properties are not merged when
one might expect them to be, e.g. see how mouse highlighting in *info*
buffer obliterates underline and colouring of text underneath.  See report
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4911 (how can I find out the
status of this?)

 - David Aspinall

-------- snip ------

;;;
;;; === Test area for invisibility ===
;;;
(defvar vis nil)

(overlay-put (make-overlay 18 22) 'invisible 'smaller)
(overlay-put (make-overlay 9 43) 'invisible 'larger)

(defun toggle-invis ()
  (interactive)
  (if vis 
      (add-to-invisibility-spec '(larger . t))
    (remove-from-invisibility-spec '(larger . t)))
  (setq vis (not vis)))

In GNU Emacs 23.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.24.3)
 of 2011-03-22 on x86-15.phx2.fedoraproject.org
Windowing system distributor `Fedora Project', version 11.0.10905000
configured using `configure  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-red
hat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr
' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/e
tc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--l
ibexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--man
dir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--wit
h-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--wit
h-x-toolkit=gtk' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-lin
ux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexcept
ions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_GB.utf8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Features:
(shadow sort mail-extr message idna sendmail ecomplete rfc822 mml
mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
sha1 sha1-el hex-util hashcash mail-utils emacsbug pp parse-time vc-cvs
tar-mode jka-compr tabify man assoc make-mode preview prv-emacs byte-opt
warnings tex-bar tex-buf toolbar-x noutline outline font-latex bytecomp
byte-compile latexenc multi-isearch dired-aux latex edmacro kmacro
tex-style tex advice advice-preload bibtex dired regexp-opt
vc-dispatcher vc-svn help-mode easymenu view help-fns ansi-color shell
comint ring proof-site proof-autoloads pg-vars paren cus-start cus-load
preview-latex emacs-goodies-loaddefs easy-mmode tex-site auto-loads
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
font-setting tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind system-font-setting
font-render-setting gtk x-toolkit x multi-tty emacs)

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.