From e47f89f079c09db05b5eff303f047b419fa972a7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 13 Jan 2006 19:56:54 +0000 Subject: [PATCH] (widget-field-end): If the overlay is no longer associated with a buffer, behave as if the overlay didn't exist. --- lisp/ChangeLog | 3 +++ lisp/wid-edit.el | 34 ++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 00eace0e644..fb53df771ca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2006-01-13 Martin Rudalics (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. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 0735c467439..01b82b685c1 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -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) -- 2.39.2