* What is the value of ^@ as character in elisp
@ 2007-07-03 8:08 Slavomir Kaslev
2007-07-03 10:06 ` Peter Dyballa
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Slavomir Kaslev @ 2007-07-03 8:08 UTC (permalink / raw)
To: help-gnu-emacs
Hello,
I am new to emacs lisp and I am writing several functions to make
emacs communicate with Autodesk Maya.
I can't figure a way to get the value of ^@ as character in elisp. For
the moment I just copied the character in my .el source:
(defcustom etom-prompt-regexp "^^@$"
"Regexp which matches the Maya's prompt."
:type 'regexp
:group 'etom)
where ^@ is the character, not the string "^@".
You can check the source code at http://www.emacswiki.org/cgi-bin/wiki/etom.el
Can anyone help me?
Thank you in advance.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What is the value of ^@ as character in elisp
2007-07-03 8:08 What is the value of ^@ as character in elisp Slavomir Kaslev
@ 2007-07-03 10:06 ` Peter Dyballa
[not found] ` <mailman.2990.1183457174.32220.help-gnu-emacs@gnu.org>
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2007-07-03 10:06 UTC (permalink / raw)
To: Slavomir Kaslev; +Cc: help-gnu-emacs
Am 03.07.2007 um 10:08 schrieb Slavomir Kaslev:
> I can't figure a way to get the value of ^@ as character in elisp.
It's ASCII NUL. You can enter it via: C-q 0 0 RET.
--
Greetings
Pete
Never be led astray onto the path of virtue
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What is the value of ^@ as character in elisp
[not found] ` <mailman.2990.1183457174.32220.help-gnu-emacs@gnu.org>
@ 2007-07-03 13:34 ` Slavomir Kaslev
0 siblings, 0 replies; 6+ messages in thread
From: Slavomir Kaslev @ 2007-07-03 13:34 UTC (permalink / raw)
To: help-gnu-emacs
On Jul 3, 1:06 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
> Am 03.07.2007 um 10:08 schrieb Slavomir Kaslev:
>
> > I can't figure a way to get the value of ^@ as character in elisp.
>
> It's ASCII NUL. You can enter it via: C-q 0 0 RET.
>
> --
> Greetings
>
> Pete
>
> Never be led astray onto the path of virtue
Thank you Pete.
I should have just used string-to-char, which returns 0 on this
string.
Cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What is the value of ^@ as character in elisp
2007-07-03 8:08 What is the value of ^@ as character in elisp Slavomir Kaslev
2007-07-03 10:06 ` Peter Dyballa
[not found] ` <mailman.2990.1183457174.32220.help-gnu-emacs@gnu.org>
@ 2007-07-03 23:01 ` Johan Bockgård
2007-07-04 0:53 ` Pascal Bourguignon
3 siblings, 0 replies; 6+ messages in thread
From: Johan Bockgård @ 2007-07-03 23:01 UTC (permalink / raw)
To: help-gnu-emacs
Slavomir Kaslev <slavomir.kaslev@gmail.com> writes:
> a way to get the value of ^@ as character in elisp.
You can use the ?\^@ syntax.
--
Johan Bockgård
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What is the value of ^@ as character in elisp
2007-07-03 8:08 What is the value of ^@ as character in elisp Slavomir Kaslev
` (2 preceding siblings ...)
2007-07-03 23:01 ` Johan Bockgård
@ 2007-07-04 0:53 ` Pascal Bourguignon
3 siblings, 0 replies; 6+ messages in thread
From: Pascal Bourguignon @ 2007-07-04 0:53 UTC (permalink / raw)
To: help-gnu-emacs
Slavomir Kaslev <slavomir.kaslev@gmail.com> writes:
> Hello,
>
> I am new to emacs lisp and I am writing several functions to make
> emacs communicate with Autodesk Maya.
>
> I can't figure a way to get the value of ^@ as character in elisp. For
> the moment I just copied the character in my .el source:
In emacs lisp, characters are integers, like in C.
^@ is 0.
So to get the value of ^@, you can just write 0. For example:
(insert "Hello>" 0 "<world!")
; inserts:
Hello>\0<world!
(string 0) --> "\0"
> (defcustom etom-prompt-regexp "^^@$"
> "Regexp which matches the Maya's prompt."
> :type 'regexp
> :group 'etom)
The Maya prompt is a null character???
--
__Pascal Bourguignon__ http://www.informatimago.com/
NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What is the value of ^@ as character in elisp
[not found] <1183135633.707254.55740@n2g2000hse.googlegroups.com>
@ 2007-07-11 7:05 ` Kevin Rodgers
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2007-07-11 7:05 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: gnu-emacs-sources
Slavomir Kaslev wrote:
> I am new to emacs lisp and I am writing several functions to make
> emacs communicate with Autodesk Maya.
>
> I can't figure a way to get the value of ^@ as character in elisp. For
> the moment I just copied the character in my .el source:
>
> (defcustom etom-prompt-regexp "^^@$"
> "Regexp which matches the Maya's prompt."
> :type 'regexp
> :group 'etom)
>
> where ^@ is the character, not the string "^@".
[gnu.emacs.sources is for posting code; questions such as this should be
sent to gnu.emacs.help, which is where I'm cross-posting and directing
follow-ups.]
"^\000"
See the Nonprinting Characters node of the Emacs Lisp manual, follow the
link to the Character Type node, then its General Escape Syntax subnode.
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-07-11 7:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-03 8:08 What is the value of ^@ as character in elisp Slavomir Kaslev
2007-07-03 10:06 ` Peter Dyballa
[not found] ` <mailman.2990.1183457174.32220.help-gnu-emacs@gnu.org>
2007-07-03 13:34 ` Slavomir Kaslev
2007-07-03 23:01 ` Johan Bockgård
2007-07-04 0:53 ` Pascal Bourguignon
[not found] <1183135633.707254.55740@n2g2000hse.googlegroups.com>
2007-07-11 7:05 ` Kevin Rodgers
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).