From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: undo in loaddefs.el buffer Date: Wed, 29 Dec 2004 19:14:34 -0600 (CST) Message-ID: <200412300114.iBU1EY001351@moose.dms.auburn.edu> References: <200412211414.iBLEEZ903426@raven.dms.auburn.edu> <200412211541.iBLFfBc03861@raven.dms.auburn.edu> <87llbonyup.fsf@jurta.org> <200412260206.iBQ26wG17970@raven.dms.auburn.edu> <41CEE3B8.9090600@swipnet.se> <200412270231.iBR2VDE19709@raven.dms.auburn.edu> <41CFE247.8090409@swipnet.se> <200412280503.iBS53deD002564@manatee.dms.auburn.edu> <200412290207.iBT27Gk0006913@manatee.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1104369379 8466 80.91.229.6 (30 Dec 2004 01:16:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Dec 2004 01:16:19 +0000 (UTC) Cc: juri@jurta.org, yamaoka@jpl.org, jan.h.d@swipnet.se, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 30 02:16:11 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CjovD-0001Ze-00 for ; Thu, 30 Dec 2004 02:16:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cjp68-0004KU-3L for ged-emacs-devel@m.gmane.org; Wed, 29 Dec 2004 20:27:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Cjp5y-0004JQ-ST for emacs-devel@gnu.org; Wed, 29 Dec 2004 20:27:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Cjp5x-0004IG-MK for emacs-devel@gnu.org; Wed, 29 Dec 2004 20:27:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cjp5x-0004I4-Ii for emacs-devel@gnu.org; Wed, 29 Dec 2004 20:27:17 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cjotf-0003Ck-Tw; Wed, 29 Dec 2004 20:14:36 -0500 Original-Received: from moose.dms.auburn.edu (moose.dms.auburn.edu [131.204.53.3]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id iBU1EZ0P001148; Wed, 29 Dec 2004 19:14:35 -0600 (CST) Original-Received: (from teirllm@localhost) by moose.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id iBU1EY001351; Wed, 29 Dec 2004 19:14:34 -0600 (CST) X-Authentication-Warning: moose.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Wed, 29 Dec 2004 15:46:58 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:31592 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:31592 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 ---- ============================================================