From eaa1fd6dbff8346eb38485de5ebf0fbfacf374d9 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Thu, 3 Dec 2015 21:27:33 +0000 Subject: [PATCH] Externalize some symbols in undo-auto * doc/lispref/text.texi: Update symbols. * lisp/simple.el (undo-auto--amalgamate, undo-auto--current-boundary-timer): Make symbols public. * src/cmds.c (Fself_insert_command,Fdelete_char): Call updated symbol. --- doc/lispref/text.texi | 4 ++-- lisp/simple.el | 14 +++++++------- src/cmds.c | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 45373675998..1bb5303620d 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1352,7 +1352,7 @@ Mostly, however, this function is called automatically at an appropriate time. @end defun -@defun undo-auto--amalgamate +@defun undo-auto-amalgamate The editor command loop automatically calls @code{undo-boundary} just before executing each key sequence, so that each undo normally undoes the effects of one command. A few exceptional commands are @@ -1368,7 +1368,7 @@ buffer other than the @code{current-buffer}, then @code{undo-boundary} will be called in each of them. @end defun -@defvar undo-auto--boundary-timer +@defvar undo-auto-current-boundary-timer Some buffers, such as process buffers, can change even when no commands are executing. In these cases, @code{undo-boundary} is normally called periodically by the timer in this variable. Setting diff --git a/lisp/simple.el b/lisp/simple.el index 99e6bd31363..2ccb016aca5 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2802,7 +2802,7 @@ an amalgamating command. The car of the list is the number of times an amalgamating command has been called, and the cdr are the buffers that were changed during the last command.") -(defvar undo-auto--current-boundary-timer nil +(defvar undo-auto-current-boundary-timer nil "Current timer which will run `undo-auto--boundary-timer' or nil. If set to non-nil, this will effectively disable the timer.") @@ -2810,7 +2810,7 @@ If set to non-nil, this will effectively disable the timer.") (defvar undo-auto--this-command-amalgamating nil "Non-nil if `this-command' should be amalgamated. This variable is set to nil by `undo-auto--boundaries' and is set -by `undo-auto--amalgamate'." ) +by `undo-auto-amalgamate'." ) (defun undo-auto--needs-boundary-p () "Return non-nil if `buffer-undo-list' needs a boundary at the start." @@ -2820,7 +2820,7 @@ by `undo-auto--amalgamate'." ) "Return the number of amalgamating last commands or nil. Amalgamating commands are, by default, either `self-insert-command' and `delete-char', but can be any command -that calls `undo-auto--amalgamate'." +that calls `undo-auto-amalgamate'." (car-safe undo-auto--last-boundary-cause)) (defun undo-auto--ensure-boundary (cause) @@ -2851,13 +2851,13 @@ REASON describes the reason that the boundary is being added; see (defun undo-auto--boundary-timer () "Timer which will run `undo--auto-boundary-timer'." - (setq undo-auto--current-boundary-timer nil) + (setq undo-auto-current-boundary-timer nil) (undo-auto--boundaries 'timer)) (defun undo-auto--boundary-ensure-timer () "Ensure that the `undo-auto-boundary-timer' is set." - (unless undo-auto--current-boundary-timer - (setq undo-auto--current-boundary-timer + (unless undo-auto-current-boundary-timer + (setq undo-auto-current-boundary-timer (run-at-time 10 nil #'undo-auto--boundary-timer)))) (defvar undo-auto--undoably-changed-buffers nil @@ -2878,7 +2878,7 @@ See also `undo-auto--buffer-undoably-changed'.") 'amalgamate 'command)))) -(defun undo-auto--amalgamate () +(defun undo-auto-amalgamate () "Amalgamate undo if necessary. This function can be called before an amalgamating command. It removes the previous `undo-boundary' if a series of such calls diff --git a/src/cmds.c b/src/cmds.c index 167ebb74302..650b4628c32 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -233,7 +233,7 @@ because it respects values of `delete-active-region' and `overwrite-mode'. */) CHECK_NUMBER (n); if (eabs (XINT (n)) < 2) - call0 (Qundo_auto__amalgamate); + call0 (Qundo_auto_amalgamate); pos = PT + XINT (n); if (NILP (killflag)) @@ -279,7 +279,7 @@ At the end, it runs `post-self-insert-hook'. */) error ("Negative repetition argument %"pI"d", XINT (n)); if (XFASTINT (n) < 2) - call0 (Qundo_auto__amalgamate); + call0 (Qundo_auto_amalgamate); /* Barf if the key that invoked this was not a character. */ if (!CHARACTERP (last_command_event)) @@ -494,7 +494,7 @@ internal_self_insert (int c, EMACS_INT n) void syms_of_cmds (void) { - DEFSYM (Qundo_auto__amalgamate, "undo-auto--amalgamate"); + DEFSYM (Qundo_auto_amalgamate, "undo-auto-amalgamate"); DEFSYM (Qundo_auto__this_command_amalgamating, "undo-auto--this-command-amalgamating"); -- 2.39.5