diff options
| author | Gerd Moellmann | 1999-12-06 17:52:27 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-12-06 17:52:27 +0000 |
| commit | b55048d4d61bc80e5906b469bdd41abdf472de68 (patch) | |
| tree | 54168547b5a53e52c633f47d4f49c6a7105a98ca /src | |
| parent | f34a40eff746a7e13513fd5f3153fde90c6f35e3 (diff) | |
| download | emacs-b55048d4d61bc80e5906b469bdd41abdf472de68.tar.gz emacs-b55048d4d61bc80e5906b469bdd41abdf472de68.zip | |
(Fintern_soft): Accept a symbol argument.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/lread.c b/src/lread.c index 2874e3bc0b9..8e9aeddad35 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2752,25 +2752,33 @@ it defaults to the value of `obarray'.") | |||
| 2752 | } | 2752 | } |
| 2753 | 2753 | ||
| 2754 | DEFUN ("intern-soft", Fintern_soft, Sintern_soft, 1, 2, 0, | 2754 | DEFUN ("intern-soft", Fintern_soft, Sintern_soft, 1, 2, 0, |
| 2755 | "Return the canonical symbol whose name is STRING, or nil if none exists.\n\ | 2755 | "Return the canonical symbol named NAME, or nil if none exists.\n\ |
| 2756 | NAME may be a string or a symbol. If it is a symbol, that exact | ||
| 2757 | symbol is searched for. | ||
| 2756 | A second optional argument specifies the obarray to use;\n\ | 2758 | A second optional argument specifies the obarray to use;\n\ |
| 2757 | it defaults to the value of `obarray'.") | 2759 | it defaults to the value of `obarray'.") |
| 2758 | (string, obarray) | 2760 | (name, obarray) |
| 2759 | Lisp_Object string, obarray; | 2761 | Lisp_Object name, obarray; |
| 2760 | { | 2762 | { |
| 2761 | register Lisp_Object tem; | 2763 | register Lisp_Object tem; |
| 2764 | struct Lisp_String *string; | ||
| 2762 | 2765 | ||
| 2763 | if (NILP (obarray)) obarray = Vobarray; | 2766 | if (NILP (obarray)) obarray = Vobarray; |
| 2764 | obarray = check_obarray (obarray); | 2767 | obarray = check_obarray (obarray); |
| 2765 | 2768 | ||
| 2766 | CHECK_STRING (string, 0); | 2769 | if (!SYMBOLP (name)) |
| 2770 | { | ||
| 2771 | CHECK_STRING (name, 0); | ||
| 2772 | string = XSTRING (name); | ||
| 2773 | } | ||
| 2774 | else | ||
| 2775 | string = XSYMBOL (name)->name; | ||
| 2767 | 2776 | ||
| 2768 | tem = oblookup (obarray, XSTRING (string)->data, | 2777 | tem = oblookup (obarray, string->data, string->size, STRING_BYTES (string)); |
| 2769 | XSTRING (string)->size, | 2778 | if (INTEGERP (tem) || (SYMBOLP (name) && !EQ (name, tem))) |
| 2770 | STRING_BYTES (XSTRING (string))); | 2779 | return Qnil; |
| 2771 | if (!INTEGERP (tem)) | 2780 | else |
| 2772 | return tem; | 2781 | return tem; |
| 2773 | return Qnil; | ||
| 2774 | } | 2782 | } |
| 2775 | 2783 | ||
| 2776 | DEFUN ("unintern", Funintern, Sunintern, 1, 2, 0, | 2784 | DEFUN ("unintern", Funintern, Sunintern, 1, 2, 0, |