[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
setq and set-marker (was Re: A possible marker bug in emacs 20.4)
From: |
Ehud Karni |
Subject: |
setq and set-marker (was Re: A possible marker bug in emacs 20.4) |
Date: |
Fri, 9 Mar 2001 12:25:11 +0200 |
>
> Thanks for clearing up some of my misconceptions. I think that I would not
> have had those misconceptions if the examples in the reference manual used
> `point-marker' instead of literal numbers.
> I still have questions that I think should be answered if not by you then by
> someone who knows what is going on.
> If as you say `point' returns an integer while `point-marker' returns a
> marker:
> 1. Why does my marker variable get updated as described when I assign
> an integer to my marker variable from the eval prompt?
Give a precise description (what expression do you eval ?)
> 2. Why does the marker start-loc get updated as described when I put
> (setq start-loc 30) in my function rather than (setq start-loc (point)),
> since they are both technically integers?
I'm quiet sure you are mistaken. Elisp (and lisp) is not like C. When
you assign a value (by setq or set) to a variable, you also set its
type. (setq foo bar) will make foo same as bar. If bar is a number or
string or a list or something else, foo will be EXACTLY the same type,
no matter if was predefined or not.
You can set a marker value by 2 ways:
1. Assign it to an existing marker, e.g. (setq aaa (point-marker))
2. By using the `make-marker' and then `set-marker'.
I'm sure that (setq start-loc 30) won't update it as marker no matter
how it was defined. Do describe-variable on it and you'll see it is
not described as marker.
Ehud.
--
@@@@@@ @@@ @@@@@@ @ @ Ehud Karni Simon & Wiesel Insurance agency
@ @ @ @@ @ Tel: +972-3-6212-757 Fax: +972-3-6292-544
@ @ @ @ @ @@ (USA) Fax and voice mail: 1-815-5509341
@ @ @ @ @ @ Better Safe Than Sorry
http://www.simonwiesel.co.il mailto:ehud@unix.simonwiesel.co.il