unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs internals + lisp guru question (with an error corrected)
@ 2002-09-29  6:35 gnuist006
  2002-09-29  8:46 ` Thaddeus L Olczyk
  2002-09-29 17:03 ` Andrew Gierth
  0 siblings, 2 replies; 4+ messages in thread
From: gnuist006 @ 2002-09-29  6:35 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs internals + lisp guru question (with an error corrected)
  2002-09-29  6:35 Emacs internals + lisp guru question (with an error corrected) gnuist006
@ 2002-09-29  8:46 ` Thaddeus L Olczyk
  2002-09-29 17:03 ` Andrew Gierth
  1 sibling, 0 replies; 4+ messages in thread
From: Thaddeus L Olczyk @ 2002-09-29  8:46 UTC (permalink / raw)


On 28 Sep 2002 23:35:11 -0700, gnuist006@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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs internals + lisp guru question (with an error corrected)
  2002-09-29  6:35 Emacs internals + lisp guru question (with an error corrected) gnuist006
  2002-09-29  8:46 ` Thaddeus L Olczyk
@ 2002-09-29 17:03 ` Andrew Gierth
  2002-09-30  2:02   ` gnuist006
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Gierth @ 2002-09-29 17:03 UTC (permalink / raw)
  Cc: gnuist006

[followups pruned a bit]

>>>>> "gnuist006" == 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/>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs internals + lisp guru question (with an error corrected)
  2002-09-29 17:03 ` Andrew Gierth
@ 2002-09-30  2:02   ` gnuist006
  0 siblings, 0 replies; 4+ messages in thread
From: gnuist006 @ 2002-09-30  2:02 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-09-30  2:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-29  6:35 Emacs internals + lisp guru question (with an error corrected) gnuist006
2002-09-29  8:46 ` Thaddeus L Olczyk
2002-09-29 17:03 ` Andrew Gierth
2002-09-30  2:02   ` gnuist006

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).