]> git.eshelyaron.com Git - emacs.git/commitdiff
(widget-field-end): If the overlay is no longer associated with a buffer,
authorEli Zaretskii <eliz@gnu.org>
Fri, 13 Jan 2006 19:56:54 +0000 (19:56 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 13 Jan 2006 19:56:54 +0000 (19:56 +0000)
behave as if the overlay didn't exist.

lisp/ChangeLog
lisp/wid-edit.el

index 00eace0e644cc4034768b715db9d66e2a5847f29..fb53df771ca60e7d6d214135017c7d52f9b45040 100644 (file)
@@ -1,5 +1,8 @@
 2006-01-13  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
 
+       * wid-edit.el (widget-field-end): If the overlay is no longer
+       associated with a buffer, behave as if the overlay didn't exist.
+
        * cus-edit.el (custom-add-see-also, custom-add-parent-links): Make
        sure the links use the `custom-link' face.
 
index 0735c4674396f9d2aa0864f41367b77668f0bc06..01b82b685c1c3841fb6c7b9fa6a8d5e321576850 100644 (file)
@@ -1203,22 +1203,24 @@ When not inside a field, move to the previous button or field."
     ;; or if a special `boundary' field has been added after the widget
     ;; field.
     (if (overlayp overlay)
-       (if (and (not (eq (with-current-buffer
-                             (widget-field-buffer widget)
-                           (save-restriction
-                             ;; `widget-narrow-to-field' can be
-                             ;; active when this function is called
-                             ;; from an change-functions hook. So
-                             ;; temporarily remove field narrowing
-                             ;; before to call `get-char-property'.
-                             (widen)
-                             (get-char-property (overlay-end overlay)
-                                                'field)))
-                         'boundary))
-                (or widget-field-add-space
-                    (null (widget-get widget :size))))
-           (1- (overlay-end overlay))
-         (overlay-end overlay))
+        ;; Don't proceed if overlay has been removed from buffer.
+        (when (overlay-buffer overlay)
+          (if (and (not (eq (with-current-buffer
+                                (widget-field-buffer widget)
+                              (save-restriction
+                                ;; `widget-narrow-to-field' can be
+                                ;; active when this function is called
+                                ;; from an change-functions hook. So
+                                ;; temporarily remove field narrowing
+                                ;; before to call `get-char-property'.
+                                (widen)
+                                (get-char-property (overlay-end overlay)
+                                                   'field)))
+                            'boundary))
+                   (or widget-field-add-space
+                       (null (widget-get widget :size))))
+              (1- (overlay-end overlay))
+            (overlay-end overlay)))
       (cdr overlay))))
 
 (defun widget-field-find (pos)