[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 4ffdcfc: Nudge WoMan toward lexical-binding
From: |
Mark Oteiza |
Subject: |
Re: [Emacs-diffs] master 4ffdcfc: Nudge WoMan toward lexical-binding |
Date: |
Tue, 27 Sep 2016 13:43:20 -0400 |
User-agent: |
Mutt/1.7+23 (87911ba95dae) (2016-08-17) |
On 25/08/16 at 12:48am, Stefan Monnier wrote:
> > - (add-to-list 'manpath
> > - (if (match-beginning 1)
> > - (match-string 1)
> > - (cons (match-string 2)
> > - (match-string 3)))))
> > + (cl-pushnew (if (match-beginning 1)
> > + (match-string 1)
> > + (cons (match-string 2)
> > + (match-string 3)))
> > + manpath))
>
> cl-pushnew uses `eql` (contrary to add-to-list which uses `equal`) for
> equality testing. So when applied to value that have just been
> constructed by `cons` and `match-string`, it will do exactly the same as
> `push` would.
>
> IOW I think you need to add
>
> :test #'equal
>
> as arg to many of those cl-pushnew you introduced.
Thanks, fixed in 329e0274.
> Note that in my experience there are also some `add-to-list`s which
> don't actually care about equality testing at all and can just be
> replaced by a simple `push`.
Some of these probably should have been push, in this particular case
I suppose it makes little difference. Thanks again.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Emacs-diffs] master 4ffdcfc: Nudge WoMan toward lexical-binding,
Mark Oteiza <=