From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lars Hansen Newsgroups: gmane.emacs.devel Subject: Re: [BUG] widget-field-overlay becomes wrong Date: Fri, 02 Jul 2004 08:02:51 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <40E4FA8B.9070602@math.ku.dk> References: <40E28BE8.4030300@math.ku.dk> <40E46F50.5080204@math.ku.dk> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050501000604070308070002" X-Trace: sea.gmane.org 1088748218 11037 80.91.224.253 (2 Jul 2004 06:03:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Jul 2004 06:03:38 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Jul 02 08:03:27 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BgH8x-0008NJ-00 for ; Fri, 02 Jul 2004 08:03:27 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BgH8x-0007u6-00 for ; Fri, 02 Jul 2004 08:03:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BgHAk-0002X5-I1 for emacs-devel@quimby.gnus.org; Fri, 02 Jul 2004 02:05:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BgHAX-0002Wz-K3 for emacs-devel@gnu.org; Fri, 02 Jul 2004 02:05:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BgHAV-0002Wl-Eh for emacs-devel@gnu.org; Fri, 02 Jul 2004 02:05:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BgHAV-0002Wi-7x for emacs-devel@gnu.org; Fri, 02 Jul 2004 02:05:03 -0400 Original-Received: from [213.170.224.162] (helo=smtp.kabelnettet.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BgH8P-0005q5-0P; Fri, 02 Jul 2004 02:02:53 -0400 Original-Received: from math.ku.dk (0x52b410e6.dhcp.kabelnettet.dk [82.180.16.230]) by smtp.kabelnettet.dk (Postfix) with ESMTP id C970C609872; Fri, 2 Jul 2004 08:02:51 +0200 (CEST) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en Original-To: rms@gnu.org In-Reply-To: <40E46F50.5080204@math.ku.dk> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25372 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25372 This is a multi-part message in MIME format. --------------050501000604070308070002 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lars Hansen wrote: > I would rather like to see if I can come up with a fix. The attached patch seems to fix the bug. --------------050501000604070308070002 Content-Type: text/plain; name="wid-edit.el.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="wid-edit.el.diff" *** wid-edit.el.~1.128.~ Tue Jun 8 21:50:16 2004 --- wid-edit.el Fri Jul 2 07:49:46 2004 *************** *** 414,426 **** (widget-put widget :doc-overlay overlay))) (defmacro widget-specify-insert (&rest form) ! "Execute FORM without inheriting any text properties." `(save-restriction (let ((inhibit-read-only t) ! (inhibit-modification-hooks t)) (narrow-to-region (point) (point)) (prog1 (progn ,@form) ! (goto-char (point-max)))))) (defface widget-inactive-face '((((class grayscale color) (background dark)) --- 414,443 ---- (widget-put widget :doc-overlay overlay))) (defmacro widget-specify-insert (&rest form) ! "Execute FORM without inheriting any text properties. ! Furthermore, ensure overlays ending at point or starting at point ! does not include text inserted." `(save-restriction (let ((inhibit-read-only t) ! (inhibit-modification-hooks t) ! overlays-before ! overlays-after) ! (mapc (lambda (overlay) ! (when (= (point) (overlay-end overlay)) ! (setq overlays-before (cons overlay overlays-before))) ! (when (= (point) (overlay-start overlay)) ! (setq overlays-after (cons overlay overlays-after)))) ! (overlays-in (if (= (point) (point-min)) (point) (1- (point))) ! (if (= (point) (point-max)) (point) (1+ (point))))) (narrow-to-region (point) (point)) (prog1 (progn ,@form) ! (mapc (lambda (overlay) ! (move-overlay overlay (overlay-start overlay) (point-min))) ! overlays-before) ! (mapc (lambda (overlay) ! (move-overlay overlay (point-max) (overlay-end overlay))) ! overlays-after) ! (goto-char (point-max)))))) (defface widget-inactive-face '((((class grayscale color) (background dark)) *************** *** 1530,1538 **** (if (>= old-pos (1- to)) (- old-pos to 1) (- old-pos from))))) - ;;??? Bug: this ought to insert the new value before deleting the old one, - ;; so that markers on either side of the value automatically - ;; stay on the same side. -- rms. (save-excursion (goto-char (widget-get widget :from)) (widget-apply widget :delete) --- 1547,1552 ---- --------------050501000604070308070002 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------050501000604070308070002--