diff options
author | Yuuki Harano <masm+github@masm11.me> | 2021-01-30 23:37:19 +0900 |
---|---|---|
committer | Yuuki Harano <masm+github@masm11.me> | 2021-01-30 23:37:19 +0900 |
commit | 50c76b844bc79309b4f5d9e28a2386b9a6f735b7 (patch) | |
tree | 29f8273d8afccae1f16b723c36548cee150cb0bc /doc/lispref/text.texi | |
parent | 563a0d94c379292bd88e83f18560ed21c497cea9 (diff) | |
parent | 96f20120c97a0a329fff81a0cc3747082a8a2c55 (diff) | |
download | emacs-50c76b844bc79309b4f5d9e28a2386b9a6f735b7.tar.gz emacs-50c76b844bc79309b4f5d9e28a2386b9a6f735b7.tar.bz2 emacs-50c76b844bc79309b4f5d9e28a2386b9a6f735b7.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'doc/lispref/text.texi')
-rw-r--r-- | doc/lispref/text.texi | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 0b567d82c61..b3673465240 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -334,6 +334,25 @@ but there is no peace. (thing-at-point 'whitespace) @result{} nil @end example + +@defvar thing-at-point-provider-alist +This variable allows users and modes to tweak how +@code{thing-at-point} works. It's an association list of @var{thing}s +and functions (called with zero parameters) to return that thing. +Entries for @var{thing} will be evaluated in turn until a +non-@code{nil} result is returned. + +For instance, a major mode could say: + +@lisp +(setq-local thing-at-point-provider-alist + (append thing-at-point-provider-alist + '((url . my-mode--url-at-point)))) +@end lisp + +If no providers have a non-@code{nil} return, the @var{thing} will be +computed the standard way. +@end defvar @end defun @node Comparing Text @@ -1422,6 +1441,11 @@ the @code{amalgamating-undo-limit} variable. If this variable is 1, no changes are amalgamated. @end defun +A Lisp program can amalgamate a series of changes into a single change +group by calling @code{undo-amalgamate-change-group} (@pxref{Atomic +Changes}). Note that @code{amalgamating-undo-limit} has no effect on +the groups produced by that function. + @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 @@ -5610,6 +5634,19 @@ This function cancels and undoes all the changes in the change group specified by @var{handle}. @end defun + You can cause some or all of the changes in a change group to be +considered as a single unit for the purposes of the @code{undo} +commands (@pxref{Undo}) by using @code{undo-amalgamate-change-group}. + +@defun undo-amalgamate-change-group +Amalgamate all the changes made in the change-group since the state +identified by @var{handle}. This function removes all undo boundaries +between undo records of changes since the state described by +@var{handle}. Usually, @var{handle} is the handle returned by +@code{prepare-change-group}, in which case all the changes since the +beginning of the change-group are amalgamated into a single undo unit. +@end defun + Your code should use @code{unwind-protect} to make sure the group is always finished. The call to @code{activate-change-group} should be inside the @code{unwind-protect}, in case the user types @kbd{C-g} |