diff options
Diffstat (limited to 'devdocs/elisp/properties-in-mode.html')
| -rw-r--r-- | devdocs/elisp/properties-in-mode.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/devdocs/elisp/properties-in-mode.html b/devdocs/elisp/properties-in-mode.html new file mode 100644 index 00000000..3bc5ac9b --- /dev/null +++ b/devdocs/elisp/properties-in-mode.html @@ -0,0 +1,10 @@ + <h4 class="subsection">Properties in the Mode Line</h4> <p>Certain text properties are meaningful in the mode line. The <code>face</code> property affects the appearance of text; the <code>help-echo</code> property associates help strings with the text, and <code>keymap</code> can make the text mouse-sensitive. </p> <p>There are four ways to specify text properties for text in the mode line: </p> <ol> <li> Put a string with a text property directly into the mode line data structure, but see <a href="mode-line-data">Mode Line Data</a> for caveats for that. </li> +<li> Put a text property on a mode line %-construct such as ‘<samp>%12b</samp>’; then the expansion of the %-construct will have that same text property. </li> +<li> Use a <code>(:propertize <var>elt</var> <var>props</var>…)</code> construct to give <var>elt</var> a text property specified by <var>props</var>. </li> +<li> Use a list containing <code>:eval <var>form</var></code> in the mode line data structure, and make <var>form</var> evaluate to a string that has a text property. </li> +</ol> <p>You can use the <code>keymap</code> property to specify a keymap. This keymap only takes real effect for mouse clicks; binding character keys and function keys to it has no effect, since it is impossible to move point into the mode line. </p> <p>When the mode line refers to a variable which does not have a non-<code>nil</code> <code>risky-local-variable</code> property, any text properties given or specified within that variable’s values are ignored. This is because such properties could otherwise specify functions to be called, and those functions could come from file local variables. </p><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Properties-in-Mode.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Properties-in-Mode.html</a> + </p> +</div> |
