Mercurial > emacs
comparison lispref/text.texi @ 53435:0f3abb6bbf27
(Examining Properties): Add get-char-property-and-overlay.
Change arg name in get-char-property.
(Special Properties): Update handling of keymap property.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 29 Dec 2003 21:51:29 +0000 |
parents | 1a5c50faf357 |
children | bb6e41200945 |
comparison
equal
deleted
inserted
replaced
53434:6fddc60d9cbc | 53435:0f3abb6bbf27 |
---|---|
1888 depends on the value of @code{tab-width} and on the column where the tab | 1888 depends on the value of @code{tab-width} and on the column where the tab |
1889 begins. @xref{Usual Display}. | 1889 begins. @xref{Usual Display}. |
1890 | 1890 |
1891 Column number computations ignore the width of the window and the | 1891 Column number computations ignore the width of the window and the |
1892 amount of horizontal scrolling. Consequently, a column value can be | 1892 amount of horizontal scrolling. Consequently, a column value can be |
1893 arbitrarily high. The first (or leftmost) column is numbered 0. | 1893 arbitrarily high. The first (or leftmost) column is numbered 0. They |
1894 also ignore overlays and text properties, aside from invisibility. | |
1894 | 1895 |
1895 @defun current-column | 1896 @defun current-column |
1896 This function returns the horizontal position of point, measured in | 1897 This function returns the horizontal position of point, measured in |
1897 columns, counting from 0 at the left margin. The column position is the | 1898 columns, counting from 0 at the left margin. The column position is the |
1898 sum of the widths of all the displayed representations of the characters | 1899 sum of the widths of all the displayed representations of the characters |
2407 If there is no @var{prop} property strictly speaking, but the character | 2408 If there is no @var{prop} property strictly speaking, but the character |
2408 has a category that is a symbol, then @code{get-text-property} returns | 2409 has a category that is a symbol, then @code{get-text-property} returns |
2409 the @var{prop} property of that symbol. | 2410 the @var{prop} property of that symbol. |
2410 @end defun | 2411 @end defun |
2411 | 2412 |
2412 @defun get-char-property pos prop &optional object | 2413 @defun get-char-property position prop &optional object |
2413 This function is like @code{get-text-property}, except that it checks | 2414 This function is like @code{get-text-property}, except that it checks |
2414 overlays first and then text properties. @xref{Overlays}. | 2415 overlays first and then text properties. @xref{Overlays}. |
2415 | 2416 |
2416 The argument @var{object} may be a string, a buffer, or a window. If it | 2417 The argument @var{object} may be a string, a buffer, or a window. If it |
2417 is a window, then the buffer displayed in that window is used for text | 2418 is a window, then the buffer displayed in that window is used for text |
2418 properties and overlays, but only the overlays active for that window | 2419 properties and overlays, but only the overlays active for that window |
2419 are considered. If @var{object} is a buffer, then all overlays in that | 2420 are considered. If @var{object} is a buffer, then all overlays in that |
2420 buffer are considered, as well as text properties. If @var{object} is a | 2421 buffer are considered, as well as text properties. If @var{object} is a |
2421 string, only text properties are considered, since strings never have | 2422 string, only text properties are considered, since strings never have |
2422 overlays. | 2423 overlays. |
2424 @end defun | |
2425 | |
2426 @defun get-char-property-and-overlay position prop &optional object | |
2427 This is like @code{get-char-property}, but gives extra information | |
2428 about the overlay that the property value comes from. | |
2429 | |
2430 Its value is a cons cell whose @sc{car} is the property value, the | |
2431 same value @code{get-char-property} would return with the same | |
2432 arguments. Its @sc{cdr} is the overlay in which the property was | |
2433 found, or @code{nil}, if it was found as a text property or not found | |
2434 at all. | |
2435 | |
2436 If @var{position} is at the end of @var{object}, both the @sc{car} and | |
2437 the @sc{cdr} of the value are @code{nil}. | |
2423 @end defun | 2438 @end defun |
2424 | 2439 |
2425 @defvar char-property-alias-alist | 2440 @defvar char-property-alias-alist |
2426 This variable holds an alist which maps property names to a list of | 2441 This variable holds an alist which maps property names to a list of |
2427 alternative property names. If a character does not specify a direct | 2442 alternative property names. If a character does not specify a direct |
2858 @kindex keymap @r{(text property)} | 2873 @kindex keymap @r{(text property)} |
2859 The @code{keymap} property specifies an additional keymap for | 2874 The @code{keymap} property specifies an additional keymap for |
2860 commands. The property's value for the character before point applies | 2875 commands. The property's value for the character before point applies |
2861 if it is non-@code{nil} and rear-sticky, and the property's value for | 2876 if it is non-@code{nil} and rear-sticky, and the property's value for |
2862 the character after point applies if it is non-@code{nil} and | 2877 the character after point applies if it is non-@code{nil} and |
2863 front-sticky. When the value applies, it is used for key lookup | 2878 front-sticky. (For mouse clicks, the position of the click is used |
2864 before the buffer's local map. (For mouse clicks, the position of the | 2879 instead of the position of point.) If the property value is a symbol, |
2865 click is used instead of the position of point.) If the property | 2880 the symbol's function definition is used as the keymap. |
2866 value is a symbol, the symbol's function definition is used as the | 2881 |
2867 keymap. @xref{Active Keymaps}. | 2882 When this keymap applies, it is used for key lookup before the minor |
2883 mode keymaps and before the buffer's local map. @xref{Active | |
2884 Keymaps}. | |
2868 | 2885 |
2869 @item local-map | 2886 @item local-map |
2870 @kindex local-map @r{(text property)} | 2887 @kindex local-map @r{(text property)} |
2871 This property works like @code{keymap} except that it specifies a | 2888 This property works like @code{keymap} except that it specifies a |
2872 keymap to use @emph{instead of} the buffer's local map. For most | 2889 keymap to use @emph{instead of} the buffer's local map. For most |