all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Comparing against the single-quote symbol '
@ 2008-06-10 16:50 Nordlöw
  2008-06-10 17:07 ` David Kastrup
  2008-06-10 21:46 ` Nikolaj Schumacher
  0 siblings, 2 replies; 5+ messages in thread
From: Nordlöw @ 2008-06-10 16:50 UTC (permalink / raw)
  To: help-gnu-emacs

How do I explicitly compare against the single-quote symbol ' in emacs
lisp programs?

I thought I could use this expression
  (equal prefix \')

where the value the symbol `prefix' is
  \'

but \' is not allowed in lisp-code; it complains about void variable
\'

I also get extraordinary annoyed about the behaviour of (accidentally)
evaluating
  '(
It automatically hides the rest of the buffer and remembers this state
when I open it again. I think it has something to do with buffer
visibility.


Thanks in advance,
Nordlöw


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

* Re: Comparing against the single-quote symbol '
  2008-06-10 16:50 Comparing against the single-quote symbol ' Nordlöw
@ 2008-06-10 17:07 ` David Kastrup
  2008-06-10 17:25   ` djfiander
  2008-06-10 21:46 ` Nikolaj Schumacher
  1 sibling, 1 reply; 5+ messages in thread
From: David Kastrup @ 2008-06-10 17:07 UTC (permalink / raw)
  To: help-gnu-emacs

Nordlöw <per.nordlow@gmail.com> writes:

> How do I explicitly compare against the single-quote symbol ' in emacs
> lisp programs?
>
> I thought I could use this expression
>   (equal prefix \')
>
> where the value the symbol `prefix' is
>   \'
>
> but \' is not allowed in lisp-code;

Since when?

> it complains about void variable \'

Sure.  The symbol \' has no variable value by default.  If you don't
want to access its variable value but rather its symbol, you need to
quote it.  And sure enough
'\'
works just fine (even though it looks misleadingly symmetric).

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


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

* Re: Comparing against the single-quote symbol '
  2008-06-10 17:07 ` David Kastrup
@ 2008-06-10 17:25   ` djfiander
  2008-06-10 21:06     ` Nordlöw
  0 siblings, 1 reply; 5+ messages in thread
From: djfiander @ 2008-06-10 17:25 UTC (permalink / raw)
  To: help-gnu-emacs

On Jun 10, 1:07 pm, David Kastrup <d...@gnu.org> wrote:
>
> Sure.  The symbol \' has no variable value by default.  If you don't
> want to access its variable value but rather its symbol, you need to
> quote it.  And sure enough
> '\'
> works just fine (even though it looks misleadingly symmetric).

Of course, if you want to see if the variable 'prefix' contains the a
single quote character, then you probably want to say

    (equal prefix ?')

- David


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

* Re: Comparing against the single-quote symbol '
  2008-06-10 17:25   ` djfiander
@ 2008-06-10 21:06     ` Nordlöw
  0 siblings, 0 replies; 5+ messages in thread
From: Nordlöw @ 2008-06-10 21:06 UTC (permalink / raw)
  To: help-gnu-emacs

On 10 Juni, 19:25, djfiander <da...@fiander.info> wrote:
> On Jun 10, 1:07 pm, David Kastrup <d...@gnu.org> wrote:
>
>
>
> > Sure.  The symbol \' has no variable value by default.  If you don't
> > want to access its variable value but rather its symbol, you need to
> > quote it.  And sure enough
> > '\'
> > works just fine (even though it looks misleadingly symmetric).

Superb!, '\' works for me!

Thanks,
Nordlöw


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

* Re: Comparing against the single-quote symbol '
  2008-06-10 16:50 Comparing against the single-quote symbol ' Nordlöw
  2008-06-10 17:07 ` David Kastrup
@ 2008-06-10 21:46 ` Nikolaj Schumacher
  1 sibling, 0 replies; 5+ messages in thread
From: Nikolaj Schumacher @ 2008-06-10 21:46 UTC (permalink / raw)
  To: Nordlöw; +Cc: help-gnu-emacs

Nordlöw <per.nordlow@gmail.com> wrote:

> I also get extraordinary annoyed about the behaviour of (accidentally)
> evaluating
>   '(
> It automatically hides the rest of the buffer and remembers this state
> when I open it again. I think it has something to do with buffer
> visibility.

Does M-x top-level help?

regards,
Nikolaj Schumacher




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

end of thread, other threads:[~2008-06-10 21:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10 16:50 Comparing against the single-quote symbol ' Nordlöw
2008-06-10 17:07 ` David Kastrup
2008-06-10 17:25   ` djfiander
2008-06-10 21:06     ` Nordlöw
2008-06-10 21:46 ` Nikolaj Schumacher

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.