aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2006-08-13 03:12:43 +0000
committerChong Yidong2006-08-13 03:12:43 +0000
commitb8f5396ad1a88f7cebe3635dc4b4e2cf17a7e089 (patch)
tree7e665c0f0842195f45f05b5819ebdea7adbeaefd
parent7443a6384579ad54709095b5944fb90d491954e2 (diff)
downloademacs-b8f5396ad1a88f7cebe3635dc4b4e2cf17a7e089.tar.gz
emacs-b8f5396ad1a88f7cebe3635dc4b4e2cf17a7e089.zip
* text.texi (Near Point): Say "cursor" not "terminal cursor".
(Commands for Insertion): Removed split-line since it's not relevant for Lisp programming. (Yank Commands): Rewrite introduction. (Undo): Clarify. (Maintaining Undo): Clarify. Document undo-ask-before-discard. (Filling): Remove redundant comment. Clarify return value of current-justification. (Margins): Minor clarifications. (Adaptive Fill): Update default value of adaptive-fill-regexp. (Sorting): Update definition of sort-lines. (Columns): Clarify behavior of sort-columns. (Indent Tabs): Link to Tab Stops in Emacs manual. (Special Properties): Clarify. (Clickable Text): Mention Buttons package.
-rw-r--r--lispref/ChangeLog18
-rw-r--r--lispref/text.texi126
2 files changed, 91 insertions, 53 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 8a7dffab75a..6303c1c4563 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,21 @@
12006-08-12 Chong Yidong <cyd@stupidchicken.com>
2
3 * text.texi (Near Point): Say "cursor" not "terminal cursor".
4 (Commands for Insertion): Removed split-line since it's not
5 relevant for Lisp programming.
6 (Yank Commands): Rewrite introduction.
7 (Undo): Clarify.
8 (Maintaining Undo): Clarify. Document undo-ask-before-discard.
9 (Filling): Remove redundant comment. Clarify return value of
10 current-justification.
11 (Margins): Minor clarifications.
12 (Adaptive Fill): Update default value of adaptive-fill-regexp.
13 (Sorting): Update definition of sort-lines.
14 (Columns): Clarify behavior of sort-columns.
15 (Indent Tabs): Link to Tab Stops in Emacs manual.
16 (Special Properties): Clarify.
17 (Clickable Text): Mention Buttons package.
18
12006-08-12 Kevin Ryde <user42@zip.com.au> 192006-08-12 Kevin Ryde <user42@zip.com.au>
2 20
3 * os.texi (Time Parsing): Add %z to description of 21 * os.texi (Time Parsing): Add %z to description of
diff --git a/lispref/text.texi b/lispref/text.texi
index 08e55f18f05..4d2f278bee8 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -103,9 +103,9 @@ This function returns the character following point in the current
103buffer. This is similar to @code{(char-after (point))}. However, if 103buffer. This is similar to @code{(char-after (point))}. However, if
104point is at the end of the buffer, then @code{following-char} returns 0. 104point is at the end of the buffer, then @code{following-char} returns 0.
105 105
106Remember that point is always between characters, and the terminal 106Remember that point is always between characters, and the cursor
107cursor normally appears over the character following point. Therefore, 107normally appears over the character following point. Therefore, the
108the character returned by @code{following-char} is the character the 108character returned by @code{following-char} is the character the
109cursor is over. 109cursor is over.
110 110
111In this example, point is between the @samp{a} and the @samp{c}. 111In this example, point is between the @samp{a} and the @samp{c}.
@@ -526,16 +526,6 @@ The value returned is @code{nil}. In an interactive call, @var{count}
526is the numeric prefix argument. 526is the numeric prefix argument.
527@end deffn 527@end deffn
528 528
529@deffn Command split-line
530This command splits the current line, moving the portion of the line
531after point down vertically so that it is on the next line directly
532below where it was before. Whitespace is inserted as needed at the
533beginning of the lower line, using the @code{indent-to} function.
534@code{split-line} returns the position of point.
535
536Programs hardly ever use this function.
537@end deffn
538
539@defvar overwrite-mode 529@defvar overwrite-mode
540This variable controls whether overwrite mode is in effect. The value 530This variable controls whether overwrite mode is in effect. The value
541should be @code{overwrite-mode-textual}, @code{overwrite-mode-binary}, 531should be @code{overwrite-mode-textual}, @code{overwrite-mode-binary},
@@ -978,8 +968,11 @@ the @var{undo} value.
978@comment node-name, next, previous, up 968@comment node-name, next, previous, up
979@subsection Functions for Yanking 969@subsection Functions for Yanking
980 970
981 @dfn{Yanking} means reinserting an entry of previously killed text 971 This section describes higher-level commands for yanking, which are
982from the kill ring. The text properties are copied too. 972intended primarily for the user but useful also in Lisp programs.
973Both @code{yank} and @code{yank-pop} honor the
974@code{yank-excluded-properties} variable and @code{yank-handler} text
975property (@pxref{Yanking}).
983 976
984@deffn Command yank &optional arg 977@deffn Command yank &optional arg
985@cindex inserting killed text 978@cindex inserting killed text
@@ -1213,7 +1206,7 @@ value for @code{kill-ring-max} is 60.
1213to the buffer's text so that they can be undone. (The buffers that 1206to the buffer's text so that they can be undone. (The buffers that
1214don't have one are usually special-purpose buffers for which Emacs 1207don't have one are usually special-purpose buffers for which Emacs
1215assumes that undoing is not useful. In particular, any buffer whose 1208assumes that undoing is not useful. In particular, any buffer whose
1216name begins with a space has its undo recording off by default, 1209name begins with a space has its undo recording off by default;
1217see @ref{Buffer Names}.) All the primitives that modify the 1210see @ref{Buffer Names}.) All the primitives that modify the
1218text in the buffer automatically add elements to the front of the undo 1211text in the buffer automatically add elements to the front of the undo
1219list, which is in the variable @code{buffer-undo-list}. 1212list, which is in the variable @code{buffer-undo-list}.
@@ -1318,8 +1311,7 @@ they're being called for the sake of undoing.
1318@defun primitive-undo count list 1311@defun primitive-undo count list
1319This is the basic function for undoing elements of an undo list. 1312This is the basic function for undoing elements of an undo list.
1320It undoes the first @var{count} elements of @var{list}, returning 1313It undoes the first @var{count} elements of @var{list}, returning
1321the rest of @var{list}. You could write this function in Lisp, 1314the rest of @var{list}.
1322but it is convenient to have it in C.
1323 1315
1324@code{primitive-undo} adds elements to the buffer's undo list when it 1316@code{primitive-undo} adds elements to the buffer's undo list when it
1325changes the buffer. Undo commands avoid confusion by saving the undo 1317changes the buffer. Undo commands avoid confusion by saving the undo
@@ -1372,7 +1364,9 @@ them back to size limits you can set. (For this purpose, the ``size''
1372of an undo list measures the cons cells that make up the list, plus the 1364of an undo list measures the cons cells that make up the list, plus the
1373strings of deleted text.) Three variables control the range of acceptable 1365strings of deleted text.) Three variables control the range of acceptable
1374sizes: @code{undo-limit}, @code{undo-strong-limit} and 1366sizes: @code{undo-limit}, @code{undo-strong-limit} and
1375@code{undo-outer-limit}. 1367@code{undo-outer-limit}. In these variables, size is counted as the
1368number of bytes occupied, which includes both saved text and other
1369data.
1376 1370
1377@defopt undo-limit 1371@defopt undo-limit
1378This is the soft limit for the acceptable size of an undo list. The 1372This is the soft limit for the acceptable size of an undo list. The
@@ -1392,6 +1386,17 @@ exceeds this limit, Emacs discards the info and displays a warning.
1392This is a last ditch limit to prevent memory overflow. 1386This is a last ditch limit to prevent memory overflow.
1393@end defopt 1387@end defopt
1394 1388
1389@defopt undo-ask-before-discard
1390If this variable is non-@code{nil}, when the undo info exceeds
1391@code{undo-outer-limit}, Emacs asks in the echo area whether to
1392discard the info. The default value is @code{nil}, which means to
1393discard it automatically.
1394
1395This option is mainly intended for debugging. Garbage collection is
1396inhibited while the question is asked, which means that Emacs might
1397leak memory if the user waits too long before answering the question.
1398@end defopt
1399
1395@node Filling 1400@node Filling
1396@comment node-name, next, previous, up 1401@comment node-name, next, previous, up
1397@section Filling 1402@section Filling
@@ -1481,8 +1486,6 @@ it. If the region was made up of many paragraphs, the blank lines
1481between paragraphs are removed. This function justifies as well as 1486between paragraphs are removed. This function justifies as well as
1482filling when @var{justify} is non-@code{nil}. 1487filling when @var{justify} is non-@code{nil}.
1483 1488
1484In an interactive call, any prefix argument requests justification.
1485
1486If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace 1489If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace
1487other than line breaks untouched. If @var{squeeze-after} is 1490other than line breaks untouched. If @var{squeeze-after} is
1488non-@code{nil}, it specifies a position in the region, and means don't 1491non-@code{nil}, it specifies a position in the region, and means don't
@@ -1522,6 +1525,11 @@ values are @code{left}, @code{right}, @code{full}, @code{center}, or
1522@defun current-justification 1525@defun current-justification
1523This function returns the proper justification style to use for filling 1526This function returns the proper justification style to use for filling
1524the text around point. 1527the text around point.
1528
1529This returns the value of the @code{justification} text property at
1530point, or the variable @var{default-justification} if there is no such
1531text property. However, it returns @code{nil} rather than @code{none}
1532to mean ``don't justify''.
1525@end defun 1533@end defun
1526 1534
1527@defopt sentence-end-double-space 1535@defopt sentence-end-double-space
@@ -1569,14 +1577,14 @@ newlines'' act as paragraph separators.
1569@section Margins for Filling 1577@section Margins for Filling
1570 1578
1571@defopt fill-prefix 1579@defopt fill-prefix
1572This buffer-local variable specifies a string of text that appears at 1580This buffer-local variable, if non-@code{nil}, specifies a string of
1573the beginning 1581text that appears at the beginning of normal text lines and should be
1574of normal text lines and should be disregarded when filling them. Any 1582disregarded when filling them. Any line that fails to start with the
1575line that fails to start with the fill prefix is considered the start of 1583fill prefix is considered the start of a paragraph; so is any line
1576a paragraph; so is any line that starts with the fill prefix followed by 1584that starts with the fill prefix followed by additional whitespace.
1577additional whitespace. Lines that start with the fill prefix but no 1585Lines that start with the fill prefix but no additional whitespace are
1578additional whitespace are ordinary text lines that can be filled 1586ordinary text lines that can be filled together. The resulting filled
1579together. The resulting filled lines also start with the fill prefix. 1587lines also start with the fill prefix.
1580 1588
1581The fill prefix follows the left margin whitespace, if any. 1589The fill prefix follows the left margin whitespace, if any.
1582@end defopt 1590@end defopt
@@ -1661,12 +1669,11 @@ becomes buffer-local when set in any fashion.
1661 1669
1662@defvar fill-nobreak-predicate 1670@defvar fill-nobreak-predicate
1663This variable gives major modes a way to specify not to break a line 1671This variable gives major modes a way to specify not to break a line
1664at certain places. Its value should be a list of functions, but a 1672at certain places. Its value should be a list of functions. Whenever
1665single function is also supported for compatibility. Whenever filling 1673filling considers breaking the line at a certain place in the buffer,
1666considers breaking the line at a certain place in the buffer, it calls 1674it calls each of these functions with no arguments and with point
1667each of these functions with no arguments and with point located at 1675located at that place. If any of the functions returns
1668that place. If any of the functions returns non-@code{nil}, then the 1676non-@code{nil}, then the line won't be broken there.
1669line won't be broken there.
1670@end defvar 1677@end defvar
1671 1678
1672@node Adaptive Fill 1679@node Adaptive Fill
@@ -1733,7 +1740,7 @@ Adaptive Fill mode matches this regular expression against the text
1733starting after the left margin whitespace (if any) on a line; the 1740starting after the left margin whitespace (if any) on a line; the
1734characters it matches are that line's candidate for the fill prefix. 1741characters it matches are that line's candidate for the fill prefix.
1735 1742
1736@w{@code{"[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the 1743@w{@code{"[ \t]*\\([-!|#%;>*·•‣⁃◦]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the
1737default value. This matches a number enclosed in parentheses or 1744default value. This matches a number enclosed in parentheses or
1738followed by a period, or certain punctuation characters, or any 1745followed by a period, or certain punctuation characters, or any
1739sequence of these intermingled with whitespace. In particular, it 1746sequence of these intermingled with whitespace. In particular, it
@@ -1898,7 +1905,8 @@ the sort order."
1898 (save-restriction 1905 (save-restriction
1899 (narrow-to-region beg end) 1906 (narrow-to-region beg end)
1900 (goto-char (point-min)) 1907 (goto-char (point-min))
1901 (sort-subr reverse 'forward-line 'end-of-line)))) 1908 (let ((inhibit-field-text-motion t))
1909 (sort-subr reverse 'forward-line 'end-of-line)))))
1902@end group 1910@end group
1903@end example 1911@end example
1904 1912
@@ -2054,9 +2062,12 @@ One unusual thing about this command is that the entire line
2054containing position @var{beg}, and the entire line containing position 2062containing position @var{beg}, and the entire line containing position
2055@var{end}, are included in the region sorted. 2063@var{end}, are included in the region sorted.
2056 2064
2057Note that @code{sort-columns} uses the @code{sort} utility program, 2065Note that @code{sort-columns} rejects text that contains tabs, because
2058and so cannot work properly on text containing tab characters. Use 2066tabs could be split across the specified columns. Use @kbd{M-x
2059@kbd{M-x untabify} to convert tabs to spaces before sorting. 2067untabify} to convert tabs to spaces before sorting.
2068
2069When possible, this command actually works by calling the @code{sort}
2070utility program.
2060@end deffn 2071@end deffn
2061 2072
2062@node Columns 2073@node Columns
@@ -2391,6 +2402,7 @@ spaces and tab characters to reach the next tab stop column; it does not
2391affect the display of tab characters in the buffer (@pxref{Usual 2402affect the display of tab characters in the buffer (@pxref{Usual
2392Display}). Note that the @key{TAB} character as input uses this tab 2403Display}). Note that the @key{TAB} character as input uses this tab
2393stop feature only in a few major modes, such as Text mode. 2404stop feature only in a few major modes, such as Text mode.
2405@xref{Tab Stops,,, emacs, The GNU Emacs Manual}.
2394 2406
2395@deffn Command tab-to-tab-stop 2407@deffn Command tab-to-tab-stop
2396This command inserts spaces or tabs before point, up to the next tab 2408This command inserts spaces or tabs before point, up to the next tab
@@ -3079,22 +3091,23 @@ This feature is used in the mode line and for other active text.
3079@cindex keymap of character 3091@cindex keymap of character
3080@kindex keymap @r{(text property)} 3092@kindex keymap @r{(text property)}
3081The @code{keymap} property specifies an additional keymap for 3093The @code{keymap} property specifies an additional keymap for
3082commands. The property's value for the character before point applies 3094commands. When this keymap applies, it is used for key lookup before
3083if it is non-@code{nil} and rear-sticky, and the property's value for 3095the minor mode keymaps and before the buffer's local map.
3084the character after point applies if it is non-@code{nil} and 3096@xref{Active Keymaps}. If the property value is a symbol, the
3097symbol's function definition is used as the keymap.
3098
3099The property's value for the character before point applies if it is
3100non-@code{nil} and rear-sticky, and the property's value for the
3101character after point applies if it is non-@code{nil} and
3085front-sticky. (For mouse clicks, the position of the click is used 3102front-sticky. (For mouse clicks, the position of the click is used
3086instead of the position of point.) If the property value is a symbol, 3103instead of the position of point.)
3087the symbol's function definition is used as the keymap.
3088
3089When this keymap applies, it is used for key lookup before the minor
3090mode keymaps and before the buffer's local map. @xref{Active
3091Keymaps}.
3092 3104
3093@item local-map 3105@item local-map
3094@kindex local-map @r{(text property)} 3106@kindex local-map @r{(text property)}
3095This property works like @code{keymap} except that it specifies a 3107This property works like @code{keymap} except that it specifies a
3096keymap to use @emph{instead of} the buffer's local map. For most 3108keymap to use @emph{instead of} the buffer's local map. For most
3097purposes (perhaps all purposes), the @code{keymap} is superior. 3109purposes (perhaps all purposes), it is better to use the @code{keymap}
3110property.
3098 3111
3099@item syntax-table 3112@item syntax-table
3100The @code{syntax-table} property overrides what the syntax table says 3113The @code{syntax-table} property overrides what the syntax table says
@@ -3479,9 +3492,16 @@ being called over and over for the same text.
3479@subsection Defining Clickable Text 3492@subsection Defining Clickable Text
3480@cindex clickable text 3493@cindex clickable text
3481 3494
3482 There are two parts of setting up @dfn{clickable text} in a buffer: 3495 @dfn{Clickable text} is text that can be clicked, with either the
3483(1) to indicate clickability when the mouse moves over the text, and (2) 3496the mouse or via keyboard commands, to produce some result. Many
3484to make a mouse button do something when you click on that text. 3497major modes use clickable text to implement features such as
3498hyper-links. The @code{button} package provides an easy way to insert
3499and manipulate clickable text. @xref{Buttons}.
3500
3501 In this section, we will explain how to manually set up clickable
3502text in a buffer using text properties. This involves two things: (1)
3503indicating clickability when the mouse moves over the text, and (2)
3504making @kbd{RET} or a mouse click on that text do something.
3485 3505
3486 Indicating clickability usually involves highlighting the text, and 3506 Indicating clickability usually involves highlighting the text, and
3487often involves displaying helpful information about the action, such 3507often involves displaying helpful information about the action, such