From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: juri@jurta.org, yamaoka@jpl.org, jan.h.d@swipnet.se, emacs-devel@gnu.org
Subject: Re: undo in loaddefs.el buffer
Date: Wed, 29 Dec 2004 19:14:34 -0600 (CST) [thread overview]
Message-ID: <200412300114.iBU1EY001351@moose.dms.auburn.edu> (raw)
In-Reply-To: <E1Cjkig-0004kz-8z@fencepost.gnu.org> (message from Richard Stallman on Wed, 29 Dec 2004 15:46:58 -0500)
Richard Stallman wrote:
If they think about it. Maybe we should add something to
`(elisp)Timers' about this, if we are sure that we definitely do not
want timers do make undo boundaries automatically. I could do this,
if desired.
I think it is to change the timer functions rather than the timer
mechanism. This is because not many timers will need to do it, and it
will take some experimenting to determine just what they should do.
I updated the manual.
The change you made to the manual says that timers (as opposed to idle
timers) should not edit user buffers. But this is exactly what Auto
Revert mode and Auto Revert Tail mode do. They have to use timers,
because idle timers only run once after a period of idleness and Auto
Revert has to be able to continuously update the buffer.
I suppose the remark was meant to prevent timers from interrupting
user input. But Auto Revert takes special steps to prevent that and
so could other timers.
What about the following? I could install if desired.
===File ~/os.texi-diff======================================
*** os.texi 29 Dec 2004 15:49:18 -0600 1.67
--- os.texi 29 Dec 2004 17:42:40 -0600
***************
*** 1368,1377 ****
timer to call a function that takes substantial time to run is likely
to be annoying.
! Timer functions should normally not alter the current buffer
! contents, but it may be ok to alter some other buffer that exists for
! special purposes. A general guideline is that if a buffer has undo
! enabled, timers should not write in it.
@deffn Command run-at-time time repeat function &rest args
This sets up a timer that calls the function @var{function} with
--- 1368,1380 ----
timer to call a function that takes substantial time to run is likely
to be annoying.
! When a timer edits a buffer in which undo is enabled, it normally
! should explicitly call @code{undo-boundary} once at the beginning and
! once just before exiting, since Emacs won't do that automatically
! (@pxref{Undo}). In addition, a timer which edits a buffer that the
! user also might want to edit, should take special steps to avoid
! interrupting user input. Using an idle timer (see below) is one way
! to avoid the latter problem.
@deffn Command run-at-time time repeat function &rest args
This sets up a timer that calls the function @var{function} with
***************
*** 1486,1496 ****
input. Then it becomes idle again, and all the idle timers that are
set up to repeat will subsequently run another time, one by one.
- It is legitimate for an idle timer to edit the current buffer. If
- it does, it should explicitly call @code{undo-boundary} once at the
- beginning and once just before exiting, since Emacs won't do that
- automatically for an idle timer.
-
@defun cancel-timer timer
Cancel the requested action for @var{timer}, which should be a value
previously returned by @code{run-at-time} or @code{run-with-idle-timer}.
--- 1489,1494 ----
============================================================
next prev parent reply other threads:[~2004-12-30 1:14 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-21 14:14 undo in loaddefs.el buffer Luc Teirlinck
2004-12-21 15:41 ` Luc Teirlinck
2004-12-22 4:31 ` Katsumi Yamaoka
2004-12-22 4:58 ` Katsumi Yamaoka
2004-12-23 0:01 ` Richard Stallman
2004-12-23 0:26 ` David Kastrup
2004-12-25 15:13 ` Richard Stallman
2004-12-24 1:45 ` Juri Linkov
2004-12-24 21:39 ` Luc Teirlinck
2004-12-26 9:14 ` Richard Stallman
2004-12-27 5:29 ` Luc Teirlinck
2004-12-27 22:35 ` Richard Stallman
2004-12-24 23:59 ` Luc Teirlinck
2004-12-25 15:12 ` Richard Stallman
2004-12-26 2:06 ` Luc Teirlinck
2004-12-26 2:32 ` Juri Linkov
2004-12-26 3:59 ` Luc Teirlinck
2004-12-27 2:40 ` Luc Teirlinck
2004-12-27 20:16 ` Juri Linkov
2004-12-28 4:57 ` Richard Stallman
2004-12-27 4:09 ` Richard Stallman
2004-12-26 16:15 ` Jan D.
2004-12-27 2:31 ` Luc Teirlinck
2004-12-27 10:21 ` Jan D.
2004-12-27 11:05 ` Jan D.
2004-12-27 22:35 ` Richard Stallman
2004-12-28 13:16 ` Jan D.
2004-12-28 20:57 ` Richard Stallman
2004-12-29 12:59 ` Jan D.
2004-12-28 5:03 ` Luc Teirlinck
2004-12-28 17:25 ` Richard Stallman
2004-12-29 2:07 ` Luc Teirlinck
2004-12-29 20:46 ` Richard Stallman
2004-12-30 1:14 ` Luc Teirlinck [this message]
2004-12-30 16:43 ` Richard Stallman
2004-12-31 1:54 ` Luc Teirlinck
2004-12-31 9:22 ` David Kastrup
2004-12-31 15:04 ` Luc Teirlinck
2005-01-01 5:25 ` Richard Stallman
2005-01-02 16:02 ` Luc Teirlinck
2005-01-03 0:58 ` Richard Stallman
2005-01-04 3:07 ` Luc Teirlinck
2005-01-04 17:00 ` Richard Stallman
2004-12-31 2:14 ` Luc Teirlinck
2004-12-30 5:06 ` Luc Teirlinck
2004-12-30 20:58 ` Richard Stallman
2004-12-27 18:05 ` Richard Stallman
2004-12-27 19:33 ` Jan D.
2004-12-28 4:57 ` Richard Stallman
2004-12-28 8:11 ` Jan D.
2004-12-28 21:05 ` Jason Rumney
2004-12-29 23:22 ` Jan D.
2004-12-27 4:09 ` Richard Stallman
2004-12-27 4:42 ` Luc Teirlinck
2004-12-26 2:43 ` Juri Linkov
2004-12-27 4:09 ` Richard Stallman
2005-01-04 9:05 ` Juri Linkov
2004-12-21 21:57 ` Kevin Rodgers
2004-12-22 0:17 ` Luc Teirlinck
2004-12-22 0:17 ` 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=200412300114.iBU1EY001351@moose.dms.auburn.edu \
--to=teirllm@dms.auburn.edu \
--cc=emacs-devel@gnu.org \
--cc=jan.h.d@swipnet.se \
--cc=juri@jurta.org \
--cc=yamaoka@jpl.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).