From: gnuist006
Subject: Emacs internals + lisp guru question (with an error corrected)
Date: 
Message-ID: <b00bb831.0209282235.5ace31a6@posting.google.com>
There are some functions that take a string as argument.
                                     ^^^^^^
Text can be read from the buffer as a string.
There are other functions that take a "symbol" as an argument.
A string can be converted to a symbol.
However, when symbol is provided to the function by converting a string
 it is not working.

For example:

(describe-function quoted-SYMBOL) works 
    eg (describe-function 'describe-function)
(make-symbol "describe-function") works

but

(describe-function (make-symbol "describe-function")) is not working.

Is there a way to fix it?

How can we get the code of describe-function?

What is the meaning of the gibberish from
(insert (format "%s" (symbol-function 'describe-function) ))

What is out there to learn more about emacs/emacs_lisp and become more
sophisticated?

Many thanks to the gurus and novices for their very kind contributions.

From: Thaddeus L Olczyk
Subject: Re: Emacs internals + lisp guru question (with an error corrected)
Date: 
Message-ID: <77fdpu0o87i2o3o92ocvkc12t8ak04jo9k@4ax.com>
On 28 Sep 2002 23:35:11 -0700, ·········@hotmail.com (gnuist006)
wrote:

>There are some functions that take a string as argument.
>                                     ^^^^^^
>Text can be read from the buffer as a string.
>There are other functions that take a "symbol" as an argument.
>A string can be converted to a symbol.
>However, when symbol is provided to the function by converting a string
> it is not working.
>
>For example:
>
>(describe-function quoted-SYMBOL) works 
>    eg (describe-function 'describe-function)
>(make-symbol "describe-function") works
>
>but
>
>(describe-function (make-symbol "describe-function")) is not working.
>
>Is there a way to fix it?
>
>How can we get the code of describe-function?
>
>What is the meaning of the gibberish from
>(insert (format "%s" (symbol-function 'describe-function) ))
>
>What is out there to learn more about emacs/emacs_lisp and become more
>sophisticated?
>
>Many thanks to the gurus and novices for their very kind contributions.
Executing these three forms should clarify things:

(let ((sym 'describe-function))
  (funcall sym 'describe-function))

(let ((sym2 (make-symbol "describe-function")))
  (funcall sym2 'describe-function))

(let ((sym2 (intern "describe-function")))
  (funcall sym2 'describe-function))

To see the code ( if possible ) for describe-function do:
(describe-function 'describe-function)

Is should say something like:
describe-function is a function in "file"( underscored).

Go to "file" and press return up pops the file at the function
definition.

The one exception: a function which is an emacs primitive
imlemented in C. Then you will have to grep the source for it.
From: Andrew Gierth
Subject: Re: Emacs internals + lisp guru question (with an error corrected)
Date: 
Message-ID: <87bs6gpw2l.fsf@erlenstar.demon.co.uk>
[followups pruned a bit]

>>>>> "gnuist006" == gnuist006  <·········@hotmail.com> writes:

 gnuist006> There are some functions that take a string as argument.
 gnuist006>                                      ^^^^^^
 gnuist006> Text can be read from the buffer as a string.
 gnuist006> There are other functions that take a "symbol" as an argument.
 gnuist006> A string can be converted to a symbol.
 gnuist006> However, when symbol is provided to the function by
 gnuist006> converting a string it is not working.

 gnuist006> For example:

 gnuist006> (describe-function quoted-SYMBOL) works 
 gnuist006>     eg (describe-function 'describe-function)
 gnuist006> (make-symbol "describe-function") works

 gnuist006> but

 gnuist006> (describe-function (make-symbol "describe-function")) is
 gnuist006> not working.

make-symbol creates a new, uninterned symbol that isn't the same as
any existing symbol even if it happens to have the same name. The
values and properties of the new symbol are all undefined.

What you're looking for is 'intern', which returns the symbol with a
specific name from the specified obarray (either the default one or a
specified one).

(describe-function (intern "describe-function"))

 gnuist006> How can we get the code of describe-function?

the source is in help.el

 gnuist006> What is the meaning of the gibberish from
 gnuist006> (insert (format "%s" (symbol-function 'describe-function) ))

it's compiled bytecode.

-- 
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
From: gnuist006
Subject: Re: Emacs internals + lisp guru question (with an error corrected)
Date: 
Message-ID: <b00bb831.0209291802.36de92f5@posting.google.com>
Poor facility with newsreader prevents me from registering individually,
but accept my profound thanks to each one of you who replied on this and
the companion and other threads. I had found a little before 12pm the
answer, ie "intern" but your insights are still so valuable. I hope others
benefitted and I will have questions from time to time but intend to pay
back the help in the gnu spirit as soon as learn enough.

gnuist