aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2004-02-21 20:08:12 +0000
committerLuc Teirlinck2004-02-21 20:08:12 +0000
commitaf1996b50b34f9ace052bccbb409b31e68ea3f79 (patch)
tree461c8fedee51d8e08d4725bd06bd578b5097f3b5
parent7daa0e81c70f218ffde85b4f8eb672db25e352e2 (diff)
downloademacs-af1996b50b34f9ace052bccbb409b31e68ea3f79.tar.gz
emacs-af1996b50b34f9ace052bccbb409b31e68ea3f79.zip
Various small changes in addition to the following:
(User-Level Deletion): Mention optional BACKWARD-ONLY argument to delete-horizontal-space. (Kill Functions, Yanking, Low-Level Kill Ring): clarify and correct description of yank-handler text property at various places.
-rw-r--r--lispref/text.texi200
1 files changed, 120 insertions, 80 deletions
diff --git a/lispref/text.texi b/lispref/text.texi
index b6e477e6651..413c10e29c1 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -58,7 +58,7 @@ the character after point.
58 position stored in a register. 58 position stored in a register.
59* Base 64:: Conversion to or from base 64 encoding. 59* Base 64:: Conversion to or from base 64 encoding.
60* MD5 Checksum:: Compute the MD5 ``message digest''/``checksum''. 60* MD5 Checksum:: Compute the MD5 ``message digest''/``checksum''.
61* Atomic Changes:: Installing several buffer changs ``atomically''. 61* Atomic Changes:: Installing several buffer changes ``atomically''.
62* Change Hooks:: Supplying functions to be run when text is changed. 62* Change Hooks:: Supplying functions to be run when text is changed.
63@end menu 63@end menu
64 64
@@ -69,6 +69,9 @@ the character after point.
69Several simple functions are described here. See also @code{looking-at} 69Several simple functions are described here. See also @code{looking-at}
70in @ref{Regexp Search}. 70in @ref{Regexp Search}.
71 71
72In the following four functions, ``beginning'' or ``end'' of buffer
73refers to the beginning or end of the accessible portion.
74
72@defun char-after &optional position 75@defun char-after &optional position
73This function returns the character in the current buffer at (i.e., 76This function returns the character in the current buffer at (i.e.,
74immediately after) position @var{position}. If @var{position} is out of 77immediately after) position @var{position}. If @var{position} is out of
@@ -230,9 +233,9 @@ This is the contents of buffer foo
230This function returns the symbol (or word) at or near point, as a string. 233This function returns the symbol (or word) at or near point, as a string.
231The return value includes no text properties. 234The return value includes no text properties.
232 235
233The optional argument @var{really-word} is non-@code{nil}, it finds a 236If the optional argument @var{really-word} is non-@code{nil}, it finds a
234word; otherwise, it finds a symbol (which includes word characters and 237word; otherwise, it finds a symbol (which includes both word
235both symbol constituent characters). 238characters and symbol constituent characters).
236 239
237If the optional argument @var{strict} is non-@code{nil}, then point 240If the optional argument @var{strict} is non-@code{nil}, then point
238must be in or next to the symbol or word---if no symbol or word is 241must be in or next to the symbol or word---if no symbol or word is
@@ -273,10 +276,10 @@ copying them into strings first.
273@defun compare-buffer-substrings buffer1 start1 end1 buffer2 start2 end2 276@defun compare-buffer-substrings buffer1 start1 end1 buffer2 start2 end2
274This function lets you compare two substrings of the same buffer or two 277This function lets you compare two substrings of the same buffer or two
275different buffers. The first three arguments specify one substring, 278different buffers. The first three arguments specify one substring,
276giving a buffer and two positions within the buffer. The last three 279giving a buffer (or a buffer name) and two positions within the
277arguments specify the other substring in the same way. You can use 280buffer. The last three arguments specify the other substring in the
278@code{nil} for @var{buffer1}, @var{buffer2}, or both to stand for the 281same way. You can use @code{nil} for @var{buffer1}, @var{buffer2}, or
279current buffer. 282both to stand for the current buffer.
280 283
281The value is negative if the first substring is less, positive if the 284The value is negative if the first substring is less, positive if the
282first is greater, and zero if they are equal. The absolute value of 285first is greater, and zero if they are equal. The absolute value of
@@ -360,8 +363,7 @@ overlay.
360@defun insert-char character count &optional inherit 363@defun insert-char character count &optional inherit
361This function inserts @var{count} instances of @var{character} into the 364This function inserts @var{count} instances of @var{character} into the
362current buffer before point. The argument @var{count} should be a 365current buffer before point. The argument @var{count} should be a
363number (@code{nil} means 1), and @var{character} must be a character. 366number, and @var{character} must be a character. The value is @code{nil}.
364The value is @code{nil}.
365 367
366This function does not convert unibyte character codes 128 through 255 368This function does not convert unibyte character codes 128 through 255
367to multibyte characters, not even if the current buffer is a multibyte 369to multibyte characters, not even if the current buffer is a multibyte
@@ -375,7 +377,7 @@ insertion point. @xref{Sticky Properties}.
375@defun insert-buffer-substring from-buffer-or-name &optional start end 377@defun insert-buffer-substring from-buffer-or-name &optional start end
376This function inserts a portion of buffer @var{from-buffer-or-name} 378This function inserts a portion of buffer @var{from-buffer-or-name}
377(which must already exist) into the current buffer before point. The 379(which must already exist) into the current buffer before point. The
378text inserted is the region from @var{start} and @var{end}. (These 380text inserted is the region between @var{start} and @var{end}. (These
379arguments default to the beginning and end of the accessible portion of 381arguments default to the beginning and end of the accessible portion of
380that buffer.) This function returns @code{nil}. 382that buffer.) This function returns @code{nil}.
381 383
@@ -418,9 +420,10 @@ commands intended primarily for the user but useful also in Lisp
418programs. 420programs.
419 421
420@deffn Command insert-buffer from-buffer-or-name 422@deffn Command insert-buffer from-buffer-or-name
421This command inserts the entire contents of @var{from-buffer-or-name} 423This command inserts the entire accessible contents of
422(which must exist) into the current buffer after point. It leaves 424@var{from-buffer-or-name} (which must exist) into the current buffer
423the mark after the inserted text. The value is @code{nil}. 425after point. It leaves the mark after the inserted text. The value
426is @code{nil}.
424@end deffn 427@end deffn
425 428
426@deffn Command self-insert-command count 429@deffn Command self-insert-command count
@@ -501,11 +504,11 @@ yanked, but can be reinserted using the undo mechanism (@pxref{Undo}).
501Some deletion functions do save text in the kill ring in some special 504Some deletion functions do save text in the kill ring in some special
502cases. 505cases.
503 506
504 All of the deletion functions operate on the current buffer, and all 507 All of the deletion functions operate on the current buffer.
505return a value of @code{nil}.
506 508
507@deffn Command erase-buffer 509@deffn Command erase-buffer
508This function deletes the entire text of the current buffer, leaving it 510This function deletes the entire text of the current buffer
511(@emph{not} just the accessible portion), leaving it
509empty. If the buffer is read-only, it signals a @code{buffer-read-only} 512empty. If the buffer is read-only, it signals a @code{buffer-read-only}
510error; if some of the text in it is read-only, it signals a 513error; if some of the text in it is read-only, it signals a
511@code{text-read-only} error. Otherwise, it deletes the text without 514@code{text-read-only} error. Otherwise, it deletes the text without
@@ -591,8 +594,9 @@ The value returned is always @code{nil}.
591This option specifies how @code{backward-delete-char-untabify} should 594This option specifies how @code{backward-delete-char-untabify} should
592deal with whitespace. Possible values include @code{untabify}, the 595deal with whitespace. Possible values include @code{untabify}, the
593default, meaning convert a tab to many spaces and delete one; 596default, meaning convert a tab to many spaces and delete one;
594@code{hungry}, meaning delete all the whitespace characters before point 597@code{hungry}, meaning delete all tabs and spaces before point with
595with one command, and @code{nil}, meaning do nothing special for 598one command; @code{all} meaning delete all tabs, spaces and newlines
599before point, and @code{nil}, meaning do nothing special for
596whitespace characters. 600whitespace characters.
597@end defopt 601@end defopt
598 602
@@ -603,11 +607,14 @@ whitespace characters.
603commands intended primarily for the user but useful also in Lisp 607commands intended primarily for the user but useful also in Lisp
604programs. 608programs.
605 609
606@deffn Command delete-horizontal-space 610@deffn Command delete-horizontal-space &optional backward-only
607@cindex deleting whitespace 611@cindex deleting whitespace
608This function deletes all spaces and tabs around point. It returns 612This function deletes all spaces and tabs around point. It returns
609@code{nil}. 613@code{nil}.
610 614
615If @var{backward-only} is non-@code{nil}, the function deletes
616spaces and tabs before point, but not after point.
617
611In the following examples, we call @code{delete-horizontal-space} four 618In the following examples, we call @code{delete-horizontal-space} four
612times, once on each line, with point between the second and third 619times, once on each line, with point between the second and third
613characters on the line each time. 620characters on the line each time.
@@ -673,9 +680,10 @@ After the lines are joined, the function @code{fixup-whitespace} is
673responsible for deciding whether to leave a space at the junction. 680responsible for deciding whether to leave a space at the junction.
674@end deffn 681@end deffn
675 682
676@defun fixup-whitespace 683@deffn Command fixup-whitespace
677This function replaces all the whitespace surrounding point with either 684This function replaces all the horizontal whitespace surrounding point
678one space or no space, according to the context. It returns @code{nil}. 685with either one space or no space, according to the context. It
686returns @code{nil}.
679 687
680At the beginning or end of a line, the appropriate amount of space is 688At the beginning or end of a line, the appropriate amount of space is
681none. Before a character with close parenthesis syntax, or after a 689none. Before a character with close parenthesis syntax, or after a
@@ -709,7 +717,7 @@ This has too many spaces at the start of (this list)
709---------- Buffer: foo ---------- 717---------- Buffer: foo ----------
710@end group 718@end group
711@end smallexample 719@end smallexample
712@end defun 720@end deffn
713 721
714@deffn Command just-one-space 722@deffn Command just-one-space
715@comment !!SourceFile simple.el 723@comment !!SourceFile simple.el
@@ -722,7 +730,7 @@ This function deletes blank lines surrounding point. If point is on a
722blank line with one or more blank lines before or after it, then all but 730blank line with one or more blank lines before or after it, then all but
723one of them are deleted. If point is on an isolated blank line, then it 731one of them are deleted. If point is on an isolated blank line, then it
724is deleted. If point is on a nonblank line, the command deletes all 732is deleted. If point is on a nonblank line, the command deletes all
725blank lines following it. 733blank lines immediately following it.
726 734
727A blank line is defined as a line containing only tabs and spaces. 735A blank line is defined as a line containing only tabs and spaces.
728 736
@@ -771,7 +779,7 @@ would be difficult to change the terminology now.
771* Yanking:: How yanking is done. 779* Yanking:: How yanking is done.
772* Yank Commands:: Commands that access the kill ring. 780* Yank Commands:: Commands that access the kill ring.
773* Low-Level Kill Ring:: Functions and variables for kill ring access. 781* Low-Level Kill Ring:: Functions and variables for kill ring access.
774* Internals of Kill Ring:: Variables that hold kill-ring data. 782* Internals of Kill Ring:: Variables that hold kill ring data.
775@end menu 783@end menu
776 784
777@node Kill Ring Concepts 785@node Kill Ring Concepts
@@ -791,7 +799,7 @@ new entry automatically deletes the last entry.
791 799
792 When kill commands are interwoven with other commands, each kill 800 When kill commands are interwoven with other commands, each kill
793command makes a new entry in the kill ring. Multiple kill commands in 801command makes a new entry in the kill ring. Multiple kill commands in
794succession build up a single kill-ring entry, which would be yanked as a 802succession build up a single kill ring entry, which would be yanked as a
795unit; the second and subsequent consecutive kill commands add text to 803unit; the second and subsequent consecutive kill commands add text to
796the entry made by the first one. 804the entry made by the first one.
797 805
@@ -828,8 +836,10 @@ This is convenient because it lets the user use a series of kill
828commands to copy text from a read-only buffer into the kill ring. 836commands to copy text from a read-only buffer into the kill ring.
829 837
830If @var{yank-handler} is non-@code{nil}, this puts that value onto 838If @var{yank-handler} is non-@code{nil}, this puts that value onto
831the string of killed text, as a @code{yank-handler} property. 839the string of killed text, as a @code{yank-handler} text property.
832@xref{Yanking}. 840@xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, any
841@code{yank-handler} properties present on the killed text are copied
842onto the kill ring, like other text properties.
833@end deffn 843@end deffn
834 844
835@defopt kill-read-only-ok 845@defopt kill-read-only-ok
@@ -841,9 +851,7 @@ updating the kill ring but not changing the buffer.
841@deffn Command copy-region-as-kill start end 851@deffn Command copy-region-as-kill start end
842This command saves the region defined by @var{start} and @var{end} on 852This command saves the region defined by @var{start} and @var{end} on
843the kill ring (including text properties), but does not delete the text 853the kill ring (including text properties), but does not delete the text
844from the buffer. It returns @code{nil}. It also indicates the extent 854from the buffer. It returns @code{nil}.
845of the text copied by moving the cursor momentarily, or by displaying a
846message in the echo area.
847 855
848The command does not set @code{this-command} to @code{kill-region}, so a 856The command does not set @code{this-command} to @code{kill-region}, so a
849subsequent kill command does not append to the same kill ring entry. 857subsequent kill command does not append to the same kill ring entry.
@@ -865,9 +873,9 @@ text that they copy into the buffer.
865@defun insert-for-yank string 873@defun insert-for-yank string
866This function normally works like @code{insert} except that it doesn't 874This function normally works like @code{insert} except that it doesn't
867insert the text properties in the @code{yank-excluded-properties} 875insert the text properties in the @code{yank-excluded-properties}
868list. However, if the first character of @var{string} has a 876list. However, if any part of @var{string} has a non-@code{nil}
869non-@code{nil}@code{yank-handler} text property, that property 877@code{yank-handler} text property, that property can do various
870can do various special processing on the text being inserted. 878special processing on that part of the text being inserted.
871@end defun 879@end defun
872 880
873@defun insert-buffer-substring-as-yank buf &optional start end 881@defun insert-buffer-substring-as-yank buf &optional start end
@@ -876,12 +884,11 @@ doesn't insert the text properties in the
876@code{yank-excluded-properties} list. 884@code{yank-excluded-properties} list.
877@end defun 885@end defun
878 886
879 You can put a @code{yank-handler} text property on the text to 887 You can put a @code{yank-handler} text property on all or part of
880control how it will be inserted if it is yanked. The 888the text to control how it will be inserted if it is yanked. The
881@code{insert-for-yank} function looks for a @code{yank-handler} 889@code{insert-for-yank} function looks for that property. The property
882property on the first character in its @var{string} argument. The 890value must be a list of one to four elements, with the following
883property value must be a list of one to four elements, with the 891format (where elements after the first may be omitted):
884following format (where elements after the first may be omitted):
885 892
886@example 893@example
887(@var{function} @var{param} @var{noexclude} @var{undo}) 894(@var{function} @var{param} @var{noexclude} @var{undo})
@@ -891,15 +898,16 @@ following format (where elements after the first may be omitted):
891 898
892@table @var 899@table @var
893@item function 900@item function
894When @var{function} is present and non-nil, it is called instead of 901When @var{function} is present and non-@code{nil}, it is called instead of
895@code{insert} to insert the string. @var{function} takes one 902@code{insert} to insert the string. @var{function} takes one
896argument---the string to insert. 903argument---the string to insert.
897 904
898@item param 905@item param
899If @var{param} is present and non-@code{nil}, it replaces @var{string} 906If @var{param} is present and non-@code{nil}, it replaces @var{string}
900as the object passed to @var{function} (or @code{insert}); for 907(or the part of @var{string} being processed) as the object passed to
901example, if @var{function} is @code{yank-rectangle}, @var{param} 908@var{function} (or @code{insert}); for example, if @var{function} is
902should be a list of strings to insert as a rectangle. 909@code{yank-rectangle}, @var{param} should be a list of strings to
910insert as a rectangle.
903 911
904@item noexclude 912@item noexclude
905If @var{noexclude} is present and non-@code{nil}, the normal removal of the 913If @var{noexclude} is present and non-@code{nil}, the normal removal of the
@@ -908,7 +916,7 @@ responsible for removing those properties. This may be necessary
908if @var{function} adjusts point before or after inserting the object. 916if @var{function} adjusts point before or after inserting the object.
909 917
910@item undo 918@item undo
911If @var{undo} is present and non-nil, it is a function that will be 919If @var{undo} is present and non-@code{nil}, it is a function that will be
912called by @code{yank-pop} to undo the insertion of the current object. 920called by @code{yank-pop} to undo the insertion of the current object.
913It is called with two arguments, the start and end of the current 921It is called with two arguments, the start and end of the current
914region. @var{function} can set @code{yank-undo-function} to override 922region. @var{function} can set @code{yank-undo-function} to override
@@ -924,23 +932,29 @@ from the kill ring. The text properties are copied too.
924 932
925@deffn Command yank &optional arg 933@deffn Command yank &optional arg
926@cindex inserting killed text 934@cindex inserting killed text
927This command inserts before point the text in the first entry in the 935This command inserts before point the text at the front of the
928kill ring. It positions the mark at the beginning of that text, and 936kill ring. It positions the mark at the beginning of that text, and
929point at the end. 937point at the end.
930 938
931If @var{arg} is a list (which occurs interactively when the user 939If @var{arg} is a non-@code{nil} list (which occurs interactively when
932types @kbd{C-u} with no digits), then @code{yank} inserts the text as 940the user types @kbd{C-u} with no digits), then @code{yank} inserts the
933described above, but puts point before the yanked text and puts the mark 941text as described above, but puts point before the yanked text and
934after it. 942puts the mark after it.
935 943
936If @var{arg} is a number, then @code{yank} inserts the @var{arg}th most 944If @var{arg} is a number, then @code{yank} inserts the @var{arg}th
937recently killed text---the @var{arg}th element of the kill ring list. 945most recently killed text---the @var{arg}th element of the kill ring
946list, counted cyclically from the front, which is considered the
947first element for this purpose.
938 948
939@code{yank} does not alter the contents of the kill ring or rotate it. 949@code{yank} does not alter the contents of the kill ring, unless it
940It returns @code{nil}. 950used text provided by another program, in which case it pushes that text
951onto the kill ring. However if @var{arg} is an integer different from
952one, it rotates the kill ring to place the yanked string at the front.
953
954@code{yank} returns @code{nil}.
941@end deffn 955@end deffn
942 956
943@deffn Command yank-pop arg 957@deffn Command yank-pop &optional arg
944This command replaces the just-yanked entry from the kill ring with a 958This command replaces the just-yanked entry from the kill ring with a
945different entry from the kill ring. 959different entry from the kill ring.
946 960
@@ -949,6 +963,8 @@ This is allowed only immediately after a @code{yank} or another
949inserted by yanking. @code{yank-pop} deletes that text and inserts in 963inserted by yanking. @code{yank-pop} deletes that text and inserts in
950its place a different piece of killed text. It does not add the deleted 964its place a different piece of killed text. It does not add the deleted
951text to the kill ring, since it is already in the kill ring somewhere. 965text to the kill ring, since it is already in the kill ring somewhere.
966It does however rotate the kill ring to place the newly yanked string at
967the front.
952 968
953If @var{arg} is @code{nil}, then the replacement text is the previous 969If @var{arg} is @code{nil}, then the replacement text is the previous
954element of the kill ring. If @var{arg} is numeric, the replacement is 970element of the kill ring. If @var{arg} is numeric, the replacement is
@@ -966,7 +982,8 @@ The return value is always @code{nil}.
966If this variable is non-@code{nil}, the function @code{yank-pop} uses 982If this variable is non-@code{nil}, the function @code{yank-pop} uses
967its value instead of @code{delete-region} to delete the text 983its value instead of @code{delete-region} to delete the text
968inserted by the previous @code{yank} or 984inserted by the previous @code{yank} or
969@code{yank-pop} command. 985@code{yank-pop} command. The value must be a function of two
986arguments, the start and end of the current region.
970 987
971The function @code{insert-for-yank} automatically sets this variable 988The function @code{insert-for-yank} automatically sets this variable
972according to the @var{undo} element of the @code{yank-handler} 989according to the @var{undo} element of the @code{yank-handler}
@@ -992,27 +1009,44 @@ returns the @var{n}th kill, counting from the current yanking pointer.
992 1009
993If @var{n} is zero, indicating a request for the latest kill, 1010If @var{n} is zero, indicating a request for the latest kill,
994@code{current-kill} calls the value of 1011@code{current-kill} calls the value of
995@code{interprogram-paste-function} (documented below) before consulting 1012@code{interprogram-paste-function} (documented below) before
996the kill ring. 1013consulting the kill ring. If that value is a function and calling it
997@end defun 1014returns a string, @code{current-kill} pushes that string onto the kill
998 1015ring and returns it. It also sets the yanking pointer to point to
999@defun kill-new string &optional yank-handler 1016that new entry, regardless of the value of @var{do-not-move}.
1000This function puts the text @var{string} into the kill ring as a new 1017Otherwise, @code{current-kill} does not treat a zero value for @var{n}
1001entry at the front of the ring. It discards the oldest entry if 1018specially: it returns the entry pointed at by the yanking pointer and
1002appropriate. It also invokes the value of 1019does not move the yanking pointer.
1020@end defun
1021
1022@defun kill-new string &optional replace yank-handler
1023This function pushes the text @var{string} onto the kill ring and
1024makes the yanking pointer point to it. It discards the oldest entry
1025if appropriate. It also invokes the value of
1003@code{interprogram-cut-function} (see below). 1026@code{interprogram-cut-function} (see below).
1004 1027
1028If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the
1029first element of the kill ring with @var{string}, rather than pushing
1030@var{string} onto the kill ring.
1031
1005If @var{yank-handler} is non-@code{nil}, this puts that value onto 1032If @var{yank-handler} is non-@code{nil}, this puts that value onto
1006the string of killed text, as a @code{yank-handler} property. 1033the string of killed text, as a @code{yank-handler} property.
1007@xref{Yanking}. 1034@xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, then
1035@code{kill-new} copies any @code{yank-handler} properties present on
1036@var{string} onto the kill ring, as it does with other text properties.
1008@end defun 1037@end defun
1009 1038
1010@defun kill-append string before-p &optional yank-handler 1039@defun kill-append string before-p &optional yank-handler
1011This function appends the text @var{string} to the first entry in the 1040This function appends the text @var{string} to the first entry in the
1012kill ring. Normally @var{string} goes at the end of the entry, but if 1041kill ring and makes the yanking pointer point to the combined entry.
1042Normally @var{string} goes at the end of the entry, but if
1013@var{before-p} is non-@code{nil}, it goes at the beginning. This 1043@var{before-p} is non-@code{nil}, it goes at the beginning. This
1014function also invokes the value of @code{interprogram-cut-function} (see 1044function also invokes the value of @code{interprogram-cut-function}
1015below). This handles @var{yank-handler} just like @code{kill-new}. 1045(see below). This handles @var{yank-handler} just like
1046@code{kill-new}, except that if @var{yank-handler} is different from
1047the @code{yank-handler} property of the first entry of the kill ring,
1048@code{kill-append} pushes the concatenated string onto the kill ring,
1049instead of replacing the original first entry with it.
1016@end defun 1050@end defun
1017 1051
1018@defvar interprogram-paste-function 1052@defvar interprogram-paste-function
@@ -1023,7 +1057,7 @@ programs, when you are using a window system. Its value should be
1023If the value is a function, @code{current-kill} calls it to get the 1057If the value is a function, @code{current-kill} calls it to get the
1024``most recent kill''. If the function returns a non-@code{nil} value, 1058``most recent kill''. If the function returns a non-@code{nil} value,
1025then that value is used as the ``most recent kill''. If it returns 1059then that value is used as the ``most recent kill''. If it returns
1026@code{nil}, then the first element of @code{kill-ring} is used. 1060@code{nil}, then the front of the kill ring is used.
1027 1061
1028The normal use of this hook is to get the window system's primary 1062The normal use of this hook is to get the window system's primary
1029selection as the most recent kill, even if the selection belongs to 1063selection as the most recent kill, even if the selection belongs to
@@ -1033,13 +1067,17 @@ another application. @xref{Window System Selections}.
1033@defvar interprogram-cut-function 1067@defvar interprogram-cut-function
1034This variable provides a way of communicating killed text to other 1068This variable provides a way of communicating killed text to other
1035programs, when you are using a window system. Its value should be 1069programs, when you are using a window system. Its value should be
1036@code{nil} or a function of one argument. 1070@code{nil} or a function of one required and one optional argument.
1037 1071
1038If the value is a function, @code{kill-new} and @code{kill-append} call 1072If the value is a function, @code{kill-new} and @code{kill-append} call
1039it with the new first element of the kill ring as an argument. 1073it with the new first element of the kill ring as the first argument.
1074The second, optional, argument has the same meaning as the @var{push}
1075argument to @code{x-set-cut-buffer} (@pxref{Definition of
1076x-set-cut-buffer}) and only affects the second and later cut buffers.
1040 1077
1041The normal use of this hook is to set the window system's primary 1078The normal use of this hook is to set the window system's primary
1042selection from the newly killed text. @xref{Window System Selections}. 1079selection (and first cut buffer) from the newly killed text.
1080@xref{Window System Selections}.
1043@end defvar 1081@end defvar
1044 1082
1045@node Internals of Kill Ring 1083@node Internals of Kill Ring
@@ -1112,7 +1150,7 @@ that @kbd{C-y} should yank.
1112@defopt kill-ring-max 1150@defopt kill-ring-max
1113The value of this variable is the maximum length to which the kill 1151The value of this variable is the maximum length to which the kill
1114ring can grow, before elements are thrown away at the end. The default 1152ring can grow, before elements are thrown away at the end. The default
1115value for @code{kill-ring-max} is 30. 1153value for @code{kill-ring-max} is 60.
1116@end defopt 1154@end defopt
1117 1155
1118@node Undo 1156@node Undo
@@ -1149,7 +1187,9 @@ buffer.
1149@item (@var{text} . @var{position}) 1187@item (@var{text} . @var{position})
1150This kind of element indicates how to reinsert text that was deleted. 1188This kind of element indicates how to reinsert text that was deleted.
1151The deleted text itself is the string @var{text}. The place to 1189The deleted text itself is the string @var{text}. The place to
1152reinsert it is @code{(abs @var{position})}. 1190reinsert it is @code{(abs @var{position})}. If @var{position} is
1191positive, point was at the beginning of the deleted text, otherwise it
1192was at the end.
1153 1193
1154@item (t @var{high} . @var{low}) 1194@item (t @var{high} . @var{low})
1155This kind of element indicates that an unmodified buffer became 1195This kind of element indicates that an unmodified buffer became
@@ -1241,13 +1281,13 @@ In an interactive call, @var{buffer-or-name} is the current buffer.
1241You cannot specify any other buffer. 1281You cannot specify any other buffer.
1242@end deffn 1282@end deffn
1243 1283
1244@deffn Command buffer-disable-undo &optional buffer 1284@deffn Command buffer-disable-undo &optional buffer-or-name
1245@deffnx Command buffer-flush-undo &optional buffer 1285@deffnx Command buffer-flush-undo &optional buffer-or-name
1246@cindex disable undo 1286@cindex disable undo
1247This function discards the undo list of @var{buffer}, and disables 1287This function discards the undo list of @var{buffer-or-name}, and disables
1248further recording of undo information. As a result, it is no longer 1288further recording of undo information. As a result, it is no longer
1249possible to undo either previous changes or any subsequent changes. If 1289possible to undo either previous changes or any subsequent changes. If
1250the undo list of @var{buffer} is already disabled, this function 1290the undo list of @var{buffer-or-name} is already disabled, this function
1251has no effect. 1291has no effect.
1252 1292
1253This function returns @code{nil}. 1293This function returns @code{nil}.
@@ -3935,7 +3975,7 @@ changed text, its length is simply the difference between the first two
3935arguments. 3975arguments.
3936@end defvar 3976@end defvar
3937 3977
3938 Output of messges into the @samp{*Messages*} buffer does not 3978 Output of messages into the @samp{*Messages*} buffer does not
3939call these functions. 3979call these functions.
3940 3980
3941@defmac combine-after-change-calls body... 3981@defmac combine-after-change-calls body...