From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Miguel V. S. Frasson" Newsgroups: gmane.emacs.bugs Subject: bug#34708: alist-get has unclear documentation Date: Sat, 2 Mar 2019 01:50:10 -0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="230403"; mail-complaints-to="usenet@blaine.gmane.org" To: 34708@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 02 05:52:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzwdE-000xnf-9T for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Mar 2019 05:52:16 +0100 Original-Received: from localhost ([127.0.0.1]:48467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzwdD-0006ku-4o for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Mar 2019 23:52:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzwd3-0006kp-HM for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 23:52:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzwd2-0006Lp-FA for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 23:52:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43383) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzwd0-0006HF-A7 for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 23:52:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gzwd0-0005b7-1F for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 23:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Miguel V. S. Frasson" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Mar 2019 04:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34708 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155150227321455 (code B ref -1); Sat, 02 Mar 2019 04:52:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Mar 2019 04:51:13 +0000 Original-Received: from localhost ([127.0.0.1]:56927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzwcD-0005Zz-Dj for submit@debbugs.gnu.org; Fri, 01 Mar 2019 23:51:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzwc8-0005ZZ-EK for submit@debbugs.gnu.org; Fri, 01 Mar 2019 23:51:11 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:39157) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gzwc2-0005OS-LE for submit@debbugs.gnu.org; Fri, 01 Mar 2019 23:51:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzwc1-0006g6-Nn for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 23:51:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzwbz-0005L6-Oj for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 23:51:01 -0500 Original-Received: from mail-it1-x133.google.com ([2607:f8b0:4864:20::133]:52741) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzwbv-00059K-MK for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2019 23:50:57 -0500 Original-Received: by mail-it1-x133.google.com with SMTP id g17so81778ita.2 for ; Fri, 01 Mar 2019 20:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Cn9SZs7PVg1bQfBgWjbuZBUdzx3b0x1mjw6N6wxglWI=; b=lY+3L3AVxxczGJS+R0CklZujZSv/ShyCO/3upBszjh3+0oboFjIk9FQ/bEvU5U35YF Is0cJ/5EzY3BOaQhkdmTsWVXB4FmUTNulzjcTyoQ8zcFFw0e6sGnFISno79XNr7LTBsg OX79DOGTg8/JWo/iZIR7/e25hLJ0A9X3EQ+OKsnHG6zSMEFne8iYE+lVU0l9JVw4ZClu HKqayE12bbhgEnp4e832E6HSv9wVQYtOoLJoqKlaVLMS6FcG3VmIp9ibRu4FQcIqlsrt JQ72cQp+Lx8u7wRKb6WRpVfhS73oWODYHQqGXN/aD778uyR84uu+KY/ZVAJOXmEAQQ8g ZhMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Cn9SZs7PVg1bQfBgWjbuZBUdzx3b0x1mjw6N6wxglWI=; b=WUWZofpuxjOhvRRz3eHUk9diodfFRZOmgPOy5oikuBwhx9A5P8/o0Eux5M0mqf5NJT N3k2WGLaA/lA2EVpOF9k/Lb/6N5Pvh+2BsqT+ODyNhP4PD0Mb9hxSiWD6WtBBUeNy6Ow 0AUVchyd1n3n8XLPcyPihigZAmpmkiom8FFnKSA0brBtlnjoIKyoRDEgzrrnMzTPFw6A i5qgN37T9H2Ov2DoyxCluCHBWLzCnRI5yUacm9BLKDE+56ta3au1AGyqwRssoQyAy9s0 Xm/M1twe/et5KoFDXMjGQIPN5QpW3ooBbsvyO9Kg9ThhbF3XxC3De5v9eWZv20AfPXj7 2LDA== X-Gm-Message-State: APjAAAUP3VxwQhZscLX5lXj67RiKuIVLyK0YHuNUC+Ik0O2GYTDrMvUo 8ij0M2KjTHoAT7pk+8ya0wc5+aCcY1F8c1dEtKompksO X-Google-Smtp-Source: APXvYqwyFbWiklTEsGZE28/BCf/MAeJrq8Atg11tTvfDNl8zGXN3ttxfDuc5bX/59oeQZNIMtFaSOuhYuXQtf/xYc8o= X-Received: by 2002:a24:4e0f:: with SMTP id r15mr5304081ita.163.1551502236430; Fri, 01 Mar 2019 20:50:36 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155941 Archived-At: Hi In most recent subr.el (git repository, lisp folder), this is the definition of alist-get: (defun alist-get (key alist &optional default remove testfn) "Return the value associated with KEY in ALIST. If KEY is not found in ALIST, return DEFAULT. Use TESTFN to lookup in the alist if non-nil. Otherwise, use `assq'. This is a generalized variable suitable for use with `setf'. When using it to set a value, optional argument REMOVE non-nil means to remove KEY from ALIST if the new value is `eql' to DEFAULT." (ignore remove) ;;Silence byte-compiler. (let ((x (if (not testfn) (assq key alist) (assoc key alist testfn)))) (if x (cdr x) default))) * Last paragraph starts with `This'. What is `this'? ALIST? TESTFN? alist-get itself? Since this doc-string is there for a long time, it may be the case it makes sense and I didn't understand it, but again in this case, others will not understand as well, unclear doc-string. * How do I use `this' or `it' to set a value? Function is alist-*get* but somehow I can set values. A simple example on doc-string and/or info node would explain everything. * Action of REMOVE is described, but it doesn't correspond to code. REMOVE is ignored. * Probably Elisp info follows misleading doc-string. Miguel -- Miguel Vinicius Santini Frasson mvsfrasson@gmail.com