Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the colon (:) in Emacs lisp?

Tags:

emacs

elisp

I'm not talking about keyword variables (those that are prefixed with a colon), I'm talking about just :. Example from an ielm session:

ELISP> :
:

It seems to be a variable whose value is : which makes it sort of act like a noop like it does in shell. I'm just curious if there's any documentation about it. I can't look it up with describe-variable...

like image 486
mgalgs Avatar asked Sep 18 '14 20:09

mgalgs


People also ask

What does colon mean in Lisp?

In Common Lisp generally symbols can be in a package (kind of a namespace). An unexported symbol bar in a package foo is written as foo::bar . The double colon is between the package name and the symbol name. An exported symbol then is written as foo:bar . A single colon is used.

What does #' mean in Emacs Lisp?

function (aka #' ) is used to quote functions, whereas quote (aka ' ) is used to quote data.

What is a symbol in Emacs?

A symbol in GNU Emacs Lisp is an object with a name. The symbol name serves as the printed representation of the symbol. In ordinary Lisp use, with one single obarray (see Creating and Interning Symbols), a symbol's name is unique—no two symbols have the same name.

What is Defcustom?

In addition to calling defvar as a subroutine, defcustom states how the variable should be displayed in the Customize interface, the values it is allowed to take, etc. Macro: defcustom option standard doc [keyword value]… ¶ This macro declares option as a user option (i.e., a customizable variable).


1 Answers

: is a keyword, that is, a Lisp symbol whose print name begins with ":". It satisfies predicate keywordp.

like image 125
Drew Avatar answered Oct 16 '22 18:10

Drew