Mercurial > emacs
comparison lispref/text.texi @ 25751:467b88fab665
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 17 Sep 1999 06:59:04 +0000 |
parents | 80ac191b6d2b |
children | 6a17c48b52ef |
comparison
equal
deleted
inserted
replaced
25750:f1968a807f56 | 25751:467b88fab665 |
---|---|
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. | |
223 @end defun | 226 @end defun |
224 | 227 |
225 @defun thing-at-point thing | 228 @defun thing-at-point thing |
226 Return the @var{thing} around or next to point, as a string. | 229 Return the @var{thing} around or next to point, as a string. |
227 | 230 |
273 haha!rara!}; then in this example the two substrings are @samp{rbar } | 276 haha!rara!}; then in this example the two substrings are @samp{rbar } |
274 and @samp{rara!}. The value is 2 because the first substring is greater | 277 and @samp{rara!}. The value is 2 because the first substring is greater |
275 at the second character. | 278 at the second character. |
276 | 279 |
277 @example | 280 @example |
278 (compare-buffer-substring nil 6 11 nil 16 21) | 281 (compare-buffer-substrings nil 6 11 nil 16 21) |
279 @result{} 2 | 282 @result{} 2 |
280 @end example | 283 @end example |
281 @end defun | 284 @end defun |
282 | 285 |
283 @node Insertion | 286 @node Insertion |
479 @deffn Command erase-buffer | 482 @deffn Command erase-buffer |
480 This function deletes the entire text of the current buffer, leaving it | 483 This function deletes the entire text of the current buffer, leaving it |
481 empty. If the buffer is read-only, it signals a @code{buffer-read-only} | 484 empty. If the buffer is read-only, it signals a @code{buffer-read-only} |
482 error. Otherwise, it deletes the text without asking for any | 485 error. Otherwise, it deletes the text without asking for any |
483 confirmation. It returns @code{nil}. | 486 confirmation. It returns @code{nil}. |
487 | |
488 In the minibuffer, @code{erase-buffer} does not delete the prompt. | |
484 | 489 |
485 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 |
486 auto-saving of that buffer ``because it has shrunk''. However, | 491 auto-saving of that buffer ``because it has shrunk''. However, |
487 @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 |
488 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 |
1788 converts the tab into spaces so that it can move precisely to column | 1793 converts the tab into spaces so that it can move precisely to column |
1789 @var{column}. Other multicolumn characters can cause anomalies despite | 1794 @var{column}. Other multicolumn characters can cause anomalies despite |
1790 @var{force}, since there is no way to split them. | 1795 @var{force}, since there is no way to split them. |
1791 | 1796 |
1792 The argument @var{force} also has an effect if the line isn't long | 1797 The argument @var{force} also has an effect if the line isn't long |
1793 enough to reach column @var{column}; in that case, it says to add | 1798 enough to reach column @var{column}; if it is @code{t}, that means to |
1794 whitespace at the end of the line to reach that column. | 1799 add whitespace at the end of the line to reach that column. |
1795 | 1800 |
1796 If @var{column} is not an integer, an error is signaled. | 1801 If @var{column} is not an integer, an error is signaled. |
1797 | 1802 |
1798 The return value is the column number actually moved to. | 1803 The return value is the column number actually moved to. |
1799 @end defun | 1804 @end defun |
2538 | 2543 |
2539 @item face | 2544 @item face |
2540 @cindex face codes of text | 2545 @cindex face codes of text |
2541 @kindex face @r{(text property)} | 2546 @kindex face @r{(text property)} |
2542 You can use the property @code{face} to control the font and color of | 2547 You can use the property @code{face} to control the font and color of |
2543 text. Its value is a face name or a list of face names. @xref{Faces}, | 2548 text. @xref{Faces}, for more information. |
2544 for more information. | 2549 |
2545 | 2550 In the simplest case, the value is a face name. It can also be a list; |
2546 If the property value is a list, elements may also have the form | 2551 then each element can be any of these possibilities; |
2547 @code{(foreground-color . @var{color-name})} or @code{(background-color | 2552 |
2548 . @var{color-name})}. These elements specify just the foreground color | 2553 @itemize @bullet |
2549 or just the background color; therefore, there is no need to create a | 2554 @item |
2550 face for each color that you want to use. | 2555 A face name (a symbol or string). |
2556 | |
2557 @item | |
2558 Starting in Emacs 21, a property list of face attributes. This has the | |
2559 form (@var{keyword} @var{value} @dots{}), where each @var{keyword} is a | |
2560 face attribute name and @var{value} is a meaningful value for that | |
2561 attribute. With this feature, you do not need to create a face each | |
2562 time you want to specify a particular attribute for certain text. | |
2563 @xref{Face Attributes}. | |
2564 | |
2565 @item | |
2566 A cons cell of the form @code{(foreground-color . @var{color-name})} or | |
2567 @code{(background-color . @var{color-name})}. These elements specify | |
2568 just the foreground color or just the background color. | |
2569 | |
2570 @code{(foreground-color . @var{color-name})} is equivalent to | |
2571 @code{(:foreground @var{color-name})}, and likewise for the background. | |
2572 @end itemize | |
2551 | 2573 |
2552 @xref{Font Lock Mode}, for information on how to update @code{face} | 2574 @xref{Font Lock Mode}, for information on how to update @code{face} |
2553 properties automatically based on the contents of the text. | 2575 properties automatically based on the contents of the text. |
2554 | 2576 |
2555 @item mouse-face | 2577 @item mouse-face |
2556 @kindex mouse-face @r{(text property)} | 2578 @kindex mouse-face @r{(text property)} |
2557 The property @code{mouse-face} is used instead of @code{face} when the | 2579 The property @code{mouse-face} is used instead of @code{face} when the |
2558 mouse is on or near the character. For this purpose, ``near'' means | 2580 mouse is on or near the character. For this purpose, ``near'' means |
2559 that all text between the character and where the mouse is have the same | 2581 that all text between the character and where the mouse is have the same |
2560 @code{mouse-face} property value. | 2582 @code{mouse-face} property value. |
2583 | |
2584 @item fontified | |
2585 @kindex fontified @r{(text property)} | |
2586 This property, if non-@code{nil}, says that text in the buffer has | |
2587 had faces assigned automatically by a feature such as Font-Lock mode. | |
2588 @xref{Auto Faces}. | |
2589 | |
2590 @item display | |
2591 @kindex display @r{(text property)} | |
2592 This property activates various features that change the | |
2593 way text is displayed. For example, it can make text appear taller | |
2594 or shorter, higher or lower, wider or narror, or replaced with an image. | |
2595 @xref{Display Property}. | |
2596 | |
2597 @item help-echo | |
2598 @kindex help-echo @r{(text property)} | |
2599 If text has a string as its @code{help-echo} property, then when you | |
2600 move the mouse onto that text, Emacs displays that string in the echo | |
2601 area, or in the tooltip window. This feature is used in the mode line. | |
2602 It is available starting in Emacs 21. | |
2561 | 2603 |
2562 @item local-map | 2604 @item local-map |
2563 @cindex keymap of character | 2605 @cindex keymap of character |
2564 @kindex local-map @r{(text property)} | 2606 @kindex local-map @r{(text property)} |
2565 You can specify a different keymap for some of the text in a buffer by | 2607 You can specify a different keymap for some of the text in a buffer by |
3229 @node Base 64 | 3271 @node Base 64 |
3230 @section Base 64 Encoding | 3272 @section Base 64 Encoding |
3231 @cindex base 64 encoding | 3273 @cindex base 64 encoding |
3232 | 3274 |
3233 Base 64 code is used in email to encode a sequence of 8-bit bytes as a | 3275 Base 64 code is used in email to encode a sequence of 8-bit bytes as a |
3234 longer sequence of @sc{ASCII} graphic characters. This section | 3276 longer sequence of @sc{ascii} graphic characters. This section |
3235 describes the functions for converting to and from this code. | 3277 describes the functions for converting to and from this code. |
3236 | 3278 |
3237 @defun base64-encode-region beg end &optional no-line-break | 3279 @defun base64-encode-region beg end &optional no-line-break |
3238 @tindex base64-encode-region | 3280 @tindex base64-encode-region |
3239 This function converts the region from @var{beg} to @var{end} | 3281 This function converts the region from @var{beg} to @var{end} |
3375 | 3417 |
3376 @defvar first-change-hook | 3418 @defvar first-change-hook |
3377 This variable is a normal hook that is run whenever a buffer is changed | 3419 This variable is a normal hook that is run whenever a buffer is changed |
3378 that was previously in the unmodified state. | 3420 that was previously in the unmodified state. |
3379 @end defvar | 3421 @end defvar |
3422 | |
3423 @defvar inhibit-modification-hooks | |
3424 @tindex inhibit-modification-hooks | |
3425 If this variable is non-@code{nil}, all of the change hooks are | |
3426 disabled; none of them run. This affects all the hook variables | |
3427 described above in this section, as well as the hooks attached to | |
3428 certain special text properties (@pxref{Special Properties}) and overlay | |
3429 properties (@pxref{Overlay Properties}). | |
3430 | |
3431 This variable is available starting in Emacs 21. | |
3432 @end defvar |