unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Pascal Bourguignon <pjb@informatimago.com>
Subject: Re: Question about quotes on emacs lisp
Date: Sun, 17 Sep 2006 03:38:14 +0200	[thread overview]
Message-ID: <877j032ry1.fsf@thalassa.informatimago.com> (raw)
In-Reply-To: 1158447897.558742.294990@e3g2000cwe.googlegroups.com

"grocery_stocker" <cdalten@gmail.com> writes:

> Why can't I do something like this:
>
> (global-set-key "\C-x\n" "other-window")
>
> Aren't I still using quotes when calling the function other-window?

LISP = List & Intelligent Symbolic Programming language.

There are lists and symbols in lisp.

Symbols are not strings.  (But the name of a symbol is a string).


Quoting of symbols becomes necessary when you want to consider the
symbol as data from code.  In code, symbols are normally interpreted
as function or variable identifiers.  If you want to have a symbol
interpreted as literal data, you must quote it with the special
operator quote:

         (quote example)   --> example


(global-set-key "\C-x\n" (quote other-window))


Now, some consider that writting (quote ...) is fastidiuous, and
prefer to use some shorter syntax.  You can use a single prefix quote
instead:

          'example  == (quote example)

(global-set-key "\C-x\n" 'other-window)



-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"I have challenged the entire quality assurance team to a Bat-Leth
contest.  They will not concern us again."

      parent reply	other threads:[~2006-09-17  1:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-16 23:04 Question about quotes on emacs lisp grocery_stocker
2006-09-17  0:06 ` Drew Adams
2006-09-17  1:38 ` Pascal Bourguignon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877j032ry1.fsf@thalassa.informatimago.com \
    --to=pjb@informatimago.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).