]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve warning about changing the string returned by symbol-name
authorGregory Heytings <gregory@heytings.org>
Sat, 18 Mar 2023 22:41:33 +0000 (22:41 +0000)
committerGregory Heytings <gregory@heytings.org>
Sun, 19 Mar 2023 21:17:40 +0000 (22:17 +0100)
* src/data.c (Fsymbol_name): Add warning.  See bug#62009.

* doc/lispref/symbols.texi (Creating Symbols): Improve warning.

doc/lispref/symbols.texi
src/data.c

index 5b53cbe310a453f77adf6ee76a8f98a6a0aeb2b2..c6a0408abd1438dc32530a133e2569508d99a3b0 100644 (file)
@@ -276,9 +276,8 @@ This function returns the string that is @var{symbol}'s name.  For example:
 @end group
 @end example
 
-@strong{Warning:} Changing the string by substituting characters does
-change the name of the symbol, but fails to update the obarray, so don't
-do it!
+@strong{Warning:} Never alter the string returned by that function.
+Doing that might make Emacs dysfunctional, and might even crash Emacs.
 @end defun
 
 @cindex uninterned symbol, and generating Lisp code
index 0f1d881e00b14bcb281eff93d61e0689e919231a..930d476bc3fbb269fae3a5684fd532abf69ad02d 100644 (file)
@@ -773,7 +773,10 @@ DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
 }
 
 DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
-       doc: /* Return SYMBOL's name, a string.  */)
+       doc: /* Return SYMBOL's name, a string.
+
+Warning: never alter the string returned by `symbol-name'.
+Doing that might make Emacs dysfunctional, and might even crash Emacs.  */)
   (register Lisp_Object symbol)
 {
   register Lisp_Object name;