all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug in elide-head
@ 2002-12-06 23:59 Matthias Meulien
  2002-12-07  0:09 ` Matthias Meulien
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Meulien @ 2002-12-06 23:59 UTC (permalink / raw)


Hi,

I think there is a bug in `elide-head'. 

Look at the way the header is made invisible:

(overlay-put elide-head-overlay 'invisible t)

Now suppose you call `elide-head' in a new buffer in `outline-mode';
`outline-mode' had add (outline . t) to `buffer-invisibility-spec', which
made `buffer-invisibility-spec' into a list. But

,----[ C-h v buffer-invisibility-spec RET ]
| (...)
| This variable is always local in all buffers.
| The default is t, which means that text is invisible
| if it has a non-nil `invisible' property.
| If the value is a list, a text character is invisible if its `invisible'
| property is an element in that list.
| If an element is a cons cell of the form (PROP . ELLIPSIS),
| then characters with property value PROP are invisible,
| and they have an ellipsis as well if ELLIPSIS is non-nil.
`----

The header will not disappear because the `invisible' property of the
elide-head-overlay isn't an element of `buffer-invisibility-spec' !
-- 
Matthias

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in elide-head
  2002-12-06 23:59 Bug in elide-head Matthias Meulien
@ 2002-12-07  0:09 ` Matthias Meulien
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Meulien @ 2002-12-07  0:09 UTC (permalink / raw)


Here is a patch.

*** /tmp/elide-head.el	Sat Dec  7 01:08:35 2002
--- /tmp/elide-head.el2851wuw	Sat Dec  7 01:08:35 2002
***************
*** 80,90 ****
  
  This is suitable as an entry on `find-file-hooks' or appropriate mode hooks."
    (interactive "P")
-   (add-to-invisibility-spec '(elide-head . t))
    (if arg
!       (progn
! 	(elide-head-show)
! 	(remove-from-invisibility-spec '(elide-head . t)))
      (save-excursion
        (save-restriction
  	(let ((rest elide-head-headers-to-hide)
--- 80,87 ----
  
  This is suitable as an entry on `find-file-hooks' or appropriate mode hooks."
    (interactive "P")
    (if arg
!       (elide-head-show)
      (save-excursion
        (save-restriction
  	(let ((rest elide-head-headers-to-hide)
***************
*** 107,113 ****
  	    (if (overlayp elide-head-overlay)
  		(move-overlay elide-head-overlay (point-marker) end)
  	      (setq elide-head-overlay (make-overlay (point-marker) end)))
! 	    (overlay-put elide-head-overlay 'invisible 'elide-head)
  	    (overlay-put elide-head-overlay 'intangible t)
  	    (overlay-put elide-head-overlay 'evaporate t)
  	    (overlay-put elide-head-overlay 'after-string "...")))))))
--- 104,110 ----
  	    (if (overlayp elide-head-overlay)
  		(move-overlay elide-head-overlay (point-marker) end)
  	      (setq elide-head-overlay (make-overlay (point-marker) end)))
! 	    (overlay-put elide-head-overlay 'invisible t)
  	    (overlay-put elide-head-overlay 'intangible t)
  	    (overlay-put elide-head-overlay 'evaporate t)
  	    (overlay-put elide-head-overlay 'after-string "...")))))))

-- 
Matthias

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-07  0:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-06 23:59 Bug in elide-head Matthias Meulien
2002-12-07  0:09 ` Matthias Meulien

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.