aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref/objects.texi
diff options
context:
space:
mode:
authorAlan Mackenzie2023-09-04 12:51:24 +0000
committerAlan Mackenzie2023-09-04 12:51:24 +0000
commitafcb6d0bc7abcdbca6b18d020deeff24d1ad197f (patch)
tree1561281df0284ced50d19005770c00023e7a617e /doc/lispref/objects.texi
parent55a0f0e047034b3a458b6fdbe245f33b83fd88b0 (diff)
downloademacs-afcb6d0bc7abcdbca6b18d020deeff24d1ad197f.tar.gz
emacs-afcb6d0bc7abcdbca6b18d020deeff24d1ad197f.zip
Correct the handling of symbols with position in equal
* src/fns.c (internal_equal): Only regard symbols with position as their symbols when symbols-with-pos-enabled is non-nil. * doc/lispref/symbols.texi (Symbols with Position): Expand the description of symbols with position, in particular the way they work with eq and equal. * doc/lispref/objects.texi (Equality Predicates): Describe how eq and equal handle symbols with position. * test/src/fns-tests.el (fns-tests-equal-symbols-with-position): New tests for symbols with position.
Diffstat (limited to 'doc/lispref/objects.texi')
-rw-r--r--doc/lispref/objects.texi11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index ad079e0d63a..784d59720ed 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -2206,6 +2206,10 @@ and the same non-fixnum numeric type, then they might or might not be
2206the same object, and @code{eq} returns @code{t} or @code{nil} 2206the same object, and @code{eq} returns @code{t} or @code{nil}
2207depending on whether the Lisp interpreter created one object or two. 2207depending on whether the Lisp interpreter created one object or two.
2208 2208
2209If @var{object1} or @var{object2} is a symbol with position, @code{eq}
2210regards it as its bare symbol when @code{symbols-with-pos-enabled} is
2211non-@code{nil} (@pxref{Symbols with Position}).
2212
2209@example 2213@example
2210@group 2214@group
2211(eq 'foo 'foo) 2215(eq 'foo 'foo)
@@ -2363,6 +2367,13 @@ same sequence of character codes and all these codes are in the range
2363The @code{equal} function recursively compares the contents of objects 2367The @code{equal} function recursively compares the contents of objects
2364if they are integers, strings, markers, vectors, bool-vectors, 2368if they are integers, strings, markers, vectors, bool-vectors,
2365byte-code function objects, char-tables, records, or font objects. 2369byte-code function objects, char-tables, records, or font objects.
2370
2371If @var{object1} or @var{object2} is a symbol with position,
2372@code{equal} regards it as its bare symbol when
2373@code{symbols-with-pos-enabled} is non-@code{nil}. Otherwise
2374@code{equal} compares two symbols with position by recursively
2375comparing their components. @xref{Symbols with Position}.
2376
2366Other objects are considered @code{equal} only if they are @code{eq}. 2377Other objects are considered @code{equal} only if they are @code{eq}.
2367For example, two distinct buffers are never considered @code{equal}, 2378For example, two distinct buffers are never considered @code{equal},
2368even if their textual contents are the same. 2379even if their textual contents are the same.