]> git.eshelyaron.com Git - emacs.git/commitdiff
(widget-field-end): Temporarily remove field
authorDavid Ponce <david@dponce.com>
Tue, 5 Apr 2005 06:41:09 +0000 (06:41 +0000)
committerDavid Ponce <david@dponce.com>
Tue, 5 Apr 2005 06:41:09 +0000 (06:41 +0000)
narrowing before to call `get-char-property'.

lisp/wid-edit.el

index f89095fd7fcbdccd038c51d6496bc6e807264bd1..74bda990aedcb93deb1900d0a1293f307531d44f 100644 (file)
@@ -1185,9 +1185,17 @@ 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 (get-char-property (overlay-end overlay)
-                                            'field
-                                            (widget-field-buffer widget))
+       (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))))