emacs-devel
[Top][All Lists]
Advanced

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

Re: delq string element in ido


From: Leo
Subject: Re: delq string element in ido
Date: Sat, 26 Dec 2009 15:24:31 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On 2009-12-26 13:05 +0000, Andreas Schwab wrote:
> Leo <address@hidden> writes:
>
>> If buf holds "str1" and ido-cur-list '("str1" "str2" "str3"), (delq
>> buf ido-cur-list) does not return '("str2" "str3"). But it does inside
>> ido-kill-buffer-at-head. That's where I am confused.
>
> (setq buf (car ido-cur-list))
> (eq (delq buf ido-cur-list) (cdr ido-cur-list))
>
> Andreas.

Thank you. Now I get it.

On 2009-12-26 12:37 +0000, Eli Zaretskii wrote:
>> Date: Sat, 26 Dec 2009 12:13:22 +0000
>> From: Leo <address@hidden>
>> Cc: Leo <address@hidden>, address@hidden
>> 
>> If buf holds "str1" and ido-cur-list '("str1" "str2" "str3"), (delq
>> buf ido-cur-list) does not return '("str2" "str3"). But it does inside
>> ido-kill-buffer-at-head. That's where I am confused.
>
> Probably because the value of buf comes from ido-cur-list, so it's the
> same Lisp object as one of the strings in ido-cur-list.

Indeed, it is due to ido-name.

On 2009-12-26 12:34 +0000, Teemu Likonen wrote:
[...]
>
> It's not actually "identical Lisp objects"; eq is about the _same_ Lisp
> object. Let me demonstrate:
>
>     (setq my-list (list "one" "two")
>           my-one (car my-list))
>
> Internally my-one and (car my-list) refer to the same Lisp object:
>
>     (eq my-one (car my-list))
>     => t
>
> But in the following examples the string "one" creates new Lisp object
> which is different from the one referenced by my-one or (car my-list).
>
>     (eq "one" (car my-list))
>     => nil
>
>     (eq "one" my-one)
>     => nil

Many thanks for the detailed explanation.

Leo





reply via email to

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