summaryrefslogtreecommitdiff
path: root/devdocs/elisp/resources.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/resources.html
new repository
Diffstat (limited to 'devdocs/elisp/resources.html')
-rw-r--r--devdocs/elisp/resources.html26
1 files changed, 26 insertions, 0 deletions
diff --git a/devdocs/elisp/resources.html b/devdocs/elisp/resources.html
new file mode 100644
index 00000000..803c5530
--- /dev/null
+++ b/devdocs/elisp/resources.html
@@ -0,0 +1,26 @@
+ <h3 class="section">X Resources</h3> <p>This section describes some of the functions and variables for querying and using X resources, or their equivalent on your operating system. See <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/X-Resources.html#X-Resources">X Resources</a> in <cite>The GNU Emacs Manual</cite>, for more information about X resources. </p> <dl> <dt id="x-get-resource">Function: <strong>x-get-resource</strong> <em>attribute class &amp;optional component subclass</em>
+</dt> <dd>
+<p>The function <code>x-get-resource</code> retrieves a resource value from the X Window defaults database. </p> <p>Resources are indexed by a combination of a <em>key</em> and a <em>class</em>. This function searches using a key of the form ‘<samp><var>instance</var>.<var>attribute</var></samp>’ (where <var>instance</var> is the name under which Emacs was invoked), and using ‘<samp>Emacs.<var>class</var></samp>’ as the class. </p> <p>The optional arguments <var>component</var> and <var>subclass</var> add to the key and the class, respectively. You must specify both of them or neither. If you specify them, the key is ‘<samp><var>instance</var>.<var>component</var>.<var>attribute</var></samp>’, and the class is ‘<samp>Emacs.<var>class</var>.<var>subclass</var></samp>’. </p>
+</dd>
+</dl> <dl> <dt id="x-resource-class">Variable: <strong>x-resource-class</strong>
+</dt> <dd><p>This variable specifies the application name that <code>x-get-resource</code> should look up. The default value is <code>"Emacs"</code>. You can examine X resources for other application names by binding this variable to some other string, around a call to <code>x-get-resource</code>. </p></dd>
+</dl> <dl> <dt id="x-resource-name">Variable: <strong>x-resource-name</strong>
+</dt> <dd><p>This variable specifies the instance name that <code>x-get-resource</code> should look up. The default value is the name Emacs was invoked with, or the value specified with the ‘<samp>-name</samp>’ or ‘<samp>-rn</samp>’ switches. </p></dd>
+</dl> <p>To illustrate some of the above, suppose that you have the line: </p> <div class="example"> <pre class="example">xterm.vt100.background: yellow
+</pre>
+</div> <p>in your X resources file (whose name is usually <samp>~/.Xdefaults</samp> or <samp>~/.Xresources</samp>). Then: </p> <div class="example"> <pre class="example">(let ((x-resource-class "XTerm") (x-resource-name "xterm"))
+ (x-get-resource "vt100.background" "VT100.Background"))
+ ⇒ "yellow"
+</pre>
+<pre class="example">(let ((x-resource-class "XTerm") (x-resource-name "xterm"))
+ (x-get-resource "background" "VT100" "vt100" "Background"))
+ ⇒ "yellow"
+</pre>
+</div> <dl> <dt id="inhibit-x-resources">Variable: <strong>inhibit-x-resources</strong>
+</dt> <dd><p>If this variable is non-<code>nil</code>, Emacs does not look up X resources, and X resources do not have any effect when creating new frames. </p></dd>
+</dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 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/Resources.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Resources.html</a>
+ </p>
+</div>