unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: emacs-devel@gnu.org
Subject: Re: [n_schumacher@web.de: modification hooks called only once in c-mode]
Date: Wed, 01 Aug 2007 11:16:08 +0200	[thread overview]
Message-ID: <yoijbqdrwr6v.fsf@remote5.student.chalmers.se> (raw)
In-Reply-To: E1IDShS-0006MR-2x@fencepost.gnu.org

Richard Stallman <rms@gnu.org> writes:

> If the fix is simple enough, it should be installed in Emacs 22.

I don't have a fix, but here's a recipe that doesn't depends on c
mode.

;; emacs -Q

(defun test-bug-hook (overlay afterp beg end &optional r)
  (message "%s hook called" (if afterp "after" "before")))

(defun test-bug-after-change (beg end old-len)
  (remove-text-properties beg end nil))

(defun test-bug ()
  (interactive)
  (switch-to-buffer (get-buffer-create "*test*"))

  (kill-all-local-variables)
  (add-hook 'after-change-functions 'test-bug-after-change nil t)
  (setq font-lock-defaults '(nil t))

  (let ((beg (point)) ov)
    (insert "foobar")
    (setq ov (make-overlay beg (point)))
    (overlay-put ov 'face 'highlight)
    (overlay-put ov 'insert-in-front-hooks '(test-bug-hook)))
  (goto-char (point-min)))

(test-bug)

;; M-x eval-buffer RET
;; Insert char before overlay
;; => only before hook is called

-- 
Johan Bockgård

  reply	other threads:[~2007-08-01  9:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-24 22:17 [n_schumacher@web.de: modification hooks called only once in c-mode] Richard Stallman
2007-08-01  9:16 ` Johan Bockgård [this message]
2007-08-02 15:45   ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2007-08-08  4:55 Richard Stallman
2007-08-11  0:46 ` Chong Yidong
2007-08-12  4:14   ` Richard Stallman
2007-08-12  5:50   ` Stefan Monnier
2007-08-13  0:52     ` Richard Stallman
2007-08-13  4:10       ` Stefan Monnier
2007-08-13  5:59         ` David Kastrup
2007-08-16 20:46           ` Stefan Monnier
2007-08-13  9:40         ` martin rudalics
2007-08-13 14:01           ` Stefan Monnier
2007-07-31 20:22 Richard Stallman
2007-07-17 15:06 Richard Stallman

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=yoijbqdrwr6v.fsf@remote5.student.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    --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).