From: Ivan Shmakov <ivan@siamics.net>
To: 19104@debbugs.gnu.org
Subject: bug#19104: eww.el vs. plist-put documentation (docstring, doc/lispref/lists.texi)
Date: Thu, 20 Nov 2014 04:47:26 +0000 [thread overview]
Message-ID: <871toy32ch.fsf@violet.siamics.net> (raw)
In-Reply-To: <m31tozp0d8.fsf@stories.gnus.org> (Lars Magne Ingebrigtsen's message of "Wed, 19 Nov 2014 18:26:59 +0100")
>>>>> 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
next prev parent reply other threads:[~2014-11-20 4:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 11:05 bug#19104: eww.el vs. plist-put documentation (docstring, doc/lispref/lists.texi) Ivan Shmakov
2014-11-19 17:26 ` Lars Magne Ingebrigtsen
2014-11-20 4:31 ` Stefan Monnier
2014-11-21 18:43 ` Lars Magne Ingebrigtsen
2014-11-21 18:47 ` Lars Magne Ingebrigtsen
2014-11-22 16:17 ` Stefan Monnier
2014-11-20 4:47 ` Ivan Shmakov [this message]
2015-12-25 7:05 ` Lars Ingebrigtsen
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=871toy32ch.fsf@violet.siamics.net \
--to=ivan@siamics.net \
--cc=19104@debbugs.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).