Mercurial > emacs
comparison lispref/text.texi @ 26696:ef5e7bbe6f19
Current version from /gd/gnu/elisp.
author | Dave Love <fx@gnu.org> |
---|---|
date | Fri, 03 Dec 1999 19:11:12 +0000 |
parents | 6a17c48b52ef |
children | 4b1a67a46d8c |
comparison
equal
deleted
inserted
replaced
26695:778a88ba7c10 | 26696:ef5e7bbe6f19 |
---|---|
218 (buffer-string) | 218 (buffer-string) |
219 @result{} "This is the contents of buffer foo | 219 @result{} "This is the contents of buffer foo |
220 " | 220 " |
221 @end group | 221 @end group |
222 @end example | 222 @end example |
223 | |
224 When this function is used in the minibuffer, the value does not include | |
225 the prompt. | |
226 @end defun | 223 @end defun |
227 | 224 |
228 @defun thing-at-point thing | 225 @defun thing-at-point thing |
229 Return the @var{thing} around or next to point, as a string. | 226 Return the @var{thing} around or next to point, as a string. |
230 | 227 |
304 functions such as @code{insert-before-markers} relocate all such markers | 301 functions such as @code{insert-before-markers} relocate all such markers |
305 to point after the inserted text, regardless of the markers' insertion | 302 to point after the inserted text, regardless of the markers' insertion |
306 type. | 303 type. |
307 | 304 |
308 Insertion functions signal an error if the current buffer is | 305 Insertion functions signal an error if the current buffer is |
309 read-only. | 306 read-only or if they insert within read-only text. |
310 | 307 |
311 These functions copy text characters from strings and buffers along | 308 These functions copy text characters from strings and buffers along |
312 with their properties. The inserted characters have exactly the same | 309 with their properties. The inserted characters have exactly the same |
313 properties as the characters they were copied from. By contrast, | 310 properties as the characters they were copied from. By contrast, |
314 characters specified as separate arguments, not part of a string or | 311 characters specified as separate arguments, not part of a string or |
484 return a value of @code{nil}. | 481 return a value of @code{nil}. |
485 | 482 |
486 @deffn Command erase-buffer | 483 @deffn Command erase-buffer |
487 This function deletes the entire text of the current buffer, leaving it | 484 This function deletes the entire text of the current buffer, leaving it |
488 empty. If the buffer is read-only, it signals a @code{buffer-read-only} | 485 empty. If the buffer is read-only, it signals a @code{buffer-read-only} |
489 error. Otherwise, it deletes the text without asking for any | 486 error; if some of the text in it is read-only, it signals a |
490 confirmation. It returns @code{nil}. | 487 @code{text-read-only} error. Otherwise, it deletes the text without |
491 | 488 asking for any confirmation. It returns @code{nil}. |
492 In the minibuffer, @code{erase-buffer} does not delete the prompt. | |
493 | 489 |
494 Normally, deleting a large amount of text from a buffer inhibits further | 490 Normally, deleting a large amount of text from a buffer inhibits further |
495 auto-saving of that buffer ``because it has shrunk''. However, | 491 auto-saving of that buffer ``because it has shrunk''. However, |
496 @code{erase-buffer} does not do this, the idea being that the future | 492 @code{erase-buffer} does not do this, the idea being that the future |
497 text is not really related to the former text, and its size should not | 493 text is not really related to the former text, and its size should not |
789 | 785 |
790 In an interactive call, @var{start} and @var{end} are point and | 786 In an interactive call, @var{start} and @var{end} are point and |
791 the mark. | 787 the mark. |
792 | 788 |
793 @c Emacs 19 feature | 789 @c Emacs 19 feature |
794 If the buffer is read-only, @code{kill-region} modifies the kill ring | 790 If the buffer or text is read-only, @code{kill-region} modifies the kill |
795 just the same, then signals an error without modifying the buffer. This | 791 ring just the same, then signals an error without modifying the buffer. |
796 is convenient because it lets the user use all the kill commands to copy | 792 This is convenient because it lets the user use a series of kill |
797 text into the kill ring from a read-only buffer. | 793 commands to copy text from a read-only buffer into the kill ring. |
798 @end deffn | 794 @end deffn |
799 | 795 |
800 @defopt kill-read-only-ok | 796 @defopt kill-read-only-ok |
801 If this option is non-@code{nil}, @code{kill-region} does not get an | 797 If this option is non-@code{nil}, @code{kill-region} does not signal an |
802 error if the buffer is read-only. Instead, it simply returns, updating | 798 error if the buffer or text is read-only. Instead, it simply returns, |
803 the kill ring but not changing the buffer. | 799 updating the kill ring but not changing the buffer. |
804 @end defopt | 800 @end defopt |
805 | 801 |
806 @deffn Command copy-region-as-kill start end | 802 @deffn Command copy-region-as-kill start end |
807 This command saves the region defined by @var{start} and @var{end} on | 803 This command saves the region defined by @var{start} and @var{end} on |
808 the kill ring (including text properties), but does not delete the text | 804 the kill ring (including text properties), but does not delete the text |
1217 | 1213 |
1218 The variable @code{paragraph-separate} controls how to distinguish | 1214 The variable @code{paragraph-separate} controls how to distinguish |
1219 paragraphs. @xref{Standard Regexps}. | 1215 paragraphs. @xref{Standard Regexps}. |
1220 @end deffn | 1216 @end deffn |
1221 | 1217 |
1222 @deffn Command fill-individual-paragraphs start end &optional justify mail-flag | 1218 @deffn Command fill-individual-paragraphs start end &optional justify citation-regexp |
1223 This command fills each paragraph in the region according to its | 1219 This command fills each paragraph in the region according to its |
1224 individual fill prefix. Thus, if the lines of a paragraph were indented | 1220 individual fill prefix. Thus, if the lines of a paragraph were indented |
1225 with spaces, the filled paragraph will remain indented in the same | 1221 with spaces, the filled paragraph will remain indented in the same |
1226 fashion. | 1222 fashion. |
1227 | 1223 |
1228 The first two arguments, @var{start} and @var{end}, are the beginning | 1224 The first two arguments, @var{start} and @var{end}, are the beginning |
1229 and end of the region to be filled. The third and fourth arguments, | 1225 and end of the region to be filled. The third and fourth arguments, |
1230 @var{justify} and @var{mail-flag}, are optional. If | 1226 @var{justify} and @var{citation-regexp}, are optional. If |
1231 @var{justify} is non-@code{nil}, the paragraphs are justified as | 1227 @var{justify} is non-@code{nil}, the paragraphs are justified as |
1232 well as filled. If @var{mail-flag} is non-@code{nil}, it means the | 1228 well as filled. If @var{citation-regexp} is non-@code{nil}, it means the |
1233 function is operating on a mail message and therefore should not fill | 1229 function is operating on a mail message and therefore should not fill |
1234 the header lines. | 1230 the header lines. If @var{citation-regexp} is a string, it is used as |
1231 a regular expression; if it matches the beginning of a line, that line | |
1232 is treated as a citation marker. | |
1235 | 1233 |
1236 Ordinarily, @code{fill-individual-paragraphs} regards each change in | 1234 Ordinarily, @code{fill-individual-paragraphs} regards each change in |
1237 indentation as starting a new paragraph. If | 1235 indentation as starting a new paragraph. If |
1238 @code{fill-individual-varying-indent} is non-@code{nil}, then only | 1236 @code{fill-individual-varying-indent} is non-@code{nil}, then only |
1239 separator lines separate paragraphs. That mode can handle indented | 1237 separator lines separate paragraphs. That mode can handle indented |
1260 | 1258 |
1261 In Adaptive Fill mode, this command calls @code{fill-context-prefix} to | 1259 In Adaptive Fill mode, this command calls @code{fill-context-prefix} to |
1262 choose a fill prefix by default. @xref{Adaptive Fill}. | 1260 choose a fill prefix by default. @xref{Adaptive Fill}. |
1263 @end deffn | 1261 @end deffn |
1264 | 1262 |
1265 @deffn Command justify-current-line how eop nosqueeze | 1263 @deffn Command justify-current-line &optional how eop nosqueeze |
1266 This command inserts spaces between the words of the current line so | 1264 This command inserts spaces between the words of the current line so |
1267 that the line ends exactly at @code{fill-column}. It returns | 1265 that the line ends exactly at @code{fill-column}. It returns |
1268 @code{nil}. | 1266 @code{nil}. |
1269 | 1267 |
1270 The argument @var{how}, if non-@code{nil} specifies explicitly the style | 1268 The argument @var{how}, if non-@code{nil} specifies explicitly the style |
1393 | 1391 |
1394 If @var{force} is non-@code{nil}, that says to fix the line's | 1392 If @var{force} is non-@code{nil}, that says to fix the line's |
1395 indentation if that doesn't match the left margin value. | 1393 indentation if that doesn't match the left margin value. |
1396 @end deffn | 1394 @end deffn |
1397 | 1395 |
1398 @defun delete-to-left-margin from to | 1396 @defun delete-to-left-margin &optional from to |
1399 This function removes left margin indentation from the text | 1397 This function removes left margin indentation from the text between |
1400 between @var{from} and @var{to}. The amount of indentation | 1398 @var{from} and @var{to}. The amount of indentation to delete is |
1401 to delete is determined by calling @code{current-left-margin}. | 1399 determined by calling @code{current-left-margin}. In no case does this |
1402 In no case does this function delete non-whitespace. | 1400 function delete non-whitespace. If @var{from} and @var{to} are omitted, |
1401 they default to the whole buffer. | |
1403 @end defun | 1402 @end defun |
1404 | 1403 |
1405 @defun indent-to-left-margin | 1404 @defun indent-to-left-margin |
1406 This is the default @code{indent-line-function}, used in Fundamental | 1405 This is the default @code{indent-line-function}, used in Fundamental |
1407 mode, Text mode, etc. Its effect is to adjust the indentation at the | 1406 mode, Text mode, etc. Its effect is to adjust the indentation at the |
1440 @defun fill-context-prefix from to | 1439 @defun fill-context-prefix from to |
1441 This function implements the heart of Adaptive Fill mode; it chooses a | 1440 This function implements the heart of Adaptive Fill mode; it chooses a |
1442 fill prefix based on the text between @var{from} and @var{to}. It does | 1441 fill prefix based on the text between @var{from} and @var{to}. It does |
1443 this by looking at the first two lines of the paragraph, based on the | 1442 this by looking at the first two lines of the paragraph, based on the |
1444 variables described below. | 1443 variables described below. |
1444 @c The optional argument first-line-regexp is not documented | |
1445 @c because it exists for internal purposes and might be eliminated | |
1446 @c in the future. | |
1445 @end defun | 1447 @end defun |
1446 | 1448 |
1447 @defopt adaptive-fill-regexp | 1449 @defopt adaptive-fill-regexp |
1448 This variable holds a regular expression to control Adaptive Fill mode. | 1450 This variable holds a regular expression to control Adaptive Fill mode. |
1449 Adaptive Fill mode matches this regular expression against the text | 1451 Adaptive Fill mode matches this regular expression against the text |
2253 them back. | 2255 them back. |
2254 * Lazy Properties:: Computing text properties in a lazy fashion | 2256 * Lazy Properties:: Computing text properties in a lazy fashion |
2255 only when text is examined. | 2257 only when text is examined. |
2256 * Clickable Text:: Using text properties to make regions of text | 2258 * Clickable Text:: Using text properties to make regions of text |
2257 do something when you click on them. | 2259 do something when you click on them. |
2260 * Fields:: The @code{field} property defines | |
2261 fields within the buffer. | |
2258 * Not Intervals:: Why text properties do not use | 2262 * Not Intervals:: Why text properties do not use |
2259 Lisp-visible text intervals. | 2263 Lisp-visible text intervals. |
2260 @end menu | 2264 @end menu |
2261 | 2265 |
2262 @node Examining Properties | 2266 @node Examining Properties |
2327 range; more often, it is useful to add, change, or delete just certain | 2331 range; more often, it is useful to add, change, or delete just certain |
2328 properties specified by name. | 2332 properties specified by name. |
2329 | 2333 |
2330 Since text properties are considered part of the contents of the | 2334 Since text properties are considered part of the contents of the |
2331 buffer (or string), and can affect how a buffer looks on the screen, any | 2335 buffer (or string), and can affect how a buffer looks on the screen, any |
2332 change in buffer text properties mark the buffer as modified. Buffer | 2336 change in buffer text properties marks the buffer as modified. Buffer |
2333 text property changes are undoable also (@pxref{Undo}). | 2337 text property changes are undoable also (@pxref{Undo}). |
2334 | 2338 |
2335 @defun put-text-property start end prop value &optional object | 2339 @defun put-text-property start end prop value &optional object |
2336 This function sets the @var{prop} property to @var{value} for the text | 2340 This function sets the @var{prop} property to @var{value} for the text |
2337 between @var{start} and @var{end} in the string or buffer @var{object}. | 2341 between @var{start} and @var{end} in the string or buffer @var{object}. |
2656 | 2660 |
2657 @item read-only | 2661 @item read-only |
2658 @cindex read-only character | 2662 @cindex read-only character |
2659 @kindex read-only @r{(text property)} | 2663 @kindex read-only @r{(text property)} |
2660 If a character has the property @code{read-only}, then modifying that | 2664 If a character has the property @code{read-only}, then modifying that |
2661 character is not allowed. Any command that would do so gets an error. | 2665 character is not allowed. Any command that would do so gets an error, |
2666 @code{text-read-only}. | |
2662 | 2667 |
2663 Insertion next to a read-only character is an error if inserting | 2668 Insertion next to a read-only character is an error if inserting |
2664 ordinary text there would inherit the @code{read-only} property due to | 2669 ordinary text there would inherit the @code{read-only} property due to |
2665 stickiness. Thus, you can control permission to insert next to | 2670 stickiness. Thus, you can control permission to insert next to |
2666 read-only text by controlling the stickiness. @xref{Sticky Properties}. | 2671 read-only text by controlling the stickiness. @xref{Sticky Properties}. |
2683 the end of the group. If you try to move point backward into the group, | 2688 the end of the group. If you try to move point backward into the group, |
2684 point actually moves to the start of the group. | 2689 point actually moves to the start of the group. |
2685 | 2690 |
2686 When the variable @code{inhibit-point-motion-hooks} is non-@code{nil}, | 2691 When the variable @code{inhibit-point-motion-hooks} is non-@code{nil}, |
2687 the @code{intangible} property is ignored. | 2692 the @code{intangible} property is ignored. |
2693 | |
2694 @item field | |
2695 @kindex field @r{(text property)} | |
2696 Consecutive characters with the same @code{field} property constitute a | |
2697 @dfn{field}. Some motion functions including @code{forward-word} and | |
2698 @code{beginning-of-line} stop moving at a field boundary. | |
2699 @xref{Fields}. | |
2688 | 2700 |
2689 @item modification-hooks | 2701 @item modification-hooks |
2690 @cindex change hooks for a character | 2702 @cindex change hooks for a character |
2691 @cindex hooks for changing a character | 2703 @cindex hooks for changing a character |
2692 @kindex modification-hooks @r{(text property)} | 2704 @kindex modification-hooks @r{(text property)} |
2797 To insert with inheritance, use the special primitives described in this | 2809 To insert with inheritance, use the special primitives described in this |
2798 section. Self-inserting characters inherit properties because they work | 2810 section. Self-inserting characters inherit properties because they work |
2799 using these primitives. | 2811 using these primitives. |
2800 | 2812 |
2801 When you do insertion with inheritance, @emph{which} properties are | 2813 When you do insertion with inheritance, @emph{which} properties are |
2802 inherited depends on two specific properties: @code{front-sticky} and | 2814 inherited, and from where, depends on which properties are @dfn{sticky}. |
2803 @code{rear-nonsticky}. | 2815 Insertion after a character inherits those of its properties that are |
2804 | |
2805 Insertion after a character inherits those of its properties that are | |
2806 @dfn{rear-sticky}. Insertion before a character inherits those of its | 2816 @dfn{rear-sticky}. Insertion before a character inherits those of its |
2807 properties that are @dfn{front-sticky}. By default, a text property is | 2817 properties that are @dfn{front-sticky}. When both sides offer different |
2808 rear-sticky but not front-sticky. Thus, the default is to inherit all | 2818 sticky values for the same property, the previous character's value |
2809 the properties of the preceding character, and nothing from the | 2819 takes precedence. |
2810 following character. You can request different behavior by specifying | 2820 |
2811 the stickiness of certain properties. | 2821 By default, a text property is rear-sticky but not front-sticky; thus, |
2822 the default is to inherit all the properties of the preceding character, | |
2823 and nothing from the following character. | |
2824 | |
2825 You can control the stickiness of various text properties with two | |
2826 specific text properties, @code{front-sticky} and @code{rear-nonsticky}, | |
2827 and with the variable @code{text-property-default-nonsticky}. You can | |
2828 use the variable to specify a different default for a given property. | |
2829 You can use those two text properties to make any specific properties | |
2830 sticky or nonsticky in any particular part of the text. | |
2812 | 2831 |
2813 If a character's @code{front-sticky} property is @code{t}, then all | 2832 If a character's @code{front-sticky} property is @code{t}, then all |
2814 its properties are front-sticky. If the @code{front-sticky} property is | 2833 its properties are front-sticky. If the @code{front-sticky} property is |
2815 a list, then the sticky properties of the character are those whose | 2834 a list, then the sticky properties of the character are those whose |
2816 names are in the list. For example, if a character has a | 2835 names are in the list. For example, if a character has a |
2817 @code{front-sticky} property whose value is @code{(face read-only)}, | 2836 @code{front-sticky} property whose value is @code{(face read-only)}, |
2818 then insertion before the character can inherit its @code{face} property | 2837 then insertion before the character can inherit its @code{face} property |
2819 and its @code{read-only} property, but no others. | 2838 and its @code{read-only} property, but no others. |
2820 | 2839 |
2821 The @code{rear-nonsticky} works the opposite way. Every property is | 2840 The @code{rear-nonsticky} works the opposite way. A property is |
2822 rear-sticky by default, so the @code{rear-nonsticky} property says which | 2841 normally rear-sticky by default, so the @code{rear-nonsticky} property |
2823 properties are @emph{not} rear-sticky. If a character's | 2842 says which properties are @emph{not} rear-sticky. If a character's |
2824 @code{rear-nonsticky} property is @code{t}, then none of its properties | 2843 @code{rear-nonsticky} property is @code{t}, then none of its properties |
2825 are rear-sticky. If the @code{rear-nonsticky} property is a list, | 2844 are rear-sticky. If the @code{rear-nonsticky} property is a list, |
2826 properties are rear-sticky @emph{unless} their names are in the list. | 2845 properties are rear-sticky @emph{unless} their names are in the list. |
2827 | 2846 |
2828 When you insert text with inheritance, it inherits all the rear-sticky | 2847 @defvar text-property-default-nonsticky |
2829 properties of the preceding character, and all the front-sticky | 2848 @tindex text-property-default-nonsticky |
2830 properties of the following character. The previous character's | 2849 This variable holds an alist which defines the default rear-stickiness |
2831 properties take precedence when both sides offer different sticky values | 2850 of various text properties. Each element has the form |
2832 for the same property. | 2851 @code{(@var{property} . @var{nonstickiness})}, and it defines the |
2852 stickiness of a particular text property, @var{property}. | |
2853 | |
2854 If @var{nonstickiness} is non-@code{nil}, this means that the property | |
2855 @var{property} is rear-nonsticky by default. Since all properties are | |
2856 front-nonsticky by default, this makes @var{property} nonsticky in both | |
2857 directions by default. | |
2858 | |
2859 The text properties @code{front-sticky} and @code{rear-nonsticky}, when | |
2860 used, take precedence over the default @var{nonstickiness} specifed in | |
2861 @code{text-property-default-nonsticky}. | |
2862 @end defvar | |
2833 | 2863 |
2834 Here are the functions that insert text with inheritance of properties: | 2864 Here are the functions that insert text with inheritance of properties: |
2835 | 2865 |
2836 @defun insert-and-inherit &rest strings | 2866 @defun insert-and-inherit &rest strings |
2837 Insert the strings @var{strings}, just like the function @code{insert}, | 2867 Insert the strings @var{strings}, just like the function @code{insert}, |
3032 This method makes it possible to define different commands for various | 3062 This method makes it possible to define different commands for various |
3033 clickable pieces of text. Also, the major mode definition (or the | 3063 clickable pieces of text. Also, the major mode definition (or the |
3034 global definition) remains available for the rest of the text in the | 3064 global definition) remains available for the rest of the text in the |
3035 buffer. | 3065 buffer. |
3036 | 3066 |
3067 @node Fields | |
3068 @subsection Defining and Using Fields | |
3069 @cindex fields | |
3070 | |
3071 A field is a range of consecutive characters in the buffer that are | |
3072 identified by having the same value (comparing with @code{eq}) of the | |
3073 @code{field} property. This section describes special functions that | |
3074 are available for operating on fields. | |
3075 | |
3076 You specify a field with a buffer position, @var{pos}. We think of | |
3077 each field as containing a range of buffer positions, so the position | |
3078 you specify stands for the field containing that position. | |
3079 | |
3080 When the characters before and after @var{pos} are part of the same | |
3081 field, there is no doubt which field contains @var{pos}: the one those | |
3082 characters both belong to. When @var{pos} is at a boundary between | |
3083 fields, which field it belongs to depends on the stickiness of the | |
3084 @code{field} properties of the two surrounding characters (@pxref{Sticky | |
3085 Properties}). The field whose property would be inherited by text | |
3086 inserted at @var{pos} is the field that contains @var{pos}. | |
3087 | |
3088 There is an anomalous case where newly inserted text at @var{pos} | |
3089 would not inherit the @code{field} property from either side. This | |
3090 happens if the previous character's @code{field} property is not | |
3091 rear-sticky, and the following character's @code{field} property is not | |
3092 front-sticky. In this case, @var{pos} belongs to neither the preceding | |
3093 field nor the following field; the field functions treat it as belonging | |
3094 to an empty field whose beginning and end are both at @var{pos}. | |
3095 | |
3096 In all of these functions, if @var{pos} is omitted or @code{nil}, the | |
3097 value of point is used by default. | |
3098 | |
3099 @defun field-beginning &optional pos escape-from-edge | |
3100 @tindex field-beginning | |
3101 This function returns the beginning of the field specified by @var{pos}. | |
3102 | |
3103 If @var{pos} is at the end of a field, and @var{escape-from-edge} is | |
3104 non-@code{nil}, then the return value is always the beginning of the | |
3105 field that @emph{ends} at @var{pos}, regardless of the stickiness of the | |
3106 @code{field} properties around @var{pos}. | |
3107 @end defun | |
3108 | |
3109 @defun field-end &optional pos escape-from-edge | |
3110 @tindex field-end | |
3111 This function returns the end of the field specified by @var{pos}. | |
3112 | |
3113 If @var{pos} is at the beginning of a field, and @var{escape-from-edge} | |
3114 is non-@code{nil}, then the return value is always the end of the field | |
3115 that @emph{begins} at @var{pos}, regardless of the stickiness of the | |
3116 @code{field} properties around @var{pos}. | |
3117 @end defun | |
3118 | |
3119 @defun field-string &optional pos | |
3120 @tindex field-string | |
3121 This function returns the contents of the field specified by @var{pos}, | |
3122 as a string. | |
3123 @end defun | |
3124 | |
3125 @defun field-string-no-properties &optional pos | |
3126 @tindex field-string-no-properties | |
3127 This function returns the contents of the field specified by @var{pos}, | |
3128 as a string, discarding text properties. | |
3129 @end defun | |
3130 | |
3131 @defun delete-field &optional pos | |
3132 @tindex delete-field | |
3133 This function deletes the text of the field specified by @var{pos}. | |
3134 @end defun | |
3135 | |
3136 @defun constrain-to-field new-pos old-pos &optional escape-from-edge only-in-line | |
3137 @tindex constrain-to-field | |
3138 This function ``constrains'' @var{new-pos} to the field that | |
3139 @var{old-pos} belongs to---in other words, it returns the position | |
3140 closest to @var{new-pos} that is in the same field as @var{old-pos}. | |
3141 | |
3142 If @var{new-pos} is @code{nil}, then @code{constrain-to-field} uses | |
3143 the value of point instead, and moves point to the resulting position. | |
3144 | |
3145 If @var{old-pos} is at the boundary of two fields, then the allowable | |
3146 positions for @var{new-pos} depends on the value of the optional | |
3147 argument @var{escape-from-edge}. If @var{escape-from-edge} is | |
3148 @code{nil}, then @var{new-pos} is constrained to the field that has the | |
3149 same @code{field} text-property that new characters inserted at | |
3150 @var{old-pos} would get. (This depends on the stickiness of the | |
3151 @code{field} property for the characters before and after | |
3152 @var{old-pos}.) If @var{escape-from-edge} is non-@code{nil}, | |
3153 @var{new-pos} is constrained to the union of the two adjacent fields. | |
3154 | |
3155 If the optional argument @var{only-in-line} is non-@code{nil}, and | |
3156 constraining @var{new-pos} in the usual way would move it to a different | |
3157 line, @var{new-pos} is returned unconstrained. This used in commands | |
3158 that move by line, such as @code{next-line} and | |
3159 @code{beginning-of-line}, so that they respect field boundaries only in | |
3160 the case where they can still move to the right line. | |
3161 @end defun | |
3162 | |
3037 @node Not Intervals | 3163 @node Not Intervals |
3038 @subsection Why Text Properties are not Intervals | 3164 @subsection Why Text Properties are not Intervals |
3039 @cindex intervals | 3165 @cindex intervals |
3040 | 3166 |
3041 Some editors that support adding attributes to text in the buffer do | 3167 Some editors that support adding attributes to text in the buffer do |
3092 @cindex replace characters | 3218 @cindex replace characters |
3093 This function replaces all occurrences of the character @var{old-char} | 3219 This function replaces all occurrences of the character @var{old-char} |
3094 with the character @var{new-char} in the region of the current buffer | 3220 with the character @var{new-char} in the region of the current buffer |
3095 defined by @var{start} and @var{end}. | 3221 defined by @var{start} and @var{end}. |
3096 | 3222 |
3097 @cindex Outline mode | |
3098 @cindex undo avoidance | 3223 @cindex undo avoidance |
3099 If @var{noundo} is non-@code{nil}, then @code{subst-char-in-region} does | 3224 If @var{noundo} is non-@code{nil}, then @code{subst-char-in-region} does |
3100 not record the change for undo and does not mark the buffer as modified. | 3225 not record the change for undo and does not mark the buffer as modified. |
3101 This feature is used for controlling selective display (@pxref{Selective | 3226 This was useful for controlling the old selective display feature |
3102 Display}). | 3227 (@pxref{Selective Display}). |
3103 | 3228 |
3104 @code{subst-char-in-region} does not move point and returns | 3229 @code{subst-char-in-region} does not move point and returns |
3105 @code{nil}. | 3230 @code{nil}. |
3106 | 3231 |
3107 @example | 3232 @example |