changeset 61308:8fc6a70b402a

(widget-field-end): Temporarily remove field narrowing before to call `get-char-property'.
author David Ponce <david@dponce.com>
date Tue, 05 Apr 2005 06:41:09 +0000
parents 0592ebb75598
children ebfe038b7e6c
files lisp/wid-edit.el
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/wid-edit.el	Tue Apr 05 06:40:12 2005 +0000
+++ b/lisp/wid-edit.el	Tue Apr 05 06:41:09 2005 +0000
@@ -1185,9 +1185,17 @@
     ;; 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))))