unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* after change function not invoked on all changes in *Messages*
@ 2003-06-13 10:14 Milan Zamazal
  2003-06-14 12:29 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Milan Zamazal @ 2003-06-13 10:14 UTC (permalink / raw)


In GNU Emacs 21.3.2 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2003-06-03 on blackbird, modified by Debian

When I try to install a local after change function on the *Messages*
buffer, it's not invoked on insertions to that buffer via the `message'
function and some other functions.  When I edit the buffer manually, the
after change function gets invoked as expected.  On deletions, the after
change function seems to be always invoked.

Try the following:

- Eval the following code:

   (defvar foo nil)
   (defun my-after-change (&rest args)
     (setq foo (cons args foo)))

- Switch to the *Messages* buffer.

- Apply

   `M-: (add-hook 'after-change-functions 'my-after-change nil t) RET'

- Apply

   `M-: (message "hello") RET'

- There's nothing about the `hello' insertion in the variable `foo'.

- Now try to type or yank some text in *Messages*.

- `foo' should contain information about the changes.

I couldn't find anything in documentation explaining this behavior, so I
think it's a bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: after change function not invoked on all changes in *Messages*
  2003-06-13 10:14 after change function not invoked on all changes in *Messages* Milan Zamazal
@ 2003-06-14 12:29 ` Richard Stallman
  2003-06-23  7:37   ` Milan Zamazal
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2003-06-14 12:29 UTC (permalink / raw)
  Cc: bug-gnu-emacs

    When I try to install a local after change function on the *Messages*
    buffer, it's not invoked on insertions to that buffer via the `message'
    function and some other functions.

Messages are generated from places in the code where
it is not safe to call Lisp code, so the change hooks are
disabled.  I will document that.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: after change function not invoked on all changes in *Messages*
  2003-06-14 12:29 ` Richard Stallman
@ 2003-06-23  7:37   ` Milan Zamazal
  0 siblings, 0 replies; 3+ messages in thread
From: Milan Zamazal @ 2003-06-23  7:37 UTC (permalink / raw)
  Cc: bug-gnu-emacs

>>>>> "RS" == Richard Stallman <rms@gnu.org> writes:

    RS> Messages are generated from places in the code where it is not
    RS> safe to call Lisp code, so the change hooks are disabled.  I
    RS> will document that.

OK, thank you.

Regards,

Milan Zamazal

-- 
All programmers are optimists.  Perhaps this modern sorcery especially attracts
those who believe in happy endings and fairy godmothers.  Perhaps the hundreds
of nitty frustrations drive away all but those who habitually focus on the end
goal.                     -- Frederick P. Brooks, Jr. in The Mythical Man-Month

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-06-23  7:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-13 10:14 after change function not invoked on all changes in *Messages* Milan Zamazal
2003-06-14 12:29 ` Richard Stallman
2003-06-23  7:37   ` Milan Zamazal

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).