* Bug? Won't eval an 'if' sexp?
@ 2003-01-26 8:23 Hacksaw
0 siblings, 0 replies; 5+ messages in thread
From: Hacksaw @ 2003-01-26 8:23 UTC (permalink / raw)
I added this to my .emacs under version 20.7:
(if (eq (user-uid) 0)
(message "You're uid 0, no desktop")
(lambda ()
(message "setting up desktop")
(custom-set-variables
'(desktop-enable t nil (desktop)))
(desktop-load-default)
(desktop-read)
)
)
It worked just fine. Under 21.2 it's not evaluated correctly. Doing a eval lst
sexp, it returns the lamda, I guess implying that it's not evaluating it?
[What I see in the *Message* buffer]
(lambda nil (message "setting up desktop") (custom-set-variables (quote
(desktop-enable t nil ...))) (desktop-load-default) (desktop-read))
Anyone know what's up?
--
Life is too short to take on the unnecessary.
http://www.hacksaw.org -- http://www.privatecircus.com -- KB1FVD
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Bug? Won't eval an 'if' sexp?
[not found] <mailman.1000.1043569455.21513.bug-gnu-emacs@gnu.org>
@ 2003-01-26 9:41 ` David Kastrup
2003-01-26 9:48 ` Hacksaw
0 siblings, 1 reply; 5+ messages in thread
From: David Kastrup @ 2003-01-26 9:41 UTC (permalink / raw)
Hacksaw <hacksaw@hacksaw.org> writes:
> I added this to my .emacs under version 20.7:
>
> (if (eq (user-uid) 0)
> (message "You're uid 0, no desktop")
> (lambda ()
> (message "setting up desktop")
> (custom-set-variables
> '(desktop-enable t nil (desktop)))
> (desktop-load-default)
> (desktop-read)
> )
> )
>
>
> It worked just fine. Under 21.2 it's not evaluated correctly. Doing
> a eval lst sexp, it returns the lamda, I guess implying that it's
> not evaluating it?
Whoever gave you the idea it should? You want to use progn here, not
lambda.
Actually, you don't need to use even progn here: everything beyond
the first clause of an if-form belong to the else-part.
Please start using C-h f on functions/forms you have no clue about.
Better yet, read an introduction to Lisp.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Bug? Won't eval an 'if' sexp?
2003-01-26 9:41 ` Bug? Won't eval an 'if' sexp? David Kastrup
@ 2003-01-26 9:48 ` Hacksaw
2003-01-26 10:01 ` David Kastrup
0 siblings, 1 reply; 5+ messages in thread
From: Hacksaw @ 2003-01-26 9:48 UTC (permalink / raw)
Cc: gnu-emacs-bug
>Whoever gave you the idea it should? You want to use progn here, not
Why should lambda not work here? This form, untouched, worked in emacs 20.7.
--
When we have nothing to say, it is very hard to say nothing.
When we have nothing to do, it is very hard to do nothing.
http://www.hacksaw.org -- http://www.privatecircus.com -- KB1FVD
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Bug? Won't eval an 'if' sexp?
2003-01-26 9:48 ` Hacksaw
@ 2003-01-26 10:01 ` David Kastrup
2003-01-26 10:27 ` Hacksaw
0 siblings, 1 reply; 5+ messages in thread
From: David Kastrup @ 2003-01-26 10:01 UTC (permalink / raw)
Cc: gnu-emacs-bug
Hacksaw <hacksaw@hacksaw.org> writes:
> >Whoever gave you the idea it should? You want to use progn here, not
>
> Why should lambda not work here? This form, untouched, worked in
> emacs 20.7.
It should never have worked in the first place, but did so due to an
Emacs quirk. lambda is a form supposed to return a function, not
execute it.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Bug? Won't eval an 'if' sexp?
2003-01-26 10:01 ` David Kastrup
@ 2003-01-26 10:27 ` Hacksaw
0 siblings, 0 replies; 5+ messages in thread
From: Hacksaw @ 2003-01-26 10:27 UTC (permalink / raw)
Cc: gnu-emacs-bug
>lambda is a form supposed to return a function, not execute it.
Ah, it's coming back... it's been a few years since I have used lisp.
Thanks for the advice, removing the lambda form all together worked, no
surprise.
--
Suffering is our experience of the distance between what we are and who we
wish to become.
http://www.hacksaw.org -- http://www.privatecircus.com -- KB1FVD
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-01-26 10:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.1000.1043569455.21513.bug-gnu-emacs@gnu.org>
2003-01-26 9:41 ` Bug? Won't eval an 'if' sexp? David Kastrup
2003-01-26 9:48 ` Hacksaw
2003-01-26 10:01 ` David Kastrup
2003-01-26 10:27 ` Hacksaw
2003-01-26 8:23 Hacksaw
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).