From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: chad Newsgroups: gmane.emacs.devel Subject: Re: Always-true predicate? Date: Mon, 22 Feb 2021 15:07:37 -0800 Message-ID: References: <875z2qoqc6.fsf@gnus.org> <87eehcsal4.fsf@gmail.com> <83zh002zjm.fsf@gnu.org> <83im6kw2lv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c35c3805bbf4def9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8287"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Robert Pluim , EMACS development team , Lars Ingebrigtsen , Richard Stallman To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 23 00:08:39 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lEKJi-000226-I7 for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Feb 2021 00:08:38 +0100 Original-Received: from localhost ([::1]:39944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEKJh-0006Xw-KL for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Feb 2021 18:08:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEKIx-00067u-5O for emacs-devel@gnu.org; Mon, 22 Feb 2021 18:07:51 -0500 Original-Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]:41823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEKIv-0001Fl-4N; Mon, 22 Feb 2021 18:07:50 -0500 Original-Received: by mail-yb1-xb34.google.com with SMTP id m9so14613240ybk.8; Mon, 22 Feb 2021 15:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S5AON5kJOZS0OBRyAy2PHJnQzxytqdvQVPjynGXge9Q=; b=LalwPmPfx5c/7XjXPNSeBN86H3rkX/mV39oJwHEtLMW8mBbLneI/SZr+t+LRKQlYIc 9xyyj7aHvvTu9EqRrUK4LySfqDnIKAPABa/YQlvNS1blKDyfvRBSUDM0UDAK5EgADNkx uP1pcfqqzVfFDwrLzOI+dYXVjGviIStBCwKfQ5wXqD12YoUijHSjOg/51Qf0je51OVgt yHnfMCki4Xht/wzkqUldtCJxSA8rtwjVwGvGWlnwvdNbbfwBksVOIwZ04q5nhCkUjsCw Ozx0ZzHwXk0ch4BLLgS/evZm/xmbK/8O8VSnLxVQA9kvNm6umsRBzsHHo2oPPozZ/LoJ FEkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S5AON5kJOZS0OBRyAy2PHJnQzxytqdvQVPjynGXge9Q=; b=bB6psPY8k3FZZMeHCqhlzbn+SwEGVBVRybPtWYmG1f254zZCKw5KgZxYt883t3pWFe 5UkrHGkOlHk2rt2MaQjxRTPtx3moZs7x46WxGTGAHxpYvlPh4KR6qff5aVp1V7oIayXB 33xmpoQcRKmr40XCkLB1TSS69ZPptYSXhst3puKVnk+z8LpPB5imIHyU0+xNi1BLC6AG VvE51fdcGpveI91uJFicFi6jRuISwDP7MnPKMYnQlp+QuFwJ+czxYHicopcYJbaksvda lfWlk2WaA93VCYfRWjsTVg3UsIAIqllM4UBrsaWl9fhyYhTsDPFbt8tsIByGVFcdwhM+ FmJw== X-Gm-Message-State: AOAM533UvVvi58VA4iCb87XvQfieEWzmvwZ+67H0nahODScsipYNkxrW st6P4v3xpAf64gVA52jzfdmm7xDubR5OrrkWwvgtVBfzxpHiQw== X-Google-Smtp-Source: ABdhPJwRxTnNhudmuaKck+rSIY6GkZ/rHfcf/2U2kdDzlFX99IouJt3cAVcNM4NGXaaFBAcdkhzt/qyuvdYgpIpbs4o= X-Received: by 2002:a25:d94b:: with SMTP id q72mr33937511ybg.135.1614035267311; Mon, 22 Feb 2021 15:07:47 -0800 (PST) In-Reply-To: <83im6kw2lv.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::b34; envelope-from=yandros@gmail.com; helo=mail-yb1-xb34.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:265517 Archived-At: --000000000000c35c3805bbf4def9 Content-Type: text/plain; charset="UTF-8" On Mon, Feb 22, 2021 at 7:21 AM Eli Zaretskii wrote: > > From: chad > > Date: Sun, 21 Feb 2021 21:02:43 -0800 > > Cc: Robert Pluim , Lars Ingebrigtsen , > Richard Stallman , > > EMACS development team > > > > I suspect that I ran into an instance of this recently, where the > helpful package (an extension that offers > > expanded help functions, basically) had trouble in it's helpful-callable > function with facemenu-face-menu. I > > tracked the problem down to a bad interaction in helpful with this code > in facemenu.el: > > > > (defvar facemenu-face-menu > > [...]) > > (defalias 'facemenu-face-menu facemenu-face-menu) > > > > The problem that I get is: > > > > Debugger entered--Lisp error: (wrong-type-argument sequencep t) > > mapconcat(identity (t) " ") > > s-join(" " (t)) > > helpful--signature(facemenu-face-menu) > > helpful-update() > > helpful-callable(facemenu-face-menu) > > funcall-interactively(helpful-callable facemenu-face-menu) > > call-interactively(helpful-callable nil nil) > > command-execute(helpful-callable) > > > > I'm not familiar with the (defalias 'foo foo) idiom, so maybe it should > be expected to work, and it's just a bug > > in helpful. (I reported it to the package maintainers already, with a > note that I'd mention it here.) There are a > > few other instances of in emacs that I found with a quick search, and > they also cause similar trouble for > > helpful. > > > > Is this an example of an accidental functional value, as I originally > expected, or am I barking up the wrong > > tree and instead just looking at a parsing bug? (My lisp is largely self > taught and started with Scheme, so > > these parts of elisp are murky to me.) > > I think it's a bug in helpful: facemenu-face-menu is a keymap, so > maybe helpful isn't ready for that. > Good point; I didn't (but should have) say: the issue, I think, is that the use of defalias makes helpful-callable think that facemenu-face-menu is a "viable callable", when it isn't. This doesn't mean that it's not a bug in helpful, of course; I'm just trying to understand if the bug is that helpful should be able to tell that facemenu-face-menu isn't "callable". Here's the start of helpful-callable, fwiw: (defun helpful-callable (symbol) > "Show help for function, macro or special form named SYMBOL. > See also `helpful-macro', `helpful-function' and `helpful-command'." > (interactive > (list (helpful--read-symbol > "Callable: " > (helpful--callable-at-point) > #'fboundp))) helpful--read-symbol seems to be a simple porcelain around completing-read with, in this case, #'fboundp as the predicate. That said, I'm not sure if this is just a bug in helpful being confused by the idiom with defalias, via the function-value usage you mentioned upthread. Thanks, ~Chad --000000000000c35c3805bbf4def9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Mon, Feb 22, 2021 at 7:21 AM Eli Zaret= skii <eliz@gnu.org> wrote:
> From: chad <yandros@gmail.com&= gt;
> Date: Sun, 21 Feb 2021 21:02:43 -0800
> Cc: Robert Pluim <rpluim@gmail.com>, Lars Ingebrigtsen <larsi@gnus.org>, Richard Stallman <= rms@gnu.org>,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0EMACS development team <emacs-devel@gnu.org>
>
> I suspect that I ran into an instance of this recently, where the help= ful package (an extension that offers
> expanded help functions, basically) had trouble in it's helpful-ca= llable function with facemenu-face-menu. I
> tracked the problem down to a bad interaction in helpful with this cod= e in facemenu.el:
>
>=C2=A0 (defvar facemenu-face-menu
>=C2=A0 =C2=A0 [...])
>=C2=A0 (defalias 'facemenu-face-menu facemenu-face-menu)
>
> The problem that I get is:
>
>=C2=A0 Debugger entered--Lisp error: (wrong-type-argument sequencep t)<= br> >=C2=A0 =C2=A0 mapconcat(identity (t) " ")
>=C2=A0 =C2=A0 s-join(" " (t))
>=C2=A0 =C2=A0 helpful--signature(facemenu-face-menu)
>=C2=A0 =C2=A0 helpful-update()
>=C2=A0 =C2=A0 helpful-callable(facemenu-face-menu)
>=C2=A0 =C2=A0 funcall-interactively(helpful-callable facemenu-face-menu= )
>=C2=A0 =C2=A0 call-interactively(helpful-callable nil nil)
>=C2=A0 =C2=A0 command-execute(helpful-callable)
>
> I'm not familiar with the (defalias 'foo foo) idiom, so maybe = it should be expected to work, and it's just a bug
> in helpful. (I reported it to the package maintainers already, with a = note that I'd mention it here.) There are a
> few other instances of in emacs that I found with a quick search, and = they also cause similar trouble for
> helpful.
>
> Is this an example of an accidental functional value, as I originally = expected, or am I barking up the wrong
> tree and instead just looking at a parsing bug? (My lisp is largely se= lf taught and started with Scheme, so
> these parts of elisp are murky to me.)

I think it's a bug in helpful: facemenu-face-menu is a keymap, so
maybe helpful isn't ready for that.

Good point; I didn't (but should have) say: the issue, I think, is tha= t the use of defalias makes helpful-callable think that facemenu-face-menu = is a "viable callable", when it isn't. This doesn't mean = that it's not a bug in helpful, of course; I'm just trying to under= stand if the bug is that helpful should be able to tell that facemenu-face-= menu isn't "callable". Here's the start of helpful-callab= le, fwiw:

(defun helpful-callable (symbol)
=C2=A0 "Show help for functio= n, macro or special form named SYMBOL.
=C2=A0
See also `helpful-macro', `helpful-function'= ; and `helpful-command'."
=C2=A0 (interactive
=C2=A0 =C2=A0(= list (helpful--read-symbol
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Call= able: "
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (helpful--callable-at-po= int)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #'fboundp)))

helpful--read-symbol seems to be a simple porcelain around= completing-read with, in this case, #'fboundp as the predicate. That s= aid, I'm not sure if this is just a bug in helpful being confused by th= e idiom with defalias, via the function-value usage you mentioned upthread.= =C2=A0

Thanks,
~Chad

=C2=A0
--000000000000c35c3805bbf4def9--