[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19104: eww.el vs. plist-put documentation (docstring, doc/lispref/li
From: |
Ivan Shmakov |
Subject: |
bug#19104: eww.el vs. plist-put documentation (docstring, doc/lispref/lists.texi) |
Date: |
Thu, 20 Nov 2014 04:47:26 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>>>>> Ivan Shmakov <ivan@siamics.net> writes:
>> Briefly scanning over eww.el, I see no actual bugs that may arise
>> from that given the current plist-put implementation (which
>> apparently returns a new list if and only if given nil as the
>> argument, and modifies the list given otherwise.)
> It should be documented.
> On the other hand, eww should really be using an object for this
> stuff and not a plist.
What for, specifically?
For instance, the current (property list) version of the
eww-desktop-data-1 filter is as follows:
(defun eww-desktop-data-1 (alist)
(let ((acc nil)
(tail alist))
(while tail
(let ((k (car tail))
(v (cadr tail)))
(when (memq k eww-desktop-data-save)
(setq acc (cons k (cons v acc)))))
(setq tail (cddr tail)))
acc))
The association list version could be as simple as:
(defun eww-desktop-data-1 (alist)
(remove-if-not (lambda (k) (memq k eww-desktop-data-save))
alist
:key 'car))
And for eww-data and eww-history to be object-based, I can’t
readily suggest any simple implementation.
(For a hash table, it could presumably be something based on
maphash.)
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A