help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does this code sometimes work?


From: Robert D. Crawford
Subject: Re: Why does this code sometimes work?
Date: Fri, 17 Feb 2006 05:31:48 -0600
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.4 (gnu/linux)

jacksneckhurts@yahoo.com writes:

> I pulled the following code from a tutorial:
>
> ;; begin (defun multiply-by-seven (number)
>   "Multiply NUMBER by seven."
>   (* 7 number))
>
> (multiply-by-seven 3) ;; end
>
> I put it in emacs as is, and sometimes it runs, and most of the time
> it errors out... 

What does the backtrace tell you.  If you are getting a lisp error, you
should be getting a backgtrace.

> I run the code with "ctrl-x ctrl-e" while the cursor is to the right
> of "3)". What am I doing wrong? Thanks!

You have to be more specific about where the cursor is.  C-x C-e will
eval the last sexp before point.  Point is actually _between the
character that the cursor is on and the character right before it.  So
if the cursor is resting on the paren after the three in your
expression, then it will eval the 3 and since numbers eval as
themselves, that will be returned.  If, however you have the cursor
resting on the space just after the paren, it should eval properly.

rdc

position of the cursor 

-- 
<========================================================================>
Robert D. Crawford                                      rdc1x@comcast.net

There was a phone call for you.
<========================================================================>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]