[Top][All Lists]

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

Re: Strange problem with latest CVS

From: Masatake YAMATO
Subject: Re: Strange problem with latest CVS
Date: Wed, 14 Apr 2004 12:13:23 +0900 (JST)

> Richard Stallman <address@hidden> writes:
> >     It seems that (at least) widgets related code doesn't set evaporate to
> >     their overlays(*). My question was whether I should fix it.
> >     Now, your answer is obvious. I will fix it.
> > 
> > No!  These overlays should not evaporate.
> > If they evaporate, the form won't work any more.
> Unless I misunderstand, they will evaporate only when the underlying
> buffer content gets deleted to prepare the buffer for insertion of new
> contents.  The old overlays/buttons are then completely useless to
> keep around.
> When they evaporate, they do it at a time when there is no form left
> that could be working.

Thank you for your explanation. You write what I want to say.
However, as RMS wrote, I wondner what I should do when a editable-field
becomes empty during the user editing. Try the next code with the attached
patch. Delete "Delete me" in *Widget Example* buffer. You will get a signal.

  (switch-to-buffer "*Widget Example*")
  (let ((inhibit-read-only t))
  (widget-create 'editable-field
                 "Delete me")
  (use-local-map widget-keymap)

cvs diff: warning: unrecognized response `access control disabled, clients can 
connect from any host' from cvs server
Index: lisp/wid-edit.el
RCS file: /cvsroot/emacs/emacs/lisp/wid-edit.el,v
retrieving revision 1.124
diff -u -r1.124 wid-edit.el
--- lisp/wid-edit.el    4 Jan 2004 15:11:59 -0000       1.124
+++ lisp/wid-edit.el    14 Apr 2004 03:11:19 -0000
@@ -343,7 +343,9 @@
        ;; works in the field when, say, Custom uses `suppress-keymap'.
        (overlay-put overlay 'local-map keymap)
        (overlay-put overlay 'face face)
-       (overlay-put overlay 'help-echo help-echo))
+       (overlay-put overlay 'help-echo help-echo)
+       (overlay-put overlay 'evaporate t)
+       )
       (setq to (1- to))
       (setq rear-sticky t))
     (let ((overlay (make-overlay from to nil nil rear-sticky)))
@@ -352,7 +354,9 @@
       (overlay-put overlay 'field widget)
       (overlay-put overlay 'local-map keymap)
       (overlay-put overlay 'face face)
-      (overlay-put overlay 'help-echo help-echo)))
+      (overlay-put overlay 'help-echo help-echo)
+      (overlay-put overlay 'evaporate t)
+      ))
   (widget-specify-secret widget))
 (defun widget-specify-secret (field)
@@ -382,6 +386,7 @@
       (setq help-echo 'widget-mouse-help))
     (overlay-put overlay 'button widget)
     (overlay-put overlay 'keymap (widget-get widget :keymap))
+    (overlay-put overlay 'evaporate t)
     ;; We want to avoid the face with image buttons.
     (unless (widget-get widget :suppress-face)
       (overlay-put overlay 'face (widget-apply widget :button-face-get))
@@ -401,6 +406,7 @@
   "Specify sample for WIDGET between FROM and TO."
   (let ((overlay (make-overlay from to nil t nil)))
     (overlay-put overlay 'face (widget-apply widget :sample-face-get))
+    (overlay-put overlay 'evaporate t)
     (widget-put widget :sample-overlay overlay)))
 (defun widget-specify-doc (widget from to)
@@ -408,6 +414,7 @@
   (let ((overlay (make-overlay from to nil t nil)))
     (overlay-put overlay 'widget-doc widget)
     (overlay-put overlay 'face widget-documentation-face)
+    (overlay-put overlay 'evaporate t)
     (widget-put widget :doc-overlay overlay)))
 (defmacro widget-specify-insert (&rest form)

reply via email to

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