[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: enabling evaporation of overlays
> The idae is rejected but another idea is suggested by RMS in emacs-devel:
>
> How do you think make evaporate overlay's property t by default(when make-overlay)?
>
> That would break many programs. It is the wrong solution.
>
> I think the right fix is in fix_start_end_in_overlays. When an
> insertion occurs next to an overlay whose beginning-marker is the
> advancing kind and whose end-marker is not, the overlay should stay
> empty.
>
> I will follow this idea.
I've done this. I hope no backwards overlay in GNU Emacs.
I will inspect overlay usage in widgets next.
BTW, I found a programming tip in button.el of GNU Emacs.
;; Default properties for buttons
(put 'default-button 'face 'button)
(put 'default-button 'mouse-face 'highlight)
(put 'default-button 'keymap button-map)
(put 'default-button 'type 'button)
(put 'default-button 'action 'ignore)
(put 'default-button 'help-echo "mouse-2, RET: Push this button")
;; Make overlay buttons go away if their underlying text is deleted.
(put 'default-button 'evaporate t)
;; Prevent insertions adjacent to the text-property buttons from
;; inheriting its properties.
(put 'default-button 'rear-nonsticky t)
(defun make-button (beg end &rest properties)
...
(overlay-put overlay 'category 'default-button)
...)
With category property, you can give your own default property of overlays
made in your lisp code. This will be useful in your code.
Masatake YAMATO