From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58531: 29.0.50; Wrong predicate used by map-elt gv getter Date: Sat, 22 Oct 2022 21:04:27 +0300 Message-ID: <87czaju444.fsf@tcd.ie> References: <87r0zaxeox.fsf@tcd.ie> <874jw6xe9h.fsf@tcd.ie> <87wn906765.fsf@tcd.ie> Reply-To: "Basil L. Contovounesios" Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39389"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Thomas Fitzsimmons , 58531@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 24 06:56:32 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ompVn-0009za-Su for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Oct 2022 06:56:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omil2-0006Et-MK for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Oct 2022 17:43:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omIrn-0003sz-Aw for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2022 14:05:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omIrn-0006XH-2m for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2022 14:05:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omIrm-0007rz-K9 for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2022 14:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Oct 2022 18:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58531 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58531-submit@debbugs.gnu.org id=B58531.166646188330223 (code B ref 58531); Sat, 22 Oct 2022 18:05:02 +0000 Original-Received: (at 58531) by debbugs.gnu.org; 22 Oct 2022 18:04:43 +0000 Original-Received: from localhost ([127.0.0.1]:42286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omIrS-0007rO-WE for submit@debbugs.gnu.org; Sat, 22 Oct 2022 14:04:43 -0400 Original-Received: from mail-ed1-f53.google.com ([209.85.208.53]:46884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omIrL-0007r3-O8 for 58531@debbugs.gnu.org; Sat, 22 Oct 2022 14:04:41 -0400 Original-Received: by mail-ed1-f53.google.com with SMTP id m15so17065731edb.13 for <58531@debbugs.gnu.org>; Sat, 22 Oct 2022 11:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=HIxS5HQVkY7wxKaXvJ6vnDtBo+5wiA/OSFWK3mJJyz0=; b=a/a8+S6kuQYfJzaF9Lq8R94ME7WlbGGdXnNh7D+djdQykP1ftqy0p2XBtnmmJ9uznp WSzpKRGML4KxGhOMCeJoHLC31PFTweghuc33l0Nwtt1wFkwzdTkQaPakPNXzwu1iOkzK BMOhxX87nsLz9ANSxYlIsc6ZFV9rT9zLRwkPmfNTDLR6arX0tx40MOVuOuVOk86umefP XEkQ+bVNE6PLXyiSAS6ZAuyRHDYojPHdo/0Iw21+hDy2CcJRqWspZud/ktgR5LPVcgzn +lLUPIplrbmgpRv037xvf/ZsGq2Yu1+39/eWmBChFtvjQ3o1WdlAVnNf0ICMyfzucjEL joDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HIxS5HQVkY7wxKaXvJ6vnDtBo+5wiA/OSFWK3mJJyz0=; b=t8s8fFytVef4O5rlgi7Za0m1M6XbnvodYsT0H7dTPaTtBg75LFnYmKCu9cVwo8BgQP 1E2bs5N9nkb0TO24GvIglbl8Op4mRQbqvGInh2bkhY1H+nXCiOg1hU/YWkBwGctyuPEX fnuhxD+49GjS0OMuLM+DFnA3Dsz5p3i5CCTqho3DVrqlNYnV7O86oJc/qO0KOREQxjU8 j5lcUdwKxB8KKaIhZK8hzpmTuSkmyt01WOHwIPGALNnCt+8VkdujZ6XkbU6S1kmruH75 tTAOBHYQ8EZ/ovlunNL1ky3aG6S+B4zY6uRHNFv4o1Unk4e4UsI/sY//8K3inW51f+e9 8Amw== X-Gm-Message-State: ACrzQf3/3yzWuPfQ43gvrThHn2K9HEMWuT8cWwcUzgch3qsvlzU1+0SR hVM2gjsfXicRU/fVtqJJXPpYjw== X-Google-Smtp-Source: AMsMyM4/oOqn0Mrhgt8XTKNZwOsYm3xGS1YCvicX5iW48Mt037GPh6nCRhHl/65Wk+AkPkk6p41bAg== X-Received: by 2002:a17:907:2cea:b0:7a3:4ebe:5eb with SMTP id hz10-20020a1709072cea00b007a34ebe05ebmr1375056ejc.228.1666461869663; Sat, 22 Oct 2022 11:04:29 -0700 (PDT) Original-Received: from localhost ([2a02:587:321f:7e8a:d9:365a:ced1:b3d1]) by smtp.gmail.com with ESMTPSA id i1-20020a170906250100b0077a11b79b9bsm13106350ejb.133.2022.10.22.11.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 11:04:28 -0700 (PDT) In-Reply-To: <87wn906765.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 16 Oct 2022 01:41:54 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:246082 Archived-At: Basil L. Contovounesios [2022-10-16 01:41 +0300] wrote: > Stefan Monnier [2022-10-15 11:52 -0400] wrote: > >>> -(defun eudc-plist-member (plist prop) >>> - "Return t if PROP has a value specified in PLIST." >>> - (if (not (= 0 (% (length plist) 2))) >>> +(defun eudc--plist-member (plist prop &optional predicate) >>> + "Like `plist-member', but signal on invalid PLIST." >>> + ;; Could also use `plistp', but that would change the error. >>> + (or (zerop (% (length plist) 2)) >>> (error "Malformed plist")) >>> - (catch 'found >>> - (while plist >>> - (if (eq prop (car plist)) >>> - (throw 'found t)) >>> - (setq plist (cdr (cdr plist)))) >>> - nil)) >>> + (plist-member plist prop predicate)) >> >> The current error is poor (it doesn't include the offending plist, for >> example), so I think changing it (e.g. using the usual >> `wrong-type-argument` error) would be for the better. >> I do wonder whether it's worth the trouble keeping the error here, tho, >> instead of just using `plist-member` directly. > > I was just being conservative, because I don't know where EUDC might get > its data from, or how important it is to catch dubious plists > red-handed. > > I'd be happy to simplify the code, but let's see if Thomas (CCed) has > any comments. Thomas, the patch touching eudc.el can be found at: > https://bugs.gnu.org/58531#8. I've now moved this subdiscussion to https://bugs.gnu.org/58720. -- Basil