From: Lars Hansen <larsh@math.ku.dk>
Cc: emacs-devel@gnu.org
Subject: Re: [BUG] widget-field-overlay becomes wrong
Date: Fri, 02 Jul 2004 08:02:51 +0200 [thread overview]
Message-ID: <40E4FA8B.9070602@math.ku.dk> (raw)
In-Reply-To: <40E46F50.5080204@math.ku.dk>
[-- Attachment #1: Type: text/plain, Size: 121 bytes --]
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.
[-- Attachment #2: wid-edit.el.diff --]
[-- Type: text/plain, Size: 2369 bytes --]
*** 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 ----
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2004-07-02 6:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-30 9:46 [BUG] widget-field-overlay becomes wrong Lars Hansen
2004-07-01 17:14 ` Richard Stallman
2004-07-01 20:08 ` Lars Hansen
2004-07-02 6:02 ` Lars Hansen [this message]
2004-07-03 18:20 ` Richard Stallman
2004-07-04 9:47 ` Lars Hansen
2004-07-07 16:02 ` Per Abrahamsen
2004-07-08 12:30 ` Lars Hansen
2004-07-08 23:18 ` Richard Stallman
2004-07-09 21:10 ` Lars Hansen
2004-07-13 15:00 ` Per Abrahamsen
2004-07-14 7:00 ` Lars Hansen
2004-07-19 7:31 ` Per Abrahamsen
2004-07-19 18:44 ` Richard Stallman
2004-07-23 16:24 ` Per Abrahamsen
2004-07-24 16:28 ` Lars Hansen
2004-08-01 15:18 ` Per Abrahamsen
2004-08-02 9:08 ` Lars Hansen
2004-08-02 12:21 ` Per Abrahamsen
2004-07-24 19:43 ` Richard Stallman
2004-08-01 15:33 ` Per Abrahamsen
2004-08-02 9:07 ` Lars Hansen
2004-08-03 19:37 ` Richard Stallman
2004-08-03 21:18 ` Lars Hansen
2004-08-03 21:25 ` Lars Hansen
2004-08-05 4:22 ` Richard Stallman
2004-08-05 6:22 ` Lars Hansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40E4FA8B.9070602@math.ku.dk \
--to=larsh@math.ku.dk \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).