unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: delq string element in ido
Date: Sat, 26 Dec 2009 15:24:31 +0000	[thread overview]
Message-ID: <xbaihbrdep1s.fsf@cam.ac.uk> (raw)
In-Reply-To: m2zl55ubqk.fsf@whitebox.home

On 2009-12-26 13:05 +0000, Andreas Schwab wrote:
> Leo <sdl.web@googlemail.com> 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 <sdl.web@googlemail.com>
>> Cc: Leo <sdl.web@gmail.com>, emacs-devel@gnu.org
>> 
>> 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	other threads:[~2009-12-26 15:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-26 10:49 delq string element in ido Leo
2009-12-26 11:15 ` Andreas Schwab
2009-12-26 12:13   ` Leo
2009-12-26 12:34     ` Teemu Likonen
2009-12-26 12:37     ` Eli Zaretskii
2009-12-26 13:05     ` Andreas Schwab
2009-12-26 15:24       ` Leo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xbaihbrdep1s.fsf@cam.ac.uk \
    --to=sdl.web@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).