[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 4ffdcfc: Nudge WoMan toward lexical-binding
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] master 4ffdcfc: Nudge WoMan toward lexical-binding |
Date: |
Thu, 25 Aug 2016 00:48:18 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
> - (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. 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`.
Stefan
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Emacs-diffs] master 4ffdcfc: Nudge WoMan toward lexical-binding,
Stefan Monnier <=